|
@@ -3,98 +3,269 @@
|
|
|
<!-- 左侧区域 -->
|
|
|
<section class="list-part-container" style="flex: 3">
|
|
|
<!-- 搜索区 -->
|
|
|
- <el-form class="list-search-container" :model="queryDayworkParams" ref="queryRef" :inline="true"
|
|
|
- style="margin-right: 0px">
|
|
|
+ <el-form
|
|
|
+ class="list-search-container"
|
|
|
+ :model="queryDayworkParams"
|
|
|
+ ref="queryRef"
|
|
|
+ :inline="true"
|
|
|
+ style="margin-right: 0px"
|
|
|
+ >
|
|
|
<el-form-item class="section-title" label="生产批次" />
|
|
|
<el-form-item label="生产计划单号:">
|
|
|
- <el-input placeholder="请输入生产计划单号/批次号" v-model.trim="queryDayworkParams.productionPlanNo"
|
|
|
- @keydown.enter.prevent clearable style="width: 100px" />
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入生产计划单号/批次号"
|
|
|
+ v-model.trim="queryDayworkParams.productionPlanNo"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ clearable
|
|
|
+ style="width: 100px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品描述:">
|
|
|
- <el-input placeholder="请输入产品描述" v-model.trim="queryDayworkParams.productDescription" @keydown.enter.prevent
|
|
|
- clearable style="width: 100px" />
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入产品描述"
|
|
|
+ v-model.trim="queryDayworkParams.productDescription"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ clearable
|
|
|
+ style="width: 100px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="section-title" label="请选择当前工段:">
|
|
|
- <el-select-v2 v-model="queryDayworkParams.deptId" :options="deptList" placeholder="请选择工段" style="width: 100px"
|
|
|
- @change="handleDeptChange" />
|
|
|
+ <el-select-v2
|
|
|
+ v-model="queryDayworkParams.deptId"
|
|
|
+ :options="deptList"
|
|
|
+ placeholder="请选择工段"
|
|
|
+ style="width: 100px"
|
|
|
+ @change="handleDeptChange"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="section-title" label="查询设备:" prop="equipmentDetailCode">
|
|
|
- <el-input placeholder="请输入设备名称" v-model.trim="queryDayworkParams.equipmentDetailCode" @keydown.enter.prevent
|
|
|
- clearable style="width: 100px" />
|
|
|
+ <el-form-item
|
|
|
+ class="section-title"
|
|
|
+ label="查询设备:"
|
|
|
+ prop="equipmentDetailCode"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入设备名称"
|
|
|
+ v-model.trim="queryDayworkParams.equipmentDetailCode"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ clearable
|
|
|
+ style="width: 100px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item style="margin-left: 0">
|
|
|
- <el-button type="info" icon="Search" :disabled="deptList.length === 0" @click="handleQuery">搜索
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ icon="Search"
|
|
|
+ :disabled="deptList.length === 0"
|
|
|
+ @click="handleQuery"
|
|
|
+ >搜索
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table ref="dayworkTable" :data="dayworkList" v-loading="dayworkLoading" highlight-current-row
|
|
|
- height="100%" @current-change="handleDayworkCurrentChange">
|
|
|
- <el-table-column label="客户简称" prop="companyAlias" width="120" align="center" />
|
|
|
- <el-table-column label="生产计划单号" prop="productionPlanNo" width="100" align="center" />
|
|
|
- <el-table-column label="批次号" min-width="120" prop="lotCode" align="center">
|
|
|
+ <el-table
|
|
|
+ ref="dayworkTable"
|
|
|
+ :data="dayworkList"
|
|
|
+ v-loading="dayworkLoading"
|
|
|
+ highlight-current-row
|
|
|
+ height="100%"
|
|
|
+ @current-change="handleDayworkCurrentChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="客户简称"
|
|
|
+ prop="companyAlias"
|
|
|
+ width="120"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="生产计划单号"
|
|
|
+ prop="productionPlanNo"
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="批次号"
|
|
|
+ min-width="120"
|
|
|
+ prop="lotCode"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" v-hasPermi="['business:productionPlan:query']"
|
|
|
- @click="handleColumnClick(scope.row)"><span>{{ scope.row.lotCode }}</span></el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ v-hasPermi="['business:productionPlan:query']"
|
|
|
+ @click="handleColumnClick(scope.row)"
|
|
|
+ ><span>{{ scope.row.lotCode }}</span></el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="产品描述" prop="productDescription" align="center" />
|
|
|
- <el-table-column label="图纸版本" prop="technologyVersion" width="60" align="center" />
|
|
|
- <el-table-column label="投产量" prop="productionQuantity" width="60" align="center" />
|
|
|
- <el-table-column label="下达日期" prop="createTime" width="100" align="center">
|
|
|
+ <el-table-column
|
|
|
+ label="产品描述"
|
|
|
+ prop="productDescription"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="图纸版本"
|
|
|
+ prop="technologyVersion"
|
|
|
+ width="60"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="投产量"
|
|
|
+ prop="productionQuantity"
|
|
|
+ width="60"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="下达日期"
|
|
|
+ prop="createTime"
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
<span>{{
|
|
|
proxy.moment(scope.row.createTime).format("YYYY-MM-DD")
|
|
|
}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="报工总时长" prop="totalWorkingHours" width="150" align="center" />
|
|
|
+ <el-table-column
|
|
|
+ label="报工总时长"
|
|
|
+ prop="totalWorkingHours"
|
|
|
+ width="150"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 分页 -->
|
|
|
- <pagination v-show="total > 0" :total="total" v-model:page="queryDayworkParams.pageNum"
|
|
|
- v-model:limit="queryDayworkParams.pageSize" @pagination="getDayworks" />
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryDayworkParams.pageNum"
|
|
|
+ v-model:limit="queryDayworkParams.pageSize"
|
|
|
+ @pagination="getDayworks"
|
|
|
+ />
|
|
|
</section>
|
|
|
<!-- 右侧区域 -->
|
|
|
<section class="list-part-container" style="flex: 2">
|
|
|
<el-form class="list-search-container" :inline="true">
|
|
|
<el-form-item class="section-title" label="报工信息" />
|
|
|
- <el-form-item class="section-title" label="请选择工序:" prop="processId">
|
|
|
- <el-select-v2 v-model="queryItemParams.processId" clearable :options="processList" placeholder="请选择工序"
|
|
|
- style="width: 100%" @change="handleProcessChange" />
|
|
|
+ <el-form-item
|
|
|
+ class="section-title"
|
|
|
+ label="请选择工序:"
|
|
|
+ prop="processId"
|
|
|
+ >
|
|
|
+ <el-select-v2
|
|
|
+ v-model="queryItemParams.processId"
|
|
|
+ clearable
|
|
|
+ :options="processList"
|
|
|
+ placeholder="请选择工序"
|
|
|
+ style="width: 100%"
|
|
|
+ @change="handleProcessChange"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<div class="el-table-container">
|
|
|
<div class="el-table-inner-container">
|
|
|
- <el-table :data="dayworkItemList" v-loading="dayworkItemLoading" height="100%">
|
|
|
- <el-table-column label="操作者" prop="nickName" width="60" align="center" />
|
|
|
- <el-table-column label="工序名称" prop="processAlias" align="center" />
|
|
|
- <el-table-column label="投产量" prop="prodNum" width="60" align="center" />
|
|
|
- <el-table-column label="合格数" prop="qualifiedNum" width="60" align="center" />
|
|
|
- <el-table-column label="废品数" prop="rejectNum" width="60" align="center" />
|
|
|
- <el-table-column label="开始时间" prop="startTime" width="160" align="center" />
|
|
|
- <el-table-column label="结束时间" prop="endTime" width="160" align="center" />
|
|
|
- <el-table-column label="总工时" prop="workingHours" width="160" align="center" />
|
|
|
- <el-table-column label="生产状态" prop="status" width="100" align="center">
|
|
|
+ <el-table
|
|
|
+ :data="dayworkItemList"
|
|
|
+ v-loading="dayworkItemLoading"
|
|
|
+ height="100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="操作者"
|
|
|
+ prop="nickName"
|
|
|
+ width="60"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="工序名称"
|
|
|
+ prop="processAlias"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="投产量"
|
|
|
+ prop="prodNum"
|
|
|
+ width="60"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="合格数"
|
|
|
+ prop="qualifiedNum"
|
|
|
+ width="60"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="废品数"
|
|
|
+ prop="rejectNum"
|
|
|
+ width="60"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="开始时间"
|
|
|
+ prop="startTime"
|
|
|
+ width="160"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="结束时间"
|
|
|
+ prop="endTime"
|
|
|
+ width="160"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="总工时"
|
|
|
+ prop="workingHours"
|
|
|
+ width="160"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="生产状态"
|
|
|
+ prop="status"
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
<dict-tag :options="daywork_status" :value="scope.row.status" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" align="center" width="200px">
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ width="200px"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
- <el-button v-show="scope.row.deptProcessStatus &&
|
|
|
- (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
- scope.row.id == latestProcessId && scope.row.deptId == latestDeptId && !(lastStatus == 4 || lastStatus == 5 || lastStatus == 7)
|
|
|
- " link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)">编辑
|
|
|
+ <el-button
|
|
|
+ v-show="
|
|
|
+ scope.row.deptProcessStatus &&
|
|
|
+ (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
+ scope.row.id == latestProcessId &&
|
|
|
+ scope.row.deptId == latestDeptId &&
|
|
|
+ !(lastStatus == 4 || lastStatus == 5 || lastStatus == 7)
|
|
|
+ "
|
|
|
+ link
|
|
|
+ type="warning"
|
|
|
+ icon="Edit"
|
|
|
+ @click="handleUpdateDayworkItem(scope.row)"
|
|
|
+ >编辑
|
|
|
</el-button>
|
|
|
- <el-button link type="primary" icon="View" @click="handleCheckDayworkItem(scope.row)">查看
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ icon="View"
|
|
|
+ @click="handleCheckDayworkItem(scope.row)"
|
|
|
+ >查看
|
|
|
</el-button>
|
|
|
- <el-button v-show="showItemDel(scope.row)
|
|
|
- " v-hasPermi="['business:daywork:remove']" link type="danger" icon="Delete"
|
|
|
- @click="handleDeletedItem(scope.row.id)">删除
|
|
|
+ <el-button
|
|
|
+ v-show="showItemDel(scope.row)"
|
|
|
+ v-hasPermi="['business:daywork:remove']"
|
|
|
+ link
|
|
|
+ type="danger"
|
|
|
+ icon="Delete"
|
|
|
+ @click="handleDeletedItem(scope.row.id)"
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -102,13 +273,24 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 分页 -->
|
|
|
- <pagination v-show="itemTotal > 0" :total="itemTotal" v-model:page="queryItemParams.pageNum"
|
|
|
- v-model:limit="queryItemParams.pageSize" @pagination="getDayworkItems" />
|
|
|
+ <pagination
|
|
|
+ v-show="itemTotal > 0"
|
|
|
+ :total="itemTotal"
|
|
|
+ v-model:page="queryItemParams.pageNum"
|
|
|
+ v-model:limit="queryItemParams.pageSize"
|
|
|
+ @pagination="getDayworkItems"
|
|
|
+ />
|
|
|
</section>
|
|
|
<!-- 报工信息表单 -->
|
|
|
- <daywork-item-form ref="dayworkItemRef" @handleSaveSuccess="handleGetDayworkItems" />
|
|
|
+ <daywork-item-form
|
|
|
+ ref="dayworkItemRef"
|
|
|
+ @handleSaveSuccess="handleGetDayworkItems"
|
|
|
+ />
|
|
|
<!-- 分选报工信息表单 -->
|
|
|
- <sort-item-form ref="sortItemRef" @handleSaveSuccess="handleGetDayworkItems" />
|
|
|
+ <sort-item-form
|
|
|
+ ref="sortItemRef"
|
|
|
+ @handleSaveSuccess="handleGetDayworkItems"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -118,20 +300,20 @@ import {
|
|
|
listDayworkItem,
|
|
|
listOriginalDayworkItem,
|
|
|
getProcessList,
|
|
|
- delDayworkItem
|
|
|
+ delDayworkItem,
|
|
|
} from "@/api/business/daywork.js";
|
|
|
import { listDeptProcess } from "@/api/business/deptProcess";
|
|
|
import { getDeptList } from "@/api/business/planDetailSubDetail.js";
|
|
|
import router from "@/router";
|
|
|
import dayworkItemForm from "./form";
|
|
|
-import sortItemForm from "./sortForm"
|
|
|
+import sortItemForm from "./sortForm";
|
|
|
import dayworkStore from "@/store/modules/daywork";
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
/** 字典 */
|
|
|
const { daywork_status } = proxy.useDict("daywork_status");
|
|
|
-const { report_up_limit } = proxy.useDict("report_up_limit")
|
|
|
-const { sort_report_up_limit } = proxy.useDict("sort_report_up_limit")
|
|
|
+const { report_up_limit } = proxy.useDict("report_up_limit");
|
|
|
+const { sort_report_up_limit } = proxy.useDict("sort_report_up_limit");
|
|
|
|
|
|
/** 生产批次 */
|
|
|
const dayworkList = ref([]);
|
|
@@ -146,11 +328,11 @@ const loading = ref(false);
|
|
|
const dayworkItemList = ref([]);
|
|
|
const dayworkItemLoading = ref(false);
|
|
|
const itemTotal = ref(0);
|
|
|
-const lastStatus = ref(null)
|
|
|
+const lastStatus = ref(null);
|
|
|
const latestProcessId = ref(null);
|
|
|
-const latestDeptId = ref(null)
|
|
|
-const lastProcessStepNumber = ref(null)
|
|
|
-const latestItem = ref(null)
|
|
|
+const latestDeptId = ref(null);
|
|
|
+const lastProcessStepNumber = ref(null);
|
|
|
+const latestItem = ref(null);
|
|
|
const deptProcessList = ref([]);
|
|
|
/**工序 */
|
|
|
const processList = ref([]);
|
|
@@ -182,7 +364,7 @@ function getList() {
|
|
|
loading.value = false;
|
|
|
if (deptList.value.length > 0) {
|
|
|
if (dayworkStore().deptId != null) {
|
|
|
- queryDayworkParams.value.deptId = dayworkStore().deptId
|
|
|
+ queryDayworkParams.value.deptId = dayworkStore().deptId;
|
|
|
} else {
|
|
|
queryDayworkParams.value.deptId = deptList.value[0].value;
|
|
|
}
|
|
@@ -195,7 +377,7 @@ function getList() {
|
|
|
|
|
|
//切换工段
|
|
|
function handleDeptChange() {
|
|
|
- dayworkStore().setDeptIdQueryParams(queryDayworkParams.value.deptId)
|
|
|
+ dayworkStore().setDeptIdQueryParams(queryDayworkParams.value.deptId);
|
|
|
getDayworks();
|
|
|
}
|
|
|
|
|
@@ -205,13 +387,15 @@ function handleDeptChange() {
|
|
|
function getDayworks() {
|
|
|
dayworkLoading.value = true;
|
|
|
if (dayworkStore().productionPlanNo != null) {
|
|
|
- queryDayworkParams.value.productionPlanNo = dayworkStore().productionPlanNo
|
|
|
+ queryDayworkParams.value.productionPlanNo = dayworkStore().productionPlanNo;
|
|
|
}
|
|
|
if (dayworkStore().productDescription != null) {
|
|
|
- queryDayworkParams.value.productDescription = dayworkStore().productDescription
|
|
|
+ queryDayworkParams.value.productDescription =
|
|
|
+ dayworkStore().productDescription;
|
|
|
}
|
|
|
if (dayworkStore().equipmentDetailCode != null) {
|
|
|
- queryDayworkParams.value.equipmentDetailCode = dayworkStore().equipmentDetailCode
|
|
|
+ queryDayworkParams.value.equipmentDetailCode =
|
|
|
+ dayworkStore().equipmentDetailCode;
|
|
|
}
|
|
|
listDaywork(queryDayworkParams.value).then((res) => {
|
|
|
dayworkList.value = res.rows;
|
|
@@ -228,7 +412,7 @@ function getDayworks() {
|
|
|
// 批次
|
|
|
if (dayworkList.value.length > 0) {
|
|
|
proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[0]);
|
|
|
- console.log(dayworkList.value[0])
|
|
|
+ console.log(dayworkList.value[0]);
|
|
|
} else {
|
|
|
dayworkItemList.value = [];
|
|
|
itemTotal.value = 0;
|
|
@@ -288,42 +472,47 @@ function handleGetDayworkItems() {
|
|
|
}
|
|
|
//删除报工信息
|
|
|
function handleDeletedItem(id) {
|
|
|
- proxy.$modal
|
|
|
- .confirm("是否确认删除选中的数据项?")
|
|
|
- .then(function () {
|
|
|
- delDayworkItem(id).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- proxy.$modal.msgSuccess("删除成功")
|
|
|
- listDaywork(queryDayworkParams.value).then((res) => {
|
|
|
- dayworkList.value = res.rows;
|
|
|
- for (var i = 0; i < dayworkList.value.length; i++) {
|
|
|
- let timeStamp = dayworkList.value[i].totalWorkingHours;
|
|
|
- let seconds = Math.floor((timeStamp / 1000) % 60);
|
|
|
- let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
|
|
|
- let hours = Math.floor(timeStamp / (1000 * 60 * 60));
|
|
|
- let time = `${hours}小时${minutes}分钟${seconds}秒`;
|
|
|
- dayworkList.value[i].totalWorkingHours = time;
|
|
|
- }
|
|
|
- total.value = res.total;
|
|
|
- // 批次
|
|
|
- proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[dayworkList.value.findIndex(daywork => daywork.id == currentDaywork.value.id)]);
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ proxy.$modal.confirm("是否确认删除选中的数据项?").then(function () {
|
|
|
+ delDayworkItem(id).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ proxy.$modal.msgSuccess("删除成功");
|
|
|
+ listDaywork(queryDayworkParams.value).then((res) => {
|
|
|
+ dayworkList.value = res.rows;
|
|
|
+ for (var i = 0; i < dayworkList.value.length; i++) {
|
|
|
+ let timeStamp = dayworkList.value[i].totalWorkingHours;
|
|
|
+ let seconds = Math.floor((timeStamp / 1000) % 60);
|
|
|
+ let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
|
|
|
+ let hours = Math.floor(timeStamp / (1000 * 60 * 60));
|
|
|
+ let time = `${hours}小时${minutes}分钟${seconds}秒`;
|
|
|
+ dayworkList.value[i].totalWorkingHours = time;
|
|
|
+ }
|
|
|
+ total.value = res.total;
|
|
|
+ // 批次
|
|
|
+ proxy.$refs.dayworkTable.setCurrentRow(
|
|
|
+ dayworkList.value[
|
|
|
+ dayworkList.value.findIndex(
|
|
|
+ (daywork) => daywork.id == currentDaywork.value.id
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
//修改报工信息
|
|
|
function handleUpdateDayworkItem(row) {
|
|
|
- console.log(report_up_limit.value)
|
|
|
- const upLimitForReport = Number(report_up_limit.value[0].value) / 100
|
|
|
- const upLimitForSort = Number(sort_report_up_limit.value[0].value) / 100
|
|
|
+ console.log(report_up_limit.value);
|
|
|
+ const upLimitForReport = Number(report_up_limit.value[0].value) / 100;
|
|
|
+ const upLimitForSort = Number(sort_report_up_limit.value[0].value) / 100;
|
|
|
//同工序下状态是否有工序已完成
|
|
|
let processFinish = false;
|
|
|
//除了编辑此条以外的同工序合格数
|
|
|
let totalQuailifiedNum = 0;
|
|
|
for (let i = 0; i < dayworkItemList.value.length; i++) {
|
|
|
if (
|
|
|
- row.processId == dayworkItemList.value[i].processId &&
|
|
|
+ row.technologicalProcessDetailId ==
|
|
|
+ dayworkItemList.value[i].technologicalProcessDetailId &&
|
|
|
(dayworkItemList.value[i].status == 2 ||
|
|
|
dayworkItemList.value[i].status == 3) &&
|
|
|
row.id != dayworkItemList.value[i].id
|
|
@@ -331,21 +520,22 @@ function handleUpdateDayworkItem(row) {
|
|
|
totalQuailifiedNum += dayworkItemList.value[i].qualifiedNum;
|
|
|
}
|
|
|
if (
|
|
|
- row.processId == dayworkItemList.value[i].processId &&
|
|
|
+ row.technologicalProcessDetailId ==
|
|
|
+ dayworkItemList.value[i].technologicalProcessDetailId &&
|
|
|
dayworkItemList.value[i].status == 3 &&
|
|
|
row.id != dayworkItemList.value[i].id
|
|
|
) {
|
|
|
processFinish = true;
|
|
|
}
|
|
|
}
|
|
|
- let maxQuailifiedNum = row.isSort == 0 ?
|
|
|
- (Math.floor(row.prodNum * upLimitForReport - totalQuailifiedNum) > 0
|
|
|
- ? Math.floor(row.prodNum * upLimitForReport - totalQuailifiedNum)
|
|
|
- : 0)
|
|
|
- :
|
|
|
- (Math.floor(row.prodNum * upLimitForSort - totalQuailifiedNum) > 0
|
|
|
+ let maxQuailifiedNum =
|
|
|
+ row.isSort == 0
|
|
|
+ ? Math.floor(row.prodNum * upLimitForReport - totalQuailifiedNum) > 0
|
|
|
+ ? Math.floor(row.prodNum * upLimitForReport - totalQuailifiedNum)
|
|
|
+ : 0
|
|
|
+ : Math.floor(row.prodNum * upLimitForSort - totalQuailifiedNum) > 0
|
|
|
? Math.floor(row.prodNum * upLimitForSort - totalQuailifiedNum)
|
|
|
- : 0);
|
|
|
+ : 0;
|
|
|
//该daywork合格数总数不能超过投产数的103%
|
|
|
row.technologicalProcessId = queryItemParams.value.technologicalProcessId;
|
|
|
row.deptId = queryDayworkParams.value.deptId;
|
|
@@ -356,7 +546,7 @@ function handleUpdateDayworkItem(row) {
|
|
|
row.isWasteRecycling = currentDaywork.value.isWasteRecycling;
|
|
|
row.maxQuailifiedNum = maxQuailifiedNum;
|
|
|
row.totalQuailifiedNum = totalQuailifiedNum;
|
|
|
- row.productId = currentDaywork.value.productId
|
|
|
+ row.productId = currentDaywork.value.productId;
|
|
|
// console.log(row, currentDaywork)
|
|
|
//判断是否是当前工段
|
|
|
if (row.deptId == currentDaywork.value.deptId) {
|
|
@@ -373,7 +563,6 @@ function handleUpdateDayworkItem(row) {
|
|
|
} else {
|
|
|
proxy.$refs.sortItemRef.open(row);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//查看报工信息
|
|
@@ -384,7 +573,7 @@ function handleCheckDayworkItem(row) {
|
|
|
row.isAmend = currentDaywork.value.isAmend;
|
|
|
row.isWasteRecycling = currentDaywork.value.isWasteRecycling;
|
|
|
row.dayworkId = currentDaywork.value.id;
|
|
|
- row.productId = currentDaywork.value.productId
|
|
|
+ row.productId = currentDaywork.value.productId;
|
|
|
row.lotId = currentDaywork.value.lotId;
|
|
|
//判断是否是当前工段
|
|
|
if (row.deptId == currentDaywork.value.deptId) {
|
|
@@ -402,14 +591,14 @@ function handleCheckDayworkItem(row) {
|
|
|
if (row.isSort == 0) {
|
|
|
proxy.$refs.dayworkItemRef.open(row);
|
|
|
} else {
|
|
|
- console.log(row)
|
|
|
+ console.log(row);
|
|
|
proxy.$refs.sortItemRef.open(row);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**切换工序 */
|
|
|
function handleProcessChange() {
|
|
|
- dayworkStore().setProcessIdQueryParams(queryItemParams.value.processId)
|
|
|
+ dayworkStore().setProcessIdQueryParams(queryItemParams.value.processId);
|
|
|
getDayworkItems();
|
|
|
}
|
|
|
|
|
@@ -424,7 +613,10 @@ function getDayworkItems() {
|
|
|
console.log(currentDaywork.value);
|
|
|
for (let i = 0; i < res.rows.length; i++) {
|
|
|
//如果时首序,投产数是单批数
|
|
|
- if (res.rows[i].processStepNumber === res.others.isFirst && res.rows[i].prodNum == 0) {
|
|
|
+ if (
|
|
|
+ res.rows[i].processStepNumber === res.others.isFirst &&
|
|
|
+ res.rows[i].prodNum == 0
|
|
|
+ ) {
|
|
|
if (currentDaywork.value.isLast == 1) {
|
|
|
res.rows[i].prodNum = currentDaywork.value.lastLotQuantity;
|
|
|
} else {
|
|
@@ -437,13 +629,13 @@ function getDayworkItems() {
|
|
|
// }
|
|
|
}
|
|
|
if (res.others != null && res.others.latestProcessId != null) {
|
|
|
- latestProcessId.value = res.others.latestProcessId
|
|
|
+ latestProcessId.value = res.others.latestProcessId;
|
|
|
}
|
|
|
if (res.others != null && res.others.lastItem != null) {
|
|
|
- latestDeptId.value = res.others.lastItem.deptId
|
|
|
- lastStatus.value = res.others.lastItem.status
|
|
|
- latestItem.value = res.others.lastItem
|
|
|
- lastProcessStepNumber.value = res.others.lastProcessStepNumber
|
|
|
+ latestDeptId.value = res.others.lastItem.deptId;
|
|
|
+ lastStatus.value = res.others.lastItem.status;
|
|
|
+ latestItem.value = res.others.lastItem;
|
|
|
+ lastProcessStepNumber.value = res.others.lastProcessStepNumber;
|
|
|
}
|
|
|
for (var i = 0; i < res.rows.length; i++) {
|
|
|
let timeStamp = res.rows[i].workingHours;
|
|
@@ -455,11 +647,13 @@ function getDayworkItems() {
|
|
|
res.rows[i].deptProcessStatus = false;
|
|
|
//报工记录的工序id是该工段绑定的工序时,允许编辑
|
|
|
for (var item = 0; item < deptProcessList.value.length; item++) {
|
|
|
- if (res.rows[i].processId == deptProcessList.value[item].processId) {
|
|
|
+ if (
|
|
|
+ res.rows[i].processId == deptProcessList.value[item].processId
|
|
|
+ ) {
|
|
|
res.rows[i].deptProcessStatus = true;
|
|
|
}
|
|
|
}
|
|
|
- console.log(res.rows[i].deptProcessStatus)
|
|
|
+ console.log(res.rows[i].deptProcessStatus);
|
|
|
}
|
|
|
dayworkItemList.value = res.rows;
|
|
|
getProcess();
|
|
@@ -484,26 +678,32 @@ function getProcess() {
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
function handleQuery() {
|
|
|
- dayworkStore().setProductionPlanNoQueryParams(queryDayworkParams.value.productionPlanNo)
|
|
|
- dayworkStore().setProductDescriptionQueryParams(queryDayworkParams.value.productDescription)
|
|
|
- dayworkStore().setEquipmentDetailCodeQueryParams(queryDayworkParams.value.equipmentDetailCode)
|
|
|
+ dayworkStore().setProductionPlanNoQueryParams(
|
|
|
+ queryDayworkParams.value.productionPlanNo
|
|
|
+ );
|
|
|
+ dayworkStore().setProductDescriptionQueryParams(
|
|
|
+ queryDayworkParams.value.productDescription
|
|
|
+ );
|
|
|
+ dayworkStore().setEquipmentDetailCodeQueryParams(
|
|
|
+ queryDayworkParams.value.equipmentDetailCode
|
|
|
+ );
|
|
|
getDayworks();
|
|
|
}
|
|
|
|
|
|
function showItemDel(row) {
|
|
|
// 判断是最新一条且是当前工段加工则可删除
|
|
|
if (row.processStepNumber == lastProcessStepNumber.value && row.status == 3) {
|
|
|
- return false
|
|
|
+ return false;
|
|
|
}
|
|
|
if (row.id == latestItem.value.id) {
|
|
|
if (row.status >= 4) {
|
|
|
// 周转则判断fromDeptId
|
|
|
- return row.fromDeptId == queryDayworkParams.value.deptId
|
|
|
+ return row.fromDeptId == queryDayworkParams.value.deptId;
|
|
|
} else {
|
|
|
- return row.deptId == queryDayworkParams.value.deptId
|
|
|
+ return row.deptId == queryDayworkParams.value.deptId;
|
|
|
}
|
|
|
}
|
|
|
- return false
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|