|
|
@@ -12,6 +12,8 @@
|
|
|
<WorkShop
|
|
|
v-if="this.activeName == 'first' || this.activeName == 'third'"
|
|
|
@product-line-selected="handleProductLineSelected"
|
|
|
+ @work-shop-selected="handleWorkshopSelected"
|
|
|
+ :jobProps="jobProps"
|
|
|
></WorkShop>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
@@ -32,52 +34,54 @@
|
|
|
<el-form ref="form" :model="form" label-width="90px">
|
|
|
<el-form-item label="选择SOP" prop="sop">
|
|
|
<el-select
|
|
|
- v-model="form.sop"
|
|
|
+ v-model="form.sopId"
|
|
|
placeholder="请选择sop"
|
|
|
clearable
|
|
|
style="width: 100%"
|
|
|
+ @change="handleSelectSOP"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in this.hardwareTypeOption"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
+ v-for="dict in this.sopOptions"
|
|
|
+ :key="dict.sopId"
|
|
|
+ :label="dict.sopName"
|
|
|
+ :value="dict.sopId"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="作业票编号" prop="workCode">
|
|
|
+ <el-form-item label="作业票编号" prop="ticketCode">
|
|
|
<el-input
|
|
|
- v-model="form.workCode"
|
|
|
+ v-model="form.ticketCode"
|
|
|
placeholder="请输入作业票编号"
|
|
|
style="width: 100%"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="作业票名称" prop="workName">
|
|
|
+ <el-form-item label="作业票名称" prop="ticketName">
|
|
|
<el-input
|
|
|
- v-model="form.workName"
|
|
|
+ v-model="form.ticketName"
|
|
|
placeholder="请输入作业票名称"
|
|
|
style="width: 100%"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="作业票类型" prop="workType">
|
|
|
+ <el-form-item label="作业票类型" prop="ticketType">
|
|
|
<el-select
|
|
|
- v-model="form.workType"
|
|
|
+ v-model="form.ticketType"
|
|
|
placeholder="请选择作业类型"
|
|
|
clearable
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in this.hardwareTypeOption"
|
|
|
+ v-for="dict in dict.type.ticket_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
+
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="作业内容" prop="workContent">
|
|
|
+ <el-form-item label="作业内容" prop="ticketContent">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- v-model="form.workContent"
|
|
|
+ v-model="form.ticketContent"
|
|
|
:rows="4"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -116,22 +120,34 @@
|
|
|
height="480"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
- <el-table-column prop="id" label="序号" width="60">
|
|
|
+ <el-table-column prop="pointId" label="序号" width="60">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="point" label="已选隔离点">
|
|
|
+ <el-table-column prop="pointName" label="已选隔离点">
|
|
|
<template slot-scope="scope">
|
|
|
<span style="color: #2a87ff">{{
|
|
|
- scope.row.point
|
|
|
+ scope.row.pointName
|
|
|
}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="isolation" label="隔离方式">
|
|
|
+ <el-table-column prop="pointType" label="隔离点类型">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.point_type"
|
|
|
+ :value="scope.row.pointType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="type"
|
|
|
+ prop="powerType"
|
|
|
label="危险能量类型"
|
|
|
width="100"
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.power_type"
|
|
|
+ :value="scope.row.powerType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
@@ -237,66 +253,6 @@
|
|
|
</div>
|
|
|
<!-- newOperations盒子结束-->
|
|
|
|
|
|
- <!-- 添加或修改设备维修单对话框 -->
|
|
|
- <el-dialog
|
|
|
- :visible.sync="open"
|
|
|
- width="450px"
|
|
|
- append-to-body
|
|
|
- style="margin-top: 13%"
|
|
|
- >
|
|
|
- <div slot="title" class="dialog-title">
|
|
|
- <i></i>
|
|
|
- <span class="title">{{ title }}</span>
|
|
|
- </div>
|
|
|
- <el-form
|
|
|
- ref="dialogForm"
|
|
|
- :model="dialogForm"
|
|
|
- :rules="rules"
|
|
|
- label-width="70px"
|
|
|
- >
|
|
|
- <el-form-item label="部门" prop="dept" v-if="insideMumber">
|
|
|
- <el-select
|
|
|
- v-model="dialogForm.dept"
|
|
|
- placeholder="请选择部门"
|
|
|
- clearable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in this.hardwareTypeOption"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="选择人员" prop="mumber" v-if="insideMumber">
|
|
|
- <el-select
|
|
|
- v-model="dialogForm.mumber"
|
|
|
- placeholder="请选择人员"
|
|
|
- clearable
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="dict in this.hardwareTypeOption"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="人员ID" prop="mumberId" v-if="outsideMumber">
|
|
|
- <el-input
|
|
|
- v-model="dialogForm.mumberId"
|
|
|
- placeholder="请输入人员ID"
|
|
|
- style="width: 100%"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="dialogConfirm">确认</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -313,9 +269,11 @@ import {
|
|
|
getworkareaList,
|
|
|
} from "@/api/mes/job/job";
|
|
|
import { listAllWorkshop } from "@/api/mes/md/workshop";
|
|
|
+import {getIsSopPage} from "@/api/mes/sop/sopindex"
|
|
|
import IsolationLeftVue from "@/components/separationPoint/index.vue";
|
|
|
export default {
|
|
|
name: "addView",
|
|
|
+ dicts:['ticket_type',"power_type", "point_type"],
|
|
|
components: {
|
|
|
IsolationLeftVue,
|
|
|
SeparationPoint,
|
|
|
@@ -325,11 +283,11 @@ export default {
|
|
|
return {
|
|
|
activeName: "first",
|
|
|
form: {
|
|
|
- sop: "",
|
|
|
- workName: "",
|
|
|
- workCode: "",
|
|
|
- workType: "",
|
|
|
- workContent: "",
|
|
|
+ sopId: "",
|
|
|
+ ticketType: "",
|
|
|
+ ticketName: "",
|
|
|
+ ticketCode: "",
|
|
|
+ ticketContent: "",
|
|
|
workshopName: "", //车间名称
|
|
|
workline: "", //产线
|
|
|
spoint: [], //已选隔离点
|
|
|
@@ -343,7 +301,7 @@ export default {
|
|
|
mumber: "",
|
|
|
mumberId: "",
|
|
|
},
|
|
|
- hardwareTypeOption: null,
|
|
|
+ hardwareTypeOption:[],
|
|
|
// 已选隔离点
|
|
|
tableData: [],
|
|
|
pickerOptions: {
|
|
|
@@ -380,6 +338,8 @@ export default {
|
|
|
insideMumber: false,
|
|
|
outsideMumber: false,
|
|
|
points: null, //逆向传递拿到隔离点的数据
|
|
|
+ sopOptions:[],//sop下拉
|
|
|
+ jobProps:[],//正向传递给车间components
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
teamCode: [
|
|
|
@@ -394,10 +354,27 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ this.getSopList()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getSopList(){
|
|
|
+ const query={
|
|
|
+ current:1,
|
|
|
+ size:100000,
|
|
|
+ }
|
|
|
+ getIsSopPage(query).then((res) => {
|
|
|
+ console.log(res,'sop列表接口')
|
|
|
+ this.sopOptions=res.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // sop下拉change事件
|
|
|
+ handleSelectSOP(value){
|
|
|
+ this.jobProps=this.sopOptions.filter((item)=>item.sopId==value)
|
|
|
+ console.log(this.jobProps,'父组件jobProps')
|
|
|
+ },
|
|
|
handleClick(tab, event) {
|
|
|
- console.log(tab, event);
|
|
|
+ // console.log(tab, event);
|
|
|
},
|
|
|
previousStep(val) {
|
|
|
this.activeName = val;
|
|
|
@@ -411,24 +388,27 @@ export default {
|
|
|
console.log("确认");
|
|
|
},
|
|
|
// 子组件逆向传递选中的隔离点
|
|
|
+ // 子组件逆向传递选中的隔离点
|
|
|
handleSelectPoint(points) {
|
|
|
- console.log(points, "逆向传递选中的隔离点");
|
|
|
+ console.log(points, "父组件接收逆向传递选中的隔离点");
|
|
|
+
|
|
|
// 使用 Set 来存储传递过来的点值
|
|
|
- const newValues = new Set(points.map((point) => point.value));
|
|
|
+ const newValues = new Set(points.map((point) => point.pointId));
|
|
|
|
|
|
// 1. 删除取消选中的点
|
|
|
- this.tableData = this.tableData.filter((item) => newValues.has(item.id));
|
|
|
+ this.tableData = this.tableData.filter((item) => newValues.has(item.pointId));
|
|
|
|
|
|
// 2. 确保新增点不会重复
|
|
|
- const existingValues = new Set(this.tableData.map((item) => item.id));
|
|
|
+ const existingValues = new Set(this.tableData.map((item) => item.pointId));
|
|
|
+
|
|
|
points.forEach((point) => {
|
|
|
// 如果当前传递的点不在已有的点集中,则添加
|
|
|
- if (!existingValues.has(point.value)) {
|
|
|
+ if (!existingValues.has(point.pointId)) {
|
|
|
this.tableData.push({
|
|
|
- point: point.label, // 显示的名称
|
|
|
- id: point.value, // 对应的值
|
|
|
- isolation: "挂锁",
|
|
|
- type: "电能",
|
|
|
+ pointName: point.pointName, // 显示的名称
|
|
|
+ pointId: point.pointId, // 对应的值
|
|
|
+ pointType:point.pointType,
|
|
|
+ powerType:point.powerType,
|
|
|
});
|
|
|
// 将新点值添加到 Set 中
|
|
|
existingValues.add(point.value);
|
|
|
@@ -436,13 +416,20 @@ export default {
|
|
|
});
|
|
|
|
|
|
// 更新 form.spoint 为最新选中的隔离点数组
|
|
|
- this.form.spoint = points.map((point) => point.value);
|
|
|
- },
|
|
|
- // 车间子组件逆向传递隔离点数量和布局
|
|
|
+ this.form.spoint = points.map((point) => point.pointId);
|
|
|
|
|
|
+ },
|
|
|
+ // 车间你逆向传递拿到的隔离点数据产线
|
|
|
handleProductLineSelected(selectedOption) {
|
|
|
- console.log(selectedOption, "父组件接收到的 selectedOption");
|
|
|
+ // console.log(selectedOption, '父组件接收到的 selectedOption');
|
|
|
this.points = selectedOption;
|
|
|
+ this.form.workline=selectedOption.label
|
|
|
+ },
|
|
|
+ // 车间子组件逆传递车间相关数据车间
|
|
|
+ handleWorkshopSelected(selectedOption){
|
|
|
+ console.log(selectedOption,'handleWorkshopSelected')
|
|
|
+ this.emitWorkShop=selectedOption
|
|
|
+ this.form.workshopName=selectedOption.label
|
|
|
},
|
|
|
// 添加内部人员
|
|
|
addInside() {
|