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

update:修改上下机状态

parent 34616f8d
...@@ -4,7 +4,11 @@ ...@@ -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="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('1')">上机扫描</u-button>
<u-button style="margin-left: 20rpx" type="success" size="mini" @click="handleScancode('2')">下机扫描</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> </view>
</template> </template>
...@@ -16,6 +20,7 @@ export default { ...@@ -16,6 +20,7 @@ export default {
default: () => [] default: () => []
} }
}, },
dicts: ['TOOL_MACHINES_TYPE'],
data() { data() {
return { return {
tableSelectData: [], tableSelectData: [],
...@@ -25,6 +30,7 @@ export default { ...@@ -25,6 +30,7 @@ export default {
width: 35 width: 35
}, },
{ {
type: 'slot',
name: 'typeName', name: 'typeName',
label: '状态', label: '状态',
width: 80 width: 80
...@@ -32,18 +38,18 @@ export default { ...@@ -32,18 +38,18 @@ export default {
{ {
name: 'toolCode', name: 'toolCode',
label: '刀模版sn码', label: '刀模版sn码',
width: 140 width: 130
}, },
{ {
name: 'toolName', name: 'toolName',
label: '刀模版名称', label: '刀模版名称',
width: 140 width: 130
}, },
{ {
name: 'itemName', name: 'itemName',
label: '物料名称', label: '物料名称',
width: 140 width: 130
}, },
{ {
name: 'upDate', name: 'upDate',
...@@ -55,15 +61,41 @@ export default { ...@@ -55,15 +61,41 @@ export default {
label: '下机时间', label: '下机时间',
width: 140 width: 140
} }
] ],
}; };
}, },
computed: { computed: {
tableData() { tableData() {
return this.data || []; return this.data || [];
} }
},
mounted () {
}, },
methods: { 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) { async commonClick(type) {
if (this.tableSelectData.length == 0) { if (this.tableSelectData.length == 0) {
return this.$u.toast('请选择一条数据!'); return this.$u.toast('请选择一条数据!');
......
...@@ -145,6 +145,13 @@ ...@@ -145,6 +145,13 @@
<text>{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}</text> <text>{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }}</text>
</view> </view>
</template> </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> <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):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
{{ ite.filters ? itemFilter(item, ite) : formatterAction(item, ite, index, i) }} {{ 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