This commit is contained in:
liushuai
2020-01-01 19:21:46 +08:00
5 changed files with 70 additions and 56 deletions

View File

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

View File

@@ -422,14 +422,22 @@ export default {
}, },
watch: { watch: {
// 如果路由有变化,会再次执行该方法 // 如果路由有变化,会再次执行该方法
'$route': { '$route'(to) {
handler(route) { const _this = this
const _this = this console.log(to, 2222)
if (route.name === 'InitialProduction') { if (to.name === 'InitialProduction') {
_this.typeChange() _this.typeChange()
}
} }
} }
// '$route': {
// handler(route) {
// const _this = this
// console.log(route.name)
// if (route.name === 'InitialProduction') {
// _this.typeChange()
// }
// }
// }
}, },
created() { created() {
// this.typeChange() // this.typeChange()
@@ -503,10 +511,12 @@ export default {
}) })
}, },
typeChange() { typeChange() {
console.log(Cookie.get('machineValue'), 1111111)
this.toolNumValue = ''
this.toolNum = []
this.NumValue = ''
this.Num = []
if (Cookie.get('machineValue') !== undefined) { if (Cookie.get('machineValue') !== undefined) {
this.toolNumValue = ''
this.NumValue = ''
this.Num = []
getToolNum().then(response => { getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({ this.toolNum.push({
@@ -524,9 +534,6 @@ export default {
Cookie.remove('group') Cookie.remove('group')
}) })
} else { } else {
this.toolNumValue = ''
this.NumValue = ''
this.Num = []
getToolNum().then(response => { getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({ this.toolNum.push({

View File

@@ -24,7 +24,7 @@
</el-select> </el-select>
<el-button type="primary" size="small" icon="el-icon-bangzhu" style="margin-left: 10px" @click="selectAll(tableData)">全选</el-button> <el-button type="primary" size="small" icon="el-icon-bangzhu" style="margin-left: 10px" @click="selectAll(tableData)">全选</el-button>
<el-button type="baocun" size="small" icon="el-icon-upload" style="margin-left: 10px" @click="save">保存</el-button> <el-button type="baocun" size="small" icon="el-icon-upload" style="margin-left: 10px" @click="save">保存</el-button>
<!--<el-button type="baocun" size="small" icon="el-icon-upload" style="margin-left: 10px;float: right" @click="currency">通用件保存</el-button>--> <el-button type="baocun" size="small" icon="el-icon-upload" style="margin-left: 10px;float: right" @click="currency">通用件保存</el-button>
</el-card> </el-card>
<el-card> <el-card>
<el-table <el-table
@@ -386,34 +386,42 @@ export default {
}, },
// 直接保存工艺 // 直接保存工艺
currency() { currency() {
this.工艺计划流水号组 = [] if (this.multipleSelection.length === 0) {
this.通用件图号 = [] this.$message.error('请先选择零件')
this.通用件规格 = []
this.工艺员 = []
var check = 1
this.multipleSelection.map(v => {
if (!v.工艺员) {
check = 0
}
this.工艺计划流水号组.push(v.工艺计划流水号)
this.通用件图号.push(v.零件号)
this.通用件规格.push(v.规格)
this.工艺员.push(v.工艺员)
})
if (check === 1) {
console.log(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员)
save2(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员).then(response => {
console.log(response.data, 231)
if (response.data[0].结果 === 'success') {
this.$message.success('保存成功')
this.PageCurrent = 1
this.getTable()
} else {
this.$message.error('请选择工艺员')
}
})
} else { } else {
this.$message.error('请选择工艺员') this.工艺计划流水号组 = []
this.通用件图号 = []
this.通用件规格 = []
this.工艺员 = []
var check = 1
this.multipleSelection.map(v => {
if (!v.工艺员) {
check = 0
}
this.工艺计划流水号组.push(v.工艺计划流水号)
this.通用件图号.push(v.零件号)
this.通用件规格.push(v.规格)
this.工艺员.push(v.工艺员)
})
if (check === 1) {
console.log(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员)
save2(this.工艺计划流水号组, this.通用件图号, this.通用件规格, this.工艺员).then(response => {
console.log(response.data, 231)
if (response.data[0].结果 === 'success') {
this.$message.success('保存成功')
this.PageCurrent = 1
this.getTable()
} else {
var messages = []
messages = response.data[0].结果.split('||||')
messages.shift()
console.log(messages)
this.$message.error(`图号${messages}无已完成`)
}
})
} else {
this.$message.error('请选择工艺员')
}
} }
} }
} }

View File

@@ -90,12 +90,12 @@
{{ scope.row.跟单号 }} {{ scope.row.跟单号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="零件图号" show-overflow-tooltip width="180"> <el-table-column align="center" label="零件图号" show-overflow-tooltip width="280">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.零件图号 }} {{ scope.row.零件图号 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="零件名称" show-overflow-tooltip width="80"> <el-table-column align="center" label="零件名称" show-overflow-tooltip width="200">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.零件名称 }} {{ scope.row.零件名称 }}
</template> </template>
@@ -346,6 +346,7 @@ export default {
for (let i = 0; i < response.data.rows.length; i++) { for (let i = 0; i < response.data.rows.length; i++) {
this.tableData.push({ 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].零件图号,
@@ -448,7 +449,7 @@ export default {
// 完成日期变色 // 完成日期变色
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
row.index = rowIndex row.index = rowIndex
if (row.完成日期 !== '') { if (parseInt(row.考核状态) > 6) {
return 'CompleteColor' return 'CompleteColor'
} }
}, // 重置表单 }, // 重置表单

View File

@@ -42,11 +42,11 @@
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-card> <el-card>
<el-button type="warning" size="mini" icon="el-icon-arrow-down" style="margin-left:10px" @click="getSpareParts">收货</el-button> <el-button :disabled="loading=false" type="warning" size="mini" icon="el-icon-arrow-down" style="margin-left:10px" @click="getSpareParts">收货</el-button>
<!--<el-tooltip :open-delay="1200" effect="dark" content="打印外协任务单" placement="top">--> <!--<el-tooltip :open-delay="1200" effect="dark" content="打印外协任务单" placement="top">-->
<!--<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;float: right" @click="exportTable('RWD')">导出单据</el-button>--> <!--<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;float: right" @click="exportTable('RWD')">导出单据</el-button>-->
<!--</el-tooltip>--> <!--</el-tooltip>-->
<el-table ref="multipleTable" :data="List3" border stripe size="mini" highlight-current-row height="595" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="List3" border stripe size="mini" highlight-current-row height="595" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column <el-table-column
:selectable="selectable" :selectable="selectable"
type="selection" type="selection"
@@ -167,6 +167,7 @@ export default {
}, },
data() { data() {
return { return {
工艺计划流水号: [],
OutsouringNumber: [], OutsouringNumber: [],
wancheng: '', wancheng: '',
gongxulsh: [], gongxulsh: [],
@@ -478,9 +479,6 @@ export default {
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费 this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计) this.大写金额 = convertCurrency(this.总计)
// RWD end // RWD end
if (response.data.length === 0) {
this.loading = false
}
for (let i = 0; i < response.data.length; i++) { // 声明二维数组 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].零件名称)
@@ -529,6 +527,7 @@ export default {
getProcedure(row) { getProcedure(row) {
for (let i = 0; i < row.length; i++) { for (let i = 0; i < row.length; i++) {
getprocedure(row[i].工艺计划流水号, row[i].单件是否外协).then(response => { getprocedure(row[i].工艺计划流水号, row[i].单件是否外协).then(response => {
this.List3[i].外协工序 = ''
this.procedure[i] = '' this.procedure[i] = ''
for (let j = 0; j < response.data.length; j++) { for (let j = 0; j < response.data.length; j++) {
this.procedure[i] = this.procedure[i] + ' ' + response.data[j].工艺名称简称 this.procedure[i] = this.procedure[i] + ' ' + response.data[j].工艺名称简称
@@ -597,18 +596,20 @@ export default {
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.OutsouringNumber = [] this.OutsouringNumber = []
this.工艺计划流水号 = []
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
this.OutsouringNumber.push(val[i].外协加工任务单明细流水号) this.OutsouringNumber.push(val[i].外协加工任务单明细流水号)
this.工艺计划流水号.push(val[i].工艺计划流水号)
} }
}, },
getSpareParts() { // 选入零件 getSpareParts() {
if (this.OutsouringNumber.length !== 0) { if (this.OutsouringNumber.length !== 0) {
Arrival(this.OutsouringNumber).then(response => { this.loading = true
Arrival(this.OutsouringNumber, this.工艺计划流水号).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('到货成功') this.$message.success('到货成功')
this.contrast = 3000000000000 this.contrast = 3000000000000
this.contrast1 = 0 this.contrast1 = 0
this.loading = true
this.List3 = [] this.List3 = []
this.零件图号 = [] this.零件图号 = []
this.零件名称 = [] this.零件名称 = []
@@ -688,9 +689,6 @@ export default {
} }
this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费 this.总计 = this.加工价格合计 + this.材料价格合计 + this.其他价格合计 + this.运费
this.大写金额 = convertCurrency(this.总计) this.大写金额 = convertCurrency(this.总计)
if (response.data.length === 0) {
this.loading = false
}
for (let i = 0; i < response.data.length; i++) { // 声明二维数组 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].零件名称)