待分配

This commit is contained in:
chenjianan
2019-06-21 12:46:22 +08:00
parent ede9e572b8
commit c36ebf051f

View File

@@ -9,16 +9,26 @@
<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 class="sudoku_item " :class="curSelect==sudoku.id?'opacity':''" v-for="(sudoku,index) in sudokus" :key="index" @touchstart="touchstart(index)" @touchend="touchend">-->
<!--&lt;!&ndash;<img :src="sudoku.img_src" width="40" height="40" >&ndash;&gt;-->
<!---->
<!--</div>-->
<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>
@@ -35,7 +45,9 @@ export default {
sudokus: [],
curSelect: null,
number: '',
timer: ''
timer: '',
timer2: '',
machines: []
}
},
computed: {
@@ -47,11 +59,18 @@ 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: '',
@@ -85,6 +104,28 @@ 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
})
}
}
}