|
|
@@ -84,6 +84,11 @@
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column
|
|
|
+ label="sop名称"
|
|
|
+ align="center"
|
|
|
+ prop="sopName"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
label="设备/工艺名称"
|
|
|
align="center"
|
|
|
@@ -306,7 +311,7 @@
|
|
|
<i></i>
|
|
|
<span class="title">添加人员</span>
|
|
|
</div>
|
|
|
- <el-form ref="dialogForm" :model="dialogForm" label-width="70px">
|
|
|
+ <el-form ref="dialogForm" :model="dialogForm" :rules="rules" label-width="70px">
|
|
|
<el-row>
|
|
|
<el-form-item label="上锁人" prop="locker">
|
|
|
<el-select
|
|
|
@@ -718,7 +723,13 @@ export default {
|
|
|
scaleFactor: 1, // 缩放比例,初始值为1
|
|
|
EightDetailvisible: false,//第八步受影响作业票
|
|
|
AffectedTickets:[],//第八步查看详情信息表格
|
|
|
+ rules: {
|
|
|
+ locker: [
|
|
|
+ { required: true, message: '上锁人不能为空', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
filteredSopTypes() {
|
|
|
@@ -734,6 +745,13 @@ export default {
|
|
|
return stepFour && stepFour.stepStatus === '1';
|
|
|
},
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ 'tabPosition': function (val, oldVal) {
|
|
|
+ if (val =='first') {
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
mounted() {
|
|
|
this.getList()
|
|
|
@@ -771,9 +789,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-// 外部人员搜索
|
|
|
+ // 外部人员搜索
|
|
|
filterOutsideTable() {
|
|
|
const query = this.outsideSearchQuery.trim().toLowerCase();
|
|
|
const filteredData = this.outsideTableDataOrign.filter(item =>
|
|
|
@@ -806,9 +822,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
handleTicketClick(data) {
|
|
|
console.log(data, '查看作业票详情')
|
|
|
this.ticketId = data.ticketId
|
|
|
@@ -887,6 +900,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
if (val == 'third') {
|
|
|
+ this.selectedOption=''
|
|
|
const data = {
|
|
|
sopId: this.form[0].sopId
|
|
|
}
|
|
|
@@ -928,7 +942,11 @@ export default {
|
|
|
// 添加内部人员
|
|
|
addInside(row) {
|
|
|
if (row.stepIndex == '3') {
|
|
|
+ this.dialogForm.locker=''
|
|
|
+ this.AllUserTable=[]
|
|
|
+ this.newticketUserDTOList=[]
|
|
|
this.open = true
|
|
|
+
|
|
|
const query = {
|
|
|
pageSize: 10000,
|
|
|
pageNum: 1
|
|
|
@@ -939,43 +957,46 @@ export default {
|
|
|
console.log(this.insideTableData, this.outsideTableData, '用户')
|
|
|
|
|
|
// 获取已分配人员数据
|
|
|
- getJobTicketInfo(this.ticketId).then((res) => {
|
|
|
- const assignedUsers = res.data.jobTicketUserList || [];
|
|
|
- console.log(assignedUsers, '已分配人员');
|
|
|
- this.dialogForm.locker = assignedUsers
|
|
|
- .filter(item => item.userRole == 'jtlocker')
|
|
|
- .map(item => item.userName);
|
|
|
- console.log(this.dialogForm.locker,'上锁人回显数据')
|
|
|
|
|
|
- // 更新内部和外部用户的选中状态
|
|
|
- this.$nextTick(() => {
|
|
|
- // 手动选中内部人员
|
|
|
- this.insideTableData.forEach((user) => {
|
|
|
- const isAssigned = assignedUsers.some(
|
|
|
- (assigned) =>
|
|
|
- assigned.userId == user.userId && assigned.userType == '0'&&assigned.userRole!=='jtlocker'
|
|
|
- );
|
|
|
- if (isAssigned) {
|
|
|
- this.$refs.insideTable.toggleRowSelection(user, true);
|
|
|
+ getJobTicketInfo(this.ticketId).then((res) => {
|
|
|
+ const assignedUsers = res.data.jobTicketUserList || [];
|
|
|
+ console.log(assignedUsers, '已分配人员');
|
|
|
+ this.dialogForm.locker = assignedUsers
|
|
|
+ .filter(item => item.userRole == 'jtlocker')
|
|
|
+ .map(item => item.userName);
|
|
|
+ console.log(this.dialogForm.locker,'上锁人回显数据')
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
+ // 更新内部和外部用户的选中状态
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 手动选中内部人员
|
|
|
+ this.insideTableData.forEach((user) => {
|
|
|
+ const isAssigned = assignedUsers.some(
|
|
|
+ (assigned) =>
|
|
|
+ assigned.userId == user.userId && assigned.userType == '0'&&assigned.userRole!=='jtlocker'
|
|
|
+ );
|
|
|
+ if (isAssigned) {
|
|
|
+ this.$refs.insideTable.toggleRowSelection(user, true);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- // 手动选中外部人员
|
|
|
- this.outsideTableData.forEach((user) => {
|
|
|
- const isAssigned = assignedUsers.some(
|
|
|
- (assigned) =>
|
|
|
- assigned.userId == user.userId && assigned.userType == '1'&&assigned.userRole!=='jtlocker'
|
|
|
- );
|
|
|
- if (isAssigned) {
|
|
|
- this.$refs.outsideTable.toggleRowSelection(user, true);
|
|
|
+ // 手动选中外部人员
|
|
|
+ this.outsideTableData.forEach((user) => {
|
|
|
+ const isAssigned = assignedUsers.some(
|
|
|
+ (assigned) =>
|
|
|
+ assigned.userId == user.userId && assigned.userType == '1'&&assigned.userRole!=='jtlocker'
|
|
|
+ );
|
|
|
+ if (isAssigned) {
|
|
|
+ this.$refs.outsideTable.toggleRowSelection(user, true);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.insideTableDataOrign = [...this.insideTableData];
|
|
|
+ this.outsideTableDataOrign = [...this.outsideTableData];
|
|
|
});
|
|
|
- this.insideTableDataOrign = [...this.insideTableData];
|
|
|
- this.outsideTableDataOrign = [...this.outsideTableData];
|
|
|
});
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
|
|
|
})
|
|
|
|
|
|
@@ -998,6 +1019,12 @@ export default {
|
|
|
// 上锁人下拉选择change事件
|
|
|
handlelockerChage(val) {
|
|
|
console.log(val, '上锁人chage')
|
|
|
+ if (val) {
|
|
|
+ // 操作选中角色发生变化
|
|
|
+ this.$set(this.dialogForm, this.dialogForm.locker, val)
|
|
|
+ } else {
|
|
|
+ this.$set(this.dialogForm, this.dialogForm.locker, '')
|
|
|
+ }
|
|
|
this.$forceUpdate();
|
|
|
const user = this.listLockerOption.find((item) => item.value == val)
|
|
|
|
|
|
@@ -1056,19 +1083,24 @@ export default {
|
|
|
ticketUserDTOList: [...this.AllUserTable, ...this.newticketUserDTOList]
|
|
|
}
|
|
|
console.log(data, '添加人员')
|
|
|
- addJobUsers(data).then((res) => {
|
|
|
- console.log(res, '添加人员')
|
|
|
- if (res.data) {
|
|
|
- this.$message.success('分配人员成功')
|
|
|
- this.open = false
|
|
|
- this.AllUserTable = []
|
|
|
- this.dialogForm.locker = ''
|
|
|
- getStepInfo(this.ticketId).then((res) => {
|
|
|
- this.EightStepForm = res.data
|
|
|
- console.log(res, '作业票-详细信息')
|
|
|
+ this.$refs.dialogForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ addJobUsers(data).then((res) => {
|
|
|
+ console.log(res, '添加人员')
|
|
|
+ if (res.data) {
|
|
|
+ this.$message.success('分配人员成功')
|
|
|
+ this.open = false
|
|
|
+ this.AllUserTable = []
|
|
|
+ this.dialogForm.locker = ''
|
|
|
+ getStepInfo(this.ticketId).then((res) => {
|
|
|
+ this.EightStepForm = res.data
|
|
|
+ console.log(res, '作业票-详细信息')
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
// 人员列表删除
|
|
|
deleteRow(index, rows) {
|