Merge remote-tracking branch 'origin/main'

main
zhen 11 months ago
commit f888279892
  1. 14
      src/api/spares/inbound.js
  2. 2
      src/api/spares/material.js
  3. 14
      src/api/spares/outbound.js
  4. 13
      src/router/views/index.js
  5. 419
      src/views/spares/material.vue
  6. 338
      src/views/spares/materialDetail.vue

@ -32,7 +32,7 @@ export const remove = (ids) => {
})
}
export const add = (row) => {
export const in_add = (row) => {
return request({
url: '/api/spares/inbound/submit',
method: 'post',
@ -42,9 +42,19 @@ export const add = (row) => {
export const update = (row) => {
return request({
url: '/api/spares/inbound/submit',
url: '/api/spares/inbound/update',
method: 'post',
data: row
})
}
export const inbound_getListByMaterialNo = (materialNo) => {
return request({
url: '/api//spares/inbound/getList',
method: 'get',
params: {
materialNo: materialNo
}
})
}

@ -42,7 +42,7 @@ export const add = (row) => {
export const update = (row) => {
return request({
url: '/api/spares/material/submit',
url: '/api/spares/material/update',
method: 'post',
data: row
})

@ -32,7 +32,7 @@ export const remove = (ids) => {
})
}
export const add = (row) => {
export const out_add = (row) => {
return request({
url: '/api/spares/outbound/submit',
method: 'post',
@ -42,9 +42,19 @@ export const add = (row) => {
export const update = (row) => {
return request({
url: '/api/spares/outbound/submit',
url: '/api/spares/outbound/update',
method: 'post',
data: row
})
}
export const outbound_getListByMaterialNo = (materialNo) => {
return request({
url: '/api//spares/outbound/getList',
method: 'get',
params: {
materialNo: materialNo
}
})
}

@ -139,5 +139,18 @@ export default [{
component: () =>
import( /* webpackChunkName: "views" */ '@/views/smart/workorderDetail')
}]
}, {
path: '/spares',
component: Layout,
redirect: '/spares/index',
children: [{
path: 'materialDetail',
name: '物资详情',
meta: {
menu: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/spares/materialDetail')
}]
}
]

@ -8,8 +8,7 @@
:before-open="beforeOpen"
v-model="form"
ref="crud"
@row-update="rowUpdate"
@row-save="rowSave"
:header-cell-class-name="headerClass"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@ -23,23 +22,89 @@
icon="el-icon-delete"
plain
v-if="permission.material_delete"
@click="handleDelete">
@click="handleDelete">批量删除
</el-button>
</template>
<template slot="menuRight">
<el-button type="primary"
size="small"
plain
@click="handleDetailAdd">新增
</el-button>
<el-button type="primary"
size="small"
plain
@click="handleIn">入库
</el-button>
<el-button type="primary"
size="small"
plain
@click="handleOut">出库
</el-button>
<el-button type="primary"
size="small"
plain
@click="handleExport()">导出
</el-button>
</template>
<template #menu="{row,index,size}">
<el-button @click="handleDetailSearch(row,index)" type="text">查看</el-button>
<el-button @click="rowDel(row)" type="text">删除</el-button>
</template>
</avue-crud>
<el-dialog title="入库信息"
append-to-body
:visible.sync="inBox"
width="480px"
@close="handleClose">
<avue-form :option="optionIn"
v-model="inForm"
ref="inForm">
<!-- :upload-after="uploadAfter">-->
</avue-form>
<span slot="footer" class="dialog-footer">
<el-button @click="inBox = false"> </el-button>
<el-button type="primary"
@click="submitIn"> </el-button>
</span>
</el-dialog>
<el-dialog title="出库信息"
append-to-body
:visible.sync="outBox"
width="480px"
@close="handleClose">
<avue-form :option="optionOut"
v-model="outForm"
ref="outForm">
<!-- :upload-after="uploadAfter">-->
</avue-form>
<span slot="footer" class="dialog-footer">
<el-button @click="outBox = false"> </el-button>
<el-button type="primary"
@click="submitOut"> </el-button>
</span>
</el-dialog>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/spares/material";
import {getList, getDetail, remove} from "@/api/spares/material";
import {in_add} from "@/api/spares/inbound";
import {out_add} from "@/api/spares/outbound";
import {mapGetters} from "vuex";
import expUtil from "@/util/exportUtil";
import {getToken} from "@/util/auth";
import request from "@/router/axios";
export default {
data() {
return {
form: {},
query: {},
search:{},
loading: true,
inBox: false,
outBox: false,
page: {
pageSize: 10,
currentPage: 1,
@ -53,31 +118,40 @@
searchMenuSpan: 6,
tip: false,
border: true,
index: true,
index: false,
viewBtn: true,
selection: true,
column: [
{
label: "主键",
prop: "id",
label: "物资编号",
prop: "materialNo",
search: true,
rules: [{
required: true,
message: "请输入主键",
message: "请输入物资编号",
trigger: "blur"
}]
},
{
label: "物资编号",
prop: "materialNo",
label: "场站",
prop: "station",
type: "select",
search: true,
dicUrl: "/api/daf-system/dict/dictionary?code=station",
props: {
label: "dictValue",
value: "dictKey"
},
rules: [{
required: true,
message: "请输入物资编号",
message: "请输入场站",
trigger: "blur"
}]
},
{
label: "物资名称",
prop: "materialName",
search: true,
rules: [{
required: true,
message: "请输入物资名称",
@ -87,6 +161,7 @@
{
label: "物资分类码",
prop: "materialClassCode",
hide: true,
rules: [{
required: true,
message: "请输入物资分类码",
@ -96,6 +171,7 @@
{
label: "规格型号",
prop: "model",
search: true,
rules: [{
required: true,
message: "请输入规格型号",
@ -105,6 +181,7 @@
{
label: "制造商名称",
prop: "manufacturerName",
hide: true,
rules: [{
required: true,
message: "请输入制造商名称",
@ -114,6 +191,7 @@
{
label: "供应商名称",
prop: "sipplierName",
hide: true,
rules: [{
required: true,
message: "请输入供应商名称",
@ -123,6 +201,7 @@
{
label: "所属仓库",
prop: "warehouse",
hide: true,
rules: [{
required: true,
message: "请输入所属仓库",
@ -132,6 +211,7 @@
{
label: "库存数量",
prop: "inventoryCount",
search: true,
rules: [{
required: true,
message: "请输入库存数量",
@ -147,21 +227,203 @@
trigger: "blur"
}]
},
{
label: "场站",
prop: "station",
label: "审核状态",
prop: "istatus",
hide: true,
dicUrl: "/api/daf-system/dict/dictionary?code=check_status",
props: {
label: "dictValue",
value: "dictKey"
},
rules: [{
required: true,
message: "请输入场站",
message: "请输入审核状态",
trigger: "blur"
}]
},
]
},
inForm: {},
optionIn: {
submitBtn: false,
emptyBtn: false,
menuAlign: "left",
column: [
{
label: "审核状态",
prop: "istatus",
label: "物资编号",
prop: "materialNo",
type:"select",
span: 22,
dicUrl: "/api/spares/material/getNoList",
props: {
label: "materialNo",
value: "materialNo",
},
event: {
change: (val) => {
if (!val) return
if (val) {
request({
url: '/api/spares/material/getDetailList',
method: 'get',
params: {
materialNo: val
}
}).then((res) => {
this.inForm.materialName = res.data.data.materialName;
this.inForm.model = res.data.data.model;
// this.inForm.warehouse = res.data.data.warehouseName;
})
}
},
},
rules: [{
required: true,
message: "请输入审核状态",
message: "请输入物资编号",
trigger: "blur"
}]
},
{
label: "物资名称",
prop: "materialName",
span: 22,
disabled: true,
},
{
label: "规格型号",
prop: "model",
span: 22,
disabled: true,
},
{
label: "所属仓库",
prop: "warehouse",
span: 22,
disabled: true,
},
{
label: "入库数量",
prop: "inboundCount",
span: 22,
rules: [{
required: true,
message: "请输入入库数量",
trigger: "blur"
}]
},
{
label: "入库申领人",
prop: "inboundClaimants",
span: 22,
labelWidth:100,
rules: [{
required: true,
message: "请输入入库申领人",
trigger: "blur"
}]
},
{
label: "入库经办人",
prop: "inboundManager",
span: 22,
labelWidth: 100,
rules: [{
required: true,
message: "请输入入库经办人",
trigger: "blur"
}]
},
]
},
outForm: {},
optionOut: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "物资编号",
prop: "materialNo",
span: 22,
dicUrl: "/api/spares/material/getNoList",
props: {
label: "materialNo",
value: "materialNo",
},
event: {
change: (val) => {
if (!val) return
if (val) {
request({
url: '/api/spares/material/getDetailList',
method: 'get',
params: {
materialNo: val
}
}).then((res) => {
this.inForm.materialName = res.data.data.materialName;
this.inForm.model = res.data.data.model;
// this.inForm.warehouse = res.data.data.warehouseName;
})
}
},
},
rules: [{
required: true,
message: "请输入物资编号",
trigger: "blur"
}]
},
{
label: "物资名称",
prop: "materialName",
span: 22,
disabled: true,
},
{
label: "规格型号",
prop: "model",
span: 22,
disabled: true,
},
{
label: "所属仓库",
prop: "warehouse",
span: 22,
disabled: true,
},
{
label: "出库数量",
prop: "outboundCount",
span: 22,
rules: [{
required: true,
message: "请输入入库数量",
trigger: "blur"
}]
},
{
label: "出库申领人",
prop: "outboundClaimants",
span: 22,
labelWidth: 100,
rules: [{
required: true,
message: "请输入出库申领人",
trigger: "blur"
}]
},
{
label: "出库经办人",
prop: "outboundManager",
span: 22,
labelWidth: 100,
rules: [{
required: true,
message: "请输入出库经办人",
trigger: "blur"
}]
},
@ -177,10 +439,10 @@
// return this.permission['material_col_' + v.prop]
// })
return {
addBtn: this.vaildData(this.permission.material_add, false),
viewBtn: this.vaildData(this.permission.material_view, false),
delBtn: this.vaildData(this.permission.material_delete, false),
editBtn: this.vaildData(this.permission.material_edit, false)
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false
};
},
ids() {
@ -192,32 +454,6 @@
}
},
methods: {
rowSave(row, done, loading) {
add(row).then(() => {
done();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
done();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
@ -257,6 +493,91 @@
this.$refs.crud.toggleSelection();
});
},
handleDetailAdd() {
this.$router.push({
path: "/spares/materialDetail",
query: {
frameMode:"add"
},
});
},
handleIn(){
this.inBox = true;
this.$refs.inForm.resetForm();
},
submitIn(row, done, loading) {
this.$refs.inForm.validate((valid, done, msg) => {
if (valid) {
done()
in_add(this.inForm).then(() => {
this.$refs.inForm.resetForm();
this.inBox = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
} else {
this.$message({
type: "warning",
message: "请输入必要信息!"
});
}
});
},
handleOut(){
this.outBox = true;
this.$refs.outForm.resetForm();
},
submitOut(row, done, loading) {
this.$refs.outForm.validate((valid, done, msg) => {
if (valid) {
done()
out_add(this.outForm).then(() => {
this.$refs.outForm.resetForm();
this.outBox = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}, error => {
window.console.log(error);
loading();
});
} else {
this.$message({
type: "warning",
message: "请输入必要信息!"
});
}
});
},
handleExport() {
this.$confirm("是否导出数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
expUtil.excelExport(`/api/spares/material/export?daf-auth=${getToken()}`, this.search, ['station']);
});
},
handleDetailSearch(row) {
this.$router.push({
path: "/spares/materialDetail",
query: {
frameMode:"view",
id: row.id,
},
});
},
headerClass() {
return 'header-class'
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDetail(this.form.id).then(res => {
@ -303,4 +624,8 @@
</script>
<style>
.header-class{
background-color: #3366cc !important;
color: #FFFFFF !important;
}
</style>

@ -0,0 +1,338 @@
<template>
<basic-container>
<avue-tabs :option="option"
@change="handleChange"></avue-tabs>
<span v-if="type.prop==='information'">
<avue-form :option="tab1_option"
v-model="tab1_form"
ref="tab1_form"
:class="frame_class">
</avue-form>
</span>
<span v-else-if="type.prop==='inbound'">
<div>
<avue-crud :data="inbound_data"
:table-loading="loading"
:option="option_inbound"
:permission="permissionList"
:header-cell-class-name="headerClass"
v-model="inbound_form"
ref="inbound_crud">
</avue-crud>
</div>
</span>
<span v-else-if="type.prop==='outbound'">
<avue-crud :option="option_outbound"
:table-loading="loading"
:data="outbound_data"
:permission="permissionList"
:header-cell-class-name="headerClass"
v-model="outbound_form"
ref="outbound_crud2">
</avue-crud>
</span>
<div class="container">
<span >
<el-button type="primary"
size="large"
@click="handleFormSubmit"
v-if="addUpdateShowButton">
确定</el-button>
</span>
</div>
</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 {mapGetters} from "vuex";
export default {
data() {
return {
form: {},
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
readonlyForm:{},
addUpdateShowButton:{},
frame_class: '',
tab1_form: {},
tab1_option: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "物资编号",
prop: "materialNo",
span: 6,
rules: [{
required: true,
message: "请输入物资编号",
trigger: "blur"
}]
},
{
label: "场站",
prop: "station",
span: 6,
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=station",
props: {
label: "dictValue",
value: "dictKey"
},
rules: [{
required: true,
message: "请输入场站",
trigger: "blur"
}]
},
{
label: "物资名称",
prop: "materialName",
span: 6,
rules: [{
required: true,
message: "请输入物资名称",
trigger: "blur"
}]
},
{
label: "物资分类码",
prop: "materialClassCode",
span: 6,
rules: [{
required: true,
message: "请输入物资分类码",
trigger: "blur"
}]
},
{
label: "规格型号",
prop: "model",
span: 6,
rules: [{
required: true,
message: "请输入规格型号",
trigger: "blur"
}]
},
{
label: "制造商名称",
prop: "manufacturerName",
span: 6
},
{
label: "供应商名称",
prop: "sipplierName",
span: 6
},
{
label: "所属仓库",
prop: "warehouse",
span: 6
},
{
label: "库存数量",
prop: "inventoryCount",
span: 6,
rules: [{
required: true,
message: "请输入库存数量",
trigger: "blur"
}]
},
{
label: "物资描述",
prop: "materialDescription",
span: 6,
rules: [{
required: true,
message: "请输入物资描述",
trigger: "blur"
}]
}
]
},
inbound_form: {},
option_inbound: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "物资编号",
prop: "materialNo"
},
{
label: "入库编号",
prop: "inboundNo"
},
{
label: "入库时间",
prop: "inboundTime",
format: 'yyyy/MM/dd'
},
{
label: "入库申领人",
prop: "inboundClaimants"
},
{
label: "入库经办人",
prop: "inboundManager"
},
{
label: "入库数量",
prop: "inboundCount"
},
{
label: "入库审核状态",
prop: "istatus",
dicUrl: "/api/daf-system/dict/dictionary?code=check_status",
props: {
label: "dictValue",
value: "dictKey"
}
}
]
},
outbound_form: {},
option_outbound: {
submitBtn: false,
emptyBtn: false,
column: [
{
label: "物资编号",
prop: "materialNo"
},
{
label: "出库编号",
prop: "outboundNo"
},
{
label: "出库时间",
prop: "outboundTime",
format: 'yyyy/MM/dd'
},
{
label: "入库申领人",
prop: "inboundClaimants"
},
{
label: "出库经办人",
prop: "outboundManager"
},
{
label: "出库数量",
prop: "outboundCount"
},
{
label: "出库审核状态",
prop: "istatus",
type: "select",
dicUrl: "/api/daf-system/dict/dictionary?code=check_status",
props: {
label: "dictValue",
value: "dictKey"
}
}
]
},
data: [],
inbound_data: [],
outbound_data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
// this.option.column = this.option.column.filter(v => {
// return this.permission['material_col_' + v.prop]
// })
return {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false
};
},
},
created () {
this.type = this.option.column[0];
if(this.$route.query.frameMode == "view"){
this.option.column.push({ label: '入库详情', prop: 'inbound' },{ label: '出库详情', prop: 'outbound' });
this.readonlyForm=true;
this.addUpdateShowButton=false;
this.frame_class = 'frame_class';
this.SearchDetail();
}else{
this.readonlyForm=false;
this.addUpdateShowButton=true;
this.frame_class = null;
}
},
methods: {
handleChange (column) {
this.type = column
if (column.prop == 'inbound') {
this.inbound_onLoad();
}if (column.prop == 'outbound') {
this.outbound_onLoad();
}
},
SearchDetail() {
getDetail(this.$route.query.id).then(res => {
console.log(res);
this.tab1_form = res.data.data;
});
},
inbound_onLoad() {
this.loading = true;
inbound_getListByMaterialNo(this.$route.query.id).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;
this.loading = false;
});
},
headerClass(){
return 'head-style'
}
}
};
</script>
<style>
.head-style{
background-color: #1e9fff !important;
color: #FFFFFF !important;
}
.frame_class input.el-input__inner {
border: none;
box-shadow: none;
outline: none;
pointer-events: none;
}
.frame_class .el-input__icon {
display: none;
}
.frame_class .el-input--prefix .el-input__inner {
padding-left: 15px;
}
.frame_class input::placeholder {
color: transparent;
display: none; /* 默认隐藏 */
}
</style>
Loading…
Cancel
Save