Commit 8afa1cb8 authored by 高滢's avatar 高滢

feat(任务): 检验小组

parent cc9d76c1
......@@ -280,7 +280,7 @@ export function getUseCaseListByScenario(data) {
}
export function getInspection() {
return request({
url: '/system/user/getInspection',
url: '/system/user/getInspectionNew',
method: 'post'
})
}
......@@ -311,15 +311,15 @@ export function getScenarios(data) {
})
}
/**
*下载附件
* @param {} data
* @returns
*下载附件
* @param {} data
* @returns
*/
export function getAttachment(data) {
return request({
url: '/pdf/downloadFile',
method: 'post',
data: data,
responseType:'blob'
responseType:'blob'
})
}
......@@ -203,12 +203,8 @@
<el-table-column label="姓名" align="left" prop="nickName">
<template slot-scope="{ row }">
<span v-if="row.userId !== ''">
<span v-show="row.status.toString() === '1'"
>{{ row.name }}(已停用)</span
>
<span v-show="row.status.toString() === '0'">{{
row.name
}}</span>
<span v-show="row.status == '1'">{{ row.name }}(已停用)</span>
<span v-show="row.status == '0'">{{ row.name }}</span>
</span>
<el-select
v-else
......@@ -219,7 +215,7 @@
<el-option
v-for="(item, index) in userList"
:key="index"
:label="item.nickName"
:label="item.nickname"
:value="item.userId"
:disabled="item.disabled"
>
......@@ -238,25 +234,24 @@
<el-table-column label="所属部门" align="left" prop="dept">
<template slot-scope="{ row }">
<span v-if="row.userId === ''">-</span>
<span v-else-if="row.dept === null"> - </span>
<span v-else>{{ row.dept.deptName || '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="orderIndex"
label="排序"
width="160"
align="center"
>
<template slot-scope="scope">
<div v-if="scope.row.userId !== ''" class="sortable-handle">
<icon-park type="sort-three" size="14" fill="#F9A221" />
</div>
<div v-else>
<span>-</span>
</div>
<span v-else>{{ row.deptName ? row.deptName : '-' }}</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="orderIndex"-->
<!-- label="排序"-->
<!-- width="160"-->
<!-- align="center"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.userId !== ''" class="sortable-handle">-->
<!-- <icon-park type="sort-three" size="14" fill="#F9A221" />-->
<!-- </div>-->
<!-- <div v-else>-->
<!-- <span>-</span>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
width="160"
label="操作"
......@@ -353,7 +348,6 @@ import Sortable from 'sortablejs'
import CarInfo from '../new/components/CarInfo'
import PartInfo from '../new/components/PartInfo'
import { selectSamplePage } from '@/api/system/sample'
import { getUserByRole } from '@/api/system/user'
import { componentSelect } from '@/api/system/sample'
import {
createTask,
......@@ -364,10 +358,8 @@ import {
updateTask
} from '@/api/task/task'
import { mapGetters } from 'vuex'
import { getDicts } from '@/api/system/dict/data'
import DocumentInfo from '@/views/task/new/components/DocumentInfo.vue'
import { getByStandardId } from '@/api/task/new'
import { number } from 'echarts'
import { getInspection } from '../../../api/task/task'
export default {
dicts: [
'sys_task_status',
......@@ -676,10 +668,10 @@ export default {
this.getUserByRole()
// 查询样品信息(整车、零件)
// this.getSampleInformation()
this.$nextTick(() => {
this.leaderTop()
this.rowDrop()
})
// this.$nextTick(() => {
// this.leaderTop()
// this.rowDrop()
// })
this.getComponentSelect()
this.$store.dispatch('standard/setStandardList')
},
......@@ -794,6 +786,7 @@ export default {
}
// 文件
this.passDocumentInfoArr = this.taskDetail.fileList
this.leaderTop()
})
},
selectAll() {
......@@ -892,7 +885,7 @@ export default {
})
},
getUserByRole() {
getUserByRole({ roleName: '检验员' }).then(response => {
getInspection().then(response => {
this.userList = response.data
.filter(obj => obj.status.toString() !== '1')
.map(obj => {
......@@ -911,44 +904,15 @@ export default {
this.currentPartSampleInformation = cards
console.log('PartInfo组件传值', cards)
},
// getSampleInformation() {
// // 查询整车样品信息
// selectSamplePage({ pageNum: 1, pageSize: 999, flag: 0 }).then(
// response => {
// this.vehicleSampleInformationList = response.rows
// console.log(
// 'vehicleSampleInformationList',
// this.vehicleSampleInformationList
// )
// }
// )
// // 查询零件样品信息
// selectSamplePage({ pageNum: 1, pageSize: 999, flag: 1 }).then(
// response => {
// this.partSampleInformationList = response.rows
// console.log(
// 'partSampleInformationList',
// this.partSampleInformationList
// )
// }
// )
// },
/** 主检角色置顶逻辑 */
leaderTop() {
if (this.tableData.length !== 0) {
this.tableData.findIndex((item, index) => {
// 循环遍历数组是否有主检
let obj = {}
this.tableData.forEach((item, index) => {
// 在数组中循环遍历找到主检并置顶
if (item.isLeader === 1) {
let obj = {}
this.tableData.length &&
this.tableData.forEach((item, index) => {
// 在数组中循环遍历找到主检并置顶
if (item.isLeader === 1) {
obj = item
this.tableData.splice(index, 1)
return
}
})
obj = item
this.tableData.splice(index, 1)
this.tableData.unshift(obj)
}
})
......@@ -1043,50 +1007,45 @@ export default {
closeOnClickModal: false,
confirmButtonClass: 'queryBtn'
}).then(() => {
console.log(this.userList, row)
// 把当前人取消禁用
if (row.status === '0') {
this.userList.find(
item => item.userId.toString() === row.userId.toString()
).disabled = false
this.tableData = this.tableData.filter(
item => item.userId !== row.userId
)
this.tableData = this.tableData.map((item, index) => {
if (index === 0) {
return { ...item, isLeader: 1 }
} else {
return { ...item, isLeader: 0 }
}
})
} else {
this.tableData = this.tableData.filter(
item => item.userId !== row.userId
)
}
// if (row.status === '0') {
this.userList.find(
// eslint-disable-next-line eqeqeq
item => item.userId == row.userId
).disabled = false
this.tableData = this.tableData.filter(
item => item.userId !== row.userId
)
})
},
handleNameChange(value) {
console.log('value', value)
this.userId = value
const selectData = this.userList.find(item => item.userId === value)
// eslint-disable-next-line eqeqeq
const selectData = this.userList.find(item => item.userId == value)
this.tableData.forEach(data => {
if (data.userId === '') {
data.nickName = selectData.nickName
data.name = selectData.nickName
console.log('selectData', selectData)
data.nickName = selectData.nickname
data.name = selectData.nickname
data.userId = selectData.userId
data.dept = selectData.dept
data.dept = selectData.deptName
data.deptName = selectData.deptName
data.status = '0'
if (selectData.roleId.includes(112)) {
data.isLeader = 1
} else {
data.isLeader = 0
}
}
})
// 已被选择的人做禁用
this.userList.find(item => item.userId === this.userId).disabled = true
// eslint-disable-next-line eqeqeq
this.userList.find(item => item.userId == this.userId).disabled = true
this.userId = ''
this.leaderTop()
if (this.tableData.length === 1) {
this.tableData[0].isLeader = 1
} else {
this.tableData[this.tableData.length - 1].isLeader = 0
}
// this.leaderTop()
console.log(this.tableData)
},
/**
* 保存人员
......@@ -1121,6 +1080,7 @@ export default {
num++
}
})
console.log('lastObj', lastObj)
if (lastObj.userId === '' || num === 1) {
this.$message.error('请填写完此成员信息')
return
......@@ -1147,14 +1107,6 @@ export default {
this.$message.error('请保存小组成员信息')
return
}
// else if (this.currentVehicleSampleInformation.length === 0) {
// this.$message.error('请填写整车样品信息')
// return
// }
// else if (this.currentPartSampleInformation.length === 0) {
// this.$message.error('请填写零部件样品信息')
// return
// }
this.$confirm('是否确认进行发布功能', '发布', {
confirmButtonText: '确定',
concelButtonText: '取消',
......
This diff is collapsed.
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