任务分配

This commit is contained in:
chenjianan
2019-06-21 15:34:08 +08:00
parent 21e994d9d7
commit f97a91849c
3 changed files with 118 additions and 54 deletions

View File

@@ -13,22 +13,6 @@
</div>
</el-card>
<el-divider content-position="right"/>
<div v-if="Number(token)===2" style="width:100%">
<el-divider content-position="right">待分配零件数</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()">
<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>
</div>
</div>
</el-card>
@@ -45,9 +29,7 @@ export default {
sudokus: [],
curSelect: null,
number: '',
timer: '',
timer2: '',
machines: []
timer: ''
}
},
computed: {
@@ -59,18 +41,11 @@ export default {
mounted() {
this.getFileList()
this.timer = setInterval(this.getFileList, 60 * 60 * 1000) // 60 分钟一刷新
this.searchUnallocatePartNumber()
this.timer2 = setInterval(this.searchUnallocatePartNumber, 20 * 60 * 1000) // 20 分钟一刷新
},
beforeDestroy() {
clearInterval(this.timer)
clearInterval(this.timer2)
},
methods: {
// 选择机床
clickCard() {
this.$router.push({ path: '/PurchaseTaskAllocate/index' })
},
async getFileList() {
await request({
url: '',
@@ -104,28 +79,6 @@ export default {
value: res.data[0].Column1
})
})
},
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
})
}
}
}