2024-06-1 设备-备品备件相关逻辑

yangwl
A0010407 5 months ago
parent 578fa4c8ab
commit 52a4d6ae63

@ -9,6 +9,22 @@
v-show="showSearch"
label-width="98px"
>
<el-form-item label="备件申领单号" prop="applyCode">
<el-input
v-model="queryParams.applyCode"
placeholder="请输入备件申领单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="关联工单号" prop="workCode">
<el-input
v-model="queryParams.workCode"
placeholder="请输入关联工单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备品备件编码" prop="spareCode">
<el-input
v-model="queryParams.spareCode"
@ -25,6 +41,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="使用设备" prop="spareUseEquipment">
<el-input
v-model="queryParams.spareUseEquipment"
placeholder="请输入使用设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格型号" prop="spareModel">
<el-input
v-model="queryParams.spareModel"
@ -33,10 +57,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数量" prop="spareQuantity">
<el-form-item label="领用数量" prop="spareQuantity">
<el-input
v-model="queryParams.spareQuantity"
placeholder="请输入数量"
placeholder="请输入领用数量"
clearable
@keyup.enter.native="handleQuery"
/>
@ -49,14 +73,6 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="使用设备" prop="spareUseEquipment">
<el-input
v-model="queryParams.spareUseEquipment"
placeholder="请输入使用设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申领人" prop="applyPeople">
<el-input
v-model="queryParams.applyPeople"
@ -219,6 +235,12 @@
width="100"
/>
<!-- <el-table-column label="使用组线" align="center" prop="spareGroupLine" /> -->
<el-table-column
label="申领人"
align="center"
prop="applyPeople"
width="80"
/>
<el-table-column
label="领用时间"
align="center"
@ -229,12 +251,6 @@
<span>{{ parseTime(scope.row.applyTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="申领人"
align="center"
prop="applyPeople"
width="80"
/>
<!-- <el-table-column label="批准人" align="center" prop="applyApprovePeople" width="80"/> -->
<el-table-column
v-if="false"
@ -462,6 +478,7 @@ export default {
attr3: null,
factoryCode: null,
applyTimeArray: [],
workCode: null,
},
//
pickerOptions: {
@ -527,6 +544,7 @@ export default {
},
//
onItemSelectedSparePartsLedger(obj) {
this.form.storageId = obj[0].storageId;
this.form.spareCode = obj[0].materialCode;
this.form.spareName = obj[0].materialDesc;
this.form.spareModel = obj[0].spareMode;
@ -632,6 +650,7 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
console.log("this.form",this.form);
if (this.form.applyId != null) {
updateSparePartsApplicationRecord(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
@ -639,6 +658,7 @@ export default {
this.getList();
});
} else {
console.log("this.form",this.form);
if (
this.form.amount - this.form.storageAmount <
this.form.spareQuantity

@ -76,38 +76,41 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['device:sparePartsLedger:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:sparePartsLedger:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:sparePartsLedger:remove']"
>删除</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['device:sparePartsLedger:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['device:sparePartsLedger:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['device:sparePartsLedger:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -128,32 +131,111 @@
<el-table
v-loading="loading"
:data="sparePartsLedgerList"
@selection-change="handleSelectionChange"
>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"/>
<el-table-column type="selection" width="55" align="center" />
<!-- 序号 -->
<el-table-column
type="index"
width="90"
align="center"
:index="indexMethod"
label="序号"
/>
<!-- 缺了所属设备编码设备数量所在产线 -->
<el-table-column label="备品备件号" align="center" prop="materialCode" width="120"/>
<el-table-column label="备品备件名称" align="center" prop="materialDesc" width="120"/>
<el-table-column label="所属设备名称" align="center" prop="ownEquipmentName" width="120"/>
<el-table-column
label="备品备件号"
align="center"
prop="materialCode"
width="120"
/>
<el-table-column
label="备品备件名称"
align="center"
prop="materialDesc"
width="120"
/>
<el-table-column
label="所属设备名称"
align="center"
prop="ownEquipmentName"
width="120"
/>
<!-- 供应商字段里 设备厂家 -->
<el-table-column label="设备厂家" align="center" prop="spareSupplier" width="200"/>
<el-table-column label="规格型号" align="center" prop="spareMode" width="200"/>
<el-table-column label="单机装配数量" align="center" prop="unitQuantity" width="100"/>
<el-table-column label="单价" align="center" prop="unitPrice" width="80"/>
<el-table-column label="单位" align="center" prop="userDefined1" width="80"/>
<el-table-column label="代用件" align="center" prop="substituteParts" width="80"/>
<el-table-column label="安全库存" align="center" prop="safeStock" width="80"/>
<el-table-column label="现有库存" align="center" prop="amount" width="80"/>
<el-table-column label="采购方式" align="center" prop="procurementMethod" width="150"/>
<el-table-column
label="设备厂家"
align="center"
prop="spareSupplier"
width="200"
/>
<el-table-column
label="规格型号"
align="center"
prop="spareMode"
width="200"
/>
<el-table-column
label="单机装配数量"
align="center"
prop="unitQuantity"
width="100"
/>
<el-table-column
label="单价"
align="center"
prop="unitPrice"
width="80"
/>
<el-table-column
label="单位"
align="center"
prop="userDefined1"
width="80"
/>
<el-table-column
label="代用件"
align="center"
prop="substituteParts"
width="80"
/>
<el-table-column
label="安全库存"
align="center"
prop="safeStock"
width="80"
/>
<el-table-column
label="现有库存"
align="center"
prop="amount"
width="80"
/>
<el-table-column
label="采购方式"
align="center"
prop="procurementMethod"
width="150"
/>
<!-- 生产厂商暂时没有用 -->
<!-- <el-table-column label="生产厂商" align="center" prop="spareManufacturer" width="200"/> -->
<el-table-column label="更换周期(月)" align="center" prop="spareReplacementCycle" width="120"/>
<el-table-column label="采购周期(天)" align="center" prop="procurementCycle" width="120"/>
<el-table-column label="期初结存" align="center" prop="openingBalance"/>
<el-table-column label="入库记录" align="center" prop="inputRecords"/>
<el-table-column label="出库记录" align="center" prop="outputRecords"/>
<el-table-column label="期末盘点" align="center" prop="endInventory"/>
<el-table-column label="期末金额" align="center" prop="endMoney"/>
<el-table-column
label="更换周期(月)"
align="center"
prop="spareReplacementCycle"
width="120"
/>
<el-table-column
label="采购周期(天)"
align="center"
prop="procurementCycle"
width="120"
/>
<el-table-column label="期初结存" align="center" prop="openingBalance" />
<el-table-column label="入库记录" align="center" prop="inputRecords" />
<el-table-column label="出库记录" align="center" prop="outputRecords" />
<el-table-column label="期末盘点" align="center" prop="endInventory" />
<el-table-column label="期末金额" align="center" prop="endMoney" />
<!-- <el-table-column
label="备品备件类型"
align="center"
@ -192,13 +274,28 @@
prop="factoryCode"
/> -->
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="gmtCreate" width="180">
<el-table-column
label="创建时间"
align="center"
prop="gmtCreate"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtCreate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="最后更新人" align="center" prop="lastModifiedBy" width="100"/>
<el-table-column label="最后更新时间" align="center" prop="gmtModified" width="200">
<el-table-column
label="最后更新人"
align="center"
prop="lastModifiedBy"
width="100"
/>
<el-table-column
label="最后更新时间"
align="center"
prop="gmtModified"
width="200"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.gmtModified, "{y}-{m}-{d}") }}</span>
</template>
@ -232,9 +329,10 @@
/>
<!-- 添加或修改备品备件台账管理对话框 -->
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="唯一序列" prop="storageId">
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<!--
<el-form-item label="唯一序列" prop="storageId">
<el-input v-model="form.storageId" placeholder="请输入唯一序列" />
</el-form-item>
<el-form-item label="仓库编码" prop="whCode">
@ -254,14 +352,9 @@
</el-form-item>
<el-form-item label="物料描述" prop="materialDesc">
<el-input v-model="form.materialDesc" placeholder="请输入物料描述" />
</el-form-item>
<el-form-item label="总数量" prop="amount">
<el-input v-model="form.amount" placeholder="请输入总数量" />
</el-form-item>
<el-form-item label="冻结数量" prop="storageAmount">
<el-input v-model="form.storageAmount" placeholder="请输入冻结数量" />
</el-form-item>
<el-form-item label="占用数量" prop="occupyAmount">
</el-form-item>
-->
<!-- <el-form-item label="占用数量" prop="occupyAmount">
<el-input v-model="form.occupyAmount" placeholder="请输入占用数量" />
</el-form-item>
<el-form-item label="LPN" prop="lpn">
@ -286,9 +379,6 @@
placeholder="请选择生产时间">
</el-date-picker>
</el-form-item>
<el-form-item label="单位" prop="userDefined1">
<el-input v-model="form.userDefined1" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="SAP库位" prop="userDefined2">
<el-input v-model="form.userDefined2" placeholder="请输入SAP库位" />
</el-form-item>
@ -349,25 +439,212 @@
</el-form-item>
<el-form-item label="0存在" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入0存在" />
</el-form-item>
<el-form-item label="使用寿命" prop="spareUseLife">
<el-input v-model="form.spareUseLife" placeholder="请输入使用寿命" />
</el-form-item>
<el-form-item label="备件名称" prop="spareName">
</el-form-item> -->
<el-row :gutter="10" class="mb8">
<el-col :span="12">
<el-form-item label="备件编码" prop="materialCode">
<el-input
v-model="form.materialCode"
placeholder="请输入备件编码"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备件名称" prop="materialDesc">
<el-input
v-model="form.materialDesc"
placeholder="请输入备件名称"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属设备编码" prop="ownEquipmentCode">
<el-input
v-model="form.ownEquipmentCode"
placeholder="请输入所属设备编码"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属设备名称" prop="ownEquipmentName">
<el-input
v-model="form.ownEquipmentName"
placeholder="请输入所属设备名称"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- 原来的供应商 现在的设备厂商-->
<el-form-item label="设备厂商" prop="spareSupplier">
<el-input
v-model="form.spareSupplier"
placeholder="请输入设备厂商"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="spareMode">
<el-input
v-model="form.spareMode"
placeholder="请输入规格型号"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-form-item label="备件名称" prop="spareName">
<el-input v-model="form.spareName" placeholder="请输入备件名称" />
</el-form-item>
<el-form-item label="规格型号" prop="spareMode">
<el-input v-model="form.spareMode" placeholder="请输入规格型号" />
</el-form-item>
<el-form-item label="生产厂商" prop="spareManufacturer">
</el-form-item> -->
<!-- <el-form-item label="生产厂商" prop="spareManufacturer">
<el-input v-model="form.spareManufacturer" placeholder="请输入生产厂商" />
</el-form-item>
<el-form-item label="供应商" prop="spareSupplier">
</el-form-item> -->
<!-- <el-form-item label="供应商" prop="spareSupplier">
<el-input v-model="form.spareSupplier" placeholder="请输入供应商" />
</el-form-item> -->
<el-form-item label="单机装配数量" prop="unitQuantity">
<el-input
v-model="form.unitQuantity"
placeholder="请输入单机装配数量"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单价" prop="unitPrice">
<el-input-number
:min="0"
:step="1"
v-model="form.unitPrice"
placeholder="请输入单价"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="userDefined1">
<el-input
v-model="form.userDefined1"
placeholder="请输入单位"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="代用件" prop="substituteParts">
<el-input
v-model="form.substituteParts"
placeholder="请输入代用件"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="现有库存" prop="amount">
<el-input-number
:min="0"
:step="1"
v-model="form.amount"
placeholder="请输入现有库存"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全库存" prop="safeStock">
<el-input
v-model="form.safeStock"
placeholder="请输入安全库存"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购方式" prop="procurementMethod">
<el-input
v-model="form.procurementMethod"
placeholder="请输入采购方式"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="更换周期(月)" prop="spareReplacementCycle">
<el-input
v-model="form.spareReplacementCycle"
placeholder="请输入更换周期"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购周期(天)" prop="procurementCycle">
<el-input
v-model="form.procurementCycle"
placeholder="请输入采购周期"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="期初结存" prop="openingBalance">
<el-input
v-model="form.openingBalance"
placeholder="请输入期初结存"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库记录" prop="inputRecords">
<el-input
v-model="form.inputRecords"
placeholder="请输入入库记录"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库记录" prop="outputRecords">
<el-input
v-model="form.outputRecords"
placeholder="请输入出库记录"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="期末盘点" prop="endInventory">
<el-input
v-model="form.endInventory"
placeholder="请输入期末盘点"
style="width: 250px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="期末金额" prop="endMoney">
<el-input-number
:min="0"
:step="1"
v-model="form.endMoney"
placeholder="请输入期末金额"
style="width: 250px"
/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="使用寿命" prop="spareUseLife">
<el-input v-model="form.spareUseLife" placeholder="请输入使用寿命" />
</el-form-item>
<el-form-item label="循环周期" prop="spareReplacementCycle">
<el-form-item label="循环周期" prop="spareReplacementCycle">
<el-input v-model="form.spareReplacementCycle" placeholder="请输入循环周期" />
</el-form-item>
</el-form-item> -->
<!--
<el-form-item label="计量单位" prop="spareMeasurementUnit">
<el-input v-model="form.spareMeasurementUnit" placeholder="请输入计量单位" />
</el-form-item>
@ -382,13 +659,13 @@
</el-form-item>
<el-form-item label="库存下限" prop="spareInventoryUpper">
<el-input v-model="form.spareInventoryUpper" placeholder="请输入库存下限" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog> -->
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -470,7 +747,9 @@ export default {
spareConversionRatio: null,
spareInventoryFloor: null,
spareInventoryUpper: null,
ownEquipmentName : null,
ownEquipmentName: null,
ownEquipmentCode: null,
unitPrice: null,
},
options: [
{
@ -562,6 +841,7 @@ export default {
spareConversionRatio: null,
spareInventoryFloor: null,
spareInventoryUpper: null,
unitPrice: null,
};
this.resetForm("form");
},
@ -601,6 +881,7 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.spareName = this.form.materialDesc;
if (this.form.storageId != null) {
updateSparePartsLedger(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
@ -643,7 +924,6 @@ export default {
`sparePartsLedger_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
</script>
Loading…
Cancel
Save