|
@@ -175,7 +175,7 @@ import {
|
|
|
updateIsSop,
|
|
updateIsSop,
|
|
|
selectIsSopById,
|
|
selectIsSopById,
|
|
|
} from "@/api/mes/sop/sopindex";
|
|
} from "@/api/mes/sop/sopindex";
|
|
|
-import { mapActions, mapGetters } from 'vuex'
|
|
|
|
|
|
|
+import { mapActions, mapGetters } from "vuex";
|
|
|
export default {
|
|
export default {
|
|
|
name: "addView",
|
|
name: "addView",
|
|
|
dicts: ["power_type", "point_type", "sop_type"],
|
|
dicts: ["power_type", "point_type", "sop_type"],
|
|
@@ -230,23 +230,24 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
-
|
|
|
|
|
if (this.$route.query.sopId !== "null") {
|
|
if (this.$route.query.sopId !== "null") {
|
|
|
// console.log(this.$route.query.sopId, "接受路由参数");
|
|
// console.log(this.$route.query.sopId, "接受路由参数");
|
|
|
this.getSopInfo();
|
|
this.getSopInfo();
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
- ...mapActions('sopSelectPoints', [
|
|
|
|
|
- 'setSelectSopPoints','setPointTableData','setSopEdit'
|
|
|
|
|
|
|
+ ...mapActions("sopSelectPoints", [
|
|
|
|
|
+ "setSelectSopPoints",
|
|
|
|
|
+ "setPointTableData",
|
|
|
|
|
+ "setSopEdit",
|
|
|
]),
|
|
]),
|
|
|
handleClick(tab, event) {
|
|
handleClick(tab, event) {
|
|
|
// console.log(tab, event);
|
|
// console.log(tab, event);
|
|
|
},
|
|
},
|
|
|
preStep() {
|
|
preStep() {
|
|
|
this.activeName = "first";
|
|
this.activeName = "first";
|
|
|
|
|
+ this.tableData = [];
|
|
|
},
|
|
},
|
|
|
nextStep() {
|
|
nextStep() {
|
|
|
this.activeName = "second";
|
|
this.activeName = "second";
|
|
@@ -258,7 +259,7 @@ export default {
|
|
|
const sopId = this.$route.query.sopId;
|
|
const sopId = this.$route.query.sopId;
|
|
|
console.log(this.$route.query.sopId, "接受路由参数");
|
|
console.log(this.$route.query.sopId, "接受路由参数");
|
|
|
|
|
|
|
|
- if (sopId!==null) {
|
|
|
|
|
|
|
+ if (sopId !== null) {
|
|
|
selectIsSopById(sopId).then((response) => {
|
|
selectIsSopById(sopId).then((response) => {
|
|
|
console.log(response, "详细内容");
|
|
console.log(response, "详细内容");
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
@@ -268,9 +269,9 @@ export default {
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
this.title = "新增隔离点信息";
|
|
this.title = "新增隔离点信息";
|
|
|
- this.setSopEdit(true)
|
|
|
|
|
- this.setSelectSopPoints([])
|
|
|
|
|
- this.setPointTableData([])
|
|
|
|
|
|
|
+ this.setSopEdit(true);
|
|
|
|
|
+ this.setSelectSopPoints([]);
|
|
|
|
|
+ this.setPointTableData([]);
|
|
|
this.tableData = null;
|
|
this.tableData = null;
|
|
|
this.form = {
|
|
this.form = {
|
|
|
spoint: [],
|
|
spoint: [],
|
|
@@ -307,8 +308,8 @@ export default {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 编辑模式
|
|
// 编辑模式
|
|
|
- if (this.$route.query.sopId!=='null') {
|
|
|
|
|
- console.log(this.$route.query.sopId,'sopIdaaa');
|
|
|
|
|
|
|
+ if (this.$route.query.sopId !== "null") {
|
|
|
|
|
+ console.log(this.$route.query.sopId, "sopIdaaa");
|
|
|
// 确保 sopId 存在
|
|
// 确保 sopId 存在
|
|
|
if (!this.form.sopId) {
|
|
if (!this.form.sopId) {
|
|
|
console.error("隔离点id不可为空!");
|
|
console.error("隔离点id不可为空!");
|
|
@@ -322,6 +323,7 @@ export default {
|
|
|
console.log(res, "修改接口");
|
|
console.log(res, "修改接口");
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
|
|
+ this.$message.success("SOP修改成功");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
@@ -330,6 +332,7 @@ export default {
|
|
|
console.log(res, "新增接口");
|
|
console.log(res, "新增接口");
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
|
|
|
+ this.$message.success("SOP新建成功");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -378,7 +381,6 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
// },
|
|
// },
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 子组件选中的隔离点逆传递拿到的数据
|
|
// 子组件选中的隔离点逆传递拿到的数据
|
|
|
handleSelectPoint(points) {
|
|
handleSelectPoint(points) {
|
|
|
// console.log(points, "父组件接收逆向传递选中的隔离点");
|
|
// console.log(points, "父组件接收逆向传递选中的隔离点");
|