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

yangwl
A0010407 6 months ago
parent 578fa4c8ab
commit 52a4d6ae63

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

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