|
|
@@ -24,7 +24,7 @@
|
|
|
<span
|
|
|
style="float: right; padding: 1px 0; font-size: 22px"
|
|
|
type="text"
|
|
|
- >×</span
|
|
|
+ >×</span
|
|
|
>
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
@@ -75,7 +75,6 @@
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
-
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="作业内容" prop="ticketContent">
|
|
|
@@ -90,9 +89,8 @@
|
|
|
type="primary"
|
|
|
class="workTicket_btn"
|
|
|
@click="nextStep('second')"
|
|
|
- >下一步
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >下一步
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
@@ -104,6 +102,7 @@
|
|
|
v-model="form.workshopName"
|
|
|
placeholder="请输入车间名称"
|
|
|
style="width: 100%"
|
|
|
+ disabled
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产线" prop="workline">
|
|
|
@@ -111,6 +110,7 @@
|
|
|
v-model="form.workline"
|
|
|
placeholder="请输入产线"
|
|
|
style="width: 100%"
|
|
|
+ disabled
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<div class="text item">
|
|
|
@@ -126,8 +126,8 @@
|
|
|
<el-table-column prop="pointName" label="已选隔离点">
|
|
|
<template slot-scope="scope">
|
|
|
<span style="color: #2a87ff">{{
|
|
|
- scope.row.pointName
|
|
|
- }}</span>
|
|
|
+ scope.row.pointName
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="pointType" label="隔离点类型">
|
|
|
@@ -157,9 +157,8 @@
|
|
|
style="float: right; height: 30px; line-height: 10px"
|
|
|
type="primary"
|
|
|
@click="nextStep('third')"
|
|
|
- >下一步
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >下一步
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
plain
|
|
|
style="
|
|
|
@@ -170,9 +169,8 @@
|
|
|
"
|
|
|
type="primary"
|
|
|
@click="previousStep('first')"
|
|
|
- >上一步
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >上一步
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
@@ -196,7 +194,6 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="共锁人" prop="coLocker">
|
|
|
-
|
|
|
<el-select
|
|
|
v-model="form.coLocker"
|
|
|
placeholder="共锁人"
|
|
|
@@ -215,13 +212,11 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="共锁人" prop="coLocker">
|
|
|
<el-button type="primary" @click="addInside"
|
|
|
- >添加内部人员
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >添加内部人员
|
|
|
+ </el-button>
|
|
|
<el-button type="primary" @click="addOutside"
|
|
|
- >添加外部人员
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >添加外部人员
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开始时间" prop="ticketStartTime">
|
|
|
<el-date-picker
|
|
|
@@ -250,9 +245,8 @@
|
|
|
style="float: right; height: 30px; line-height: 10px"
|
|
|
type="primary"
|
|
|
@click="confirm"
|
|
|
- >完 成
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >完 成
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
@@ -322,61 +316,60 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="open=false">确认</el-button>
|
|
|
+ <el-button type="primary" @click="open = false">确认</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- newOperations盒子结束-->
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
|
|
|
<script>
|
|
|
-import SeparationPoint from '@/components/separationPoint/index.vue'
|
|
|
-import WorkShop from '@/components/separationPoint/workshop.vue'
|
|
|
+import SeparationPoint from "@/components/separationPoint/index.vue";
|
|
|
+import WorkShop from "@/components/separationPoint/workshop.vue";
|
|
|
import {
|
|
|
listJobTicket,
|
|
|
getJobTicketInfo,
|
|
|
addJobTicket,
|
|
|
updateJobTicket,
|
|
|
deleteIsJobTicket,
|
|
|
- getworkareaList
|
|
|
-} from '@/api/mes/job/job'
|
|
|
-import { listWorkshop } from '@/api/mes/md/workshop'
|
|
|
-import {listWorkarea} from '@/api/mes/wa/workarea'
|
|
|
-import { getIsSopPage } from '@/api/mes/sop/sopindex'
|
|
|
-import { listUser } from '@/api/system/user'
|
|
|
-import { listDept } from '@/api/system/dept'
|
|
|
-import IsolationLeftVue from '@/components/separationPoint/index.vue'
|
|
|
+ getworkareaList,
|
|
|
+} from "@/api/mes/job/job";
|
|
|
+import { listWorkshop } from "@/api/mes/md/workshop";
|
|
|
+import { listWorkarea } from "@/api/mes/wa/workarea";
|
|
|
+import { getIsSopPage } from "@/api/mes/sop/sopindex";
|
|
|
+import { listUser } from "@/api/system/user";
|
|
|
+import { listDept } from "@/api/system/dept";
|
|
|
+import IsolationLeftVue from "@/components/separationPoint/index.vue";
|
|
|
|
|
|
-import { mapGetters } from 'vuex'
|
|
|
+import { mapGetters } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
- name: 'addView',
|
|
|
- dicts: ['ticket_type', 'power_type', 'point_type', 'is_user_type'],
|
|
|
+ name: "addView",
|
|
|
+ dicts: ["ticket_type", "power_type", "point_type", "is_user_type"],
|
|
|
components: {
|
|
|
IsolationLeftVue,
|
|
|
SeparationPoint,
|
|
|
- WorkShop
|
|
|
+ WorkShop,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- activeName: 'first',
|
|
|
+ activeName: "first",
|
|
|
form: {
|
|
|
- sopId: '',
|
|
|
- pointIds: '',
|
|
|
- ticketType: '',
|
|
|
- ticketName: '',
|
|
|
- ticketCode: '',
|
|
|
- ticketContent: '',
|
|
|
- workshopName: '', //车间名称
|
|
|
- workline: '', //产线
|
|
|
+ sopId: "",
|
|
|
+ pointIds: "",
|
|
|
+ ticketType: "",
|
|
|
+ ticketName: "",
|
|
|
+ ticketCode: "",
|
|
|
+ ticketContent: "",
|
|
|
+ workshopName: "", //车间名称
|
|
|
+ workline: "", //产线
|
|
|
spoint: [], //已选隔离点
|
|
|
- locker: '', //上锁人
|
|
|
- coLocker: '', //共锁人
|
|
|
- ticketStartTime: '', //开始时间
|
|
|
- ticketEndTime: '', //结束时间
|
|
|
+ locker: "", //上锁人
|
|
|
+ coLocker: "", //共锁人
|
|
|
+ ticketStartTime: "", //开始时间
|
|
|
+ ticketEndTime: "", //结束时间
|
|
|
ticketUserDTOList: [
|
|
|
// {
|
|
|
// userId: '',
|
|
|
@@ -384,12 +377,12 @@ export default {
|
|
|
// userRole: '',//作业票角色 暂时不传递
|
|
|
// userType: ''//用户类型 上锁人或共锁人
|
|
|
// }
|
|
|
- ]//所选择的用户
|
|
|
+ ], //所选择的用户
|
|
|
},
|
|
|
dialogForm: {
|
|
|
- deptId: '',
|
|
|
- nickname: '',
|
|
|
- username: ''
|
|
|
+ deptId: "",
|
|
|
+ nickname: "",
|
|
|
+ username: "",
|
|
|
},
|
|
|
listUserOption: null,
|
|
|
listDeptOption: null,
|
|
|
@@ -398,248 +391,258 @@ export default {
|
|
|
pickerOptions: {
|
|
|
shortcuts: [
|
|
|
{
|
|
|
- text: '今天',
|
|
|
+ text: "今天",
|
|
|
onClick(picker) {
|
|
|
- picker.$emit('pick', new Date())
|
|
|
- }
|
|
|
+ picker.$emit("pick", new Date());
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- text: '昨天',
|
|
|
+ text: "昨天",
|
|
|
onClick(picker) {
|
|
|
- const date = new Date()
|
|
|
- date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
|
- picker.$emit('pick', date)
|
|
|
- }
|
|
|
+ const date = new Date();
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
+ picker.$emit("pick", date);
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- text: '一周前',
|
|
|
+ text: "一周前",
|
|
|
onClick(picker) {
|
|
|
- const date = new Date()
|
|
|
- date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
- picker.$emit('pick', date)
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
+ const date = new Date();
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit("pick", date);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
// 弹出层标题
|
|
|
- title: '',
|
|
|
+ title: "",
|
|
|
// 弹框中显示的form表单内容
|
|
|
insideMumber: false,
|
|
|
outsideMumber: false,
|
|
|
points: null, //逆向传递拿到隔离点的数据
|
|
|
- sopOptions: [],//sop下拉
|
|
|
- jobProps: [],//正向传递给车间components
|
|
|
+ sopOptions: [], //sop下拉
|
|
|
+ jobProps: [], //正向传递给车间components
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
teamCode: [
|
|
|
- { required: true, message: '班组编号不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: "班组编号不能为空", trigger: "blur" },
|
|
|
],
|
|
|
teamName: [
|
|
|
- { required: true, message: '班组名称不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: "班组名称不能为空", trigger: "blur" },
|
|
|
],
|
|
|
calendarType: [
|
|
|
- { required: true, message: '清选择班组类型', trigger: 'blur' }
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
+ { required: true, message: "清选择班组类型", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
},
|
|
|
watch: {
|
|
|
tableData: {
|
|
|
handler(newVal) {
|
|
|
// 将 pointId 提取出来并连接成一个字符串
|
|
|
if (newVal && newVal.length > 0) {
|
|
|
- this.form.pointIds = this.tableData.map(item => item.pointId).join(',');
|
|
|
- console.log(this.form.pointIds,this.tableData,'pointIds')
|
|
|
+ this.form.pointIds = this.tableData
|
|
|
+ .map((item) => item.pointId)
|
|
|
+ .join(",");
|
|
|
+ console.log(this.form.pointIds, this.tableData, "pointIds");
|
|
|
}
|
|
|
},
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters('sopSelectPoints', [
|
|
|
- 'getPointTableData'
|
|
|
- ])
|
|
|
+ ...mapGetters("sopSelectPoints", ["getPointTableData"]),
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getSopList()
|
|
|
- this.getUser()
|
|
|
+ this.getSopList();
|
|
|
+ this.getUser();
|
|
|
|
|
|
- console.log(this.getPointTableData, 'this.getPointTableData')
|
|
|
+ console.log(this.getPointTableData, "this.getPointTableData");
|
|
|
if (this.getPointTableData) {
|
|
|
this.tableData = this.getPointTableData.pointDetailVOList.map((item) => {
|
|
|
return {
|
|
|
pointId: item.pointId,
|
|
|
pointName: item.pointName,
|
|
|
pointType: item.pointType,
|
|
|
- powerType: item.powerType
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
+ powerType: item.powerType,
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
formatDateTime(date) {
|
|
|
- const year = date.getFullYear().toString().padStart(2, '0');
|
|
|
- const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
|
- const day = date.getDate().toString().padStart(2, '0');
|
|
|
- const hours = date.getHours().toString().padStart(2, '0');
|
|
|
- const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
|
- const seconds = date.getSeconds().toString().padStart(2, '0');
|
|
|
+ const year = date.getFullYear().toString().padStart(2, "0");
|
|
|
+ const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
|
+ const day = date.getDate().toString().padStart(2, "0");
|
|
|
+ const hours = date.getHours().toString().padStart(2, "0");
|
|
|
+ const minutes = date.getMinutes().toString().padStart(2, "0");
|
|
|
+ const seconds = date.getSeconds().toString().padStart(2, "0");
|
|
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
},
|
|
|
getSopList() {
|
|
|
const query = {
|
|
|
current: 1,
|
|
|
- size: 100000
|
|
|
- }
|
|
|
+ size: 100000,
|
|
|
+ };
|
|
|
getIsSopPage(query).then((res) => {
|
|
|
- console.log(res, 'sop列表接口')
|
|
|
- this.sopOptions = res.data.records
|
|
|
- })
|
|
|
+ console.log(res, "sop列表接口");
|
|
|
+ this.sopOptions = res.data.records;
|
|
|
+ });
|
|
|
},
|
|
|
getUser() {
|
|
|
const query = {
|
|
|
pageNum: 1,
|
|
|
- pageSize: 100000
|
|
|
- }
|
|
|
- listUser(query).then(res => {
|
|
|
- console.log(res, '用户列表')
|
|
|
+ pageSize: 100000,
|
|
|
+ };
|
|
|
+ listUser(query).then((res) => {
|
|
|
+ console.log(res, "用户列表");
|
|
|
this.listUserOption = res.rows.map((item) => {
|
|
|
return {
|
|
|
label: item.nickName,
|
|
|
value: item.userId,
|
|
|
- }
|
|
|
- })
|
|
|
+ };
|
|
|
+ });
|
|
|
}),
|
|
|
- listDept(query).then(res => {
|
|
|
- console.log(res, '部门列表')
|
|
|
+ listDept(query).then((res) => {
|
|
|
+ console.log(res, "部门列表");
|
|
|
this.listDeptOption = res.data.map((item) => {
|
|
|
return {
|
|
|
label: item.deptName,
|
|
|
value: item.deptId,
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
// 添加内部人员 部门下拉的chage事件
|
|
|
DeptChage(val) {
|
|
|
- console.log(val, ' 部门下拉')
|
|
|
+ console.log(val, " 部门下拉");
|
|
|
// 每次选中先清空用户下拉
|
|
|
- this.listUserOption=[]
|
|
|
- this.dialogForm.nickName=null
|
|
|
+ this.listUserOption = [];
|
|
|
+ this.dialogForm.nickName = null;
|
|
|
const query = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 100000,
|
|
|
- deptId: this.dialogForm.deptId
|
|
|
- }
|
|
|
- listUser(query).then(res => {
|
|
|
- console.log(res, '用户列表')
|
|
|
+ deptId: this.dialogForm.deptId,
|
|
|
+ };
|
|
|
+ listUser(query).then((res) => {
|
|
|
+ console.log(res, "用户列表");
|
|
|
this.listUserOption = res.rows.map((item) => {
|
|
|
return {
|
|
|
label: item.nickName,
|
|
|
value: item.userId,
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
// sop下拉change事件
|
|
|
handleSelectSOP(value) {
|
|
|
- this.jobProps = this.sopOptions.filter((item) => item.sopId == value)
|
|
|
- console.log(this.jobProps, '父组件jobProps')
|
|
|
+ this.jobProps = this.sopOptions.filter((item) => item.sopId == value);
|
|
|
+ console.log(this.jobProps, "父组件jobProps");
|
|
|
},
|
|
|
// 上锁人下拉选择change事件
|
|
|
handlelockerChage(val) {
|
|
|
- console.log(val, '上锁人chage');
|
|
|
- const user = this.listUserOption.find(item => item.value === val);
|
|
|
+ console.log(val, "上锁人chage");
|
|
|
+ const user = this.listUserOption.find((item) => item.value === val);
|
|
|
|
|
|
- if (user && this.form.locker !== '') {
|
|
|
- const existingUser = this.form.ticketUserDTOList.find(u => u.userName === user.label);
|
|
|
+ if (user && this.form.locker !== "") {
|
|
|
+ const existingUser = this.form.ticketUserDTOList.find(
|
|
|
+ (u) => u.userName === user.label
|
|
|
+ );
|
|
|
if (!existingUser) {
|
|
|
this.form.ticketUserDTOList.push({
|
|
|
userName: user.label,
|
|
|
userId: user.value,
|
|
|
- userType: 0
|
|
|
+ userType: 0,
|
|
|
});
|
|
|
- console.log(this.form.ticketUserDTOList, '用户');
|
|
|
+ console.log(this.form.ticketUserDTOList, "用户");
|
|
|
} else {
|
|
|
- console.log('用户已存在', user.label);
|
|
|
+ console.log("用户已存在", user.label);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// 添加内部人员的用户新增到ticketUserDTOList这个数据里
|
|
|
changeInsideUser(values) {
|
|
|
- this.form.coLocker=this.form.ticketUserDTOList
|
|
|
- const usersinside = values.map(value => this.listUserOption.find(item => item.value === value)).filter(Boolean);
|
|
|
- usersinside.forEach(user => {
|
|
|
- const existingUser = this.form.ticketUserDTOList.find(u => u.userName === user.label);
|
|
|
+ this.form.coLocker = this.form.ticketUserDTOList;
|
|
|
+ const usersinside = values
|
|
|
+ .map((value) =>
|
|
|
+ this.listUserOption.find((item) => item.value === value)
|
|
|
+ )
|
|
|
+ .filter(Boolean);
|
|
|
+ usersinside.forEach((user) => {
|
|
|
+ const existingUser = this.form.ticketUserDTOList.find(
|
|
|
+ (u) => u.userName === user.label
|
|
|
+ );
|
|
|
if (!existingUser) {
|
|
|
this.form.ticketUserDTOList.push({
|
|
|
userName: user.label,
|
|
|
userId: user.value,
|
|
|
- userType: 1
|
|
|
+ userType: 1,
|
|
|
});
|
|
|
} else {
|
|
|
- console.log('用户已存在', user.label);
|
|
|
+ console.log("用户已存在", user.label);
|
|
|
}
|
|
|
});
|
|
|
- this.updateCoLocker()
|
|
|
- console.log(this.form.ticketUserDTOList, '用户');
|
|
|
+ this.updateCoLocker();
|
|
|
+ console.log(this.form.ticketUserDTOList, "用户");
|
|
|
},
|
|
|
// 添加外部人员 输入名称 userType==q userId==0
|
|
|
outSideUserInput(value) {
|
|
|
- console.log(value, '外部人员名称');
|
|
|
- this.form.coLocker=[...this.dialogForm.username]
|
|
|
- const existingUser = this.form.ticketUserDTOList.find(u => u.userName === value);
|
|
|
- if (!existingUser) {
|
|
|
- this.form.ticketUserDTOList.push({
|
|
|
- userName: value,
|
|
|
- userId: 0,
|
|
|
- userType: 1
|
|
|
- });
|
|
|
- console.log(this.form.ticketUserDTOList, '用户');
|
|
|
- } else {
|
|
|
- console.log('用户已存在', value);
|
|
|
- }
|
|
|
- this.updateCoLocker()
|
|
|
+ console.log(value, "外部人员名称");
|
|
|
+ this.form.coLocker = [...this.dialogForm.username];
|
|
|
+ const existingUser = this.form.ticketUserDTOList.find(
|
|
|
+ (u) => u.userName === value
|
|
|
+ );
|
|
|
+ if (!existingUser) {
|
|
|
+ this.form.ticketUserDTOList.push({
|
|
|
+ userName: value,
|
|
|
+ userId: 0,
|
|
|
+ userType: 1,
|
|
|
+ });
|
|
|
+ console.log(this.form.ticketUserDTOList, "用户");
|
|
|
+ } else {
|
|
|
+ console.log("用户已存在", value);
|
|
|
+ }
|
|
|
+ this.updateCoLocker();
|
|
|
},
|
|
|
// 更新界面中共锁人下拉框显示的内容
|
|
|
updateCoLocker() {
|
|
|
- this.form.coLocker = this.form.ticketUserDTOList.map(user => user.userName);
|
|
|
+ this.form.coLocker = this.form.ticketUserDTOList.map(
|
|
|
+ (user) => user.userName
|
|
|
+ );
|
|
|
},
|
|
|
// 共锁人下拉框删除事件
|
|
|
handleCoLockerChange(newValues) {
|
|
|
- console.log(newValues, 'ticketUserDTOList-newsValue');
|
|
|
+ console.log(newValues, "ticketUserDTOList-newsValue");
|
|
|
|
|
|
// 根据新值更新 this.form.ticketUserDTOList
|
|
|
- this.form.ticketUserDTOList = this.form.ticketUserDTOList.filter(user => newValues.includes(user.userName));
|
|
|
+ this.form.ticketUserDTOList = this.form.ticketUserDTOList.filter((user) =>
|
|
|
+ newValues.includes(user.userName)
|
|
|
+ );
|
|
|
|
|
|
// 更新 coLocker 显示的内容
|
|
|
this.updateCoLocker();
|
|
|
},
|
|
|
handleClick(tab, event) {
|
|
|
// console.log(tab, event);
|
|
|
- }
|
|
|
- ,
|
|
|
+ },
|
|
|
previousStep(val) {
|
|
|
- this.activeName = val
|
|
|
- }
|
|
|
- ,
|
|
|
+ this.activeName = val;
|
|
|
+ },
|
|
|
nextStep(val) {
|
|
|
- console.log(val, 'nextStep')
|
|
|
- this.activeName = val
|
|
|
- console.log('我点击了下一步')
|
|
|
+ console.log(val, "nextStep");
|
|
|
+ this.activeName = val;
|
|
|
+ console.log("我点击了下一步");
|
|
|
},
|
|
|
async getWorkareaId(query) {
|
|
|
try {
|
|
|
const res = await listWorkarea(query);
|
|
|
- console.log(res, '工作区域page');
|
|
|
+ console.log(res, "工作区域page");
|
|
|
return res.data.records[0].workareaId;
|
|
|
} catch (error) {
|
|
|
- console.error('获取工作区域ID失败', error);
|
|
|
+ console.error("获取工作区域ID失败", error);
|
|
|
throw error;
|
|
|
}
|
|
|
},
|
|
|
@@ -647,10 +650,10 @@ export default {
|
|
|
async getWorkshopId(query) {
|
|
|
try {
|
|
|
const res = await listWorkshop(query);
|
|
|
- console.log(res,'车间id')
|
|
|
+ console.log(res, "车间id");
|
|
|
return res.rows[0].workshopId;
|
|
|
} catch (error) {
|
|
|
- console.error('获取车间ID失败', error);
|
|
|
+ console.error("获取车间ID失败", error);
|
|
|
throw error;
|
|
|
}
|
|
|
},
|
|
|
@@ -658,9 +661,13 @@ export default {
|
|
|
async confirm() {
|
|
|
try {
|
|
|
// 格式化时间
|
|
|
- this.form.ticketStartTime = this.formatDateTime(new Date(this.form.ticketStartTime));
|
|
|
- this.form.ticketEndTime = this.formatDateTime(new Date(this.form.ticketEndTime));
|
|
|
- console.log(this.form, '拿到的所有参数确认');
|
|
|
+ this.form.ticketStartTime = this.formatDateTime(
|
|
|
+ new Date(this.form.ticketStartTime)
|
|
|
+ );
|
|
|
+ this.form.ticketEndTime = this.formatDateTime(
|
|
|
+ new Date(this.form.ticketEndTime)
|
|
|
+ );
|
|
|
+ console.log(this.form, "拿到的所有参数确认");
|
|
|
|
|
|
const query = {
|
|
|
current: 1,
|
|
|
@@ -688,34 +695,38 @@ export default {
|
|
|
ticketType: this.form.ticketType,
|
|
|
ticketUserDTOList: this.form.ticketUserDTOList,
|
|
|
workareaId: workareaId,
|
|
|
- workshopId: workshopId
|
|
|
+ workshopId: workshopId,
|
|
|
};
|
|
|
|
|
|
const res = await addJobTicket(data);
|
|
|
if (res.code === 200) {
|
|
|
this.$router.go(-1);
|
|
|
} else {
|
|
|
- console.error('提交工单失败', res);
|
|
|
+ console.error("提交工单失败", res);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error('确认过程中发生错误', error);
|
|
|
+ console.error("确认过程中发生错误", error);
|
|
|
}
|
|
|
|
|
|
- console.log('确认');
|
|
|
+ console.log("确认");
|
|
|
},
|
|
|
// 子组件逆向传递选中的隔离点
|
|
|
|
|
|
handleSelectPoint(points) {
|
|
|
- console.log(points, '父组件接收逆向传递选中的隔离点')
|
|
|
+ console.log(points, "父组件接收逆向传递选中的隔离点");
|
|
|
|
|
|
// 使用 Set 来存储传递过来的点值
|
|
|
- const newValues = new Set(points.map((point) => point.pointId))
|
|
|
+ const newValues = new Set(points.map((point) => point.pointId));
|
|
|
|
|
|
// 1. 删除取消选中的点
|
|
|
- this.tableData = this.tableData.filter((item) => newValues.has(item.pointId))
|
|
|
+ this.tableData = this.tableData.filter((item) =>
|
|
|
+ newValues.has(item.pointId)
|
|
|
+ );
|
|
|
|
|
|
// 2. 确保新增点不会重复
|
|
|
- const existingValues = new Set(this.tableData.map((item) => item.pointId))
|
|
|
+ const existingValues = new Set(
|
|
|
+ this.tableData.map((item) => item.pointId)
|
|
|
+ );
|
|
|
|
|
|
points.forEach((point) => {
|
|
|
// 如果当前传递的点不在已有的点集中,则添加
|
|
|
@@ -724,53 +735,52 @@ export default {
|
|
|
pointName: point.pointName, // 显示的名称
|
|
|
pointId: point.pointId, // 对应的值
|
|
|
pointType: point.pointType,
|
|
|
- powerType: point.powerType
|
|
|
- })
|
|
|
+ powerType: point.powerType,
|
|
|
+ });
|
|
|
// 将新点值添加到 Set 中
|
|
|
- existingValues.add(point.value)
|
|
|
+ existingValues.add(point.value);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
// 更新 form.spoint 为最新选中的隔离点数组
|
|
|
- this.form.spoint = points.map((point) => point.pointId)
|
|
|
-
|
|
|
+ this.form.spoint = points.map((point) => point.pointId);
|
|
|
},
|
|
|
// 车间你逆向传递拿到的隔离点数据产线
|
|
|
handleProductLineSelected(selectedOption) {
|
|
|
// console.log(selectedOption, '父组件接收到的 selectedOption');
|
|
|
- this.points = selectedOption
|
|
|
- this.form.workline = selectedOption.label
|
|
|
+ this.points = selectedOption;
|
|
|
+ this.form.workline = selectedOption.label;
|
|
|
},
|
|
|
// 车间子组件逆传递车间相关数据车间
|
|
|
handleWorkshopSelected(selectedOption) {
|
|
|
- console.log(selectedOption, 'handleWorkshopSelected')
|
|
|
- this.emitWorkShop = selectedOption
|
|
|
- this.form.workshopName = selectedOption.label
|
|
|
+ console.log(selectedOption, "handleWorkshopSelected");
|
|
|
+ this.emitWorkShop = selectedOption;
|
|
|
+ this.form.workshopName = selectedOption.label;
|
|
|
},
|
|
|
// 添加内部人员
|
|
|
addInside() {
|
|
|
- this.open = true
|
|
|
- this.title = '添加内部人员'
|
|
|
- this.insideMumber = true
|
|
|
- this.outsideMumber = false
|
|
|
- this.form.ticketUserDTOList=[]
|
|
|
- this.dialogForm.deptId=""
|
|
|
- this.dialogForm.nickname=''
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加内部人员";
|
|
|
+ this.insideMumber = true;
|
|
|
+ this.outsideMumber = false;
|
|
|
+ this.form.ticketUserDTOList = [];
|
|
|
+ this.dialogForm.deptId = "";
|
|
|
+ this.dialogForm.nickname = "";
|
|
|
},
|
|
|
addOutside() {
|
|
|
- this.open = true
|
|
|
- this.title = '添加外部人员'
|
|
|
- this.insideMumber = false
|
|
|
- this.outsideMumber = true
|
|
|
- this.dialogForm.username=null
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加外部人员";
|
|
|
+ this.insideMumber = false;
|
|
|
+ this.outsideMumber = true;
|
|
|
+ this.dialogForm.username = null;
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false
|
|
|
- this.reset()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
|