零件追溯

This commit is contained in:
caoxinyu
2019-06-24 15:15:01 +08:00
14 changed files with 589 additions and 742 deletions

View File

@@ -78,8 +78,8 @@ export function returnEdit(num) {
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_在制零件工艺调整_修改工艺',
param: '工艺计划流水号=' + num
name: '车间生产管理工艺_在制零件工艺调整_修改工艺_循环',
param: `工艺计划流水号组=${num}`
}
})
}

View File

@@ -0,0 +1,39 @@
import request from '@/utils/request'
// 查询外协到货单列表
export function searchTable1(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协到货单_查询数据',
param: `外协到货单号_check=${params[2]}&外协到货单号=${params[3]}&外协厂家_check=${params[4]}&外协厂家=${params[5]}`,
Pagination: params[0] + '&' + params[1]
}
})
}
// 查询外协到货单明细
export function searchTable2(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理_外协到货单明细_查询数据',
param: `外协到货单流水号=${params[0]}`
}
})
}
// 查询外协到货单明细
export function searchTableDetail(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '质检管理_外协质检数据_查询数据',
param: `检测类型=${params[0]}&外协到货单明细流水号=${params[1]}`
}
})
}

View File

@@ -155,15 +155,15 @@ export function deleteData1(Number) {
}
})
}
// 选入零件
export function insertParts(processNum, Number) {
// 零件到货
export function Arrival(Number) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理_外协加工任务单明细_增加数据',
param: '外协加工任务单流水号=' + Number + '=int&工艺计划流水号=' + processNum + '=int'
name: '车间生产管理_外协零件_到货',
param: `外协加工任务单明细流水号组=${Number}`
}
})
}

View File

@@ -31,7 +31,7 @@ export function searchTable1(...params) {
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_分配后_加供应商',
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}`,
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}&物料名称_check=${params[7]}&物料名称=${params[8]}&物料规格_check=${params[9]}&物料规格=${params[10]}&物料型号_check=${params[11]}&物料型号=${params[12]}`,
Pagination: params[4] + '&' + params[5]
}
})
@@ -44,7 +44,7 @@ export function searchTable2(...params) {
data: {
type: '1',
name: '采购管理_采购部采购_查询物料_基本件_分配后_加供应商',
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}`,
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件名称_check=${params[6]}&零件名称=${params[7]}&零件规格_check=${params[8]}&零件规格=${params[9]}&零件图号_check=${params[10]}&零件图号=${params[11]}`,
Pagination: params[4] + '&' + params[5]
}
})

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1545978796022" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1103" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M835.584 1016.32H50.176c-14.336 0-25.6-11.264-25.6-25.6V76.8c0-14.336 11.264-25.6 25.6-25.6h545.28c6.656 0 13.312 2.56 17.92 7.68l240.128 240.64c4.608 4.608 7.68 11.264 7.68 17.92v673.28c0 14.336-11.264 25.6-25.6 25.6z m-759.808-51.2h734.208V328.192l-225.28-225.792H75.776v862.72z" p-id="1104"></path><path d="M835.584 343.04h-240.128c-14.336 0-25.6-11.264-25.6-25.6V76.8c0-14.336 11.264-25.6 25.6-25.6s25.6 11.264 25.6 25.6v215.04h214.528c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM688.128 865.792c-6.656 0-13.312-2.56-17.92-7.68l-99.84-99.84c-4.608-4.608-7.68-11.264-7.68-17.92 0-6.656 2.56-13.312 7.68-17.92l99.84-99.328c10.24-9.728 26.112-9.728 36.352 0 9.728 10.24 9.728 26.112 0 36.352l-81.92 80.896 81.92 81.92c10.24 10.24 10.24 26.112 0 36.352-5.12 4.608-11.776 7.168-18.432 7.168zM574.464 428.544H247.808c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h326.656c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM574.464 604.672H247.808c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h326.656c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="1105"></path><path d="M984.064 769.024h-345.6c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h345.6c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM376.32 770.56H247.808c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h128.512c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="1106"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -26,65 +26,4 @@ const service = axios.create({
timeout: 1500000 // 请求超时时间
})
// request拦截器
// service.interceptors.request.use(
// config => {
// if (store.getters.token) {
// config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
// }
// return config
// },
// error => {
// // Do something with request error
// console.log(error) // for debug
// Promise.reject(error)
// }
// )
// response 拦截器
// service.interceptors.response.use(
// response => {
// /**
// * code为非20000是抛错 可结合自己业务进行修改
// */
// const res = response.data
// if (res.code !== 20000) {
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// })
//
// // 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
// if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// MessageBox.confirm(
// '你已被登出,可以取消继续留在该页面,或者重新登录',
// '确定登出',
// {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }
// ).then(() => {
// store.dispatch('FedLogOut').then(() => {
// location.reload() // 为了重新实例化vue-router对象 避免bug
// })
// })
// }
// return Promise.reject('error')
// } else {
// return response.data
// }
// },
// error => {
// console.log('err' + error) // for debug
// Message({
// message: error.message,
// type: 'error',
// duration: 5 * 1000
// })
// return Promise.reject(error)
// }
// )
export default service

View File

@@ -128,7 +128,7 @@ export function groupBy(datas, keys) {
group.data1 = group.data1 || 0
group.key.数量 = group.data1 += v.数量
group.data2 = group.data2 || ''
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + ';'
group.key.机床图号_组号 = group.data2 += (v.机床图号 || '') + '-' + (v.组号 ? v.组号.split('组')[0] : '') + '<br/>'
group.data3 = group.data3 || 0
group.key.合计 = group.data3 += v.合计
})

View File

