Commit fda1fb0d authored by chenzj's avatar chenzj

生产报工人自动带入和自己选择

parent 8a5b5bd6
...@@ -63,6 +63,9 @@ const install = (Vue, vm) => { ...@@ -63,6 +63,9 @@ const install = (Vue, vm) => {
getIpqcCode: (params = {}) => getIpqcCode: (params = {}) =>
vm.$u.get(config.adminPath + '/system/autocode/get/IPQC_CODE', params), vm.$u.get(config.adminPath + '/system/autocode/get/IPQC_CODE', params),
//查看人员管理
userQuery: (params = {}) => vm.$u.get(config.adminPath + '/mes/md/workstationworker/list' ,params),
//增加缺陷记录 //增加缺陷记录
addDefectrecord: (params = {}) => addDefectrecord: (params = {}) =>
vm.$u.putJson(config.adminPath + '/mes/qc/defectrecord', params), vm.$u.putJson(config.adminPath + '/mes/qc/defectrecord', params),
......
<template>
<view class="dmodel-table">
<zb-table ref="zbTable" rowKey="recordId"
:columns="tableColumn" :data="tableData" :stripe="true" @toggleAllSelection="toggl
eAllSelection"
@toggleRowSelection="toggleRowSelection">
</zb-table>
</view>
</template>
<script>
export default {
props: {
data: {
type: Object,
default: () => {}
}
},
data() {
return {
tableData: [],
tableSelectData: [],
tableColumn: [{
type: 'selection',
width: 35
},
{
name: 'nickName',
label: '名称',
width: 200,
},
{
name: 'userName',
label: '编号',
width: 160,
},
{
name: 'workstationName',
label: '工作站',
width: 160,
},
],
}
},
// computed: {
// tableData() {
// return this.data || []
// }
// },
mounted() {
console.log(this.data, 'this.data')
console.log(this.data.workstationName)
this.getList()
// this.data.workstationName
},
methods: {
rowClick(row, index) {
console.log(this.$refs.zbTable)
this.$refs.zbTable.checkboxSelectedAll({checked: false})
this.$refs.zbTable.toggleRowSelection(row)
},
async commonClick(type) {
if (this.tableSelectData.length == 0) {
return this.$u.toast('请选择一条数据!')
}
// 判断选中的类型是否一致
if (this.tableSelectData.length > 1) {
let flag = false
for (let i = 1; i < this.tableSelectData.length; i++) {
const pre = this.tableSelectData[i - 1]
const cur = this.tableSelectData[i]
flag = cur.type == pre.type
if (!flag) {
break;
}
}
if (!flag) {
return this.$u.toast('请选择状态相同的数据')
}
}
},
async getList() {
const params = {
pageNum: 1,
pageSize: 10,
workstationId: this.data.workstationId
}
const res = await this.$u.api.userQuery(params)
console.log(res, 'res')
if (res.code == 200) {
this.tableData=res.rows.map(item => {
return {
...item,
workstationName: this.data.workstationName
}
})
}
},
toggleAllSelection(checked, arr) {
this.tableSelectData = arr
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr
},
}
}
</script>
<style scoped>
.dmodel-table {
height: 500rpx;
margin-top: 20rpx;
padding: 0 20rpx;
}
</style>
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