fixed bug

This commit is contained in:
chenjianan
2019-05-25 14:14:53 +08:00
parent e59d3f8114
commit 139431e6fe
7 changed files with 767 additions and 352 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-tabs type="border-card" @tab-click="searchTable1();searchTable2()">
<el-tab-pane label="标准件和外购件">
<el-tabs v-model="tabName" type="border-card" @tab-click="searchTable1();searchTable2()">
<el-tab-pane label="标准件和外购件" name="标准件和外购件">
<el-row style="margin-bottom: 5px">
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
@@ -101,18 +101,17 @@
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange1">
<el-table v-loading="" :data="tableData1" size="mini" style="max-height: 600px" height="500px" border stripe @selection-change="handleSelectionChange1">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="采购情况" min-width="80px">
<template slot-scope="scope">
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
<el-tag v-else-if="scope.row.人员编号===''" type="primary" size="small">分配</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
<el-tag v-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" min-width="150px">
<el-table-column align="center" label="项目名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
@@ -187,6 +186,16 @@
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="!(parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='')"
type="primary"
size="mini"
icon="el-icon-back"
@click="retract(scope.row)">撤回</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
@@ -201,7 +210,7 @@
@current-change="handleCurrentChange1"/>
</div>
</el-tab-pane>
<el-tab-pane label="基本件">
<el-tab-pane label="基本件" name="基本件">
<el-row style="margin-bottom: 5px">
<span style="margin-left: 0">项目名称:</span>
<el-select v-model="projectValue" placeholder="项目名称" size="small" filterable clearable @change="projectChange">
@@ -278,18 +287,17 @@
<el-input v-model="partMaterial" placeholder="零件材料" size="small" clearable/>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table v-loading="" :data="tableData2" size="mini" style="max-height: 600px" height="600px" border stripe @selection-change="handleSelectionChange2">
<el-table v-loading="" :data="tableData2" size="mini" style="max-height: 600px" height="500px" border stripe @selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" type="selection"/>
<el-table-column align="center" label="采购情况" min-width="80px">
<template slot-scope="scope">
<el-tag v-if="scope.row.是否未通过" type="info" size="small">已作废</el-tag>
<el-tag v-else-if="scope.row.人员编号===''" type="primary" size="small">分配</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-else-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">已采购</el-tag>
<el-tag v-if="scope.row.人员编号===''" type="primary" size="small">未分配</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!==''" type="warning" size="small">询价</el-tag>
<el-tag v-if="parseInt(scope.row.询价状态编号)===3&&parseInt(scope.row.采购状态编号)!==3" type="success" size="small">询价</el-tag>
<el-tag v-if="parseInt(scope.row.采购状态编号)===3" type="info" size="small">采购</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称" min-width="150px">
<el-table-column align="center" label="项目名称" min-width="100px">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
@@ -359,6 +367,16 @@
{{ scope.row.任务分配时间 ? scope.row.任务分配时间.split(' ')[0] : '—' }}
</template>
</el-table-column>
<el-table-column align="center" label="撤回分配" min-width="100px" fixed="right">
<template slot-scope="scope">
<el-button
:disabled="!(parseInt(scope.row.询价状态编号)===1&&scope.row.人员编号!=='')"
type="primary"
size="mini"
icon="el-icon-back"
@click="retract(scope.row)">撤回</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<div class="block">
@@ -378,13 +396,15 @@
</template>
<script>
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchMachine, searchGroup, searchTable1, searchTable2, allocateTask1, allocateTask2, executeReturn1, executeReturn2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchMachine, searchGroup, searchTable1, searchTable2, allocateTask1,
allocateTask2, executeReturn1, executeReturn2, retract1, retract2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
import { mapGetters } from 'vuex'
export default {
name: '', // 采购任务分配
data() {
return {
tabName: '标准件和外购件',
partNum: '',
partName: '',
partSpec: '',
@@ -462,6 +482,39 @@ export default {
this.fetchData() // 初始化数据
},
methods: {
// 撤回
retract(row) {
this.$confirm('是否撤回重新分配?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.tabName === '基本件') {
retract2(row.基本件流水号).then(res => {
if (Number(res.data[0].result) === 1) {
this.$message.success('撤回成功')
this.searchTable2()
} else {
this.$message.error('撤回失败')
}
})
} else {
retract1(row.标准件和外购件流水号).then(res => {
if (Number(res.data[0].result) === 1) {
this.$message.success('撤回成功')
this.searchTable1()
} else {
this.$message.error('撤回失败')
}
})
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
fetchData() { // 初始化
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -540,7 +593,6 @@ export default {
this.groupValue ? check6 = 1 : check6 = 0
searchTable2(this.pageCurrent2, this.pageSize2, this.check3, this.projectValue, check5, this.machineValue, check6, this.groupValue, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.partNum, check2, this.partName, check3, this.partSpec, check4, this.partMaterial).then(response => {
this.tableData2 = response.data.rows
console.log(response.data.rows)
this.total2 = response.data.total
})
},