@@ -50,7 +50,12 @@
height="550"
border
highlight-current-row
@selection-change="handleSelectionChange"
@row-click="click">
<el-table-column
type="selection"
align="center"
width="55"/>
<el-table-column label="机床号" align="center">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
@@ -175,7 +180,7 @@ import { initMachineProject, searchgroup, initPerson, search, searchtable1,
export default {
data() {
return {
partNumValue: '',
partNumValue: [],
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
@@ -208,10 +213,10 @@ export default {
},
methods: {
returnEdit() { // 在制零件工艺修改
if (this.partNumValue === '' || this.partNumValue === null) {
if (this.partNumValue.length === 0) {
this.$message.error('请选择零件')
} else {
this.$confirm(`此操作会将 ${this.零件图号} 打回至未编制状态, 是否继续?`, '提示', {
this.$confirm(`此操作会将零件打回至未编制状态, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -219,8 +224,8 @@ export default {
returnEdit(this.partNumValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('打回成功')
this.partNumValue = ''
this.tableData = []
this.partNumValue = []
this.searchData()
this.tableData2 = []
} else {
this.$message.error('打回失败')
@@ -279,12 +284,17 @@ export default {
})
},
click(row) {
this.partNumValue = row.工艺计划流水号
this.零件图号 = row.零件图号
searchtable1(row.工艺计划流水号).then(response => {
this.tableData2 = response.data
})
},
handleSelectionChange(val) {
this.partNumValue = []
for (let i = 0; i < val.length; i++) {
this.partNumValue.push(val[i].工艺计划流水号)
}
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val

View File

@@ -32,7 +32,7 @@
<b style="float: right; color: #8492a6; font-size: 13px">&nbsp;&nbsp;{{ item.machine }}</b>
</el-option>
</el-select>
<el-checkbox v-model="checked" :disabled="isShow2" size="small" style="margin:10px">是否核准</el-checkbox>
<el-checkbox v-model="checked" :disabled="isShow2 || (parseInt(token) !== 6 && parseInt(token) !== 19)" size="small" style="margin:10px">是否核准</el-checkbox>
<!--<el-button v-show="isShow2" type="danger" icon="el-icon-edit" size="small" @click="returnEdit">在制零件工艺调整</el-button>-->
<!--<el-button v-show="false" plain size="small" style="margin: 10px;float:right" @click="switchEdit()">切换编辑模式</el-button>-->
<div v-show="isShow">
@@ -695,7 +695,8 @@ export default {
computed: {
...mapGetters([
'name',
'id'
'id',
'token'
])
},
mounted() {
@@ -1064,6 +1065,7 @@ export default {
})
},
initPerson() { // 初始化工艺员
console.log(this.token, 12334)
initPerson().then(response => {
this.tableData3 = response.data
})

View File

@@ -1,13 +1,270 @@
<template>
<div>123</div>
<div class="app-container">
<el-card>
<div slot="header" class="header">
<span>外协到货单号:</span>
<el-input v-model="orderNumber" clearable style="width: 200px" size="small"/>
<span>外协厂家:</span>
<el-input v-model="outsourcingSupplier" clearable style="width: 200px" size="small"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px;" @click="pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</div>
<el-table v-loading="" :data="tableData1" border style="width: 100%;max-height: 600px;" height="400px" size="mini" @row-click="searchTable2">
<el-table-column label="序号" align="center" width="80" type="index"/>
<el-table-column label="外协到货单号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.外协到货单编号 }}
</template>
</el-table-column>
<el-table-column label="外协厂家" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.外协厂家名称 }}
</template>
</el-table-column>
<el-table-column label="创建日期" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.操作日期 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin: 10px 0;">
<el-pagination
:current-page="pageCurrent1"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize1"
:total="total1"
style="display:inline-block;width:50%"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"/>
</div>
<el-table v-loading="" :data="tableData2" :summary-method="getSummaries" show-summary border style="width: 100%;min-height: 400px" height="400px" size="mini">
<el-table-column label="序号" align="center" width="80" type="index"/>
<el-table-column label="零件名称" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.批次数量 }}
</template>
</el-table-column>
<el-table-column label="检验数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.检验数量 || 0 }}
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.不合格数量 || 0 }}
</template>
</el-table-column>
<el-table-column label="检验时间" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.检验时间 || '—' }}
</template>
</el-table-column>
<el-table-column label="形位" align="center" width="100">
<template slot-scope="scope">
<el-popover placement="right" width="500" trigger="click">
<el-table :data="gridData" highlight-current-row size="mini">
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="类别">
<template slot-scope="scope">
{{ scope.row.类别 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="数值">
<template slot-scope="scope">
{{ scope.row.数值 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="零件数量">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(1, scope.row.外协到货单明细流水号)">形位</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column label="尺寸" align="center" width="100">
<template slot-scope="scope">
<el-popover placement="right" width="500" trigger="click">
<el-table :data="gridData" highlight-current-row size="mini">
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="类别">
<template slot-scope="scope">
{{ scope.row.类别 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="数值">
<template slot-scope="scope">
{{ scope.row.数值 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="零件数量">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(2, scope.row.外协到货单明细流水号)">尺寸</el-button>
</el-popover>
</template>
</el-table-column>
<el-table-column label="外观" align="center" width="100">
<template slot-scope="scope">
<el-popover placement="right" width="500" trigger="click">
<el-table :data="gridData" highlight-current-row size="mini">
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="150" align="center" label="类别">
<template slot-scope="scope">
{{ scope.row.类别 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="数值">
<template slot-scope="scope">
{{ scope.row.数值 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="零件数量">
<template slot-scope="scope">
{{ scope.row.零件数量 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="success" plain size="mini" icon="el-icon-search" @click="searchTableDetail(3, scope.row.外协到货单明细流水号)">外观</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import { searchTable1, searchTable2, searchTableDetail } from '@/api/Outsourcing/OutsourcingQCSearch'
export default {
name: 'OutsourcingQCSearch'
name: 'OutsourcingQCSearch',
data() {
return {
orderNumber: '',
outsourcingSupplier: '',
tableData1: [],
pageCurrent1: 1,
pageSize1: 10,
total1: 0,
tableData2: [],
pageCurrent2: 1,
pageSize2: 10,
total2: 0,
gridData: []
}
},
mounted() {
this.searchTable1()
},
methods: {
// 合计
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总价'
} else if (index === 3) {
const values = data.map(item => Number(item['批次数量']))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Number((prev + curr).toFixed(2))
} else {
return Number((prev).toFixed(2))
}
}, 0)
sums[index] += ''
} else {
sums[index] = 'N/A'
}
} else if (index === 4) {
const values = data.map(item => Number(item['检验数量']))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Number((prev + curr).toFixed(2))
} else {
return Number((prev).toFixed(2))
}
}, 0)
sums[index] += ''
} else {
sums[index] = 'N/A'
}
} else if (index === 5) {
const values = data.map(item => Number(item['不合格数量']))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Number((prev + curr).toFixed(2))
} else {
return Number((prev).toFixed(2))
}
}, 0)
sums[index] += ''
} else {
sums[index] = 'N/A'
}
} else if (index === 6) {
sums[index] = '检验比例:' + ((sums[4] / sums[3]) * 100).toFixed(2) + '%'
}
})
return sums
},
// 查询到货单列表
searchTable1() {
let check1, check2
this.orderNumber ? check1 = 1 : check1 = 0
this.outsourcingSupplier ? check2 = 1 : check2 = 0
searchTable1(this.pageCurrent1, this.pageSize1, check1, this.orderNumber, check2, this.outsourcingSupplier).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
handleSizeChange1(val) {
this.pageSize1 = val
this.pageCurrent1 = 1
this.searchTable1()
},
handleCurrentChange1(val) {
this.pageCurrent1 = val
this.searchTable1()
},
searchTable2(row) {
searchTable2(row.外协到货单流水号).then(response => {
this.tableData2 = response.data
})
},
searchTableDetail(type, num) {
searchTableDetail(type, num).then(response => {
this.gridData = response.data
})
}
}
}
</script>
<style scoped>
.header span{
margin: 0 0 0 20px;
}
</style>

View File

@@ -5,9 +5,7 @@
<span>表单号:</span>
<el-input v-model="formNumber" size="small" placeholder="表单号" clearable style="width:200px"/>
<span>外协厂家:</span>
<el-input v-model="manufacturers" readonly size="small" placeholder="外协厂家" style="width:250px" clearable>
<el-button slot="append" icon="el-icon-search" @click="onFocus1();param=0"/>
</el-input>
<el-input v-model="manufacturers" size="small" placeholder="外协厂家" style="width:200px" clearable/>
<span>下达任务日期:</span>
<el-date-picker
v-model="time"
@@ -20,12 +18,6 @@
<el-card>
<el-table v-loading="loading2" :data="List" highlight-current-row height="350" border @row-click="searchProcess" >
<el-table-column label="收货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.单据状态==='作废'" type="success" size="small" style="margin: 0px">已收货</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未收货</el-tag>
</template>
</el-table-column>
<el-table-column label="付款状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.实际付款时间!==''" type="success" size="small" style="margin: 0px">已付款</el-tag>
@@ -57,11 +49,6 @@
{{ scope.row.运费 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="200px">
<template slot-scope="scope">
<el-button :disabled="scope.row.单据状态==='作废'" type="primary" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="shouhuo(scope.row)">收货</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -76,6 +63,51 @@
</div>
</el-card>
<el-card>
<el-table
ref="multipleTable"
:data="List3"
border
highlight-current-row
height="450"
tooltip-effect="dark"
style="width: 100%;margin-top: 20px"
@selection-change="handleSelectionChange">
<el-table-column
:selectable="selectable"
type="selection"
align="center"
width="55"/>
<el-table-column label="收货状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.到货状态===1" type="success" size="small" style="margin: 0px">已收货</el-tag>
<el-tag v-else type="info" size="small" style="margin: 0px">未收货</el-tag>
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" >
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" >
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" >
<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>
<el-button type="info" size="mini" icon="el-icon-arrow-down" style="margin-left:10px;margin-top: 15px" @click="getSpareParts">收货</el-button>
</el-card>
<el-card>
<div id="RWD">
<table cellspacing="0px" align="center" width="100%" style="">
@@ -145,28 +177,11 @@
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible1" title="外协厂家" center width="500px" height="600px">
<div align="center">
<el-input v-model="input" size="small" style="width:200px"/>
<el-button type="success" size="mini" icon="el-icon-search" style="margin-left:10px" @click="searchData()">查询</el-button>
</div>
<el-table :data="List2" max-height="370" highlight-current-row @row-click="handleCurrentChange3">
<el-table-column label="外协厂家" align="center" >
<template slot-scope="scope">
{{ scope.row.外协厂家名称 }}
</template>
</el-table-column>
</el-table>
<div align="center" style="margin-top: 10px">
<el-button type="warning" size="small" icon="el-icon-edit-outline" @click="submit1">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { handlechange, shouhuo, getTable, getData1, getTable1, getprocedure, searchManufactor, spareParts, addTable, editData, deleteData, insertParts, getParts, getPrice, editData1, deleteData1, getNumber } from '@/api/Outsourcing/OutsourcingTaskQuery'
import { handlechange, shouhuo, getTable, getprocedure, spareParts, Arrival, getParts } from '@/api/Outsourcing/OutsourcingTaskQuery'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
import { convertCurrency } from '@/vendor/int2Chinese'
import { mapGetters } from 'vuex'
@@ -179,6 +194,7 @@ export default {
},
data() {
return {
OutsouringNumber: [],
wancheng: '',
gongxulsh: [],
bianliang: [],
@@ -288,7 +304,6 @@ export default {
},
created() {
this.fetchData()
this.getList()
},
methods: {
exportTable() {
@@ -318,7 +333,6 @@ export default {
shouhuo(row.外协加工任务单流水号).then(response => {
if (response.data[0].result === '1') {
this.fetchData()
this.getList()
}
})
}
@@ -378,7 +392,7 @@ export default {
}
this.List = []
this.List3 = []
getTable(this.num, this.formNumber, this.num1, this.ManufactorNumber, this.num2, this.time1, this.time2, this.id, this.pageList, this.pageSize).then(response => {
getTable(this.num, this.formNumber, this.num1, this.manufacturers, this.num2, this.time1, this.time2, this.id, this.pageList, this.pageSize).then(response => {
this.total = parseInt(response.data.total)
for (let i = 0; i < response.data.rows.length; i++) {
if (response.data.rows[i].任务下达日期 !== null) {
@@ -389,6 +403,9 @@ export default {
})
this.loading2 = false
},
selectable(row, index) { // 控制某行是否可选
return parseInt(row.到货状态) !== 1 // 已经到货
},
// 查询
searchProcess(row) {
this.wancheng = ''
@@ -417,7 +434,6 @@ export default {
this.外协加工任务单明细流水号 = []
this.process = []
this.freight = row.运费
this.ManufactorNumber = row.外协厂家流水号
this.Number = row.外协加工任务单流水号
getParts(this.Number).then(response => {
const data = response.data
@@ -425,7 +441,19 @@ export default {
data[i].差价 = data[i].外协预算总价格 * 1.15.toFixed(2) + data[i].材料费 * 1.15.toFixed(2) - data[i].加工价格_成交.toFixed(2) - data[i].材料价格_价格.toFixed(2) - data[i].其他价格.toFixed(2)
}
this.returns = data
this.List3 = data
for (let j = 0; j < data.length; j++) {
this.List3.push({
零件图号: data[j].零件图号,
零件名称: data[j].零件名称,
批次数量: data[j].批次数量,
到货状态: data[j].到货状态,
工艺计划流水号: data[j].工艺计划流水号,
外协加工任务单明细流水号: data[j].外协加工任务单明细流水号,
单件是否外协: data[j].单件是否外协,
外协工序: ''
})
}
this.getProcedure(this.List3)
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
@@ -525,89 +553,6 @@ export default {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.title === '增加') {
this.submitAdd()
this.title = ''
} else if (this.title === '编辑') {
this.submitEdit()
this.title = ''
}
}
})
},
handleAdd() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '增加'
this.dialogFormVisible = true
var time = new Date()
var month = time.getMonth() + 1
var day = time.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (day >= 1 && day <= 9) {
day = '0' + day
}
this.form.下达任务日期 = time.getFullYear() + '/' + month + '/' + day
getNumber(this.form.下达任务日期).then(response => {
this.form.表单号 = response.data.result[0].Column1
})
this.form.运费 = null
this.form.外协厂家 = ''
},
submitAdd() {
addTable(this.form.表单号, this.id, this.ManufactorNumber1, this.form.下达任务日期, this.form.运费).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
message: '信息添加成功',
type: 'success'
})
this.dialogFormVisible = false
this.fetchData()
} else {
this.$message.error('信息添加失败')
}
})
},
getList() {
if (this.partNumber !== '') {
this.check = 1
} else {
this.check = 0
}
this.loading1 = true
getTable1(this.check, this.partNumber).then(response => {
this.List1 = []
for (let j = 0; j < response.data.length; j++) {
this.List1.push({
项目名称: response.data[j].项目名称,
零件图号: response.data[j].零件图号,
零件名称: response.data[j].零件名称,
批次数量: response.data[j].批次数量,
加工价格_成交: response.data[j].加工价格_成交,
材料价格_价格: response.data[j].材料价格_价格,
其他价格: response.data[j].其他价格,
材料费: response.data[j].材料费,
外协分类: response.data[j].外协分类,
外协预算总价格: response.data[j].外协预算总价格,
传递时间_短: response.data[j].传递时间_短,
计划结束时间_短: response.data[j].计划结束时间_短,
是否临时件: response.data[j].是否临时件,
工艺计划流水号: response.data[j].工艺计划流水号,
单件是否外协: response.data[j].单件是否外协,
外协工序: ''
})
}
this.loading1 = false
this.getProcedure(this.List1)
})
},
getProcedure(row) {
for (let i = 0; i < row.length; i++) {
getprocedure(row[i].工艺计划流水号, row[i].单件是否外协).then(response => {
@@ -615,30 +560,10 @@ export default {
for (let j = 0; j < response.data.length; j++) {
this.procedure[i] = this.procedure[i] + ' ' + response.data[j].工艺名称简称
}
this.List1[i].外协工序 = this.procedure[i]
this.List3[i].外协工序 = this.procedure[i]
})
}
},
onFocus1() {
this.dialogFormVisible1 = true
this.input = ''
getData1().then(response => {
this.List2 = response.data
})
},
handleCurrentChange3(row) {
if (this.param === 0) {
this.name1 = row.外协厂家名称
this.ManufactorNumber = row.外协厂家流水号
} else {
this.form.外协厂家 = row.外协厂家名称
this.ManufactorNumber1 = row.外协厂家流水号
}
},
submit1() {
this.dialogFormVisible1 = false
this.manufacturers = this.name1
},
getSummaries(param) {
const { data } = param
const sums = ['', '', '', 0, '', 0, '', 0, '', 0, '', 0, '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, '', 0, 0, 0, '', '']
@@ -694,359 +619,21 @@ export default {
sums[26] = '---'
return sums
},
// 计算价格
calculatingPrice() {
this.code = 0
for (let i = 0; i < this.List3.length; i++) {
this.加工价格_成交[i] = (this.外协预算总价格[i] * (1 - this.money / 100)).toFixed(2)
getPrice(this.外协加工任务单明细流水号[i], this.外协预算总价格[i], this.加工价格_成交[i], this.材料价格_价格[i], this.其他价格[i]).then(response => {
this.code = this.code + parseInt(response.data[0].result)
if (this.code === this.List3.length) {
this.contrast = 3000000000000
this.contrast1 = 0
this.loading = true
this.List3 = []
this.零件图号 = []
this.零件名称 = []
this.批次数量 = []
this.外协预算总价格 = []
this.加工价格_成交 = []
this.外协分类 = []
this.材料费 = []
this.材料价格_价格 = []
this.其他价格 = []
this.机加工开始时间 = []
this.机加工结束时间 = []
this.外协加工任务单明细流水号 = []
this.process = []
getParts(this.Number).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].差价 = data[i].外协预算总价格 * 1.15.toFixed(2) + data[i].材料费 * 1.15.toFixed(2) - data[i].加工价格_成交.toFixed(2) - data[i].材料价格_价格.toFixed(2) - data[i].其他价格.toFixed(2)
}
this.returns = data
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
if (response.data.length !== 0) {
this.外协员电话 = response.data[0].联系电话
this.联系人 = response.data[0].联系人
this.联系人电话 = response.data[0].电话
this.运费 = response.data[0].运费
this.card = true
} else {
this.card = false
}
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('1')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td></td>' + '<td colspan="5"></td>' + '<td colspan="2"></td>' + '<td colspan="2"></td>' +
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].批次数量
document.getElementsByClassName('tableData')[j].children[4].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].是否临时件1
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].外协分类
document.getElementsByClassName('tableData')[j].children[7].innerHTML = parseInt(response.data[j].加工价格_成交.toFixed(2))
document.getElementsByClassName('tableData')[j].children[8].innerHTML = parseInt(response.data[j].材料价格_价格.toFixed(2))
document.getElementsByClassName('tableData')[j].children[9].innerHTML = parseInt(response.data[j].其他价格.toFixed(2))
if (response.data[j].机加工开始时间 !== null) {
document.getElementsByClassName('tableData')[j].children[10].innerHTML = response.data[j].机加工开始时间.substr(0, 10)
}
if (response.data[j].机加工结束时间 !== null) {
document.getElementsByClassName('tableData')[j].children[11].innerHTML = response.data[j].机加工结束时间.substr(0, 10)
}
this.加工价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[7].innerHTML)
this.材料价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[8].innerHTML)
this.其他价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[9].innerHTML)
}
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计)
if (response.data.length === 0) {
this.loading = false
}
// RWD end
if (response.data.length === 0) {
this.loading = false
}
for (let i = 0; i < response.data.length; i++) { // 声明二维数组
this.零件图号.push(response.data[i].零件图号)
this.零件名称.push(response.data[i].零件名称)
this.批次数量.push(response.data[i].批次数量)
this.外协预算总价格.push(response.data[i].外协预算总价格.toFixed(2))
this.加工价格_成交.push(response.data[i].加工价格_成交.toFixed(2))
this.外协分类.push(response.data[i].外协分类)
this.材料费.push(response.data[i].材料费.toFixed(2))
this.材料价格_价格.push(response.data[i].材料价格_价格.toFixed(2))
this.其他价格.push(response.data[i].其他价格.toFixed(2))
if (response.data[i].机加工开始时间 !== null) {
this.机加工开始时间.push(response.data[i].机加工开始时间.substr(0, 10))
} else {
this.机加工开始时间.push(' ')
}
if (response.data[i].机加工结束时间 !== null) {
this.机加工结束时间.push(response.data[i].机加工结束时间.substr(0, 10))
} else {
this.机加工结束时间.push(' ')
}
this.外协加工任务单明细流水号.push(response.data[i].外协加工任务单明细流水号)
this.process[i] = []
}
for (let i = 0; i < this.returns.length; i++) {
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) { // 执行n次2
this.process[i].push(response.data[k].工艺名称简称)
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
this.List3 = this.returns
this.money = null
this.loading = false
})
}
})
}
})
indexMethod(index) {
return index + 1
},
handleSelectionChange(val) {
this.OutsouringNumber = []
for (let i = 0; i < val.length; i++) {
this.OutsouringNumber.push(val[i].外协加工任务单明细流水号)
}
},
// 确定价格
confirmPrice() {
this.code1 = 0
for (let i = 0; i < this.List3.length; i++) {
getPrice(this.外协加工任务单明细流水号[i], this.外协预算总价格[i], this.加工价格_成交[i], this.材料价格_价格[i], this.其他价格[i]).then(response => {
this.code1 = this.code1 + parseInt(response.data[0].result)
if (this.code1 === this.List3.length) {
this.contrast = 3000000000000
this.contrast1 = 0
this.loading = true
this.List3 = []
this.零件图号 = []
this.零件名称 = []
this.批次数量 = []
this.外协预算总价格 = []
this.加工价格_成交 = []
this.外协分类 = []
this.材料费 = []
this.材料价格_价格 = []
this.其他价格 = []
this.机加工开始时间 = []
this.机加工结束时间 = []
this.外协加工任务单明细流水号 = []
this.process = []
getParts(this.Number).then(response => {
const data = response.data
for (let i = 0; i < data.length; i++) {
data[i].差价 = data[i].外协预算总价格 * 1.15.toFixed(2) + data[i].材料费 * 1.15.toFixed(2) - data[i].加工价格_成交.toFixed(2) - data[i].材料价格_价格.toFixed(2) - data[i].其他价格.toFixed(2)
}
this.returns = data
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
if (response.data.length !== 0) {
this.外协员电话 = response.data[0].联系电话
this.联系人 = response.data[0].联系人
this.联系人电话 = response.data[0].电话
this.运费 = response.data[0].运费
this.card = true
} else {
this.card = false
}
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('1')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td></td>' + '<td colspan="5"></td>' + '<td colspan="2"></td>' + '<td colspan="2"></td>' +
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].批次数量
document.getElementsByClassName('tableData')[j].children[4].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].是否临时件1
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].外协分类
document.getElementsByClassName('tableData')[j].children[7].innerHTML = parseInt(response.data[j].加工价格_成交.toFixed(2))
document.getElementsByClassName('tableData')[j].children[8].innerHTML = parseInt(response.data[j].材料价格_价格.toFixed(2))
document.getElementsByClassName('tableData')[j].children[9].innerHTML = parseInt(response.data[j].其他价格.toFixed(2))
if (response.data[j].机加工开始时间 !== null) {
document.getElementsByClassName('tableData')[j].children[10].innerHTML = response.data[j].机加工开始时间.substr(0, 10)
}
if (response.data[j].机加工结束时间 !== null) {
document.getElementsByClassName('tableData')[j].children[11].innerHTML = response.data[j].机加工结束时间.substr(0, 10)
}
this.加工价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[7].innerHTML)
this.材料价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[8].innerHTML)
this.其他价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[9].innerHTML)
}
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计)
// RWD end
if (response.data.length === 0) {
this.loading = false
}
for (let i = 0; i < response.data.length; i++) { // 声明二维数组
this.零件图号.push(response.data[i].零件图号)
this.零件名称.push(response.data[i].零件名称)
this.批次数量.push(response.data[i].批次数量)
this.外协预算总价格.push(response.data[i].外协预算总价格.toFixed(2))
this.加工价格_成交.push(response.data[i].加工价格_成交.toFixed(2))
this.外协分类.push(response.data[i].外协分类)
this.材料费.push(response.data[i].材料费.toFixed(2))
this.材料价格_价格.push(response.data[i].材料价格_价格.toFixed(2))
this.其他价格.push(response.data[i].其他价格.toFixed(2))
if (response.data[i].机加工开始时间 !== null) {
this.机加工开始时间.push(response.data[i].机加工开始时间.substr(0, 10))
} else {
this.机加工开始时间.push(' ')
}
if (response.data[i].机加工结束时间 !== null) {
this.机加工结束时间.push(response.data[i].机加工结束时间.substr(0, 10))
} else {
this.机加工结束时间.push(' ')
}
this.外协加工任务单明细流水号.push(response.data[i].外协加工任务单明细流水号)
this.process[i] = []
}
for (let i = 0; i < this.returns.length; i++) {
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) { // 执行n次2
this.process[i].push(response.data[k].工艺名称简称)
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
this.List3 = this.returns
this.loading = false
})
}
})
}
})
}
},
// 成交
Deal() {
this.documentStatus = 2
this.sign = 1
this.$confirm('成交后单据不可修改, 确定成交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editData1(this.Number, this.ManufactorNumber, this.freight, this.documentStatus, this.sign, this.Explain).then(response => {
getSpareParts() { // 选入零件
if (this.OutsouringNumber.length !== 0) {
Arrival(this.OutsouringNumber).then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.$message.success('提交成功')
this.fetchData()
this.List3 = []
this.零件图号 = []
this.零件名称 = []
this.批次数量 = []
this.外协预算总价格 = []
this.加工价格_成交 = []
this.外协分类 = []
this.材料费 = []
this.材料价格_价格 = []
this.其他价格 = []
this.机加工开始时间 = []
this.机加工结束时间 = []
this.外协加工任务单明细流水号 = []
this.process = []
this.card = false
} else { this.$message.error('提交失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消提交'
})
})
},
handleEdit(row) {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.title = '编辑'
this.dialogFormVisible = true
this.form.表单号 = row.表单号
this.form.运费 = row.运费
this.form.外协厂家 = row.外协厂家
this.form.下达任务日期 = row.任务下达日期
this.ManufactorNumber1 = row.外协厂家流水号
this.Number = row.外协加工任务单流水号
if (row.入库标志 === null) {
this.sign = 1
}
if (row.单据状态 === '未成交') {
this.documentStatus = 1
} else {
this.documentStatus = 2
}
},
// 提交编辑
submitEdit() {
editData(this.Number, this.ManufactorNumber1, this.form.运费, this.documentStatus, 1, this.Explain).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible = false
this.fetchData()
} else { this.$message.error('编辑失败') }
})
},
handleDelete(row) {
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteData(row.外协加工任务单流水号).then(response => {
if (response.data[0].result === '1') {
if (this.List && this.List.length === 1 && this.pageList > 1) { // 判断删除的是否是最后一页最后一行,如果是且不是第一页,页数减一
this.pageList--
}
this.$message.success('删除成功')
this.fetchData()
this.getList()
this.card = false
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleDelete1(index) {
this.$confirm('此操作将移除该行, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteData1(this.外协加工任务单明细流水号[index]).then(response => {
if (response.data[0].result === '1') {
this.$message.success('移除成功')
this.getList()
this.$message.success('到货成功')
this.contrast = 3000000000000
this.contrast1 = 0
this.loading = true
@@ -1066,6 +653,19 @@ export default {
this.process = []
getParts(this.Number).then(response => {
this.returns = response.data
for (let j = 0; j < response.data.length; j++) {
this.List3.push({
零件图号: response.data[j].零件图号,
零件名称: response.data[j].零件名称,
批次数量: response.data[j].批次数量,
到货状态: response.data[j].到货状态,
工艺计划流水号: response.data[j].工艺计划流水号,
外协加工任务单明细流水号: response.data[j].外协加工任务单明细流水号,
单件是否外协: response.data[j].单件是否外协,
外协工序: ''
})
}
this.getProcedure(this.List3)
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
@@ -1076,7 +676,6 @@ export default {
this.运费 = response.data[0].运费
this.card = true
} else {
this.loading = false
this.card = false
}
const children = document.getElementsByClassName('tableData')
@@ -1091,7 +690,7 @@ export default {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td></td>' + '<td colspan="5"></td>' + '<td colspan="2"></td>' + '<td colspan="2"></td>' +
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
@@ -1142,157 +741,22 @@ export default {
}
this.外协加工任务单明细流水号.push(response.data[i].外协加工任务单明细流水号)
this.process[i] = []
}
for (let i = 0; i < this.returns.length; i++) {
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) { // 执行n次2
this.process[i].push(response.data[k].工艺名称简称)
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
this.List3.push(this.returns[i])
this.loading = false
})
}
})
} else { this.$message.error('移除失败') }
} else {
this.$message.error('到货失败')
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
searchData() {
searchManufactor(this.input).then(response => {
this.List2 = response.data
})
},
indexMethod(index) {
return index + 1
},
handleSelectionChange(val) {
this.processNum = val
},
getSpareParts() { // 选入零件
if (this.Number !== null) {
this.result = 0
for (let i = 0; i < this.processNum.length; i++) {
insertParts(this.processNum[i].工艺计划流水号, this.Number).then(response => {
this.result += parseInt(response.data[0].result)
if (this.processNum.length === this.result) {
this.contrast = 3000000000000
this.contrast1 = 0
this.loading = true
this.getList()
this.List3 = []
this.零件图号 = []
this.零件名称 = []
this.批次数量 = []
this.外协预算总价格 = []
this.加工价格_成交 = []
this.外协分类 = []
this.材料费 = []
this.材料价格_价格 = []
this.其他价格 = []
this.机加工开始时间 = []
this.机加工结束时间 = []
this.外协加工任务单明细流水号 = []
this.process = []
getParts(this.Number).then(response => {
this.returns = response.data
this.加工价格合计 = 0
this.材料价格合计 = 0
this.其他价格合计 = 0
if (response.data.length !== 0) {
this.外协员电话 = response.data[0].联系电话
this.联系人 = response.data[0].联系人
this.联系人电话 = response.data[0].电话
this.运费 = response.data[0].运费
this.card = true
} else {
this.card = false
}
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('1')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td></td>' + '<td colspan="5"></td>' + '<td colspan="2"></td>' + '<td colspan="2"></td>' +
'<td colspan="9" style="text-align: left;"></td>' + '<td colspan="1"></td>' + '<td></td><td></td><td></td><td></td><td colspan="2"></td><td colspan="2"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = j + 1
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].零件图号
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].零件名称
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].批次数量
document.getElementsByClassName('tableData')[j].children[4].innerHTML = ''
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].是否临时件1
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].外协分类
document.getElementsByClassName('tableData')[j].children[7].innerHTML = parseInt(response.data[j].加工价格_成交.toFixed(2))
document.getElementsByClassName('tableData')[j].children[8].innerHTML = parseInt(response.data[j].材料价格_价格.toFixed(2))
document.getElementsByClassName('tableData')[j].children[9].innerHTML = parseInt(response.data[j].其他价格.toFixed(2))
if (response.data[j].机加工开始时间 !== null) {
document.getElementsByClassName('tableData')[j].children[10].innerHTML = response.data[j].机加工开始时间.substr(0, 10)
}
if (response.data[j].机加工结束时间 !== null) {
document.getElementsByClassName('tableData')[j].children[11].innerHTML = response.data[j].机加工结束时间.substr(0, 10)
}
this.加工价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[7].innerHTML)
this.材料价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[8].innerHTML)
this.其他价格合计 += parseInt(document.getElementsByClassName('tableData')[j].children[9].innerHTML)
}
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计)
if (response.data.length === 0) {
this.loading = false
}
for (let i = 0; i < response.data.length; i++) { // 声明二维数组
this.零件图号.push(response.data[i].零件图号)
this.零件名称.push(response.data[i].零件名称)
this.批次数量.push(response.data[i].批次数量)
this.外协预算总价格.push(response.data[i].外协预算总价格.toFixed(2))
this.加工价格_成交.push(response.data[i].加工价格_成交.toFixed(2))
this.外协分类.push(response.data[i].外协分类)
this.材料费.push(response.data[i].材料费.toFixed(2))
this.材料价格_价格.push(response.data[i].材料价格_价格.toFixed(2))
this.其他价格.push(response.data[i].其他价格.toFixed(2))
if (response.data[i].机加工开始时间 !== null) {
this.机加工开始时间.push(response.data[i].机加工开始时间.substr(0, 10))
} else {
this.机加工开始时间.push(' ')
}
if (response.data[i].机加工结束时间 !== null) {
this.机加工结束时间.push(response.data[i].机加工结束时间.substr(0, 10))
} else {
this.机加工结束时间.push(' ')
}
this.外协加工任务单明细流水号.push(response.data[i].外协加工任务单明细流水号)
this.process[i] = []
spareParts(this.returns[i].工艺计划流水号, this.returns[i].单件是否外协).then(response => {
for (let k = 0; k < response.data.length; k++) { // 执行n次2
this.process[i].push(response.data[k].工艺名称简称)
document.getElementsByClassName('tableData')[i].children[4].innerHTML += response.data[k].工艺名称简称 + '/'
}
}).then(() => {
this.List3.push(this.returns[i])
this.loading = false
})
}
})
}
})
}
} else {
this.$message.warning('请选择订单')
this.$message.warning('请选择零件')
}
},
downLoadRWD(tableid) {

View File

@@ -1,27 +1,37 @@
<template>
<div class="app-container">
<el-card>
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange">
<el-option
v-for="item in machineNumber"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>组号:</span>
<el-select v-model="groupNumberValue" placeholder="组号" size="small" clearable>
<el-option
v-for="item in groupNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable()">查询</el-button>
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 15px" @click="exportDetail()">导出</el-button>
<el-row>
<span>机床编号:</span>
<el-select v-model="machineNumberValue" filterable placeholder="机床编号" size="small" clearable @change="machineChange">
<el-option
v-for="item in machineNumber"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>
</el-option>
</el-select>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-select v-model="groupNumberValue" placeholder="组号" size="small" clearable>
<el-option
v-for="item in groupNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="name" placeholder="名称" size="small" clearable style="width:200px"/>
</el-row>
<el-row style="margin-top:10px">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="spec" placeholder="规格" size="small" clearable style="width:200px"/>
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</span>
<el-input v-model="model" placeholder="型号" size="small" clearable style="width:200px"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 15px" @click="searchTable()">查询</el-button>
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 15px" @click="exportDetail()">导出</el-button>
</el-row>
</el-card>
<el-tabs v-model="PartType" type="border-card" @tab-click="searchTable()">
@@ -305,6 +315,9 @@ export default {
name: '', // 采购件采购查询
data() {
return {
name: '',
spec: '',
model: '',
machineNumberValue: '',
machineNumber: [],
groupNumberValue: '',
@@ -486,28 +499,37 @@ export default {
this.searchTable2()
},
searchTable0() { // 查询标准件
let check1, check2
let check1, check2, check3, check4, check5
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1).then(response => {
this.name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1, check3, this.name, check4, this.spec, check5, this.model).then(response => {
this.tableData0 = response.data.rows
this.total0 = response.data.total
})
},
searchTable1() { // 查询外购件
let check1, check2
let check1, check2, check3, check4, check5
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2).then(response => {
this.name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable1(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2, check3, this.name, check4, this.spec, check5, this.model).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
searchTable2() { // 查询基本件
let check1, check2
let check1, check2, check3, check4, check5
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2).then(response => {
this.name ? check3 = 1 : check3 = 0
this.spec ? check4 = 1 : check4 = 0
this.model ? check5 = 1 : check5 = 0
searchTable2(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, check3, this.name, check4, this.spec, check5, this.model).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})

View File

@@ -611,6 +611,25 @@
</div>
</el-tab-pane>
</el-tabs>
<el-card>
<div v-if="Number(token)===2" style="width:100%">
<el-divider content-position="right">
<el-button type="text" @click="searchUnallocatePartNumber">刷新</el-button> | 待分配零件数
</el-divider>
<el-row>
<el-col v-for="(machine,index) in machines" :key="index" style="width: 200px">
<el-card shadow="hover" class="sudoku_item" style="height:80px;width: 90%" @click.native="clickCard(machine.项目流水号, machine.机床流水号)">
<el-badge :value="machine.未分配零件数">
<div style="width: 100px;height:50px;margin:0" class="sudoku_item">
{{ machine.机床图号 }}
</div>
</el-badge>
</el-card>
</el-col>
</el-row>
<el-divider content-position="right"/>
</div>
</el-card>
</div>
</template>
@@ -618,11 +637,14 @@
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchMachine, searchGroup, searchTable1, searchTable2, allocateTask1,
allocateTask2, executeReturn1, executeReturn2, retract1, retract2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { mapGetters } from 'vuex'
import request from '@/utils/request'
export default {
name: '', // 采购任务分配
data() {
return {
timer2: '',
machines: [],
source: [
{
text: 'BZ',
@@ -707,14 +729,42 @@ export default {
computed: {
...mapGetters([
'name',
'token',
'id'
])
},
created() {
this.searchTable0() // 查表1
this.fetchData() // 初始化数据
this.searchUnallocatePartNumber()
this.timer2 = setInterval(this.searchUnallocatePartNumber, 20 * 60 * 1000) // 20 分钟一刷新
},
beforeDestroy() {
clearInterval(this.timer2)
},
methods: {
// 选择机床
clickCard(project, machine) {
this.projectValue = project
this.machine = []
this.machineValue = ''
this.group = []
this.groupValue = ''
searchMachine(this.projectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
value: response.data[i].机床流水号,
label: response.data[i].机床图号,
name: response.data[i].机床名称
})
}
this.machineValue = machine
this.materialStatusValue = [1]
this.searchTable0()
this.searchTable1()
this.searchTable2()
})
},
filterSource(value, row) {
return Number(row['零件类型']) === Number(value)
},
@@ -994,6 +1044,28 @@ export default {
})
})
}
},
async searchUnallocatePartNumber() {
this.machines = []
await request({
url: '',
method: 'post',
data: {
type: '3',
name: ` select 项目流水号,机床流水号,机床图号,sum(未分配零件数) as 未分配零件数 from (
select 项目流水号,机床流水号,机床图号,COUNT(*) as 未分配零件数 from MRP_计划订单_组件零件清单_标准件和外购件_视图
where 人员编号 is null
group by 项目流水号,机床流水号,机床图号
union all
select 项目流水号,机床流水号,机床图号,COUNT(*) as 未分配零件数 from MRP_计划订单_组件零件清单_基本件_视图
where 人员编号 is null
group by 项目流水号,机床流水号,机床图号
) as tb1
group by 项目流水号,机床流水号,机床图号`
}
}).then(res => {
this.machines = res.data
})
}
}
}
@@ -1016,3 +1088,45 @@ export default {
margin: 10px 0 10px 10px;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.item {
margin-top: 10px;
margin-right: 40px;
}
.sudoku_row{
display: flex;
align-items: center;
width:100%;
flex-wrap: wrap;
}
.sudoku_item{
margin-bottom: 20px;
margin-left: 20px;
/*border: 1px solid red;*/
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width:15%;
height: 200px;
padding-top: 10px;
padding-bottom: 10px;
}
.opacity{
opacity: 0.4;
background: #e5e5e5;
}
.sudoku_item img{
margin-bottom: 3px;
display: block;
}
.dashboard {
&-container {
margin: 30px;
}
&-text {
font-size: 30px;
line-height: 46px;
}
}
</style>

View File

@@ -9,11 +9,10 @@
<el-badge :value="sudoku.value">
<svg-icon :icon-class="sudoku.icon" style="border: 1px solid black;background-color: #555c66" />
<router-link :to="sudoku.router">{{ sudoku.name }}</router-link>
<!--<a size="small" type="text" href="/Assembly/DeliveryConfirmation">{{sudoku.name}}</a>-->
</el-badge>
</div>
<div/>
</el-card>
<el-divider content-position="right"/>
</div>
</div>
</el-card>