feat(钢卷发货): 新增钢卷发货功能并优化相关界面

- 新增钢卷发货API接口及前端调用
- 将发货操作从状态更新改为专用发货接口
- 移除状态选择列并添加发货按钮
- 更新后端控制器注释和方法类型
This commit is contained in:
砂糖
2025-12-02 14:45:06 +08:00
parent ee97dee4ab
commit 86e047bd5e
4 changed files with 35 additions and 20 deletions

View File

@@ -127,4 +127,12 @@ export function exportAllMaterialCoil(query) {
method: 'post',
data: query
})
}
// 钢卷发货
export function exportCoil(coilId) {
return request({
url: '/wms/materialCoil/exportCoil/' + coilId,
method: 'get'
})
}

View File

@@ -185,7 +185,7 @@
</template>
<script>
import { updateMaterialCoilSimple, getMaterialCoil } from '@/api/wms/coil'
import { exportCoil, getMaterialCoil } from '@/api/wms/coil'
import { listPendingAction, addPendingAction } from '@/api/wms/pendingAction'
import MaterialSelect from "@/components/KLPService/MaterialSelect";
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
@@ -305,11 +305,7 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
updateMaterialCoilSimple({
...this.form,
coilId: this.form.coilId,
status: 1
}).then(response => {
exportCoil(this.form.coilId).then(response => {
addPendingAction({
actionType: 402,
currentCoilNo: this.form.currentCoilNo,

View File

@@ -99,14 +99,14 @@
<QRCode :content="scope.row.qrcodeRecordId" :size="50" />
</template>
</el-table-column>
<el-table-column label="状态" v-if="showStatus" align="center" prop="status">
<!-- <el-table-column label="状态" v-if="showStatus" align="center" prop="status">
<template slot-scope="scope">
<el-select v-model="scope.row.status" placeholder="请选择状态" @change="handleStatusChange(scope.row)">
<el-option v-for="item in dict.type.product_coil_status" :key="item.value" :value="parseInt(item.value)"
:label="item.label" />
</el-select>
</template>
</el-table-column>
</el-table-column> -->
<!-- <el-table-column label="班组" align="center" prop="team" /> -->
<!-- <el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="净重" align="center" prop="netWeight" /> -->
@@ -134,6 +134,9 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
导出标签
</el-button>
<el-button size="mini" v-if="showStatus" type="text" icon="el-icon-upload" @click="handleExportCoil(scope.row.coilId)">
发货
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)" v-if="showControl">修正</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-if="showControl">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-search" @click="handleTrace(scope.row)">追溯</el-button>
@@ -228,7 +231,7 @@
</template>
<script>
import { listMaterialCoil, getMaterialCoil, delMaterialCoil, addMaterialCoil, updateMaterialCoilSimple, getMaterialCoilTrace, exportAllMaterialCoil } from "@/api/wms/coil";
import { listMaterialCoil, getMaterialCoil, delMaterialCoil, addMaterialCoil, updateMaterialCoilSimple, getMaterialCoilTrace, exportCoil } from "@/api/wms/coil";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import QRCode from "../../print/components/QRCode.vue";
import * as XLSX from 'xlsx'
@@ -436,15 +439,15 @@ export default {
});
},
/** 状态改变时触发 */
handleStatusChange(row) {
updateMaterialCoilSimple(row).then(res => {
this.$message.success('状态更新成功');
this.getList(); // 刷新列表
}).catch(err => {
console.error('状态更新失败:', err);
this.$message.error('状态更新失败,请重试');
});
},
// handleStatusChange(row) {
// updateMaterialCoilSimple(row).then(res => {
// this.$message.success('状态更新成功');
// this.getList(); // 刷新列表
// }).catch(err => {
// console.error('状态更新失败:', err);
// this.$message.error('状态更新失败,请重试');
// });
// },
/** 追溯按钮操作 */
handleTrace(row) {
this.traceOpen = true;
@@ -592,6 +595,14 @@ export default {
this.title = "修改钢卷物料";
});
},
handleExportCoil(row) {
exportCoil(row.coilId).then(response => {
this.$modal.msgSuccess("发货成功");
this.getList();
}).catch(error => {
this.$modal.msgError("发货失败");
});
},
handleCheck(row) {
this.isCheck = true;
this.loading = true;

View File

@@ -57,12 +57,12 @@ public class WmsMaterialCoilController extends BaseController {
}
/**
* 删除钢卷物料表
* 钢卷发货,将钢卷状态更新为已发货,且更新发货时间
*
* @param coilId 主键
*/
@Log(title = "钢卷物料表", businessType = BusinessType.DELETE)
@DeleteMapping("/exportCoil/{coilId}")
@GetMapping("/exportCoil/{coilId}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable("coilId") Long coilId) {