物资详细画面处理

main
yangzhicheng 11 months ago
parent f180dfa586
commit 39b4a2cc16
  1. 10
      src/api/spares/inbound.js
  2. 14
      src/api/spares/materialclasscode.js
  3. 10
      src/api/spares/outbound.js
  4. 409
      src/views/spares/materialDetail.vue

@ -50,7 +50,7 @@ export const update = (row) => {
export const inbound_getListByMaterialNo = (materialNo) => { export const inbound_getListByMaterialNo = (materialNo) => {
return request({ return request({
url: '/api//spares/inbound/getList', url: '/api/spares/inbound/getList',
method: 'get', method: 'get',
params: { params: {
materialNo: materialNo materialNo: materialNo
@ -58,3 +58,11 @@ export const inbound_getListByMaterialNo = (materialNo) => {
}) })
} }
export const update_materialDetailIn = (row) => {
return request({
url: '/api/spares/inbound/update',
method: 'post',
data: row
})
}

@ -48,3 +48,17 @@ export const update = (row) => {
}) })
} }
export const materialClassCodeAdd = (row) => {
return request({
url: '/api/spares/materialclasscode/submit',
method: 'post',
data: row
})
}
export const getMaterialClassCode = () => {
return request({
url: '/api/spares/materialclasscode/getMaterialClassCodeList',
method: 'get'
})
}

