任务分配
This commit is contained in:
@@ -611,6 +611,25 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-card>
|
||||
<div v-if="Number(token)===2" style="width:100%">
|
||||
<el-divider content-position="right">
|
||||
<el-button type="text" @click="searchUnallocatePartNumber">刷新</el-button> | 待分配零件数
|
||||
</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(machine.项目流水号, machine.机床流水号)">
|
||||
<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>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -618,11 +637,14 @@
|
||||
import { initMaterialCategory, initMaterialVariety, initProject, initBuyer, searchMachine, searchGroup, searchTable1, searchTable2, allocateTask1,
|
||||
allocateTask2, executeReturn1, executeReturn2, retract1, retract2 } from '@/api/PurchasingCenter/PurchaseTaskAllocate'
|
||||
import { mapGetters } from 'vuex'
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
name: '', // 采购任务分配
|
||||
data() {
|
||||
return {
|
||||
timer2: '',
|
||||
machines: [],
|
||||
source: [
|
||||
{
|
||||
text: 'BZ',
|
||||
@@ -707,14 +729,42 @@ export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'name',
|
||||
'token',
|
||||
'id'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.searchTable0() // 查表1
|
||||
this.fetchData() // 初始化数据
|
||||
this.searchUnallocatePartNumber()
|
||||
this.timer2 = setInterval(this.searchUnallocatePartNumber, 20 * 60 * 1000) // 20 分钟一刷新
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer2)
|
||||
},
|
||||
methods: {
|
||||
// 选择机床
|
||||
clickCard(project, machine) {
|
||||
this.projectValue = project
|
||||
this.machine = []
|
||||
this.machineValue = ''
|
||||
this.group = []
|
||||
this.groupValue = ''
|
||||
searchMachine(this.projectValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machine.push({
|
||||
value: response.data[i].机床流水号,
|
||||
label: response.data[i].机床图号,
|
||||
name: response.data[i].机床名称
|
||||
})
|
||||
}
|
||||
this.machineValue = machine
|
||||
this.materialStatusValue = [1]
|
||||
this.searchTable0()
|
||||
this.searchTable1()
|
||||
this.searchTable2()
|
||||
})
|
||||
},
|
||||
filterSource(value, row) {
|
||||
return Number(row['零件类型']) === Number(value)
|
||||
},
|
||||
@@ -994,6 +1044,28 @@ export default {
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1016,3 +1088,45 @@ export default {
|
||||
margin: 10px 0 10px 10px;
|
||||
}
|
||||
</style>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.item {
|
||||
margin-top: 10px;
|
||||
margin-right: 40px;
|
||||
}
|
||||
.sudoku_row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width:100%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.sudoku_item{
|
||||
margin-bottom: 20px;
|
||||
margin-left: 20px;
|
||||
/*border: 1px solid red;*/
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width:15%;
|
||||
height: 200px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.opacity{
|
||||
opacity: 0.4;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
.sudoku_item img{
|
||||
margin-bottom: 3px;
|
||||
display: block;
|
||||
}
|
||||
.dashboard {
|
||||
&-container {
|
||||
margin: 30px;
|
||||
}
|
||||
&-text {
|
||||
font-size: 30px;
|
||||
line-height: 46px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user