|
|
@@ -27,7 +27,7 @@
|
|
|
<el-form-item label="状态" prop="ticketStatus">
|
|
|
<el-select v-model="queryParams.ticketStatus" placeholder="状态">
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in dict.type.ticket_status"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
@@ -38,19 +38,20 @@
|
|
|
<el-select
|
|
|
v-model="queryParams.workshopId"
|
|
|
placeholder="请选择车间名称"
|
|
|
+ @change="workShopChange"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
+ v-for="item in this.workshopList"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产线" prop="workareaId">
|
|
|
<el-select v-model="queryParams.workareaId" placeholder="请选择产线">
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in this.workareaList"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
@@ -93,7 +94,7 @@
|
|
|
placeholder="请选择作业类型"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.mes_calendar_type"
|
|
|
+ v-for="dict in dict.type.ticket_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
|
@@ -186,19 +187,16 @@
|
|
|
<el-table-column label="状态" align="center" prop="ticketStatus">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag
|
|
|
- :options="dict.type.mes_calendar_type"
|
|
|
+ :options="dict.type.ticket_status"
|
|
|
:value="scope.row.ticketStatus"
|
|
|
/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="车间名称" align="center" prop="workshopId">
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
- <img src="" alt="" />
|
|
|
- </template> -->
|
|
|
+ <el-table-column label="车间名称" align="center" prop="workshopName">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="作业类型" align="center" prop="ticketType">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="产线" align="center" prop="workareaId">
|
|
|
+ <el-table-column label="产线" align="center" prop="workareaName">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="隔离点总数" align="center" prop="pointCount">
|
|
|
</el-table-column>
|
|
|
@@ -250,12 +248,15 @@
|
|
|
|
|
|
<script>
|
|
|
import { listJobTicket } from "@/api/mes/job/job";
|
|
|
-
|
|
|
+import {
|
|
|
+ workshoplistAll,
|
|
|
+ getIsWorkareaList,
|
|
|
+} from "@/api/mes/spm/segregationPoint";
|
|
|
import { genCode } from "@/api/system/autocode/rule";
|
|
|
|
|
|
export default {
|
|
|
name: "Team",
|
|
|
- dicts: ["mes_calendar_type"],
|
|
|
+ dicts: ["ticket_type", "ticket_status"],
|
|
|
data() {
|
|
|
return {
|
|
|
//自动生成编码
|
|
|
@@ -279,6 +280,10 @@ export default {
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ // 车间数据
|
|
|
+ workshopList: [],
|
|
|
+ // 工作区域数据
|
|
|
+ workareaList: [],
|
|
|
// 查询参数
|
|
|
createTime: "",
|
|
|
queryParams: {
|
|
|
@@ -290,8 +295,8 @@ export default {
|
|
|
workshopId: null,
|
|
|
workareaId: null,
|
|
|
ticketType: null,
|
|
|
- ticketStartTime: null,
|
|
|
- ticketEndTime: null,
|
|
|
+ startTime: "",
|
|
|
+ endTime: "",
|
|
|
},
|
|
|
pickerOptions: {
|
|
|
shortcuts: [
|
|
|
@@ -327,27 +332,33 @@ export default {
|
|
|
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- teamCode: [
|
|
|
- { required: true, message: "班组编号不能为空", trigger: "blur" },
|
|
|
- ],
|
|
|
- teamName: [
|
|
|
- { required: true, message: "班组名称不能为空", trigger: "blur" },
|
|
|
- ],
|
|
|
- calendarType: [
|
|
|
- { required: true, message: "清选择班组类型", trigger: "blur" },
|
|
|
- ],
|
|
|
- },
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.getworkShop();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 格式化日期查询数据
|
|
|
+ formatDate(date) {
|
|
|
+ if (date && date instanceof Date && !isNaN(date)) {
|
|
|
+ // 使用本地时间
|
|
|
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(
|
|
|
+ 2,
|
|
|
+ "0"
|
|
|
+ )}-${String(date.getDate()).padStart(2, "0")}`;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ },
|
|
|
/** 查询班组列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
+ // 格式化日期并更新queryParams
|
|
|
+ if (Array.isArray(this.createTime) && this.createTime.length === 2) {
|
|
|
+ this.queryParams.startTime = this.formatDate(this.createTime[0]);
|
|
|
+ this.queryParams.endTime = this.formatDate(this.createTime[1]);
|
|
|
+ }
|
|
|
listJobTicket(this.queryParams).then((response) => {
|
|
|
this.jobList = response.data.records;
|
|
|
this.total = response.data.total;
|
|
|
@@ -355,6 +366,47 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ // 获取车间数据
|
|
|
+ getworkShop() {
|
|
|
+ workshoplistAll().then((response) => {
|
|
|
+ // console.log(response, "获取车间数据");
|
|
|
+ this.workshopList = response.data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.workshopName,
|
|
|
+ value: item.workshopId,
|
|
|
+ key: item.workshopCode,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ console.log(this.workshopList[0].value, "数据拿到了吗");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 所属车间下拉改变工作区域内容
|
|
|
+ workShopChange() {
|
|
|
+ console.log("我被切换了内容");
|
|
|
+ this.getworkArea();
|
|
|
+ console.log(this.workareaList, "数据拿到了吗");
|
|
|
+ },
|
|
|
+ // 获取工作区域数据
|
|
|
+ getworkArea() {
|
|
|
+ const workshopId = this.queryParams.workshopId;
|
|
|
+ // const workshopId = this.workshopList.map((workshop) => workshop.value);
|
|
|
+ console.log(workshopId, "数据格式");
|
|
|
+ console.log(workshopId, "workshopId");
|
|
|
+ if (workshopId) {
|
|
|
+ getIsWorkareaList(workshopId).then((response) => {
|
|
|
+ // console.log(response, "获取工作区域数据");
|
|
|
+ this.workareaList = response.data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.workareaName,
|
|
|
+ value: item.workareaId,
|
|
|
+ key: item.workareaCode,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ console.log(this.workareaList, "数据吗");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
@@ -363,19 +415,14 @@ export default {
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- teamId: null,
|
|
|
- teamCode: null,
|
|
|
- teamName: null,
|
|
|
- calendarType: null,
|
|
|
- remark: null,
|
|
|
- attr1: null,
|
|
|
- attr2: null,
|
|
|
- attr3: null,
|
|
|
- attr4: null,
|
|
|
- createBy: null,
|
|
|
+ ticketCode: null,
|
|
|
+ ticketName: null,
|
|
|
+ ticketStatus: null,
|
|
|
+ workareaName: null,
|
|
|
+ workshopName: null,
|
|
|
+ ticketType: null,
|
|
|
+ pointCount: null,
|
|
|
createTime: null,
|
|
|
- updateBy: null,
|
|
|
- updateTime: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
@@ -386,7 +433,10 @@ export default {
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
+ this.createTime = "";
|
|
|
+ (this.queryParams.startTime = ""),
|
|
|
+ (this.queryParams.endTime = ""),
|
|
|
+ this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|