|
|
@@ -77,43 +77,46 @@
|
|
|
>
|
|
|
<h3 style="margin-left: 20px">{{ this.marsSopTitle }} SOP</h3>
|
|
|
<span style="margin-left: 20px">选择 工艺/设备</span>
|
|
|
+<!-- :data="marsSopPage"-->
|
|
|
<el-table
|
|
|
style="width: 50%; margin: 20px"
|
|
|
:header-cell-style="{ background: '#004d8c', color: '#FFFFFF' }"
|
|
|
- :data="marsSopPage"
|
|
|
+ :data="technologyList"
|
|
|
@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="sop名称"-->
|
|
|
+<!-- align="center"-->
|
|
|
+<!-- prop="sopName"-->
|
|
|
+<!-- ></el-table-column>-->
|
|
|
<el-table-column
|
|
|
label="设备/工艺名称"
|
|
|
align="center"
|
|
|
prop="machineryName"
|
|
|
></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="所属岗位"
|
|
|
- align="center"
|
|
|
- prop="workstationName"
|
|
|
- ></el-table-column>
|
|
|
+<!-- <el-table-column-->
|
|
|
+<!-- label="所属岗位"-->
|
|
|
+<!-- align="center"-->
|
|
|
+<!-- prop="workstationName"-->
|
|
|
+<!-- ></el-table-column>-->
|
|
|
</el-table>
|
|
|
<h2 style="margin-left: 20px">sop类型</h2>
|
|
|
<el-radio-group
|
|
|
v-model="selectedOption"
|
|
|
size="small"
|
|
|
style="display: flex; flex-direction: column; align-items: flex-start"
|
|
|
+ @change="handleSopchange"
|
|
|
>
|
|
|
+<!-- v-for="(option, index) in filteredSopTypes"-->
|
|
|
<el-radio
|
|
|
- v-for="(option, index) in filteredSopTypes"
|
|
|
- :key="index"
|
|
|
- :label="option"
|
|
|
+ v-for="item in sopTypeOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
border
|
|
|
style="margin: 10px"
|
|
|
>
|
|
|
- {{ option.label }}
|
|
|
+ {{ item.label }}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
<el-button
|
|
|
@@ -147,14 +150,14 @@
|
|
|
</div>
|
|
|
<el-row>
|
|
|
<el-col :span="9">
|
|
|
- <el-table :data="selectPointList">
|
|
|
+ <el-table :data="selectPointList" :show-header="false">
|
|
|
<el-table-column
|
|
|
prop="pointName"
|
|
|
- label="隔离点"
|
|
|
+ label=""
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="powerTypeName"
|
|
|
- label="危险能量类型"
|
|
|
+ prop="remark"
|
|
|
+ label=""
|
|
|
></el-table-column>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
@@ -666,7 +669,7 @@ import {
|
|
|
getStepEight,
|
|
|
getStepInfo,
|
|
|
getWorkstationTicketList,
|
|
|
- listJobTicket,
|
|
|
+ listJobTicket, selectSopTypeByMachineryId,
|
|
|
updateJobStep,
|
|
|
updateJobToCancel,
|
|
|
updateJobToFinish
|
|
|
@@ -684,7 +687,8 @@ export default {
|
|
|
return {
|
|
|
tabPosition: 'first',
|
|
|
selectedOption: '',
|
|
|
- marsSopPage: [], //岗位对应sop列表
|
|
|
+ marsSopPage: [], //岗位对应sop列表--现在准备存放设备工艺 而不是选设备工艺的sop
|
|
|
+ technologyList:[],//设备工艺表格数据
|
|
|
marsSopTitle: '', //岗位后 对应展示sop
|
|
|
marsDeptList: [],
|
|
|
listLockerOption: [], //上锁人下拉数据
|
|
|
@@ -723,6 +727,8 @@ export default {
|
|
|
scaleFactor: 1, // 缩放比例,初始值为1
|
|
|
EightDetailvisible: false,//第八步受影响作业票
|
|
|
AffectedTickets:[],//第八步查看详情信息表格
|
|
|
+ sopTypeOption: [],
|
|
|
+ sopId:null,
|
|
|
rules: {
|
|
|
locker: [
|
|
|
{ required: true, message: '上锁人不能为空', trigger: 'change' }
|
|
|
@@ -732,14 +738,15 @@ export default {
|
|
|
|
|
|
},
|
|
|
computed: {
|
|
|
- filteredSopTypes() {
|
|
|
- const sopTypesInMarsSopPage = this.marsSopPage.map(
|
|
|
- (item) => item.sopType
|
|
|
- )
|
|
|
- return this.dict.type.sop_type.filter((option) =>
|
|
|
- sopTypesInMarsSopPage.includes(option.value)
|
|
|
- )
|
|
|
- },
|
|
|
+
|
|
|
+ // filteredSopTypes() {
|
|
|
+ // const sopTypesInMarsSopPage = this.marsSopPage.map(
|
|
|
+ // (item) => item.sopType
|
|
|
+ // )
|
|
|
+ // return this.dict.type.sop_type.filter((option) =>
|
|
|
+ // sopTypesInMarsSopPage.includes(option.value)
|
|
|
+ // )
|
|
|
+ // },
|
|
|
isStepFourExecuted() {
|
|
|
const stepFour = this.EightStepForm.find((step) => step.stepIndex == "4");
|
|
|
return stepFour && stepFour.stepStatus === '1';
|
|
|
@@ -750,6 +757,12 @@ export default {
|
|
|
if (val =='first') {
|
|
|
this.getList()
|
|
|
}
|
|
|
+ },
|
|
|
+ 'dialogForm.locker': function (val) {
|
|
|
+ if (val) {
|
|
|
+ this.handlelockerChage(val)
|
|
|
+ console.log('我制定了')
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -848,6 +861,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getList() {
|
|
|
+
|
|
|
const data = {
|
|
|
pages: 1,
|
|
|
size: -1
|
|
|
@@ -883,6 +897,21 @@ export default {
|
|
|
}))
|
|
|
})
|
|
|
},
|
|
|
+ // sop类型 el-radio
|
|
|
+ handleSopchange(data) {
|
|
|
+ const sopType=this.sopTypeOption.find((item)=>item.label==data)
|
|
|
+ const data1={
|
|
|
+ pages: 1,
|
|
|
+ size: -1,
|
|
|
+ machineryId:this.machineryId,
|
|
|
+ sopType:sopType.value
|
|
|
+ }
|
|
|
+ getIsMarsSopPage(data1).then((res) => {
|
|
|
+ console.log(res, 'SopPage')
|
|
|
+ this.sopId = res.data.records[0].sopId
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 作业票切换
|
|
|
handelChange(val, workstationId, workstationName) {
|
|
|
console.log(val)
|
|
|
@@ -894,50 +923,70 @@ export default {
|
|
|
size: -1,
|
|
|
workstationId: workstationId
|
|
|
}
|
|
|
- getIsMarsSopPage(data).then((res) => {
|
|
|
- console.log(res, 'SopPage')
|
|
|
- this.marsSopPage = res.data.records
|
|
|
+ listTechnology(data).then((res) => {
|
|
|
+ console.log(res,'设备工艺---列表')
|
|
|
+ this.technologyList = res.data.records.filter((item) =>item.machineryType=='工艺')
|
|
|
})
|
|
|
+ // getIsMarsSopPage(data).then((res) => {
|
|
|
+ // console.log(res, 'SopPage')
|
|
|
+ // this.marsSopPage = res.data.records
|
|
|
+ // })
|
|
|
}
|
|
|
if (val == 'third') {
|
|
|
this.selectedOption=''
|
|
|
- const data = {
|
|
|
- sopId: this.form[0].sopId
|
|
|
- }
|
|
|
- addJobTicket(data).then((res) => {
|
|
|
- console.log(res, '作业票新增')
|
|
|
- this.$message.success('作业开始执行')
|
|
|
- this.ticketId = res.data
|
|
|
- getStepInfo(this.ticketId).then((res) => {
|
|
|
- this.EightStepForm = res.data
|
|
|
- console.log(res, '作业票-详细信息')
|
|
|
- })
|
|
|
- // 获取设备工艺图
|
|
|
- getTechnologyInfo(this.machineryId).then((res) => {
|
|
|
- this.machineryImg = res.data.machineryImg
|
|
|
- // 获取电柜选中隔离点
|
|
|
- const lotoId = res.data.lotoId
|
|
|
- const selectPointsIds = res.data.pointIdList
|
|
|
-
|
|
|
- getLotoMapInfo(lotoId).then((response) => {
|
|
|
- console.log(response, '电柜信息--NewMarsJob')
|
|
|
- this.selectPointList = response.data.filter((item) =>
|
|
|
- selectPointsIds.includes(item.pointId)
|
|
|
- )
|
|
|
- console.log(this.selectPointList, '拿到的选中隔离点数据')
|
|
|
+ this.sopTypeOption=[]
|
|
|
+ console.log(this.sopId,'this.sopId')
|
|
|
+ if(this.sopId){
|
|
|
+
|
|
|
+ const data = {
|
|
|
+ sopId: this.sopId
|
|
|
+ }
|
|
|
+ addJobTicket(data).then((res) => {
|
|
|
+ console.log(res, '作业票新增')
|
|
|
+ this.$message.success('作业开始执行')
|
|
|
+ this.ticketId = res.data
|
|
|
+ getStepInfo(this.ticketId).then((res) => {
|
|
|
+ this.EightStepForm = res.data
|
|
|
+ console.log(res, '作业票-详细信息')
|
|
|
+ })
|
|
|
+ // 获取设备工艺图
|
|
|
+ getTechnologyInfo(this.machineryId).then((res) => {
|
|
|
+ this.machineryImg = res.data.machineryImg
|
|
|
+ // 获取电柜选中隔离点
|
|
|
+ const lotoId = res.data.lotoId
|
|
|
+ const selectPointsIds = res.data.pointIdList
|
|
|
+
|
|
|
+ getLotoMapInfo(lotoId).then((response) => {
|
|
|
+ console.log(response, '电柜信息--NewMarsJob')
|
|
|
+ this.selectPointList = response.data.filter((item) =>
|
|
|
+ selectPointsIds.includes(item.pointId)
|
|
|
+ )
|
|
|
+ console.log(this.selectPointList, '拿到的选中隔离点数据')
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
console.log(selection, 'mars设备工艺表格多选拿到的数据')
|
|
|
+
|
|
|
this.form = selection
|
|
|
this.machineryId = selection[0].machineryId
|
|
|
getTechnologyInfo(selection[0].machineryId).then((res) => {
|
|
|
this.machineryImg = res.data.machineryImg
|
|
|
})
|
|
|
+ selectSopTypeByMachineryId(selection[0].machineryId).then((res) => {
|
|
|
+ console.log(res, 'SopTypeByMachineryId')
|
|
|
+ this.sopTypeOption=res.data.map((item) =>{
|
|
|
+ return{
|
|
|
+ label: item.dictLabel,
|
|
|
+ value: item.dictValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
// 添加内部人员
|
|
|
addInside(row) {
|
|
|
@@ -964,8 +1013,8 @@ export default {
|
|
|
this.dialogForm.locker = assignedUsers
|
|
|
.filter(item => item.userRole == 'jtlocker')
|
|
|
.map(item => item.userName);
|
|
|
- console.log(this.dialogForm.locker,'上锁人回显数据')
|
|
|
-
|
|
|
+ const newUser=res.data.jobTicketUserList.filter((item) =>item.userRole == 'jtlocker')
|
|
|
+ this.newticketUserDTOList=[...this.newticketUserDTOList,...newUser];
|
|
|
// 更新内部和外部用户的选中状态
|
|
|
this.$nextTick(() => {
|
|
|
// 手动选中内部人员
|
|
|
@@ -1024,7 +1073,7 @@ export default {
|
|
|
this.newticketUserDTOList=[]
|
|
|
this.$set(this.dialogForm, this.dialogForm.locker, val)
|
|
|
} else {
|
|
|
- this.$set(this.dialogForm, this.dialogForm.locker, '')
|
|
|
+ this.$set(this.dialogForm, this.dialogForm.locker, val)
|
|
|
}
|
|
|
this.$forceUpdate();
|
|
|
const user = this.listLockerOption.find((item) => item.value == val)
|
|
|
@@ -1052,14 +1101,14 @@ export default {
|
|
|
console.log(this.newticketUserDTOList, '清除后的用户');
|
|
|
},
|
|
|
InSelectionChange(selection) {
|
|
|
- // 移除未选中的用户
|
|
|
+ // 移除未选中的内部用户
|
|
|
this.AllUserTable = this.AllUserTable.filter((user) =>
|
|
|
- selection.some((item) => item.userId === user.userId)
|
|
|
+ user.userType !== 0 || selection.some((item) => item.userId === user.userId)
|
|
|
);
|
|
|
|
|
|
// 添加新的内部用户
|
|
|
selection.forEach((item) => {
|
|
|
- if (!this.AllUserTable.some((user) => user.userId === item.userId)) {
|
|
|
+ if (!this.AllUserTable.some((user) => user.userId === item.userId && user.userType === 0)) {
|
|
|
this.AllUserTable.push({
|
|
|
userName: item.nickName,
|
|
|
userId: item.userId,
|
|
|
@@ -1073,14 +1122,14 @@ export default {
|
|
|
},
|
|
|
|
|
|
OutSelectionChange(selection) {
|
|
|
- // 移除未选中的用户
|
|
|
+ // 移除未选中的外部用户
|
|
|
this.AllUserTable = this.AllUserTable.filter((user) =>
|
|
|
- selection.some((item) => item.userId === user.userId)
|
|
|
+ user.userType !== 1 || selection.some((item) => item.userId === user.userId)
|
|
|
);
|
|
|
|
|
|
// 添加新的外部用户
|
|
|
selection.forEach((item) => {
|
|
|
- if (!this.AllUserTable.some((user) => user.userId === item.userId)) {
|
|
|
+ if (!this.AllUserTable.some((user) => user.userId === item.userId && user.userType === 1)) {
|
|
|
this.AllUserTable.push({
|
|
|
userName: item.nickName,
|
|
|
userId: item.userId,
|
|
|
@@ -1093,6 +1142,7 @@ export default {
|
|
|
console.log(this.AllUserTable, '外部人员');
|
|
|
},
|
|
|
confirmAddUser() {
|
|
|
+
|
|
|
const data = {
|
|
|
ticketId: this.ticketId,
|
|
|
ticketUserDTOList: [...this.AllUserTable, ...this.newticketUserDTOList]
|