添加客户管理
修改入库页面 修改 库存 物料 工序等页面
This commit is contained in:
1 parent
2435176f77
commit
c2b039ea47
41 files changed
+977
-160
No files matched your search
@@ -130,6 +130,10 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
return Json(new { Code = 500, Msg = "物料不存在" });
|
||||
}
|
||||
if (material.Qty == null || material.Qty <= 0)
|
||||
{
|
||||
return Json(new { Code = 500, Msg = "物料毛重没有设置,请设置后再执行入库" });
|
||||
}
|
||||
|
||||
// 获取容器信息
|
||||
var container = _unitWork.FindSingle<Container>(c => c.Code == model.PalletCode);
|
||||
@@ -137,19 +141,24 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
return Json(new { Code = 500, Msg = "容器不存在" });
|
||||
}
|
||||
|
||||
// 从字典查询工序对应的区域
|
||||
var processName = _unitWork.FindSingle<SysDictData>(x => x.DictType == "ProcessZone"
|
||||
&& x.DictLabel == model.ProcessName)?.DictValue;
|
||||
|
||||
if (string.IsNullOrEmpty(processName))
|
||||
var materialProcess = _unitWork.FindSingle<MaterialProcess>(m => m.ID == model.ProcessId);
|
||||
if (materialProcess == null)
|
||||
{
|
||||
return Json(new { Code = 500, Msg = "未找到此工序配置" });
|
||||
}
|
||||
|
||||
// 从字典查询工序对应的区域
|
||||
var zoneName = _unitWork.FindSingle<SysDictData>(x => x.DictType == "ProcessZone"
|
||||
&& x.DictLabel == materialProcess.ProcessCode)?.DictValue;
|
||||
|
||||
if (string.IsNullOrEmpty(zoneName))
|
||||
{
|
||||
return Json(new { Code = 500, Msg = "未找到此工序对应区域配置" });
|
||||
}
|
||||
|
||||
// 1. 查找可用库位信息
|
||||
var locationVm = Wtm.CreateVM<LocationVM>();
|
||||
var locationCode = locationVm.GetEmptyLocationFromXb(_materialZones[processName].BeginLine, _materialZones[processName].EndLine);
|
||||
var locationCode = locationVm.GetEmptyLocationFromXb(_materialZones[zoneName].BeginLine, _materialZones[zoneName].EndLine);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(locationCode))
|
||||
{
|
||||
@@ -187,13 +196,17 @@ namespace HHWMS.Web.Controllers
|
||||
ContainerCode = model.PalletCode,
|
||||
LocationCode = locationCode,
|
||||
MaterialCode = model.MaterialCode,
|
||||
MaterialType = material.MaterialType,
|
||||
MaterialName = material.MaterialName,
|
||||
MaterialSpec = material.MaterialSpec,
|
||||
MaterialUnit = material.MaterialUnit,
|
||||
Batch = model.ProcessName,
|
||||
Lot = model.ProcessId.ToString(),
|
||||
Batch = materialProcess.ProcessName,
|
||||
Lot = materialProcess.ProcessCode,
|
||||
Status = model.IsQualified ? "合格" : "不合格",
|
||||
TaskStatus = InventoryTaskStatusEnum.Locked,
|
||||
TaskQty = model.Qty,
|
||||
CreateBy = model.OperatorId,
|
||||
ReceiptCode = model.OperatorInfo, //校验员
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
|
||||
@@ -236,11 +249,16 @@ namespace HHWMS.Web.Controllers
|
||||
};
|
||||
|
||||
// 调用WCS任务下发接口
|
||||
// tran.Commit();
|
||||
// return Json(new { Code = 200, Msg = "入库成功", Data = new { TaskNo = taskNo } });
|
||||
var wcsResult = Wtm.CallAPI<WCSTaskResponse>("WCSXB", "TaskAssign", HttpMethodEnum.POST, wcsTaskModel).Result.Data;
|
||||
|
||||
if (wcsResult != null && wcsResult.Success)
|
||||
{
|
||||
// WCS任务下发成功,提交事务
|
||||
taskHeader.Status = TaskStatusEnum.已下发;
|
||||
_unitWork.Update(taskHeader);
|
||||
|
||||
tran.Commit();
|
||||
return Json(new { Code = 200, Msg = "入库成功", Data = new { TaskNo = taskNo } });
|
||||
}
|
||||
@@ -387,6 +405,7 @@ namespace HHWMS.Web.Controllers
|
||||
.Select(m => new
|
||||
{
|
||||
MaterialCode = m.MaterialCode,
|
||||
m.MaterialType,
|
||||
MaterialName = m.MaterialName
|
||||
})
|
||||
.Take(10)
|
||||
@@ -411,7 +430,7 @@ namespace HHWMS.Web.Controllers
|
||||
public string OperatorId { get; set; }
|
||||
public int ProcessId { get; set; }
|
||||
public string ProcessName { get; set; }
|
||||
|
||||
public int Qty { get; set; }
|
||||
public bool IsQualified { get; set; }
|
||||
public string OperatorInfo { get; set; }
|
||||
}
|
||||
|
||||
@@ -93,21 +93,41 @@ namespace HHWMS.Web.Controllers
|
||||
|
||||
var materials = _unitWork.Find<Material>(x =>
|
||||
x.MaterialCode.Contains(keyword) ||
|
||||
x.MaterialName.Contains(keyword))
|
||||
x.MaterialType.Contains(keyword))
|
||||
.Take(10)
|
||||
.Select(x => new {
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialName = x.MaterialName,
|
||||
MaterialSpec = x.MaterialSpec,
|
||||
MaterialUnit = x.MaterialUnit
|
||||
x.MaterialCode,
|
||||
x.MaterialName,
|
||||
x.MaterialSpec,
|
||||
x.MaterialUnit,
|
||||
x.MaterialType
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return JsonMore( materials );
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public ActionResult SearchCompanies(string keyword)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(keyword))
|
||||
{
|
||||
return Json(new { Code = 200, Data = new object[] { } });
|
||||
}
|
||||
// 假设公司信息在Company表,字段CompanyCode、CompanyName
|
||||
var companies = DC.Set<Customer>()
|
||||
.Where(x => x.Code.Contains(keyword) || x.Name.Contains(keyword))
|
||||
.Select(x => new {
|
||||
CompanyCode = x.Code,
|
||||
CompanyName = x.Name
|
||||
})
|
||||
.Take(10)
|
||||
.ToList();
|
||||
return Json(new { Code = 200, Data = companies });
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult AddInventory(string containerCode, string materialCode, string company, decimal qty)
|
||||
public ActionResult AddInventory(string containerCode, string materialCode, string company, string sourceCode, decimal qty)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -150,6 +170,8 @@ namespace HHWMS.Web.Controllers
|
||||
MaterialSpec = material.MaterialSpec,
|
||||
MaterialUnit = material.MaterialUnit,
|
||||
CompanyCode = company,
|
||||
SourceCode = sourceCode,
|
||||
SupplierCode = material.SupplierCode,
|
||||
Qty = qty,
|
||||
TaskStatus = InventoryTaskStatusEnum.Locked,
|
||||
CreateTime = DateTime.Now
|
||||
@@ -165,6 +187,9 @@ namespace HHWMS.Web.Controllers
|
||||
MaterialName = material.MaterialName,
|
||||
MaterialUnit = material.MaterialUnit,
|
||||
ContainerCode = containerCode,
|
||||
CompanyCode = inventory.CompanyCode,
|
||||
SourceCode = inventory.SourceCode,
|
||||
SupplierCode = inventory.SupplierCode,
|
||||
Qty = qty,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateBy = "WMS",
|
||||
@@ -225,7 +250,7 @@ namespace HHWMS.Web.Controllers
|
||||
TaskType = TaskTypeEnum.入库,
|
||||
RoadWay = 2,
|
||||
ContainerCode = containerCode,
|
||||
FromLocation = "",
|
||||
FromLocation = "Enter_0000",
|
||||
ToLocation = "",
|
||||
Status = TaskStatusEnum.待下发,
|
||||
CreateTime = DateTime.Now,
|
||||
@@ -238,12 +263,12 @@ namespace HHWMS.Web.Controllers
|
||||
TaskNo = task.TaskNo,
|
||||
PalletNo = task.ContainerCode,
|
||||
FromLocation = task.FromLocation,
|
||||
ToLocation = task.ToLocation
|
||||
ToLocation = "WareCell"
|
||||
};
|
||||
_unitWork.Add(task);
|
||||
|
||||
_unitWork.Update(container);
|
||||
/*try
|
||||
// _unitWork.Add(task);
|
||||
//
|
||||
// _unitWork.Update(container);
|
||||
try
|
||||
{
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCSCP", "TaskAssign", HttpMethodEnum.POST, postData)
|
||||
.Result?.Data;
|
||||
@@ -267,7 +292,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
task.ErrorMsg = ex.Message;
|
||||
return JsonMore(null, 500, "任务下发失败!");
|
||||
}*/
|
||||
}
|
||||
|
||||
return JsonMore(null);
|
||||
}
|
||||
@@ -298,6 +323,9 @@ namespace HHWMS.Web.Controllers
|
||||
MaterialName = inventory.MaterialName,
|
||||
MaterialUnit = inventory.MaterialUnit,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CompanyCode = inventory.CompanyCode,
|
||||
SourceCode = inventory.SourceCode,
|
||||
SupplierCode = inventory.SupplierCode,
|
||||
Qty = inventory.Qty,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateBy = "WMS",
|
||||
@@ -343,6 +371,9 @@ namespace HHWMS.Web.Controllers
|
||||
MaterialName = inventory.MaterialName,
|
||||
MaterialUnit = inventory.MaterialUnit,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CompanyCode = inventory.CompanyCode,
|
||||
SourceCode = inventory.SourceCode,
|
||||
SupplierCode = inventory.SupplierCode,
|
||||
Qty = inventory.Qty,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateBy = "WMS",
|
||||
@@ -359,6 +390,9 @@ namespace HHWMS.Web.Controllers
|
||||
MaterialName = inventory.MaterialName,
|
||||
MaterialUnit = inventory.MaterialUnit,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CompanyCode = inventory.CompanyCode,
|
||||
SourceCode = inventory.SourceCode,
|
||||
SupplierCode = inventory.SupplierCode,
|
||||
Qty = qty,
|
||||
CreateTime = DateTime.Now,
|
||||
CreateBy = "WMS",
|
||||
@@ -419,7 +453,7 @@ namespace HHWMS.Web.Controllers
|
||||
TaskType = TaskTypeEnum.入库,
|
||||
RoadWay = 2,
|
||||
ContainerCode = containerCode,
|
||||
FromLocation = "",
|
||||
FromLocation = "Enter_0000",
|
||||
ToLocation = "",
|
||||
Status = TaskStatusEnum.待下发,
|
||||
CreateTime = DateTime.Now,
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
<a-card class="general-card">
|
||||
<a-form :model="form" :rules="rules" ref="formRef" auto-label-width>
|
||||
<a-form-item label="托盘码" field="palletCode">
|
||||
<a-input v-model="form.palletCode" ref="palletCodeRef" placeholder="请扫描托盘码" @@change="scanPallet" @@keydown.enter="focusNext('materialCodeRef')" />
|
||||
<a-input v-model="form.palletCode" ref="palletCodeRef" placeholder="请扫描托盘码"
|
||||
|
||||
@@keyup.enter="validateContainer" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="物料码" field="materialCode">
|
||||
@@ -19,11 +21,15 @@
|
||||
</a-auto-complete>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="图号" field="name">
|
||||
<a-input v-model="form.name" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="当前工序" field="processId">
|
||||
<a-select v-model="form.processId" placeholder="请选择工序" @@change="processSelect">
|
||||
<a-option v-for="item in processOptions"
|
||||
:key="item.value"
|
||||
:value="item.value">
|
||||
:key="item.value"
|
||||
:value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
@@ -32,6 +38,10 @@
|
||||
<a-form-item label="工序名称" field="processName" v-show="false">
|
||||
<a-input v-model="form.processName" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="qty" label="小托盘数量">
|
||||
<a-input-number v-model="form.qty" :min="0" style="width: 100%" ref="numInput" @@keydown.enter="focusNext('operatorIdRef')"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="是否合格" field="isQualified">
|
||||
<a-switch v-model="form.isQualified" />
|
||||
@@ -69,12 +79,14 @@
|
||||
|
||||
const palletCodeRef = ref(null);
|
||||
const materialCodeRef = ref(null);
|
||||
const numInput = ref(null);
|
||||
const operatorIdRef = ref(null);
|
||||
const operatorInfoRef = ref(null);
|
||||
|
||||
const inputRefs = {
|
||||
palletCodeRef,
|
||||
materialCodeRef,
|
||||
numInput,
|
||||
operatorIdRef,
|
||||
operatorInfoRef
|
||||
};
|
||||
@@ -93,6 +105,8 @@
|
||||
operatorId: '',
|
||||
processId: '',
|
||||
processName:'',
|
||||
name:'',
|
||||
qty:null,
|
||||
isQualified: true,
|
||||
operatorInfo: ''
|
||||
});
|
||||
@@ -107,7 +121,9 @@
|
||||
materialCode: [
|
||||
{ required: true, message: '请输入物料码', trigger: ['change', 'blur'] }
|
||||
],
|
||||
|
||||
qty: [
|
||||
{ required: true, message: '请输入数量', trigger: ['change', 'blur'] }
|
||||
],
|
||||
processId: [
|
||||
{ required: true, message: '请选择工序', trigger: ['change', 'blur'] }
|
||||
],
|
||||
@@ -119,10 +135,29 @@
|
||||
{ required: true, message: '请输入检验员信息', trigger: ['change', 'blur'] }
|
||||
]
|
||||
};
|
||||
|
||||
const validateContainer = (value) => {
|
||||
if (!form.palletCode) return;
|
||||
|
||||
axios.get(`/receipt/SimpleReceiptIn/ValidateContainer?containerCode=${encodeURIComponent(form.palletCode)}`)
|
||||
.then((json) => {
|
||||
if (json.data.Code == 200) {
|
||||
Message.success("容器验证成功");
|
||||
focusNext('materialCodeRef')
|
||||
} else {
|
||||
Message.error(json.data.Msg || "容器验证失败");
|
||||
resetForm();
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
Message.error("容器验证失败");
|
||||
resetForm()
|
||||
});
|
||||
};
|
||||
|
||||
const processSelect = (value) => {
|
||||
form.processName = processOptions.value.find(item => item.value === value).processName;
|
||||
focusNext('operatorIdRef');
|
||||
focusNext('numInput');
|
||||
}
|
||||
|
||||
// 加载工序列表
|
||||
@@ -147,10 +182,11 @@
|
||||
// 根据物料加载工序列表
|
||||
const loadProcessesByMaterial = (materialCode) => {
|
||||
if (!materialCode) {
|
||||
form.processId = '';
|
||||
processOptions.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
processOptions.value = [];
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
@@ -158,7 +194,15 @@
|
||||
url: "/receipt/ReceiptIn/GetProcessesByMaterial",
|
||||
success: (json) => {
|
||||
if (json.Code == 200) {
|
||||
processOptions.value = json.Data;
|
||||
|
||||
const newOptions = json.Data.map(item => ({
|
||||
...item,
|
||||
value: item.value,
|
||||
label: `${item.processCode} - ${item.processName}`
|
||||
}));
|
||||
// 使用新数组赋值,强制组件重新渲染
|
||||
processOptions.value = [...newOptions];
|
||||
|
||||
} else {
|
||||
Message.error(json.Msg || '加载物料工序失败');
|
||||
processOptions.value = [];
|
||||
@@ -192,30 +236,25 @@
|
||||
};
|
||||
|
||||
// 搜索物料
|
||||
|
||||
const searchMaterials = (keyword) => {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { keyword: keyword },
|
||||
url: "/receipt/ReceiptIn/SearchMaterials",
|
||||
success: (json) => {
|
||||
console.log(json);
|
||||
if (json.Code == 200) {
|
||||
materialOptions.value = json.Data.map(item => ({
|
||||
axios.get(`/receipt/SimpleReceiptIn/SearchMaterials?keyword=${encodeURIComponent(keyword)}`)
|
||||
.then(function (json) {
|
||||
if (json.data.Code == 200) {
|
||||
materialOptions.value = json.data.Data.map(item => ({
|
||||
...item,
|
||||
value: item.MaterialCode,
|
||||
label: `${item.MaterialCode} - ${item.MaterialName}`
|
||||
}));console.log(materialOptions.value)
|
||||
label: `${item.MaterialCode} - ${item.MaterialType} - ${item.MaterialName}`
|
||||
}));
|
||||
} else {
|
||||
Message.error(json.Msg || '搜索失败');
|
||||
Message.error(json.data.Msg);
|
||||
materialOptions.value = [];
|
||||
}
|
||||
},
|
||||
error: (xhr, status, error) => {
|
||||
Message.error('搜索失败:' + error);
|
||||
})
|
||||
.catch(function (error) {
|
||||
Message.error(error);
|
||||
materialOptions.value = [];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 处理物料选择
|
||||
@@ -223,8 +262,19 @@
|
||||
const selectedMaterial = materialOptions.value.find(item => item.value === value);
|
||||
if (selectedMaterial) {
|
||||
form.materialCode = selectedMaterial.MaterialCode;
|
||||
form.name = selectedMaterial.MaterialType;
|
||||
// 选择物料后加载相关工序
|
||||
loadProcessesByMaterial(selectedMaterial.MaterialCode);
|
||||
// 先清空当前工序选择,避免显示旧数据
|
||||
form.processId = '';
|
||||
form.processName = '';
|
||||
|
||||
// 清除现有工序选项,触发重新渲染
|
||||
processOptions.value = [];
|
||||
|
||||
// 延迟加载新工序,确保先清空再加载
|
||||
nextTick(() => {
|
||||
loadProcessesByMaterial(selectedMaterial.MaterialCode);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -337,6 +387,7 @@
|
||||
processOptions,
|
||||
rules,
|
||||
scanPallet,
|
||||
validateContainer,
|
||||
scanMaterial,
|
||||
submitForm,
|
||||
submitEmptyPallet,
|
||||
@@ -346,6 +397,7 @@
|
||||
handleMaterialSelect,
|
||||
palletCodeRef,
|
||||
materialCodeRef,
|
||||
numInput,
|
||||
operatorIdRef,
|
||||
operatorInfoRef,
|
||||
focusNext,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div id="receiptin">
|
||||
<a-space direction="vertical" fill>
|
||||
<a-form :model="formData" layout="horizontal" :label-col="{ style: { width: '100px' } }" :wrapper-col="{ style: { width: '220px' } }">
|
||||
<a-form-item field="containerCode" label="容器编码">
|
||||
<a-form-item field="containerCode" label="托盘号">
|
||||
<a-input
|
||||
v-model="ContainerCode"
|
||||
placeholder="扫描箱号"
|
||||
placeholder="扫描托盘号"
|
||||
allow-clear
|
||||
@@keyup.enter="validateContainer"
|
||||
ref="containerInput"/>
|
||||
@@ -15,21 +15,33 @@
|
||||
:data="materialOptions"
|
||||
@@search="handleSearch"
|
||||
@@select="handleSelect"
|
||||
placeholder="输入物料编码或名称"
|
||||
placeholder="输入物料编码或图号"
|
||||
ref="materialInput">
|
||||
</a-auto-complete>
|
||||
</a-form-item>
|
||||
<a-form-item field="materialName" label="物料名称">
|
||||
<a-input v-model="MaterialName" disabled/>
|
||||
<a-form-item field="materialName" label="图号">
|
||||
<a-input v-model="MaterialName"/>
|
||||
</a-form-item>
|
||||
<a-form-item field="materialSpec" label="物料型号">
|
||||
<a-input v-model="MaterialSpec" disabled/>
|
||||
@* <a-form-item field="materialSpec" label="物料型号"> *@
|
||||
@* <a-input v-model="MaterialSpec" disabled/> *@
|
||||
@* </a-form-item> *@
|
||||
<a-form-item field="sourceCode" label="订单号">
|
||||
<a-input v-model="SourceCode" placeholder="输入订单号" ref="sourceCodeInput" @@keydown.enter="this.$nextTick(() => {
|
||||
this.$refs.companyCodeInput.focus();
|
||||
});"/>
|
||||
</a-form-item>
|
||||
<a-form-item field="company" label="公司">
|
||||
<a-input v-model="Company" placeholder="输入公司"/>
|
||||
<a-form-item field="companyCode" label="公司">
|
||||
<a-auto-complete
|
||||
v-model="CompanyCode"
|
||||
:data="companyOptions"
|
||||
@@search="handleCompanySearch"
|
||||
@@select="handleCompanySelect"
|
||||
placeholder="输入公司名称或编码"
|
||||
ref="companyCodeInput">
|
||||
</a-auto-complete>
|
||||
</a-form-item>
|
||||
<a-form-item field="qty" label="数量">
|
||||
<a-input-number v-model="Qty" :min="0" style="width: 100%"/>
|
||||
<a-input-number v-model="Qty" :min="0" style="width: 100%" ref="numInput" @@keydown.enter="this.handleBind()"/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
@@ -46,7 +58,7 @@
|
||||
<a-space>
|
||||
<a-button type="text" status="danger" @@click="handleDelete(record)">删除</a-button>
|
||||
<a-button type="text" @@click="handleEdit(record)">修改</a-button>
|
||||
@* <a-button type="text" @@click="handleDeduct(record)">扣料</a-button> *@
|
||||
<a-button type="text" @@click="handleDeduct(record)">扣料</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #qty="{ record }">
|
||||
@@ -77,6 +89,7 @@
|
||||
<a-radio-group v-model="outForm.level">
|
||||
<a-radio value="high">高货位</a-radio>
|
||||
<a-radio value="low">低货位</a-radio>
|
||||
<a-radio value="mid">模具库</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="出库口">
|
||||
@@ -98,7 +111,8 @@
|
||||
MaterialCode: '',
|
||||
MaterialName: '',
|
||||
MaterialSpec: '',
|
||||
Company: '',
|
||||
SourceCode: '',
|
||||
CompanyCode: '',
|
||||
Qty: null,
|
||||
loading1: false,
|
||||
materialOptions: [],
|
||||
@@ -150,9 +164,13 @@
|
||||
title: '物料型号',
|
||||
dataIndex: 'MaterialSpec',
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'SourceCode',
|
||||
},
|
||||
{
|
||||
title: '公司',
|
||||
dataIndex: 'Company',
|
||||
dataIndex: 'CompanyCode',
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
@@ -169,10 +187,13 @@
|
||||
containerCode: '',
|
||||
materialCode: '',
|
||||
materialName: '',
|
||||
materialSpec: '',
|
||||
company: '',
|
||||
materialSpec: '',
|
||||
sourceCode: '',
|
||||
companyCode: '',
|
||||
qty: 1
|
||||
}
|
||||
},
|
||||
companyOptions: [],
|
||||
companySearchTimer: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -203,7 +224,7 @@
|
||||
_this.materialOptions = json.data.Data.map(item => ({
|
||||
...item,
|
||||
value: item.MaterialCode,
|
||||
label: `${item.MaterialCode} - ${item.MaterialName} - ${item.MaterialSpec}`
|
||||
label: `${item.MaterialCode} - ${item.MaterialType} - ${item.MaterialName}`
|
||||
}));
|
||||
} else {
|
||||
_this.$message.error(json.data.Msg);
|
||||
@@ -220,9 +241,13 @@
|
||||
const selectedMaterial = this.materialOptions.find(item => item.value === value);
|
||||
if (selectedMaterial) {
|
||||
this.MaterialCode = selectedMaterial.MaterialCode;
|
||||
this.MaterialName = selectedMaterial.MaterialName;
|
||||
this.MaterialName = selectedMaterial.MaterialType;
|
||||
this.MaterialSpec = selectedMaterial.MaterialSpec;
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.sourceCodeInput.focus();
|
||||
});
|
||||
},
|
||||
|
||||
handleBind() {
|
||||
@@ -254,7 +279,8 @@
|
||||
MaterialCode: this.MaterialCode,
|
||||
MaterialName: this.MaterialName,
|
||||
MaterialSpec: this.MaterialSpec,
|
||||
Company: this.Company,
|
||||
SourceCode: this.SourceCode,
|
||||
CompanyCode: this.CompanyCode,
|
||||
Qty: this.Qty
|
||||
};
|
||||
|
||||
@@ -262,7 +288,8 @@
|
||||
let postData = new URLSearchParams();
|
||||
postData.append('containerCode', this.ContainerCode);
|
||||
postData.append('materialCode', this.MaterialCode);
|
||||
postData.append('company', this.Company);
|
||||
postData.append('company', this.CompanyCode);
|
||||
postData.append('sourceCode', this.SourceCode);
|
||||
postData.append('qty', this.Qty);
|
||||
|
||||
axios.post("/receipt/SimpleReceiptIn/AddInventory", postData)
|
||||
@@ -276,7 +303,8 @@
|
||||
this.MaterialCode = '';
|
||||
this.MaterialName = '';
|
||||
this.MaterialSpec = '';
|
||||
this.Company = '';
|
||||
this.SourceCode = '';
|
||||
this.CompanyCode = '';
|
||||
this.Qty = null;
|
||||
// 验证成功后,将焦点设置到物料编码输入框
|
||||
this.$nextTick(() => {
|
||||
@@ -309,7 +337,8 @@
|
||||
this.MaterialCode = '';
|
||||
this.MaterialName = '';
|
||||
this.MaterialSpec = '';
|
||||
this.Company = '';
|
||||
this.SourceCode = '';
|
||||
this.CompanyCode = '';
|
||||
this.Qty = 1;
|
||||
this.bindList = [];
|
||||
this.$notification.success("入库任务创建成功!");
|
||||
@@ -498,7 +527,7 @@
|
||||
this.MaterialCode = '';
|
||||
this.MaterialName = '';
|
||||
this.MaterialSpec = '';
|
||||
this.Company = '';
|
||||
this.CompanyCode = '';
|
||||
this.Qty = 1;
|
||||
this.bindList = [];
|
||||
this.$notification.success("空托入库成功!");
|
||||
@@ -546,8 +575,9 @@
|
||||
this.MaterialCode = '';
|
||||
this.MaterialName = '';
|
||||
this.MaterialSpec = '';
|
||||
this.Company = '';
|
||||
this.Qty = 1;
|
||||
this.SourceCode = '';
|
||||
this.CompanyCode = '';
|
||||
this.Qty = '';
|
||||
this.bindList = [];
|
||||
this.outModalVisible = false;
|
||||
this.$notification.success("呼叫出库成功!");
|
||||
@@ -570,6 +600,47 @@
|
||||
},
|
||||
handleOutCancel() {
|
||||
this.outModalVisible = false;
|
||||
},
|
||||
handleCompanySearch(value) {
|
||||
if (this.companySearchTimer) {
|
||||
clearTimeout(this.companySearchTimer);
|
||||
}
|
||||
this.companySearchTimer = setTimeout(() => {
|
||||
if (value) {
|
||||
this.searchCompanies(value);
|
||||
} else {
|
||||
this.companyOptions = [];
|
||||
}
|
||||
}, 300);
|
||||
},
|
||||
searchCompanies(keyword) {
|
||||
var _this = this;
|
||||
axios.get(`/receipt/SimpleReceiptIn/SearchCompanies?keyword=${encodeURIComponent(keyword)}`)
|
||||
.then(function (json) {
|
||||
if (json.data.Code == 200) {
|
||||
_this.companyOptions = json.data.Data.map(item => ({
|
||||
...item,
|
||||
value: item.CompanyName,
|
||||
label: `${item.CompanyCode} - ${item.CompanyName}`
|
||||
}));
|
||||
} else {
|
||||
_this.$message.error(json.data.Msg);
|
||||
_this.companyOptions = [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
_this.$message.error(error);
|
||||
_this.companyOptions = [];
|
||||
});
|
||||
},
|
||||
handleCompanySelect(value, option) {
|
||||
const selectedCompany = this.companyOptions.find(item => item.value === value);
|
||||
if (selectedCompany) {
|
||||
this.CompanyCode = selectedCompany.CompanyName;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.numInput.focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user