设备 班组+报工+维修+备料申领单+备件台账
parent
57a3d7608b
commit
a32735be01
@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<el-dialog title="备品备件选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="1100px"
|
||||
center
|
||||
:before-close="cancel"
|
||||
>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
|
||||
<el-form-item label="备品备件号" prop="materialCode">
|
||||
<el-input
|
||||
v-model="queryParams.materialCode"
|
||||
placeholder="请输入备品备件号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
style="width:150px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备件类型" prop="spareType">
|
||||
<el-select v-model="queryParams.spareType" placeholder="请选择备件类型" @keyup.enter.native="handleQuery" @change="$forceUpdate()" clearable style="width:150px">
|
||||
<el-option v-for="item in options" :key="item.spareType" :label="item.label" :value="item.spareType"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="sparePartsLedgerList" @selection-change="handleSelectionChange" ref="multipleTable">
|
||||
<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="spareType" width="120"/>
|
||||
<el-table-column label="规格型号" align="center" prop="spareMode" />
|
||||
<el-table-column label="库存总数量" align="center" prop="amount" />
|
||||
<el-table-column label="库存冻结数量" align="center" prop="storageAmount" />
|
||||
<el-table-column label="库存可用数量" align="center" prop="availableQuantity" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.amount-scope.row.storageAmount}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领用数量" align="center" prop="spareQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input size="small" v-model="scope.row.spareQuantity" @change="handleEdit(scope.$index,scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSparePartsLedger, getSparePartsLedger, delSparePartsLedger, addSparePartsLedger, updateSparePartsLedger } from "@/api/device/sparePartsLedger";
|
||||
|
||||
export default {
|
||||
name: "SparePartsLedger",
|
||||
data() {
|
||||
return {
|
||||
//展示
|
||||
showFlag:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 备品备件台账管理表格数据
|
||||
sparePartsLedgerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
storageId: null,
|
||||
whCode: null,
|
||||
regionCode: null,
|
||||
waCode: null,
|
||||
storageType: null,
|
||||
wlCode: null,
|
||||
materialCode: null,
|
||||
materialDesc: null,
|
||||
amount: null,
|
||||
storageAmount: null,
|
||||
occupyAmount: null,
|
||||
lpn: null,
|
||||
productBatch: null,
|
||||
receiveDate: null,
|
||||
productDate: null,
|
||||
userDefined1: null,
|
||||
userDefined2: null,
|
||||
userDefined3: null,
|
||||
userDefined4: null,
|
||||
userDefined5: null,
|
||||
userDefined6: null,
|
||||
userDefined7: null,
|
||||
userDefined8: null,
|
||||
userDefined9: null,
|
||||
userDefined10: null,
|
||||
gmtCreate: null,
|
||||
lastModifiedBy: null,
|
||||
gmtModified: null,
|
||||
activeFlag: null,
|
||||
factoryCode: null,
|
||||
sapFactoryCode: null,
|
||||
wlName: null,
|
||||
spareUseLife: null,
|
||||
spareName: null,
|
||||
spareMode: null,
|
||||
spareManufacturer: null,
|
||||
spareSupplier: null,
|
||||
spareReplacementCycle: null,
|
||||
spareMeasurementUnit: null,
|
||||
spareConversionUnit: null,
|
||||
spareConversionRatio: null,
|
||||
spareInventoryFloor: null,
|
||||
spareInventoryUpper: null
|
||||
},
|
||||
options: [{
|
||||
spareType: "专用",
|
||||
label: '专用'
|
||||
}, {
|
||||
spareType: "通用",
|
||||
label: '通用'
|
||||
}],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
storageId: [
|
||||
{ required: true, message: "唯一序列不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleEdit(index, row) {
|
||||
console.log('row:',index, row);
|
||||
console.log('storageId:',row.storageId) //获取到变化行的name值
|
||||
},
|
||||
// 生成表头序号
|
||||
indexMethod(index) {
|
||||
return index + 1;
|
||||
},
|
||||
/** 查询备品备件台账管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSparePartsLedger(this.queryParams).then(response => {
|
||||
this.sparePartsLedgerList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showFlag = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
storageId: null,
|
||||
whCode: null,
|
||||
regionCode: null,
|
||||
waCode: null,
|
||||
storageType: null,
|
||||
wlCode: null,
|
||||
materialCode: null,
|
||||
materialDesc: null,
|
||||
amount: null,
|
||||
storageAmount: null,
|
||||
occupyAmount: null,
|
||||
lpn: null,
|
||||
productBatch: null,
|
||||
receiveDate: null,
|
||||
productDate: null,
|
||||
userDefined1: null,
|
||||
userDefined2: null,
|
||||
userDefined3: null,
|
||||
userDefined4: null,
|
||||
userDefined5: null,
|
||||
userDefined6: null,
|
||||
userDefined7: null,
|
||||
userDefined8: null,
|
||||
userDefined9: null,
|
||||
userDefined10: null,
|
||||
createBy: null,
|
||||
gmtCreate: null,
|
||||
lastModifiedBy: null,
|
||||
gmtModified: null,
|
||||
activeFlag: null,
|
||||
factoryCode: null,
|
||||
sapFactoryCode: null,
|
||||
wlName: null,
|
||||
delFlag: null,
|
||||
spareUseLife: null,
|
||||
spareName: null,
|
||||
spareMode: null,
|
||||
spareManufacturer: null,
|
||||
spareSupplier: null,
|
||||
spareReplacementCycle: null,
|
||||
spareMeasurementUnit: null,
|
||||
spareConversionUnit: null,
|
||||
spareConversionRatio: null,
|
||||
spareInventoryFloor: null,
|
||||
spareInventoryUpper: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.storageId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm(){
|
||||
console.log('data:',this.sparePartsLedgerList);
|
||||
console.log("选择的数据",this.$refs.multipleTable.selection);
|
||||
this.$emit('onSelected',this.$refs.multipleTable.selection);
|
||||
this.showFlag = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<el-dialog title="人员选择"
|
||||
v-if="showFlag"
|
||||
:visible.sync="showFlag"
|
||||
:modal= false
|
||||
width="800px"
|
||||
center
|
||||
:before-close="cancelEquipmentForm"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!--人员数据-->
|
||||
<el-col :span="24">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="人员编码" prop="itemCode">
|
||||
<el-input
|
||||
v-model="queryParams.itemCode"
|
||||
placeholder="请输入人员编码"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="人员名称" prop="itemName">
|
||||
<el-input
|
||||
v-model="queryParams.itemName"
|
||||
placeholder="请输入人员名称"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="itemList" @selection-change="handleEquipmentSelectionChange" ref="myTable">
|
||||
<el-table-column width="50" align="center" type="selection"></el-table-column>
|
||||
<!-- 序号 -->
|
||||
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
|
||||
<el-table-column label="人员编码" align="center" key="itemCode" prop="userName" v-if="columns[0].visible" ></el-table-column>
|
||||
<el-table-column label="人员名称" align="left" key="itemName" prop="nickName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门编码" align="center" prop="postCode" v-if="columns[2].visible" ></el-table-column>
|
||||
<el-table-column label="部门名称" align="center" prop="postName" v-if="columns[3].visible" ></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitPersonForm">确 定</el-button>
|
||||
<el-button @click="cancelEquipmentForm">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMaintenancePersonList} from "@/api/device/repairOrder";
|
||||
import { Message } from 'element-ui'
|
||||
|
||||
export default {
|
||||
name: "MdItemSingle",
|
||||
data() {
|
||||
return {
|
||||
treeData1:[],
|
||||
showFlag:false,
|
||||
// 选中数组
|
||||
selectedItemId: undefined,
|
||||
selectedRows: undefined,
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total:0,
|
||||
// 人员表格数据
|
||||
itemList: null,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
itemName: undefined,
|
||||
itemCodeGet: '',
|
||||
itemCode : undefined,
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
{ key: 0, label: `人员编码`, visible: true },
|
||||
{ key: 1, label: `人员名称`, visible: true },
|
||||
{ key: 2, label: `部门编码`, visible: true },
|
||||
{ key: 3, label: `部门名称`, visible: true },
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
itemId: null,
|
||||
itemCode: this.processId,
|
||||
itemType: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
handleEquipmentSelectionChange (val) {
|
||||
this.itemList = val;
|
||||
},
|
||||
|
||||
// 生成表头序号
|
||||
indexMethod(index){
|
||||
return index+1 ;
|
||||
},
|
||||
//
|
||||
|
||||
/** 查询设备编码列表*/
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getMaintenancePersonList(this.queryParams).then(response => {
|
||||
this.itemList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
console.log('id',data.id);
|
||||
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
|
||||
console.log(this.equipmentTypeCode);
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams.equipmentTypeCode = null;
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleEquipmentSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.nickName);
|
||||
this.single = selection.length!==1;
|
||||
this.multiple = !selection.length;
|
||||
console.log("多选框",this.ids);
|
||||
},
|
||||
|
||||
submitPersonForm() {
|
||||
const data = this.ids;
|
||||
const nickName = data.toString();
|
||||
if(data.length >1){
|
||||
Message.warning("只能选择一个维修人,请勿选择多个!");
|
||||
}else{
|
||||
if(this.queryParams.itemCodeGet == ""){
|
||||
this.queryParams.itemCodeGet = nickName;
|
||||
}
|
||||
this.selectedRows = this.queryParams.itemCodeGet;
|
||||
this.$emit('onSelected', this.selectedRows);
|
||||
this.getList();
|
||||
this.showFlag = false;
|
||||
this.queryParams.itemCodeGet = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue