This commit is contained in:
liushuai
2020-04-17 18:09:43 +08:00
13 changed files with 397 additions and 155 deletions

View File

@@ -23,7 +23,6 @@
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button type="primary" icon="el-icon-search" size="small" plain style="margin-left: 10px" @click="total=0;pageSize = 20;pageCurrent = 1;searchTable()">查询</el-button>
<!--<el-button type="primary" icon="el-icon-search" size="small" plain style="margin-left: 10px" @click="total=0;pageSize = 20;pageCurrent = 1;loginsession()">session</el-button>-->
<el-tooltip :open-delay="1200" effect="dark" content="只查询加急的零件" placement="top">
<el-checkbox v-model="all" size="small">加急</el-checkbox>
</el-tooltip>
@@ -33,7 +32,7 @@
</div>
</div>
<el-card>
<el-table v-loading="loading" :data="tableData" :row-class-name="tableRowClassName" height="570" style="width: 1090px; margin: 3px 0" size="mini" border highlight-current-row element-loading-text="拼命加载中">
<el-table v-loading="loading" :data="tableData" :row-class-name="tableRowClassName" height="570" style="width: 1180px; margin: 3px 0" size="mini" border highlight-current-row element-loading-text="拼命加载中">
<el-table-column label="机床图号" prop="机床图号" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床图号 }}
@@ -85,6 +84,11 @@
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="90px" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="repulse(scope.row)">打回</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -102,7 +106,7 @@
</template>
<script>
import { searchMachine, searchtable } from '@/api/ManufacturingCenter/ProductionPlanQuery'
import { searchMachine, searchtable, repulse } from '@/api/ManufacturingCenter/ProductionPlanQuery'
export default {
data() {
return {
@@ -124,17 +128,6 @@ export default {
this.projectChange()
},
methods: {
loginsession() {
this.$axios({
methods: 'post',
url: 'http://192.168.1.192:8045/submit/SessionID.ashx?userName=1222',
data: {
userName: '0000'
}
}).then(res => {
console.log(res, 9999)
})
},
projectChange() {
this.machineName = []
this.machineNameValue = ''
@@ -200,6 +193,38 @@ export default {
this.$message.warning('请输入筛选条件')
}
},
repulse(row) {
if (row.考核状态 >= 6) {
this.$confirm('该零件已在加工中,请去零件报废页处理该零件', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(1)
}).catch(() => {
this.$message({
type: 'info',
message: '已取消打回'
})
})
} else {
this.$confirm('确定打回该零件?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
repulse(row.工艺计划流水号).then(response => {
this.searchTable()
this.$message.success('打回成功')
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消打回'
})
})
}
},
tableRowClassName({ row }) {
if (row.是否加急 === '1') {
return 'UrgentItem'

View File

@@ -21,7 +21,7 @@
<!-- <h3 style="display: inline-block;margin: 0 0 0 20px">客户名称:</h3> -->
<el-input v-model="CustomerNameValue" placeholder="客户名称" size="small" clearable style="width:200px"/>
<el-button size="small" icon="el-icon-search" type="primary" plain style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
<el-button size="small" style="margin: 0px 0px 3px 680px" type="success" icon="el-icon-edit-outline" plain @click="editPro()">保存</el-button>
<el-button size="small" style="margin: 0px 0px 3px 680px" type="success" icon="el-icon-edit-outline" plain @click="limit1()">保存</el-button>
</el-row>
<el-row v-if="false">
<h3 style="display: inline-block;margin: 0">签订日期:</h3>
@@ -36,7 +36,7 @@
<el-col style="width: 1325px;">
<el-card>
<!--<h2 style="display: inline-block;margin: 0 0 10px 0">总计划:</h2>-->
<el-table v-loading="loading" :data="tableData" height="355" highlight-current-row style="margin-top: 5px;width: 100%;" border element-loading-text="拼命加载中" @row-click="rowClick">
<el-table v-loading="loading" :data="tableData" height="315" highlight-current-row style="margin-top: 5px;width: 100%;" border element-loading-text="拼命加载中" @row-click="rowClick">
<el-table-column label="项目编号" align="center" width="170px" fixed="left">
<template slot-scope="scope">
<template v-if="scope.row.edit">
@@ -97,11 +97,16 @@
{{ scope.row.项目计划制定人 }}
</template>
</el-table-column>
<el-table-column label="修改时间" align="center" width="100px">
<template slot-scope="scope">
{{ scope.row.修改时间 }}
</template>
</el-table-column>
<el-table-column v-if="false" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-else type="primary" size="small" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="primary" size="small" @click="scope.row.edit=!scope.row.edit">取消</el-button>
<el-button v-if="scope.row.edit" type="primary" size="small" @click="cennel(scope.row)">取消</el-button>
</template>
</el-table-column>
</el-table>
@@ -212,17 +217,17 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col style="width: 20px">
<!--<el-radio v-model="radio" label="9">{{ empty }}</el-radio>-->
</el-col>
<el-col style="width: 180px;margin-left: 20px">
<el-form-item label="更新时间" prop="更新时间">
<el-input v-model="更新时间" placeholder="更新时间" clearable size="small" style="width: 180px"/>
<!--<el-date-picker v-model="更新时间" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="更新时间" class="time"/>-->
</el-form-item>
</el-col>
</el-row>
<!--<el-row>-->
<!--<el-col style="width: 20px">-->
<!--&lt;!&ndash;<el-radio v-model="radio" label="9">{{ empty }}</el-radio>&ndash;&gt;-->
<!--</el-col>-->
<!--<el-col style="width: 180px;margin-left: 20px">-->
<!--<el-form-item label="更新时间" prop="更新时间">-->
<!--<el-input v-model="更新时间" placeholder="更新时间" clearable size="small" style="width: 180px"/>-->
<!--&lt;!&ndash;<el-date-picker v-model="更新时间" size="small" value-format="yyyy-MM-dd" type="date" style="width: 150px" placeholder="更新时间" class="time"/>&ndash;&gt;-->
<!--</el-form-item>-->
<!--</el-col>-->
<!--</el-row>-->
</el-form>
</el-card>
</el-col>
@@ -336,7 +341,7 @@
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="text" size="small" @click="confirmEdit2(scope.row)">确定</el-button>
<el-button v-else type="text" size="small" icon="el-icon-edit-outline" @click="scope.row.edit=!scope.row.edit">编辑</el-button>
<el-button v-if="scope.row.edit" type="text" size="small" @click="scope.row.edit=!scope.row.edit">取消</el-button>
<el-button v-if="scope.row.edit" type="text" size="small" @click="cennel(scope.row)">取消</el-button>
<el-button v-else type="text" size="small" icon="el-icon-delete" @click="Delete(scope.row)">删除</el-button>
</template>
</el-table-column>
@@ -512,6 +517,7 @@ export default {
审图实际完成时间: 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].项目生成,
@@ -544,32 +550,70 @@ export default {
}
})
},
// 表格1保存
editPro() {
// 表1 保存判断
limit1() {
if (this.项目流水号) {
this.审图开始 ? this.审图开始 : this.审图开始 = null
this.审图结束 ? this.审图结束 : this.审图结束 = null
this.发图完成 ? this.发图完成 : this.发图完成 = null
this.采购完成 ? this.采购完成 : this.采购完成 = null
this.备料完成 ? this.备料完成 : this.备料完成 = null
this.制造完成 ? this.制造完成 : this.制造完成 = null
this.装配完成 ? this.装配完成 : this.装配完成 = null
editTable(this.项目流水号, this.机床流水号, this.项目编号, this.设计者, this.审图开始, this.审图结束, '', this.发图完成, this.采购完成, this.备料完成, this.制造完成, this.装配完成, '', this.更新时间, this.id).then(response => {
if (response.data[0].result === '1') {
this.tableData.map(v => {
if (v.项目流水号 === this.项目流水号) {
v.项目编号 = this.项目编号
}
})
this.$message.success('保存成功')
if (!this.设计者) {
this.$message.error('请输入设计者')
} else if (!this.项目编号) {
this.$message.error('请输入项目编号')
} else if (!this.审图开始) {
this.$message.error('请选择审图开始时间')
} else if (!this.审图结束) {
this.$message.error('请选择审图结束时间')
} else if (!this.发图完成) {
this.$message.error('请选择发图完成始时间')
} else if (!this.采购完成) {
this.$message.error('请选择采购完成时间')
} else if (!this.备料完成) {
this.$message.error('请选择备料完成时间')
} else if (!this.制造完成) {
this.$message.error('请选择制造完成时间')
} else if (!this.装配完成) {
this.$message.error('请选择装配完成时间')
} else {
if (this.审图结束 < this.审图开始) {
this.$message.error('审图结束时间应大于审图开始时间')
} else if (this.发图完成 < this.审图结束) {
this.$message.error('发图完成时间应大于审图结束时间')
} else if (this.采购完成 < this.发图完成) {
this.$message.error('采购完成时间应大于发图完成时间')
} else if (this.备料完成 < this.发图完成) {
this.$message.error('备料完成时间应大于发图完成时间')
} else if (this.制造完成 < this.发图完成) {
this.$message.error('制造完成时间应大于发图完成时间')
} else if (this.装配完成 < this.制造完成) {
this.$message.error('装配完成时间应大于制造完成时间')
} else {
this.$message.error('信息修改失败')
this.editPro()
}
})
}
} else {
this.$message.error('请先选择项目')
}
},
// 表格1保存
editPro() {
this.审图开始 ? this.审图开始 : this.审图开始 = null
this.审图结束 ? this.审图结束 : this.审图结束 = null
this.发图完成 ? this.发图完成 : this.发图完成 = null
this.采购完成 ? this.采购完成 : this.采购完成 = null
this.备料完成 ? this.备料完成 : this.备料完成 = null
this.制造完成 ? this.制造完成 : this.制造完成 = null
this.装配完成 ? this.装配完成 : this.装配完成 = null
editTable(this.项目流水号, this.机床流水号, this.项目编号, this.设计者, this.审图开始, this.审图结束, '', this.发图完成, this.采购完成, this.备料完成, this.制造完成, this.装配完成, '', this.更新时间, this.id).then(response => {
if (response.data[0].result === '1') {
this.tableData.map(v => {
if (v.项目流水号 === this.项目流水号) {
v.项目编号 = this.项目编号
}
})
this.$message.success('保存成功')
} else {
this.$message.error('信息修改失败')
}
})
},
// 查询表格2数据
openDialog() {
this.loading2 = true
@@ -595,7 +639,6 @@ export default {
}
})
searchTable2(this.机床流水号, this.radio).then(response => {
console.log('')
if (response.data.length === 0) {
this.loading2 = false
} else {
@@ -628,7 +671,16 @@ export default {
计划完成时间: 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].接收任务时间,
任务开始时间_原: response.data[i].任务开始时间,
计划完成时间_原: response.data[i].计划完成时间,
货期_原: response.data[i].货期,
实际完成时间_原: response.data[i].实际完成时间,
备注_原: response.data[i].备注
})
}
}
@@ -690,7 +742,16 @@ export default {
计划完成时间: 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].接收任务时间,
任务开始时间_原: response.data[i].任务开始时间,
计划完成时间_原: response.data[i].计划完成时间,
货期_原: response.data[i].货期,
实际完成时间_原: response.data[i].实际完成时间,
备注_原: response.data[i].备注
})
}
}
@@ -700,19 +761,38 @@ export default {
},
// 表格2保存
confirmEdit2(row) {
editTable2(row.组件计划流水号, row.组件流水号, row.任务名称, row.负责人, row.接收任务时间, row.任务开始时间, row.计划完成时间, row.货期, row.实际完成时间, row.备注).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.$notify({
title: '成功',
message: '信息修改成功',
type: 'success'
})
this.searchTable2()
} else {
this.$message.error('信息修改失败')
}
})
if (row.任务开始时间 < row.接收任务时间) {
this.$message.error('任务开始时间应大于接收任务时间')
} else if (row.计划完成时间 < row.任务开始时间) {
this.$message.error('计划完成时间应大于任务开始时间')
} else {
editTable2(row.组件计划流水号, row.组件流水号, row.任务名称, row.负责人, row.接收任务时间, row.任务开始时间, row.计划完成时间, row.货期, row.实际完成时间, row.备注).then(response => {
if (response.data[0].result === '1') {
row.edit = false
this.$notify({
title: '成功',
message: '信息修改成功',
type: 'success'
})
this.searchTable2()
} else {
this.$message.error('信息修改失败')
}
})
}
},
// 表格2取消
cennel(row) {
row.组号 = row.组号_原
row.任务名称 = row.任务名称_原
row.负责人 = row.负责人_原
row.接收任务时间 = row.接收任务时间_原
row.任务开始时间 = row.任务开始时间_原
row.计划完成时间 = row.计划完成时间_原
row.货期 = row.货期_原
row.实际完成时间 = row.实际完成时间_原
row.备注 = row.备注_原
row.edit = !row.edit
},
// 表格2删除
Delete(row) {