|
@@ -3,261 +3,99 @@
|
|
|
<!-- 左侧区域 -->
|
|
|
<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: 200px"
|
|
|
- />
|
|
|
+ <el-input placeholder="请输入生产计划单号/批次号" v-model.trim="queryDayworkParams.productionPlanNo"
|
|
|
+ @keydown.enter.prevent clearable style="width: 200px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品描述:">
|
|
|
- <el-input
|
|
|
- placeholder="请输入产品描述"
|
|
|
- v-model.trim="queryDayworkParams.productDescription"
|
|
|
- @keydown.enter.prevent
|
|
|
- clearable
|
|
|
- style="width: 130px"
|
|
|
- />
|
|
|
+ <el-input placeholder="请输入产品描述" v-model.trim="queryDayworkParams.productDescription" @keydown.enter.prevent
|
|
|
+ clearable style="width: 130px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="section-title" label="请选择当前工段:">
|
|
|
- <el-select-v2
|
|
|
- v-model="queryDayworkParams.deptId"
|
|
|
- :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"
|
|
|
- :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>
|
|
|
+ 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="140px"
|
|
|
- >
|
|
|
+ <el-table-column fixed="right" label="操作" align="center" width="140px">
|
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
- v-show="
|
|
|
- scope.row.deptProcessStatus &&
|
|
|
- (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
- scope.row.processId == latestProcessId
|
|
|
- "
|
|
|
- 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.processId == latestProcessId
|
|
|
+ " link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)">编辑
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- v-show="!(scope.row.deptProcessStatus &&
|
|
|
- (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
- scope.row.processId == latestProcessId)"
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- icon="View"
|
|
|
- @click="handleCheckDayworkItem(scope.row)"
|
|
|
- >查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-show="
|
|
|
- scope.row.deptProcessStatus &&
|
|
|
- (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
- scope.row.processId == latestProcessId
|
|
|
- "
|
|
|
- v-hasPermi="['business:daywork:remove']"
|
|
|
- link
|
|
|
- type="danger"
|
|
|
- icon="Delete"
|
|
|
- @click="handleDeletedItem(scope.row.id)"
|
|
|
- >删除
|
|
|
+ <el-button v-show="!(scope.row.deptProcessStatus &&
|
|
|
+ (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
+ scope.row.processId == latestProcessId)" link type="primary" icon="View"
|
|
|
+ @click="handleCheckDayworkItem(scope.row)">查看
|
|
|
+ </el-button>
|
|
|
+ <el-button v-show="scope.row.deptProcessStatus &&
|
|
|
+ (scope.row.status == 2 || scope.row.status == 3) &&
|
|
|
+ scope.row.processId == latestProcessId
|
|
|
+ " v-hasPermi="['business:daywork:remove']" link type="danger" icon="Delete"
|
|
|
+ @click="handleDeletedItem(scope.row.id)">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -265,19 +103,11 @@
|
|
|
</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" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -434,25 +264,25 @@ 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)]);
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ 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)]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
//修改报工信息
|
|
@@ -556,9 +386,12 @@ function getDayworkItems() {
|
|
|
}
|
|
|
}
|
|
|
//拿到最新一条报工信息的工序id,只能编辑当前序
|
|
|
- if (res.rows[i] == res.rows[res.rows.length - 1]) {
|
|
|
- latestProcessId.value = res.rows[i].processId;
|
|
|
- }
|
|
|
+ // if (res.rows[i] == res.rows[res.rows.length - 1]) {
|
|
|
+ // latestProcessId.value = res.rows[i].processId;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ if (res.others != null && res.others.latestProcessId != null) {
|
|
|
+ latestProcessId.value = latestProcessId
|
|
|
}
|
|
|
for (var i = 0; i < res.rows.length; i++) {
|
|
|
let timeStamp = res.rows[i].workingHours;
|