|
@@ -3,314 +3,499 @@
|
|
|
<!-- 左侧区域 -->
|
|
|
<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" @keyup.enter="handleQuery" @keydown.enter.prevent clearable style="width: 200px" />
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入生产计划单号/批次号"
|
|
|
+ v-model.trim="queryDayworkParams.productionPlanNo"
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="批次号:">
|
|
|
<el-input placeholder="请输入批次号" v-model.trim="queryDayworkParams.lotCode" @keyup.enter="handleQuery" @keydown.enter.prevent clearable style="width: 120px" />
|
|
|
</el-form-item> -->
|
|
|
<el-form-item label="产品描述:">
|
|
|
- <el-input placeholder="请输入产品描述" v-model.trim="queryDayworkParams.productDescription" @keyup.enter="handleQuery" @keydown.enter.prevent clearable style="width: 120px" />
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入产品描述"
|
|
|
+ v-model.trim="queryDayworkParams.productDescription"
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ @keydown.enter.prevent
|
|
|
+ clearable
|
|
|
+ style="width: 120px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="section-title" label="请选择当前工段:">
|
|
|
- <el-select-v2 v-model="queryDayworkParams.deptId" filterable :options="deptList" placeholder="请选择工段" style="width: 140px" @change="handleDeptChange" />
|
|
|
+ <el-select-v2
|
|
|
+ v-model="queryDayworkParams.deptId"
|
|
|
+ :options="deptList"
|
|
|
+ placeholder="请选择工段"
|
|
|
+ style="width: 140px"
|
|
|
+ @change="handleDeptChange"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item style="margin-left: 0;" >
|
|
|
- <el-button type="info" icon="Search" @click="handleQuery">搜索 </el-button>
|
|
|
+ <el-form-item style="margin-left: 0">
|
|
|
+ <el-button type="info" icon="Search" @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="批次号" prop="lotCode" width="120" 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="furnaceNumber" width="60" align="center" />
|
|
|
- <el-table-column label="下达日期" prop="createTime" width="100" 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="批次号"
|
|
|
+ prop="lotCode"
|
|
|
+ width="120"
|
|
|
+ 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="furnaceNumber"
|
|
|
+ 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>
|
|
|
+ <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="technologicalProcessDetailId">
|
|
|
- <el-select-v2 v-model="queryItemParams.technologicalProcessDetailId" clearable :options="processList" placeholder="请选择工序" style="width: 100%" @change="handleProcessChange" />
|
|
|
+ <el-form-item
|
|
|
+ class="section-title"
|
|
|
+ label="请选择工序:"
|
|
|
+ prop="technologicalProcessDetailId"
|
|
|
+ >
|
|
|
+ <el-select-v2
|
|
|
+ v-model="queryItemParams.technologicalProcessDetailId"
|
|
|
+ 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="70px">
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ width="70px"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
- <el-button v-if="(scope.row.status ==2 ||scope.row.status == 3) &&scope.row.flag" link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)" >编辑</el-button>
|
|
|
- <el-button v-else-if="(scope.row.status !=2 ||scope.row.status != 3) || scope.row.flag" link type="primary" icon="View" @click="handleCheckDayworkItem(scope.row)" >查看</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
+ scope.row.flag
|
|
|
+ "
|
|
|
+ link
|
|
|
+ type="warning"
|
|
|
+ icon="Edit"
|
|
|
+ @click="handleUpdateDayworkItem(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-else-if="
|
|
|
+ scope.row.status != 2 ||
|
|
|
+ scope.row.status != 3 ||
|
|
|
+ scope.row.flag
|
|
|
+ "
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ icon="View"
|
|
|
+ @click="handleCheckDayworkItem(scope.row)"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</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>
|
|
|
- <dayworkItem-form ref="dayworkItemRef" @handleSaveSuccess = "handleGetDayworkItems" />
|
|
|
+ <dayworkItem-form
|
|
|
+ ref="dayworkItemRef"
|
|
|
+ @handleSaveSuccess="handleGetDayworkItems"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { listDaywork, listDayworkItem, getProcessList } from '@/api/business/daywork.js'
|
|
|
-import { listDeptProcess} from '@/api/business/deptProcess'
|
|
|
-import { getDept } from '@/api/business/planDetailSubDetail.js'
|
|
|
-import { toHHmmss } from '@/components/Time/time.js'
|
|
|
-import dayworkItemForm from './form'
|
|
|
-import { get } from '@vueuse/core'
|
|
|
-const { proxy } = getCurrentInstance()
|
|
|
+import {
|
|
|
+ listDaywork,
|
|
|
+ listDayworkItem,
|
|
|
+ getProcessList,
|
|
|
+} from "@/api/business/daywork.js";
|
|
|
+import { listDeptProcess } from "@/api/business/deptProcess";
|
|
|
+import { getDept } from "@/api/business/planDetailSubDetail.js";
|
|
|
+import dayworkItemForm from "./form";
|
|
|
+import { get } from "@vueuse/core";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
|
|
|
/** 字典 */
|
|
|
-const { daywork_status } = proxy.useDict('daywork_status')
|
|
|
+const { daywork_status } = proxy.useDict("daywork_status");
|
|
|
|
|
|
/** daywork 列表 */
|
|
|
-const dayworkList = ref([])
|
|
|
-const dayworkItemList = ref([])
|
|
|
-const dayworkTable = ref(null)
|
|
|
-const deptList = ref([])
|
|
|
+const dayworkList = ref([]);
|
|
|
+const dayworkItemList = ref([]);
|
|
|
+const dayworkTable = ref(null);
|
|
|
+const deptList = ref([]);
|
|
|
|
|
|
/** daywork 批次 */
|
|
|
-const currentDaywork = ref({})
|
|
|
-const dayworkLoading = ref(false)
|
|
|
-const loading = ref(false)
|
|
|
-const dayworkItemLoading = ref(false)
|
|
|
-const processList = ref([])
|
|
|
-const total = ref(0)
|
|
|
-const itemTotal = ref(0)
|
|
|
+const currentDaywork = ref({});
|
|
|
+const dayworkLoading = ref(false);
|
|
|
+const loading = ref(false);
|
|
|
+const dayworkItemLoading = ref(false);
|
|
|
+const processList = ref([]);
|
|
|
+const total = ref(0);
|
|
|
+const itemTotal = ref(0);
|
|
|
|
|
|
/** 查询对象 */
|
|
|
const queryDayworkParams = ref({
|
|
|
- productDescription: '',
|
|
|
- deptId:'',
|
|
|
- lotCode: '',
|
|
|
+ productDescription: "",
|
|
|
+ deptId: "",
|
|
|
+ lotCode: "",
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
-})
|
|
|
+ pageSize: 10,
|
|
|
+});
|
|
|
const queryItemParams = ref({
|
|
|
- dayworkId: '0',
|
|
|
+ dayworkId: "0",
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- technologicalProcessDetailId: null
|
|
|
-})
|
|
|
+ technologicalProcessDetailId: null,
|
|
|
+});
|
|
|
|
|
|
/*********************** 方法区 ****************************/
|
|
|
|
|
|
function getList() {
|
|
|
- loading.value = true
|
|
|
+ loading.value = true;
|
|
|
getDept().then((response) => {
|
|
|
- deptList.value = response.data
|
|
|
+ deptList.value = response.data;
|
|
|
if (deptList.value.length > 0) {
|
|
|
- queryDayworkParams.value.deptId = deptList.value[0].value
|
|
|
- getDayworks()
|
|
|
- }
|
|
|
- else{
|
|
|
- dayworkList.value = []
|
|
|
+ queryDayworkParams.value.deptId = deptList.value[0].value;
|
|
|
+ getDayworks();
|
|
|
+ } else {
|
|
|
+ dayworkList.value = [];
|
|
|
}
|
|
|
- })
|
|
|
- loading.value = false
|
|
|
+ });
|
|
|
+ loading.value = false;
|
|
|
}
|
|
|
/** 查询计划明细 */
|
|
|
function getDayworks() {
|
|
|
- dayworkLoading.value = true
|
|
|
+ dayworkLoading.value = true;
|
|
|
listDaywork(queryDayworkParams.value).then((res) => {
|
|
|
- dayworkList.value = res.rows
|
|
|
+ dayworkList.value = res.rows;
|
|
|
for (var i = 0; i < dayworkList.value.length; i++) {
|
|
|
- let timeStamp = dayworkList.value[i].totalWorkingHours
|
|
|
+ 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
|
|
|
+ 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
|
|
|
- dayworkLoading.value = false
|
|
|
+ total.value = res.total;
|
|
|
+ dayworkLoading.value = false;
|
|
|
// 批次
|
|
|
if (dayworkList.value.length > 0) {
|
|
|
- proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[0])
|
|
|
+ proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[0]);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
function handleGetDayworkItems() {
|
|
|
- dayworkLoading.value = true
|
|
|
+ dayworkLoading.value = true;
|
|
|
listDaywork(queryDayworkParams.value).then((res) => {
|
|
|
- dayworkList.value = res.rows
|
|
|
+ dayworkList.value = res.rows;
|
|
|
for (var i = 0; i < dayworkList.value.length; i++) {
|
|
|
- let timeStamp = dayworkList.value[i].totalWorkingHours
|
|
|
+ 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
|
|
|
+ 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
|
|
|
- dayworkLoading.value = false
|
|
|
- if (dayworkList.value.length > 0) {
|
|
|
+ total.value = res.total;
|
|
|
+ dayworkLoading.value = false;
|
|
|
+ if (dayworkList.value.length > 0) {
|
|
|
for (var i = 0; i < dayworkList.value.length; i++) {
|
|
|
if (dayworkList.value[i].id == currentDaywork.value.id) {
|
|
|
- var index = i
|
|
|
- break
|
|
|
+ var index = i;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[index])
|
|
|
- })
|
|
|
-
|
|
|
+ proxy.$refs.dayworkTable.setCurrentRow(dayworkList.value[index]);
|
|
|
+ });
|
|
|
}
|
|
|
function handleDeptChange() {
|
|
|
- getDayworks()
|
|
|
+ getDayworks();
|
|
|
}
|
|
|
|
|
|
function handleUpdateDayworkItem(row) {
|
|
|
//编辑时拿到同工序下的合格数总数
|
|
|
- let totalQuailifiedNum = 0
|
|
|
- for(let i = 0; i<dayworkItemList.value.length;i++) {
|
|
|
- if(row.processAlias == dayworkItemList.value[i].processAlias && (dayworkItemList.value[i].status == 2 || dayworkItemList.value[i].status == 3) && row.id != dayworkItemList.value[i].id) {
|
|
|
- totalQuailifiedNum += dayworkItemList.value[i].qualifiedNum
|
|
|
+ let totalQuailifiedNum = 0;
|
|
|
+ for (let i = 0; i < dayworkItemList.value.length; i++) {
|
|
|
+ if (
|
|
|
+ row.processAlias == dayworkItemList.value[i].processAlias &&
|
|
|
+ (dayworkItemList.value[i].status == 2 ||
|
|
|
+ dayworkItemList.value[i].status == 3) &&
|
|
|
+ row.id != dayworkItemList.value[i].id
|
|
|
+ ) {
|
|
|
+ totalQuailifiedNum += dayworkItemList.value[i].qualifiedNum;
|
|
|
}
|
|
|
}
|
|
|
//该daywork合格数总数不能超过投产数的103%
|
|
|
- let maxQuailifiedNum = Math.floor(currentDaywork.value.productionQuantity * 1.03 - totalQuailifiedNum)
|
|
|
- row.technologicalProcessId = queryItemParams.value.technologicalProcessId
|
|
|
- row.deptId = queryDayworkParams.value.deptId
|
|
|
- row.productionPlanDetailId = currentDaywork.value.productionPlanDetailId
|
|
|
- row.dayworkId = currentDaywork.value.id
|
|
|
- row.lotId = currentDaywork.value.lotId
|
|
|
- row.maxQuailifiedNum = maxQuailifiedNum
|
|
|
+ let maxQuailifiedNum = Math.floor(
|
|
|
+ currentDaywork.value.productionQuantity * 1.03 - totalQuailifiedNum
|
|
|
+ );
|
|
|
+ row.technologicalProcessId = queryItemParams.value.technologicalProcessId;
|
|
|
+ row.deptId = queryDayworkParams.value.deptId;
|
|
|
+ row.productionPlanDetailId = currentDaywork.value.productionPlanDetailId;
|
|
|
+ row.dayworkId = currentDaywork.value.id;
|
|
|
+ row.lotId = currentDaywork.value.lotId;
|
|
|
+ row.maxQuailifiedNum = maxQuailifiedNum;
|
|
|
//判断是编辑
|
|
|
- row.editStatus = true
|
|
|
+ row.editStatus = true;
|
|
|
//判断是否是当前工段
|
|
|
- if(row.deptId == currentDaywork.value.deptId) {
|
|
|
- row.currentDept = true
|
|
|
- }else {
|
|
|
- row.currentDept = false
|
|
|
+ if (row.deptId == currentDaywork.value.deptId) {
|
|
|
+ row.currentDept = true;
|
|
|
+ } else {
|
|
|
+ row.currentDept = false;
|
|
|
}
|
|
|
- proxy.$refs.dayworkItemRef.open(row)
|
|
|
+ proxy.$refs.dayworkItemRef.open(row);
|
|
|
}
|
|
|
function handleCheckDayworkItem(row) {
|
|
|
- row.technologicalProcessId = queryItemParams.value.technologicalProcessId
|
|
|
- row.deptId = queryDayworkParams.value.deptId
|
|
|
- row.productionPlanDetailId = currentDaywork.value.productionPlanDetailId
|
|
|
- row.dayworkId = currentDaywork.value.id
|
|
|
- row.lotId = currentDaywork.value.lotId
|
|
|
+ row.technologicalProcessId = queryItemParams.value.technologicalProcessId;
|
|
|
+ row.deptId = queryDayworkParams.value.deptId;
|
|
|
+ row.productionPlanDetailId = currentDaywork.value.productionPlanDetailId;
|
|
|
+ row.dayworkId = currentDaywork.value.id;
|
|
|
+ row.lotId = currentDaywork.value.lotId;
|
|
|
//判断是查看
|
|
|
- row.editStatus = false
|
|
|
+ row.editStatus = false;
|
|
|
//判断是否是当前工段
|
|
|
- if(row.deptId == currentDaywork.value.deptId) {
|
|
|
- row.currentDept = true
|
|
|
- }else {
|
|
|
- row.currentDept = false
|
|
|
+ if (row.deptId == currentDaywork.value.deptId) {
|
|
|
+ row.currentDept = true;
|
|
|
+ } else {
|
|
|
+ row.currentDept = false;
|
|
|
}
|
|
|
- proxy.$refs.dayworkItemRef.open(row)
|
|
|
+ proxy.$refs.dayworkItemRef.open(row);
|
|
|
}
|
|
|
|
|
|
function handleProcessChange() {
|
|
|
- getDayworkItems()
|
|
|
+ getDayworkItems();
|
|
|
}
|
|
|
|
|
|
/** 查询报工详情列表 */
|
|
|
function getDayworkItems() {
|
|
|
- dayworkItemLoading.value = true
|
|
|
+ dayworkItemLoading.value = true;
|
|
|
listDayworkItem(queryItemParams.value).then((res) => {
|
|
|
- listDeptProcess({deptId:queryDayworkParams.value.deptId,flag:true}).then((deptProcess) => {
|
|
|
- for(let i = 0; i < res.rows.length; i++) {
|
|
|
- for(let j = 0; j < deptProcess.rows.length; j++) {
|
|
|
- //如果在工段资源工序里,则代表工段长能编辑
|
|
|
- if(res.rows[i].processAlias.trim() == deptProcess.rows[j].processAlias.trim()) {
|
|
|
- console.log(res.rows[i].processAlias.trim())
|
|
|
- console.log(deptProcess.rows[j].processAlias.trim())
|
|
|
- console.log(res.rows[i].processAlias.trim() == deptProcess.rows[j].processAlias.trim())
|
|
|
- res.rows[i].flag = true
|
|
|
- break;
|
|
|
- }
|
|
|
- else {
|
|
|
- res.rows[i].flag = false
|
|
|
+ listDeptProcess({
|
|
|
+ deptId: queryDayworkParams.value.deptId,
|
|
|
+ flag: true,
|
|
|
+ }).then((deptProcess) => {
|
|
|
+ for (let i = 0; i < res.rows.length; i++) {
|
|
|
+ for (let j = 0; j < deptProcess.rows.length; j++) {
|
|
|
+ //如果在工段资源工序里,则代表工段长能编辑
|
|
|
+ if (
|
|
|
+ res.rows[i].processAlias.trim() ==
|
|
|
+ deptProcess.rows[j].processAlias.trim()
|
|
|
+ ) {
|
|
|
+ res.rows[i].flag = true;
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ res.rows[i].flag = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- console.log(res.rows)
|
|
|
- dayworkItemList.value = res.rows
|
|
|
- console.log(dayworkItemList.value)
|
|
|
- for (var i = 0; i < dayworkItemList.value.length; i++) {
|
|
|
- let timeStamp = dayworkItemList.value[i].workingHours
|
|
|
- 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}秒`;
|
|
|
- dayworkItemList.value[i].workingHours = time
|
|
|
- }
|
|
|
- getProcessList({ technologicalProcessId: queryItemParams.value.technologicalProcessId }).then((res) => {
|
|
|
- processList.value = res.data
|
|
|
- })
|
|
|
- itemTotal.value = res.total
|
|
|
- dayworkItemLoading.value = false
|
|
|
- })
|
|
|
-})
|
|
|
+ dayworkItemList.value = res.rows;
|
|
|
+ for (var i = 0; i < dayworkItemList.value.length; i++) {
|
|
|
+ let timeStamp = dayworkItemList.value[i].workingHours;
|
|
|
+ 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}秒`;
|
|
|
+ dayworkItemList.value[i].workingHours = time;
|
|
|
+ }
|
|
|
+ getProcessList({
|
|
|
+ technologicalProcessId: queryItemParams.value.technologicalProcessId,
|
|
|
+ }).then((res) => {
|
|
|
+ processList.value = res.data;
|
|
|
+ });
|
|
|
+ itemTotal.value = res.total;
|
|
|
+ dayworkItemLoading.value = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
function handleQuery() {
|
|
|
//queryDayworkParams.value.pageNum = 1
|
|
|
- getDayworks()
|
|
|
+ getDayworks();
|
|
|
}
|
|
|
|
|
|
/** 生产计划明细 current-change 事件 */
|
|
|
function handleDayworkCurrentChange(row) {
|
|
|
if (row) {
|
|
|
- currentDaywork.value = row
|
|
|
- queryItemParams.value.dayworkId = currentDaywork.value.id
|
|
|
- queryItemParams.value.technologicalProcessDetailId = null
|
|
|
- queryItemParams.value.technologicalProcessId = row.technologicalProcessId
|
|
|
- getDayworkItems()
|
|
|
+ currentDaywork.value = row;
|
|
|
+ queryItemParams.value.dayworkId = currentDaywork.value.id;
|
|
|
+ queryItemParams.value.technologicalProcessDetailId = null;
|
|
|
+ queryItemParams.value.technologicalProcessId = row.technologicalProcessId;
|
|
|
+ getDayworkItems();
|
|
|
} else {
|
|
|
- dayworkItemList.value = []
|
|
|
+ dayworkItemList.value = [];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getList()
|
|
|
-})
|
|
|
+ getList();
|
|
|
+});
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.el-form--inline .el-form-item {
|
|
|
- margin-right: 20px;
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
|
</style>
|