物资综合查询:物资名称字段不显示bug修复;可按物资关键字进行查询

main
15036302109 9 months ago
parent 6fa3437de0
commit 02c69ccb39

@ -39,6 +39,15 @@
:props="{ multiple: false, checkStrictly: true }" :props="{ multiple: false, checkStrictly: true }"
@change="handleQueryChange"></el-cascader> @change="handleQueryChange"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="物资关键字" prop="classNameKey" label-width="98px">
<el-input
v-model="queryParams.classNameKey"
placeholder="请输入单位名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="类别" prop="classSecond"> <!-- <el-form-item label="类别" prop="classSecond">
<el-cascader style="width:500px" <el-cascader style="width:500px"
@ -139,14 +148,28 @@
</el-table-column> </el-table-column>
<el-table-column label="类别" align="center" prop="classSecond"> <el-table-column label="类别" align="center" prop="classSecond">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{classToStr(scope.row.classSecond,1,scope.row.classFirst)}}</span> <span>{{classToStr(scope.row.classSecond,1)}}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="类别" align="center" prop="classSecond">
<template slot-scope="scope">
<span>{{classToStr(scope.row.classSecond,1,scope.row.classFirst)}}</span>
</template>
</el-table-column>-->
<el-table-column label="物资名称" align="center" prop="materialName" > <el-table-column label="物资名称" align="center" prop="materialName" >
<template slot-scope="scope">
<span
@click="handleUpdate(scope.row,true)"
style="color: blue; cursor: pointer"
>{{classToStr(scope.row.materialName,2)}}</span
>
</template>
</el-table-column>
<!-- <el-table-column label="物资名称" align="center" prop="materialName" >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{classToStr(scope.row.materialName,2,scope.row.classFirst)}}</span> <span>{{classToStr(scope.row.materialName,2,scope.row.classFirst)}}</span>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="规格/参数" align="center" prop="materialSpecs" /> <el-table-column label="规格/参数" align="center" prop="materialSpecs" />
<el-table-column label="数量" align="center" prop="materialQuantity" /> <el-table-column label="数量" align="center" prop="materialQuantity" />
<el-table-column label="待处理出库" align="center" prop="sendQuantity" /> <el-table-column label="待处理出库" align="center" prop="sendQuantity" />
@ -179,6 +202,77 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="性质" prop="materialType">
<el-select v-model="form.materialType" placeholder="请选择性质" clearable :disabled="isReadOnly">
<el-option
v-for="dict in materialTypeOptions"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<!--<el-form-item label="类别" prop="classSecond">
<el-select v-model="form.classSecond" placeholder="请选择类别">
<el-option
v-for="dict in curDict"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>-->
</el-col>
</el-row>
<el-form-item label="物资名称" prop="materialNameId" style="width:500px">
<!--<el-input v-model="form.materialName" placeholder="请输入物资名称" />-->
<el-cascader style="width:500px" :disabled="isReadOnly"
v-model="form.materialNameId"
:options="options"
@change="handleChange"></el-cascader>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="规格/参数" prop="materialSpecs">
<el-input v-model="form.materialSpecs" placeholder="请输入规格/参数" :readonly="isReadOnly"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="materialQuantity">
<el-input v-model="form.materialQuantity" placeholder="请输入数量" :readonly="isReadOnly"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="储备地点" prop="reserveLocation">
<el-input v-model="form.reserveLocation" placeholder="请输入储备地点" :readonly="isReadOnly"/>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="管理责任人" prop="managerPerson">
<el-input v-model="form.managerPerson" placeholder="请输入管理责任人" :readonly="isReadOnly"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="tel">
<el-input v-model="form.tel" placeholder="请输入联系电话" :readonly="isReadOnly"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :readonly="isReadOnly"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-if="!isReadOnly"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="titleDetail" :visible.sync="openDetail" width="800px" append-to-body> <el-dialog :title="titleDetail" :visible.sync="openDetail" width="800px" append-to-body>
<el-table v-loading="loading" :data="ehsMaterialDetailList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="ehsMaterialDetailList" @selection-change="handleSelectionChange">
@ -259,6 +353,10 @@
open: false, open: false,
// //
titleDetail: "出入库明细", titleDetail: "出入库明细",
isReadOnly:false,
rules: {
},
// //
openDetail: false, openDetail: false,
ehsMaterialDetailList:[], ehsMaterialDetailList:[],
@ -275,6 +373,9 @@
allDeptList: [], allDeptList: [],
sendQuantity:"",// sendQuantity:"",//
materialJson:new Array(8) , materialJson:new Array(8) ,
form: {
classFirst:this.$route.query.classFirst
},
materialTypeOptions: [{ materialTypeOptions: [{
value: 1, value: 1,
@ -297,7 +398,8 @@
reserveLocation: null, reserveLocation: null,
managerPerson: null, managerPerson: null,
tel: null, tel: null,
classFirst:null classFirst:null,
classNameKey:null
}, },
}; };
}, },
@ -414,8 +516,9 @@
this.title = "添加物资信息包含"; this.title = "添加物资信息包含";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row,isReadOnly) {
this.reset(); this.reset();
this.isReadOnly = isReadOnly;
const materialId = row.materialId || this.ids const materialId = row.materialId || this.ids
getEhsMaterial(materialId).then(response => { getEhsMaterial(materialId).then(response => {
this.form = response.data; this.form = response.data;
@ -425,6 +528,11 @@
console.log(this.form.materialNameId); console.log(this.form.materialNameId);
this.open = true; this.open = true;
this.title = "修改物资信息"; this.title = "修改物资信息";
if (isReadOnly){
this.title = "显示物资信息";
}else {
this.title = "修改物资信息";
}
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -552,34 +660,16 @@
this.queryParams.classSecond = value[0] ; this.queryParams.classSecond = value[0] ;
} }
}, },
classToStr(value,type,classFirst) { classToStr(value,type) {
let str =""; let str =value;
let opt = this.materialJson[classFirst-1];
/* if (classFirst == 1){
opt = material1;
}else if (classFirst == 2){
opt = material2;
}else if (classFirst == 3){
opt = material3;
}else if (classFirst == 4){
opt = material4;
}else if (classFirst == 5){
opt = material5;
}else if (classFirst == 6){
opt = material6;
}else if (classFirst == 7){
opt = material7;
}else if (classFirst == 8){
opt = material8;
}*/
if(type==1){ if(type==1){
opt.forEach(item =>{ this.options.forEach(item =>{
if(item.value==value){ if(item.value==value){
str = item.label; str = item.label;
} }
}) })
}else{ }else{
opt.forEach(item =>{ this.options.forEach(item =>{
let v = value.split("-"); let v = value.split("-");
if(item.value==v[0]){ if(item.value==v[0]){
item.children.forEach(it =>{ item.children.forEach(it =>{
@ -590,7 +680,7 @@
} }
}) })
} }
//console.log(str); // console.log(str);
return str; return str;
}, },
classFirstChange(value){ classFirstChange(value){

Loading…
Cancel
Save