Merge branch '0.8.X' of https://gitee.com/hdka/klp-oa into 0.8.X

This commit is contained in:
砂糖
2026-01-16 10:49:23 +08:00
10 changed files with 361 additions and 108 deletions

View File

@@ -237,7 +237,7 @@
</el-dialog>
<el-dialog title="钢卷信息修正" :visible.sync="correctVisible" width="600px">
<el-form ref="form" :model="form" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="入场钢卷号" prop="enterCoilNo">
<el-input v-model="form.enterCoilNo" placeholder="请输入入场钢卷号" :disabled="form.coilId" />
</el-form-item>
@@ -284,7 +284,8 @@
<el-option label="C+" value="C+" />
<el-option label="C" value="C" />
<el-option label="C-" value="C-" /> -->
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
@@ -339,9 +340,9 @@
</template>
<script>
import { listMaterialCoil, updateMaterialCoilSimple } from '@/api/wms/coil'
import { listMaterialCoil, updateMaterialCoilSimple, checkCoilNo } from '@/api/wms/coil'
import { listUser } from '@/api/system/user'
import { listPendingAction, startProcess, cancelAction, delPendingAction, addPendingAction } from '@/api/wms/pendingAction'
import { listPendingAction, startProcess, cancelAction, delPendingAction } from '@/api/wms/pendingAction'
import { parseTime } from '@/utils/klp'
import ProductInfo from '@/components/KLPService/Renderer/ProductInfo'
import RawMaterialInfo from '@/components/KLPService/Renderer/RawMaterialInfo'
@@ -417,6 +418,77 @@ export default {
degree: null,
remark: null
},
// 表单校验
rules: {
planId: [
{ required: true, message: "请选择收货计划", trigger: "change" }
],
enterCoilNo: [
{ required: true, message: "入场钢卷号不能为空", trigger: "blur" },
// 自定义校验必须是8位的阿拉伯数字
{
validator: (rule, value, callback) => {
if (!/^\d{8}$/.test(value)) {
callback(new Error('入场钢卷号必须是8位的阿拉伯数字'));
} else {
callback();
}
}, trigger: 'blur'
},
{
validator: (rule, value, callback) => {
if (this.form.coilId) {
// 新增时触发校验
console.log('新增时触发校验');
callback();
} else {
checkCoilNo({ enterCoilNo: value }).then(res => {
const { duplicateType } = res.data;
if (duplicateType === 'enter' || duplicateType === 'both') {
// alert('入场钢卷号重复,请重新输入');
callback(new Error('入场钢卷号重复,请重新输入'));
} else {
callback();
}
})
}
}, trigger: 'blur'
},
],
currentCoilNo: [
{ required: true, message: "当前钢卷号不能为空", trigger: "blur" },
// 远程校验,当前钢卷号不能重复
{
validator: (rule, value, callback) => {
checkCoilNo({ currentCoilNo: value, coilId: this.form.coilId }).then(res => {
const { duplicateType } = res.data;
if (duplicateType === 'current' || duplicateType === 'both') {
// alert('当前钢卷号重复,请重新输入');
callback(new Error('当前钢卷号重复,请重新输入'));
} else {
callback();
}
})
}, trigger: 'blur'
},
],
materialType: [
{ required: true, message: "材料类型不能为空", trigger: "change" }
],
itemId: [
{ required: true, message: "物品ID不能为空", trigger: "blur" }
],
itemType: [
{ required: true, message: "物品类型不能为空", trigger: "change" }
],
// 净重和毛重
netWeight: [
{ required: true, message: "净重不能为空", trigger: "blur" }
],
grossWeight: [
{ required: true, message: "毛重不能为空", trigger: "blur" }
],
},
form: {},
correctVisible: false,
buttonLoading: false,
@@ -433,7 +505,7 @@ export default {
})
return acidAction ? parseInt(acidAction.value) : null
},
// 动态显示标签
// 动态显示标签
getItemLabel() {
if (this.form.materialType === '成品') {
return '产品类型';
@@ -555,36 +627,6 @@ export default {
this.materialQueryParams.currentCoilNo = null
this.handleMaterialQuery()
},
/** 领料操作 */
handlePickMaterial(row) {
if (!this.acidRollingActionType) {
this.$message.error(`未找到${this.label}操作类型,请检查字典配置`)
return
}
this.$set(row, 'picking', true)
const pendingData = {
coilId: row.coilId,
currentCoilNo: row.currentCoilNo,
actionType: this.acidRollingActionType,
actionStatus: 0, // 待处理
sourceType: 'manual', // 手动创建
warehouseId: row.warehouseId,
priority: 0, // 默认普通优先级
remark: `PC端领料创建-${this.label}`
}
this.$modal.confirm(`是否确认从${row.warehouseName || '仓库'}领料${row.currentCoilNo || '物料'}`).then(() => {
// 用户点击确认后执行的操作
return addPendingAction(pendingData)
}).then(response => {
this.$message.success('领料成功,已创建待操作任务')
this.getPendingAction() // 刷新待操作列表
}).finally(() => {
this.$set(row, 'picking', false)
})
},
// ========== 待操作列表相关方法 ==========
/** 查询待操作列表 */
@@ -612,15 +654,6 @@ export default {
this.actionLoading = false
})
},
/** 待操作搜索 */
handleActionQuery() {
this.actionQueryParams.pageNum = 1
// 确保始终使用酸连轧工序的 actionType
if (this.acidRollingActionType) {
this.actionQueryParams.actionType = this.acidRollingActionType
}
this.getPendingAction()
},
handleCorrectMaterial(row) {
this.form = {
...row,
@@ -632,26 +665,20 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.buttonLoading = true;
updateMaterialCoilSimple(this.form).then(_ => {
this.$modal.msgSuccess("修正成功");
this.correctVisible = false;
this.getMaterialCoil();
}).finally(() => {
this.buttonLoading = false;
});
},
/** 重置待操作搜索 */
resetActionQuery() {
this.resetForm('actionQueryForm')
this.actionQueryParams.currentCoilNo = null
this.actionQueryParams.actionStatus = null
// 确保始终使用酸连轧工序的 actionType
if (this.acidRollingActionType) {
this.actionQueryParams.actionType = this.acidRollingActionType
}
this.handleActionQuery()
this.$refs['form'].validate(valid => {
if (!valid) {
this.$message.error('请填写完整信息')
return
}
this.buttonLoading = true;
updateMaterialCoilSimple(this.form).then(_ => {
this.$modal.msgSuccess("修正成功");
this.correctVisible = false;
this.getMaterialCoil();
}).finally(() => {
this.buttonLoading = false;
});
})
},
/** 处理操作 - 跳转到对应页面 */
handleProcess(row) {

View File

@@ -438,7 +438,7 @@ export default {
// 远程校验,当前钢卷号不能重复
{
validator: (rule, value, callback) => {
checkCoilNo({ currentCoilNo: value }).then(res => {
checkCoilNo({ currentCoilNo: value, coilId: this.form.coilId }).then(res => {
const { duplicateType } = res.data;
if (duplicateType === 'current' || duplicateType === 'both') {
// alert('当前钢卷号重复,请重新输入');