物资 入库

main
Dayu 11 months ago
parent ba90716fcb
commit 85055ed7d5
  1. 4
      src/api/spares/inbound.js
  2. 2
      src/api/spares/material.js
  3. 4
      src/api/spares/outbound.js
  4. 56
      src/views/spares/material.vue

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

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

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

@ -94,12 +94,14 @@
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import expUtil from "@/util/exportUtil"; import expUtil from "@/util/exportUtil";
import {getToken} from "@/util/auth"; import {getToken} from "@/util/auth";
import request from "@/router/axios";
export default { export default {
data() { data() {
return { return {
form: {}, form: {},
query: {}, query: {},
search:{},
loading: true, loading: true,
inBox: false, inBox: false,
outBox: false, outBox: false,
@ -254,6 +256,29 @@
prop: "materialNo", prop: "materialNo",
type:"select", type:"select",
span: 22, 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: [{ rules: [{
required: true, required: true,
message: "请输入物资编号", message: "请输入物资编号",
@ -322,6 +347,29 @@
label: "物资编号", label: "物资编号",
prop: "materialNo", prop: "materialNo",
span: 22, 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: [{ rules: [{
required: true, required: true,
message: "请输入物资编号", message: "请输入物资编号",
@ -455,13 +503,14 @@
}, },
handleIn(){ handleIn(){
this.inBox = true; this.inBox = true;
this.$refs.inForm.resetForm();
}, },
submitIn(row, done, loading) { submitIn(row, done, loading) {
this.$refs.inForm.validate((valid, done, msg) => { this.$refs.inForm.validate((valid, done, msg) => {
if (valid) { if (valid) {
done() done()
in_add(this.inForm).then(() => { in_add(this.inForm).then(() => {
this.$refs.inForm.inForm(); this.$refs.inForm.resetForm();
this.inBox = false; this.inBox = false;
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
@ -482,13 +531,14 @@
}, },
handleOut(){ handleOut(){
this.outBox = true; this.outBox = true;
this.$refs.outForm.resetForm();
}, },
submitOut(row, done, loading) { submitOut(row, done, loading) {
this.$refs.outForm.validate((valid, done, msg) => { this.$refs.outForm.validate((valid, done, msg) => {
if (valid) { if (valid) {
done() done()
out_add(this.outForm).then(() => { out_add(this.outForm).then(() => {
this.$refs.outForm.outForm(); this.$refs.outForm.resetForm();
this.outBox = false; this.outBox = false;
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
@ -513,7 +563,7 @@
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
expUtil.excelExport(`/api/spares/export?daf-auth=${getToken()}`, this.search, ['station', 'iStatus']); expUtil.excelExport(`/api/spares/material/export?daf-auth=${getToken()}`, this.search, ['station']);
}); });
}, },
handleDetailSearch(row) { handleDetailSearch(row) {

Loading…
Cancel
Save