物资详细画面处理

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. 407
      src/views/spares/materialDetail.vue

@ -50,7 +50,7 @@ export const update = (row) => {
export const inbound_getListByMaterialNo = (materialNo) => {
return request({
url: '/api//spares/inbound/getList',
url: '/api/spares/inbound/getList',
method: 'get',
params: {
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) => {
return request({
url: '/api//spares/outbound/getList',
url: '/api/spares/outbound/getList',
method: 'get',
params: {
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"
ref="tab1_form"
: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>
</span>
<span v-else-if="type.prop==='inbound'">
@ -18,6 +29,10 @@
:header-cell-class-name="headerClass"
v-model="inbound_form"
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>
</div>
</span>
@ -29,10 +44,14 @@
:header-cell-class-name="headerClass"
v-model="outbound_form"
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>
</span>
<div class="container">
<span >
<span>
<el-button type="primary"
size="large"
@click="handleFormSubmit"
@ -40,14 +59,30 @@
确定</el-button>
</span>
</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>
</template>
<script>
import {getDetail} from "@/api/spares/material";
import {inbound_getListByMaterialNo} from "@/api/spares/inbound";
import {outbound_getListByMaterialNo} from "@/api/spares/outbound";
import {add, getDetail} from "@/api/spares/material";
import {inbound_getListByMaterialNo, update_materialDetailIn} from "@/api/spares/inbound";
import {outbound_getListByMaterialNo, update_materialDetailOut} from "@/api/spares/outbound";
import {mapGetters} from "vuex";
import request from "@/router/axios";
import {getMaterialClassCode, materialClassCodeAdd } from "@/api/spares/materialclasscode";
export default {
data() {
@ -55,6 +90,8 @@
form: {},
query: {},
loading: true,
type: {},
dialogVisible: false,
page: {
pageSize: 10,
currentPage: 1,
@ -63,6 +100,13 @@
readonlyForm:{},
addUpdateShowButton:{},
frame_class: '',
option: {
column: [{
label: '基本信息',
prop: 'information',
}
]
},
tab1_form: {},
tab1_option: {
submitBtn: false,
@ -71,17 +115,13 @@
{
label: "物资编号",
prop: "materialNo",
span: 6,
rules: [{
required: true,
message: "请输入物资编号",
trigger: "blur"
}]
span: 8,
disabled: true,
},
{
label: "场站",
prop: "station",
span: 6,
span: 8,
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=station",
props: {
@ -97,7 +137,7 @@
{
label: "物资名称",
prop: "materialName",
span: 6,
span: 8,
rules: [{
required: true,
message: "请输入物资名称",
@ -107,52 +147,138 @@
{
label: "物资分类码",
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: [{
required: true,
message: "请输入物资分类码",
message: "请输入规格型号",
trigger: "blur"
}]
},
{
label: "规格型号",
prop: "model",
span: 6,
label: "库存数量",
prop: "inventoryCount",
span: 8,
rules: [{
required: true,
message: "请输入规格型号",
message: "请输入库存数量",
trigger: "blur"
}]
},
{
label: "制造商名称",
prop: "manufacturerName",
span: 6
label: "制造商统一社会信用代码",
prop: "creditCodeM",
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: "供应商名称",
prop: "sipplierName",
span: 6
label: "制造商名称",
prop: "manufacturerName",
disabled: true,
span: 8
},
{
label: "所属仓库",
prop: "warehouse",
span: 6
type: "select",
dicUrl: "/api/warehouse/getWarehouseList",
props: {
label: "name",
value: "code",
},
span: 8
},
{
label: "库存数量",
prop: "inventoryCount",
span: 6,
rules: [{
required: true,
message: "请输入库存数量",
trigger: "blur"
}]
label: "供应商统一社会信用代码",
prop: "creditCodeS",
display: true,
span: 8,
type: "select",
dicUrl: "/api/supplierinfo/getNoList",
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: "物资描述",
prop: "materialDescription",
span: 6,
span: 8,
rules: [{
required: true,
message: "请输入物资描述",
@ -161,6 +287,8 @@
}
]
},
optionsExt:[],
inbound_data: [],
inbound_form: {},
option_inbound: {
submitBtn: false,
@ -177,6 +305,7 @@
{
label: "入库时间",
prop: "inboundTime",
type: "date",
format: 'yyyy/MM/dd'
},
{
@ -194,6 +323,7 @@
{
label: "入库审核状态",
prop: "istatus",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=check_status",
props: {
label: "dictValue",
@ -202,6 +332,7 @@
}
]
},
outbound_data: [],
outbound_form: {},
option_outbound: {
submitBtn: false,
@ -218,11 +349,12 @@
{
label: "出库时间",
prop: "outboundTime",
type: "date",
format: 'yyyy/MM/dd'
},
{
label: "库申领人",
prop: "inboundClaimants"
label: "库申领人",
prop: "outboundClaimants"
},
{
label: "出库经办人",
@ -244,9 +376,26 @@
}
]
},
data: [],
inbound_data: [],
outbound_data: []
diaForm: {},
optionDia: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "物资分类码",
prop: "materialClassCode",
span:22,
labelWidth: 150
},
{
label: "物资类型",
prop: "materialType",
span:22,
labelWidth: 150
}
]
},
data: []
};
},
computed: {
@ -266,18 +415,66 @@
created () {
this.type = this.option.column[0];
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.readonlyForm=true;
this.addUpdateShowButton=false;
this.frame_class = 'frame_class';
this.SearchDetail();
}else{
const materialNo = this.findObject(this.tab1_option.column, "materialNo");
materialNo.value = ' ';
materialNo.disabled = true;
this.readonlyForm=false;
this.addUpdateShowButton=true;
this.frame_class = null;
this.SearchClassCode();
}
},
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) {
this.type = column
if (column.prop == 'inbound') {
@ -292,23 +489,144 @@
this.tab1_form = res.data.data;
});
},
SearchClassCode() {
getMaterialClassCode().then(res => {
this.optionsExt = res.data.data;
});
},
inbound_onLoad() {
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.loading = false;
});
},
outbound_onLoad() {
this.loading = true;
outbound_getListByMaterialNo(this.$route.query.id).then(res => {
this.inbound_data = res.data.data;
outbound_getListByMaterialNo(this.$route.query.materialNo).then(res => {
this.outbound_data = res.data.data;
this.loading = false;
});
},
headerClass(){
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>
@ -330,9 +648,12 @@
.frame_class .el-input--prefix .el-input__inner {
padding-left: 15px;
}
.frame_class input::placeholder {
color: transparent;
display: none; /* 默认隐藏 */
}
.container {
display: flex;
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
</style>

Loading…
Cancel
Save