|
|
|
@ -675,8 +675,57 @@
|
|
|
|
|
width="50%"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<el-tabs type="border-card">
|
|
|
|
|
<el-tab-pane label="备件选择">
|
|
|
|
|
<!-- 备件申领 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col class="my-step-mar" :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="choseSpareBtn">
|
|
|
|
|
选择备件
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table
|
|
|
|
|
border
|
|
|
|
|
:data="chooseSpareList"
|
|
|
|
|
v-loading="spareLoading"
|
|
|
|
|
stripe
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="materialCode"
|
|
|
|
|
label="备件号">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="materialDesc"
|
|
|
|
|
label="备件名称">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="spareType"
|
|
|
|
|
label="备件类型">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="applyNum"
|
|
|
|
|
label="领用数量">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
fixed="right"
|
|
|
|
|
label="操作"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="delSpareList(scope.row)" type="text" size="small">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<!-- 选择备件 -->
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="选择备件"
|
|
|
|
|
:visible.sync="selectSpareDialog"
|
|
|
|
|
width="60%"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<el-form :model="spareQuery" ref="queryBPForm" size="small" :inline="true" v-show="showSearch"
|
|
|
|
|
label-width="68px">
|
|
|
|
|
<el-form-item label="备件编码">
|
|
|
|
@ -712,7 +761,7 @@
|
|
|
|
|
stripe
|
|
|
|
|
@selection-change="selectChangeSpare"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column v-if="false" type="selection" width="55" align="center"/>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="materialCode"
|
|
|
|
|
label="备件号">
|
|
|
|
@ -730,12 +779,14 @@
|
|
|
|
|
label="库存数量">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
width="150"
|
|
|
|
|
fixed="right"
|
|
|
|
|
label="操作"
|
|
|
|
|
>
|
|
|
|
|
prop="storageAmount"
|
|
|
|
|
label="冻结数量">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="applyNum"
|
|
|
|
|
label="领用数量">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="addSpareList(scope.row)" type="text" size="small">添加</el-button>
|
|
|
|
|
<el-input size="small" v-model="scope.row.applyNum" @change="handleEdit(scope.$index,scope.row)"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -749,81 +800,10 @@
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="spareDialog = false">取 消</el-button>
|
|
|
|
|
<el-button @click="selectSpareDialog = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmSelectSpareBtn">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="备件数量">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col class="my-step-mar" :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="applyNumDialog = true , applyNum = null">
|
|
|
|
|
领用数量
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="chooseSpareList"
|
|
|
|
|
v-loading="spareLoading"
|
|
|
|
|
stripe
|
|
|
|
|
@selection-change="selectChangeSpare"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="materialCode"
|
|
|
|
|
label="备件号">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="materialDesc"
|
|
|
|
|
label="备件名称">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="spareType"
|
|
|
|
|
label="备件类型">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="amount"
|
|
|
|
|
label="库存数量">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="applyNum"
|
|
|
|
|
label="领用数量">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input size="small" v-model="scope.row.applyNum" @change="handleEdit(scope.$index,scope.row)"></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
width="150"
|
|
|
|
|
fixed="right"
|
|
|
|
|
label="操作"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="delSpareList(scope.row)" type="text" size="small">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="申领数量"
|
|
|
|
|
:visible.sync="applyNumDialog"
|
|
|
|
|
width="30%"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8" :offset="7">
|
|
|
|
|
<el-input-number v-model="applyNum" @change="changeApplySpareNum" :min="1" label="描述文字"></el-input-number>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button v-if="false" @click="applyNumDialog = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="applyNumDialog = false">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-button type="primary" class="dialog-footer" @click="spareChangeCom">完成</el-button>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
@ -895,13 +875,25 @@ import {
|
|
|
|
|
updateUpkeepPlan,
|
|
|
|
|
formatEquItem, setSpareList, querySpareList
|
|
|
|
|
} from "@/api/device/upkeepPlan";
|
|
|
|
|
import {delPlan, getEquList, getPersonList, getWorkCenter, initUpdatePlanInfo, listPlan} from "@/api/device/plan";
|
|
|
|
|
import {
|
|
|
|
|
addPlan,
|
|
|
|
|
delPlan,
|
|
|
|
|
getEquList,
|
|
|
|
|
getPersonList,
|
|
|
|
|
getWorkCenter,
|
|
|
|
|
initUpdatePlanInfo,
|
|
|
|
|
listPlan, updatePlan
|
|
|
|
|
} from "@/api/device/plan";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "UpkeepPlan",
|
|
|
|
|
dicts: ['device_loop_type', 'sys_normal_disable','device_upkeep_type'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 备件选择list
|
|
|
|
|
spareOnList:[],
|
|
|
|
|
// 备件选择
|
|
|
|
|
selectSpareDialog:false,
|
|
|
|
|
// 日期范围选择快捷
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
@ -1061,14 +1053,22 @@ export default {
|
|
|
|
|
this.setWorkCenter();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 备件选择btn
|
|
|
|
|
choseSpareBtn(){
|
|
|
|
|
// 清理缓存
|
|
|
|
|
this.spareOnList = [];
|
|
|
|
|
// 打开选择备件弹窗
|
|
|
|
|
this.selectSpareDialog = true;
|
|
|
|
|
},
|
|
|
|
|
// 备件数量
|
|
|
|
|
handleEdit(index, row) {
|
|
|
|
|
if (row.amount < Number(row.applyNum)) {
|
|
|
|
|
// 库存数量-冻结数量
|
|
|
|
|
if ((Number(row.amount)-Number(row.storageAmount)) < Number(row.applyNum)) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '超过库存数量!',
|
|
|
|
|
message: '领用最大数量为:'+(Number(row.amount)-Number(row.storageAmount)),
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
row.applyNum = row.amount;
|
|
|
|
|
row.applyNum = (Number(row.amount)-Number(row.storageAmount));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 备件选择完成按钮
|
|
|
|
@ -1212,10 +1212,46 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 选择备件确定按钮
|
|
|
|
|
confirmSelectSpareBtn() {
|
|
|
|
|
if (this.spareOnList.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: "请勾选要申领的备件!",
|
|
|
|
|
type: "warning"
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.chooseSpareList.length; i++){
|
|
|
|
|
for (let j = 0; j < this.spareOnList.length; j++) {
|
|
|
|
|
if (this.chooseSpareList[i].materialCode == this.spareOnList[j].materialCode) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '不可重复添加!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (let j = 0; j < this.spareOnList.length; j++) {
|
|
|
|
|
if (this.spareOnList[j].applyNum == null) {
|
|
|
|
|
this.spareOnList[j].applyNum=1;
|
|
|
|
|
}
|
|
|
|
|
this.chooseSpareList.push(this.spareOnList[j]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '添加成功!',
|
|
|
|
|
type: 'success'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 关闭备件选择弹窗
|
|
|
|
|
this.selectSpareDialog = false;
|
|
|
|
|
},
|
|
|
|
|
// 多选备件按钮
|
|
|
|
|
selectChangeSpare(e) {
|
|
|
|
|
this.selOnSpare = e;
|
|
|
|
|
// 清理缓存
|
|
|
|
|
this.spareOnList = [];
|
|
|
|
|
// 置入值
|
|
|
|
|
this.spareOnList = e;
|
|
|
|
|
},
|
|
|
|
|
// 备件搜索重置按钮
|
|
|
|
|
resetSpare() {
|
|
|
|
@ -1232,10 +1268,6 @@ export default {
|
|
|
|
|
querySpareList(this.spareQuery).then(response => {
|
|
|
|
|
this.spareTotal = response.total;
|
|
|
|
|
this.spareList = response.rows;
|
|
|
|
|
// 设置库存:总量-冻结数量
|
|
|
|
|
for (let i = 0; i < this.spareList.length; i++) {
|
|
|
|
|
this.spareList[i].amount = Number(this.spareList[i].amount) - Number(this.spareList[i].storageAmount)
|
|
|
|
|
}
|
|
|
|
|
this.spareLoading = false;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -1629,7 +1661,7 @@ export default {
|
|
|
|
|
this.planLoading = true;
|
|
|
|
|
if (this.form.planId != null) {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
updateUpkeepPlan(this.form).then(response => {
|
|
|
|
|
updatePlan(this.form).then(response => {
|
|
|
|
|
this.planLoading = false;
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
@ -1637,7 +1669,7 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.form.personList = this.selectPersonList;
|
|
|
|
|
addUpkeepPlan(this.form).then(response => {
|
|
|
|
|
addPlan(this.form).then(response => {
|
|
|
|
|
this.planLoading = false;
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|