Commit 5cc33ef7 authored by 张海景's avatar 张海景

update:修改上下机状态

parent 34616f8d
......@@ -4,7 +4,11 @@
<u-button style="margin-left: 20rpx" type="success" size="mini" @click="commonClick('2')">下机</u-button>
<u-button style="margin-left: 20rpx" type="success" size="mini" @click="handleScancode('1')">上机扫描</u-button>
<u-button style="margin-left: 20rpx" type="success" size="mini" @click="handleScancode('2')">下机扫描</u-button>
<zb-table :columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggleAllSelection" @toggleRowSelection="toggleRowSelection"></zb-table>
<zb-table :columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggleAllSelection" @toggleRowSelection="toggleRowSelection">
<template slot="slot" slot-scope="scope">
<u-tag :text="scope.row.typeName" :type="getTag(scope.row)"></u-tag>
</template>
</zb-table>
</view>
</template>
......@@ -16,6 +20,7 @@ export default {
default: () => []
}
},
dicts: ['TOOL_MACHINES_TYPE'],
data() {
return {
tableSelectData: [],
......@@ -25,6 +30,7 @@ export default {
width: 35
},
{
type: 'slot',
name: 'typeName',
label: '状态',
width: 80
......@@ -32,18 +38,18 @@ export default {
{
name: 'toolCode',
label: '刀模版sn码',
width: 140
width: 130
},
{
name: 'toolName',
label: '刀模版名称',
width: 140
width: 130
},
{
name: 'itemName',
label: '物料名称',
width: 140
width: 130
},
{
name: 'upDate',
......@@ -55,15 +61,41 @@ export default {
label: '下机时间',
width: 140
}
]
],
};
},
computed: {
tableData() {
return this.data || [];
}
},
mounted () {
},
methods: {
getTag(row) {
console.log(row, 'row')
const obj = {
'1': 'primary',
'2': 'success',
'3': 'info'
}
let option = this.dict.type.TOOL_MACHINES_TYPE.map(item => {
return {
...item,
type: obj[item.value]
}
})
let type = ''
option.forEach(item => {
console.log(item , 'item')
if (item.value == row.type) {
type = item.type
}
})
console.log(type, 'type')
return type
},
async commonClick(type) {
if (this.tableSelectData.length == 0) {
return this.$u.toast('请选择一条数据!');
......
......@@ -145,6 +145,13 @@
<text>{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}</text>
</view>
</template>
<template v-else-if="ite.type === 'slot'">
<!-- 插槽的使用示例
<template slot="slot" slot-scope="scope">
{{ scope.row }}
</template> -->
<slot name="slot" :row="item" :index="index"></slot>
</template>
<template v-else>
<!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment