fix: 修复钢卷入库页面日期格式和操作功能

修复收货计划日期格式从"yyyy-MM-dd HH:mm:ss"改为"yyyy-MM-dd"
添加拒签和删除操作按钮功能
默认选中当天收货计划并提示未创建计划
修复表单提交后未正确重置的问题
This commit is contained in:
砂糖
2026-01-08 14:22:05 +08:00
parent b23cf7b291
commit 624482a610
3 changed files with 80 additions and 15 deletions

View File

@@ -311,7 +311,7 @@ export default {
const s = String(val)
const parts = s.split(':')
const last = parts[parts.length - 1]
const num = Number(last)
const num = last
return Number.isNaN(num) ? null : num
},

View File

@@ -16,8 +16,10 @@
<el-option v-for="item in planList" :key="item.planId" :label="item.planName"
:value="item.planId" />
</el-select>
<!-- 默认选中今天的收货计划如果今天还没有收货计划提醒创建收货计划 -->
</el-form-item>
<!-- 查找并选择选择收货计划, 使用远程搜索 -->
<el-alert v-if="noPlan" type="warning" title="今天还没有收货计划,点击创建" show-icon @click.native="$router.push('/receive/plan')"></el-alert>
</el-col>
</el-row>
<el-row>
@@ -45,12 +47,6 @@
clearable />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="实际库区" prop="actualWarehouseId">
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
clearable />
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="班组" prop="team">
<el-input v-model="form.team" placeholder="请输入班组" />
@@ -179,11 +175,16 @@
<el-tag v-else type="primary">未收货</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="操作">
<el-table-column label="操作">
<template slot-scope="scope">
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="primary" @click="openReceiptModal(scope.row)">签收</el-button>
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="primary"
@click="openReceiptModal(scope.row)" v-loading="buttonLoading">签收</el-button>
<el-button v-if="scope.row.actionStatus == 0 || scope.row.actionStatus == 1" type="danger"
@click="handleReject(scope.row)" v-loading="buttonLoading">拒签</el-button>
<el-button v-if="scope.row.actionStatus == 3" type="warning" v-loading="buttonLoading"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column> -->
</el-table-column>
</el-table>
<Pagination v-show="total > 0" :total="total" :page.sync="pagination.pageNum"
@@ -220,8 +221,8 @@
</template>
<script>
import { addMaterialCoil, updateMaterialCoilSimple, getMaterialCoil } from '@/api/wms/coil'
import { listPendingAction, addPendingAction, updatePendingAction } from '@/api/wms/pendingAction'
import { getMaterialCoil } from '@/api/wms/coil'
import { listPendingAction, delPendingAction, updatePendingAction } from '@/api/wms/pendingAction'
import MaterialSelect from "@/components/KLPService/MaterialSelect";
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
@@ -259,6 +260,7 @@ export default {
trimmingRequirement: null,
packingStatus: null,
packagingRequirement: null,
planId: null,
},
loading: false,
buttonLoading: false,
@@ -297,7 +299,7 @@ export default {
],
},
planList: [],
noPlan: false,
// 确认收货表单参数
receiptModalVisible: false,
receiptForm: {
@@ -308,10 +310,13 @@ export default {
remark: null,
},
coilInfo: {},
todayPlanId: null,
}
},
mounted() {
this.getList()
this.getTodayPlan()
this.remoteMethod('')
},
computed: {
// 动态显示标签
@@ -341,6 +346,20 @@ export default {
this.planList = res.rows
})
},
getTodayPlan() {
// 获取今天的收货计划
// 计划日期格式为yyyy-MM-dd
let today = new Date().toISOString().substring(0, 10)
// let today = '2025-01-01'
listDeliveryPlan({ planDate: today, pageNum: 1, pageSize: 1, planType: 1 }).then(res => {
if (res.rows.length > 0) {
this.form.planId = res.rows[0]?.planId
this.todayPlanId = res.rows[0]?.planId
} else {
this.noPlan = true
}
})
},
getList() {
// 获取入库历史
this.loading = true
@@ -358,7 +377,19 @@ export default {
handleCoil(COIL_ACTIONS.RECEIVE, this.form, this.form.planId)
.then(res => {
this.$modal.msgSuccess("入库成功");
this.$refs.form.resetFields();
this.form = {
itemId: null,
itemType: 'raw_material',
warehouseId: '1988150044862377986', // 酸连轧原料库
netWeight: null,
grossWeight: null,
remark: null,
dataType: 10, // 表示将要入库但是还未入库的钢卷,一般用于钢卷入库的操作去创建一个无法被检索到的钢卷
trimmingRequirement: null,
packingStatus: null,
packagingRequirement: null,
planId: this.todayPlanId,
}
this.getList()
}).finally(() => {
this.buttonLoading = false;
@@ -389,11 +420,45 @@ export default {
.then(_ => {
this.$message.success("确认收货成功");
this.getList()
this.receiptModalVisible = false;
}).finally(() => {
this.buttonLoading = false;
});
})
},
handleReject(row) {
this.$modal.confirm("确认拒签吗?", "拒签确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.buttonLoading = true;
updatePendingAction({
...row,
actionStatus: 3, // 3表示拒签
}).then(response => {
this.$modal.msgSuccess("拒签成功");
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
});
},
handleDelete(row) {
this.$modal.confirm("确认删除吗?", "删除确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.buttonLoading = true;
delPendingAction(row.actionId).then(response => {
this.$modal.msgSuccess("删除成功");
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
});
},
// 取消操作
cancel() {
this.form = {};

View File

@@ -5,7 +5,7 @@
<el-input v-model="queryParams.planName" placeholder="请输入收货计划名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="计划日期" prop="planDate">
<el-date-picker clearable v-model="queryParams.planDate" type="date" value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker clearable v-model="queryParams.planDate" type="date" value-format="yyyy-MM-dd"
placeholder="请选择计划日期">
</el-date-picker>
</el-form-item>