@ -50,7 +50,7 @@ export const update = (row) => {
export const outbound_getListByMaterialNo = (materialNo) => { export const outbound_getListByMaterialNo = (materialNo) => {
return request({ return request({
url: '/api//spares/outbound/getList', url: '/api/spares/outbound/getList',
method: 'get', method: 'get',
params: { params: {
materialNo: materialNo materialNo: materialNo
@ -58,3 +58,11 @@ export const outbound_getListByMaterialNo = (materialNo) => {
}) })
} }
export const update_materialDetailOut = (row) => {
return request({
url: '/api/spares/outbound/update',
method: 'post',
data: row
})
}

@ -7,6 +7,17 @@
v-model="tab1_form" v-model="tab1_form"
ref="tab1_form" ref="tab1_form"
:class="frame_class"> :class="frame_class">
<template #materialClassCode="{}">
<el-select v-model="tab1_form.materialClassCode">
<el-option
v-for="item in optionsExt"
:key="item"
:label="item"
:value="item">
</el-option>
<el-option key="" value="" :disabled="true"><span>找不到物资分类码?</span><el-link type="primary" @click="test">点击新增</el-link></el-option>
</el-select>
</template>
</avue-form> </avue-form>
</span> </span>
<span v-else-if="type.prop==='inbound'"> <span v-else-if="type.prop==='inbound'">
@ -18,6 +29,10 @@
:header-cell-class-name="headerClass" :header-cell-class-name="headerClass"
v-model="inbound_form" v-model="inbound_form"
ref="inbound_crud"> ref="inbound_crud">
<template #menu="{row,index,size}">
<el-button size="small" type="text" @click="auditing_in(row)">审核</el-button>
<el-button size="small" type="text" @click="reject_in(row)">驳回</el-button>
</template>
</avue-crud> </avue-crud>
</div> </div>
</span> </span>
@ -29,10 +44,14 @@
:header-cell-class-name="headerClass" :header-cell-class-name="headerClass"
v-model="outbound_form" v-model="outbound_form"
ref="outbound_crud2"> ref="outbound_crud2">
<template #menu="{row,index,size}">
<el-button size="small" type="text" @click="auditing_out(row)">审核</el-button>
<el-button size="small" type="text" @click="reject_out(row)">驳回</el-button>
</template>
</avue-crud> </avue-crud>
</span> </span>
<div class="container"> <div class="container">
<span > <span>
<el-button type="primary" <el-button type="primary"
size="large" size="large"
@click="handleFormSubmit" @click="handleFormSubmit"
@ -40,14 +59,30 @@
确定</el-button> 确定</el-button>
</span> </span>
</div> </div>
<el-dialog title="物资分类码"
append-to-body
:visible.sync="dialogVisible"
width="480px">
<avue-form :option="optionDia"
v-model="diaForm"
ref="diaForm">
</avue-form>
<span slot="footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary"
@click="submitDia"> </el-button>
</span>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import {getDetail} from "@/api/spares/material"; import {add, getDetail} from "@/api/spares/material";
import {inbound_getListByMaterialNo} from "@/api/spares/inbound"; import {inbound_getListByMaterialNo, update_materialDetailIn} from "@/api/spares/inbound";
import {outbound_getListByMaterialNo} from "@/api/spares/outbound"; import {outbound_getListByMaterialNo, update_materialDetailOut} from "@/api/spares/outbound";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import request from "@/router/axios";
import {getMaterialClassCode, materialClassCodeAdd } from "@/api/spares/materialclasscode";
export default { export default {
data() { data() {
@ -55,6 +90,8 @@
form: {}, form: {},
query: {}, query: {},
loading: true, loading: true,
type: {},
dialogVisible: false,
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -63,6 +100,13 @@
readonlyForm:{}, readonlyForm:{},
addUpdateShowButton:{}, addUpdateShowButton:{},
frame_class: '', frame_class: '',
option: {
column: [{
label: '基本信息',
prop: 'information',
}
]
},
tab1_form: {}, tab1_form: {},
tab1_option: { tab1_option: {
submitBtn: false, submitBtn: false,
@ -71,17 +115,13 @@
{ {
label: "物资编号", label: "物资编号",
prop: "materialNo", prop: "materialNo",
span: 6, span: 8,
rules: [{ disabled: true,
required: true,
message: "请输入物资编号",
trigger: "blur"
}]
}, },
{ {
label: "场站", label: "场站",
prop: "station", prop: "station",
span: 6, span: 8,
type: "select", type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=station", dicUrl: "/api/daf-system/dict/dictionary?code=station",
props: { props: {
@ -97,7 +137,7 @@
{ {
label: "物资名称", label: "物资名称",
prop: "materialName", prop: "materialName",
span: 6, span: 8,
rules: [{ rules: [{
required: true, required: true,
message: "请输入物资名称", message: "请输入物资名称",
@ -107,52 +147,138 @@
{ {
label: "物资分类码", label: "物资分类码",
prop: "materialClassCode", prop: "materialClassCode",
span: 6, span: 8,
},
// {
// label: "",
// prop: "materialClassCode",
// span: 7,
// type: "select",
// dicUrl: "/api/spares/materialclasscode/getMaterialClassCodeList",
// props: {
// label: "materialClassCode",
// value: "materialClassCode"
// },
// rules: [{
// required: true,
// message: "",
// trigger: "blur"
// }]
// },
// {
// label: "",
// labelWidth:20,
// span: 1,
// event: {
// click: () => {
// this.dialogVisible = true
// },
// },
// },
{
label: "规格型号",
prop: "model",
span: 8,
rules: [{ rules: [{
required: true, required: true,
message: "请输入物资分类码", message: "请输入规格型号",
trigger: "blur" trigger: "blur"
}] }]
}, },
{ {
label: "规格型号", label: "库存数量",
prop: "model", prop: "inventoryCount",
span: 6, span: 8,
rules: [{ rules: [{
required: true, required: true,
message: "请输入规格型号", message: "请输入库存数量",
trigger: "blur" trigger: "blur"
}] }]
}, },
{ {
label: "制造商名称", label: "制造商统一社会信用代码",
prop: "manufacturerName", prop: "creditCodeM",
span: 6 display: true,
span: 8,
type: "select",
dicUrl: "/api/manufacturerinfo/getNoList",
props: {
label: "creditCode",
value: "creditCode",
},
event: {
change: (val) => {
if (!val) return
if (val) {
request({
url: '/api/manufacturerinfo/getDetail',
method: 'get',
params: {
creditCode: val
}
}).then((res) => {
this.tab1_form.manufacturerName = res.data.data.manufacturerName;
})
}
},
}
}, },
{ {
label: "供应商名称", label: "制造商名称",
prop: "sipplierName", prop: "manufacturerName",
span: 6 disabled: true,
span: 8
}, },
{ {
label: "所属仓库", label: "所属仓库",
prop: "warehouse", prop: "warehouse",
span: 6 type: "select",
dicUrl: "/api/warehouse/getWarehouseList",
props: {
label: "name",
value: "code",
},
span: 8
}, },
{ {
label: "库存数量", label: "供应商统一社会信用代码",
prop: "inventoryCount", prop: "creditCodeS",
span: 6, display: true,
rules: [{ span: 8,
required: true, type: "select",
message: "请输入库存数量", dicUrl: "/api/supplierinfo/getNoList",
trigger: "blur" props: {
}] label: "creditCode",
value: "creditCode",
},
event: {
change: (val) => {
if (!val) return
if (val) {
request({
url: '/api/supplierinfo/getDetail',
method: 'get',
params: {
creditCode: val
}
}).then((res) => {
this.tab1_form.supplierName = res.data.data.supplierName;
})
}
},
}
},
{
label: "供应商名称",
prop: "supplierName",
disabled: true,
span: 8
}, },
{ {
label: "物资描述", label: "物资描述",
prop: "materialDescription", prop: "materialDescription",
span: 6, span: 8,
rules: [{ rules: [{
required: true, required: true,
message: "请输入物资描述", message: "请输入物资描述",
@ -161,6 +287,8 @@
} }
] ]
}, },
optionsExt:[],
inbound_data: [],
inbound_form: {}, inbound_form: {},
option_inbound: { option_inbound: {
submitBtn: false, submitBtn: false,
@ -177,6 +305,7 @@
{ {
label: "入库时间", label: "入库时间",
prop: "inboundTime", prop: "inboundTime",
type: "date",
format: 'yyyy/MM/dd' format: 'yyyy/MM/dd'
}, },
{ {
@ -194,6 +323,7 @@
{ {
label: "入库审核状态", label: "入库审核状态",
prop: "istatus", prop: "istatus",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=check_status", dicUrl: "/api/daf-system/dict/dictionary?code=check_status",
props: { props: {
label: "dictValue", label: "dictValue",
@ -202,6 +332,7 @@
} }
] ]
}, },
outbound_data: [],
outbound_form: {}, outbound_form: {},
option_outbound: { option_outbound: {
submitBtn: false, submitBtn: false,
@ -218,11 +349,12 @@
{ {
label: "出库时间", label: "出库时间",
prop: "outboundTime", prop: "outboundTime",
type: "date",
format: 'yyyy/MM/dd' format: 'yyyy/MM/dd'
}, },
{ {
label: "库申领人", label: "库申领人",
prop: "inboundClaimants" prop: "outboundClaimants"
}, },
{ {
label: "出库经办人", label: "出库经办人",
@ -244,9 +376,26 @@
} }
] ]
}, },
data: [], diaForm: {},
inbound_data: [], optionDia: {
outbound_data: [] submitBtn: false,
emptyBtn: false,
column: [
{
label: "物资分类码",
prop: "materialClassCode",
span:22,
labelWidth: 150
},
{
label: "物资类型",
prop: "materialType",
span:22,
labelWidth: 150
}
]
},
data: []
}; };
}, },
computed: { computed: {
@ -266,18 +415,66 @@
created () { created () {
this.type = this.option.column[0]; this.type = this.option.column[0];
if(this.$route.query.frameMode == "view"){ if(this.$route.query.frameMode == "view"){
const creditCodeM = this.findObject(this.tab1_option.column, "creditCodeM");
creditCodeM.display = false;
const creditCodeS = this.findObject(this.tab1_option.column, "creditCodeS");
creditCodeS.display = false;
this.option.column.push({ label: '入库详情', prop: 'inbound' },{ label: '出库详情', prop: 'outbound' }); this.option.column.push({ label: '入库详情', prop: 'inbound' },{ label: '出库详情', prop: 'outbound' });
this.readonlyForm=true; this.readonlyForm=true;
this.addUpdateShowButton=false; this.addUpdateShowButton=false;
this.frame_class = 'frame_class'; this.frame_class = 'frame_class';
this.SearchDetail(); this.SearchDetail();
}else{ }else{
const materialNo = this.findObject(this.tab1_option.column, "materialNo");
materialNo.value = ' ';
materialNo.disabled = true;
this.readonlyForm=false; this.readonlyForm=false;
this.addUpdateShowButton=true; this.addUpdateShowButton=true;
this.frame_class = null; this.frame_class = null;
this.SearchClassCode();
} }
}, },
methods: { methods: {
test(val) {
this.dialogVisible = true;
},
handleFormSubmit() {
this.$refs.tab1_form.validate((valid, done, msg) => {
if (valid) {
done()
this.Submit();
} else {
console.log('error submit!!');
return false;
}
})
},
//
Submit() {
this.$confirm("是否新增所填数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.tab1_form.checkStatus="1"
add(this.tab1_form).then(()=>{
this.$router.push({
path: "/spares/material",
query: {
},
});
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
});
},
handleChange (column) { handleChange (column) {
this.type = column this.type = column
if (column.prop == 'inbound') { if (column.prop == 'inbound') {
@ -292,23 +489,144 @@
this.tab1_form = res.data.data; this.tab1_form = res.data.data;
}); });
}, },
SearchClassCode() {
getMaterialClassCode().then(res => {
this.optionsExt = res.data.data;
});
},
inbound_onLoad() { inbound_onLoad() {
this.loading = true; this.loading = true;
inbound_getListByMaterialNo(this.$route.query.id).then(res => { inbound_getListByMaterialNo(this.$route.query.materialNo).then(res => {
this.inbound_data = res.data.data; this.inbound_data = res.data.data;
this.loading = false; this.loading = false;
}); });
}, },
outbound_onLoad() { outbound_onLoad() {
this.loading = true; this.loading = true;
outbound_getListByMaterialNo(this.$route.query.id).then(res => { outbound_getListByMaterialNo(this.$route.query.materialNo).then(res => {
this.inbound_data = res.data.data; this.outbound_data = res.data.data;
this.loading = false; this.loading = false;
}); });
}, },
headerClass(){ headerClass(){
return 'head-style' return 'head-style'
} },
auditing_in(row) {
if (row.istatus === 2)
{
this.$message({
type: "error",
message: "数据已经是已审核状态!"
});
return;
}
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
row.istatus = 2;
this.submitRejectOrauditing_in(row);
});
},
reject_in(row) {
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
row.istatus = 3;
this.submitRejectOrauditing_in(row);
});
},
submitRejectOrauditing_in(row) {
update_materialDetailIn(row).then(() => {
this.SearchDetail();
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
},
auditing_out(row) {
if (row.istatus === 2)
{
this.$message({
type: "error",
message: "数据已经是已审核状态!"
});
return;
}
if (row.outboundCount > this.tab1_form.inventoryCount)
{
this.$message({
type: "error",
message: "库存不足!"
});
return;
}
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
row.istatus = 2;
this.submitRejectOrauditing_out(row);
});
},
reject_out(row) {
this.$confirm("是否将数据审核?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
row.istatus = 3;
this.submitRejectOrauditing_out(row);
});
},
submitRejectOrauditing_out(row) {
update_materialDetailOut(row).then(() => {
this.SearchDetail();
this.$message({
type: "success",
message: "操作成功!"
});
}).catch((error) => {
this.$message({
type: "error",
message: "操作失败!"
});
});
},
submitDia(row, done, loading) {
this.$refs.diaForm.validate((valid, done, msg) => {
if (valid) {
done()
materialClassCodeAdd(this.diaForm).then(() => {
this.$refs.diaForm.resetForm();
this.dialogVisible = false;
this.SearchClassCode();
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
} else {
this.$message({
type: "warning",
message: "请输入必要信息!"
});
}
});
},
} }
}; };
</script> </script>
@ -330,9 +648,12 @@
.frame_class .el-input--prefix .el-input__inner { .frame_class .el-input--prefix .el-input__inner {
padding-left: 15px; padding-left: 15px;
} }
.frame_class input::placeholder { .frame_class input::placeholder {
color: transparent; color: transparent;
display: none; /* 默认隐藏 */ display: none; /* 默认隐藏 */
} }
.container {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
</style> </style>

Loading…
Cancel
Save