Commit 1aa4bf55 by wangyalan-git

bug解决

parent 154a5f6a
......@@ -7,7 +7,7 @@ const service = axios.create({
// baseURL: process.env.BASE_API,
withCredentials: true,
baseURL: 'http://10.27.33.5:8201/mall-admin',
// baseURL: 'http://hhg.api.jsonpro.cn:8201/mall-admin',
// baseURL: 'http://192.168.31.28:8201/mall-admin',
timeout: 60000 // 请求超时时间
})
......
......@@ -75,16 +75,24 @@
style="width: 100%">
<el-table-column
prop="name"
align="center"
label="物品名称">
</el-table-column>
<el-table-column
prop="goodsCategoryName"
align="center"
label="物品类别">
</el-table-column>
<el-table-column
prop="goodsNum"
align="center"
label="剩余数量">
</el-table-column>
<el-table-column
prop="stockRoomName"
align="center"
label="所属库房">
</el-table-column>
</el-table>
</div>
</div>
......
......@@ -49,7 +49,7 @@
</el-table-column>
<el-table-column label="入库人"
align="center">
<template slot-scope="scope">{{$store.getters.type == 1? scope.row.backName :
<template slot-scope="scope">{{ scope.row.backName ||
scope.row.receptName}}
</template>
</el-table-column>
......@@ -59,7 +59,7 @@
</el-table-column>
<el-table-column label="所属库房"
align="center">
<template slot-scope="scope">{{scope.row.stockRoomName || '--'}}</template>
<template slot-scope="scope">{{scope.row.backStockRoomName || scope.row.stockRoomName}}</template>
</el-table-column>
<el-table-column label="操作"
......
......@@ -117,9 +117,7 @@
</el-table-column>
<el-table-column label="申领人" align="center">
<template slot-scope="scope">{{
$store.getters.type == 1
? scope.row.backOutboundName
: scope.row.receptOutboundName
scope.row.backOutboundName || scope.row.receptOutboundName
}}</template>
</el-table-column>
<el-table-column label="所属部门" align="center">
......@@ -129,7 +127,7 @@
</el-table-column>
<el-table-column label="所属库房" align="center">
<template slot-scope="scope">{{
scope.row.stockRoomName || "--"
scope.row.backStockRoomName || scope.row.stockRoomName
}}</template>
</el-table-column>
<el-table-column label="出库日期" align="center">
......@@ -398,11 +396,17 @@ export default {
return jsonData.map((v) => {
return filterVal.map((j) => {
if (j === "outboundName") {
if (this.$store.getters.type == 1) {
if (v["backOutboundName"]) {
return v["backOutboundName"];
} else {
return v["receptOutboundName"];
}
} else if (j === "stockRoomName") {
if (v["backStockRoomName"]) {
return v["backStockRoomName"];
} else {
return v["stockRoomName"];
}
} else if (j === "createtime") {
return this.$options.filters.formatTime(v[j]);
} else {
......
......@@ -325,7 +325,7 @@ export default {
let data = this.formData.tableData
outGoods({
memberId: this.userInfo.id,
outMemberId: this.$store.getters.memberId,
backOutMemberId: this.$store.getters.memberId,
vankeGoodsDtoList: this.formData.tableData
}).then(res => {
this.$emit('ok')
......
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="500px">
<el-dialog :visible.sync="visible" :title="title" center width="500px">
<!-- start -->
<el-form :model="model"
ref="attributeForm"
v-loading="loading"
label-width="150px">
<el-form
:model="model"
ref="attributeForm"
v-loading="loading"
label-width="150px"
>
<el-form-item label="物品名称:">
<span>{{model.goodsName}}</span>
<span>{{ model.goodsName }}</span>
</el-form-item>
<el-form-item label="型号:">
<span>{{model.goodsNo}}</span>
<span>{{ model.goodsNo }}</span>
</el-form-item>
<el-form-item label="物品类别:">
<span>{{model.categoryName}}</span>
<span>{{ model.categoryName }}</span>
</el-form-item>
<el-form-item label="出库数量:"
:rules="[{validator: validateNum,trigger: 'blur'}]"
prop="outboundNum">
<el-input size="small"
class="input-width"
placeholder="请输入出库数量"
v-model="model.outboundNum"></el-input>
<el-form-item
label="出库数量:"
:rules="[{ validator: validateNum, trigger: 'blur' }]"
prop="outboundNum"
>
<el-input
size="small"
class="input-width"
placeholder="请输入出库数量"
v-model="model.outboundNum"
></el-input>
</el-form-item>
<el-form-item label="申领人:">
<span>{{$store.getters.type == 1? this.model.backOutboundName : this.model.receptOutboundName}}</span>
<span>{{ model.backOutboundName || model.receptOutboundName }}</span>
</el-form-item>
<el-form-item label="所属部门:">
<span>{{model.departmentName}}</span>
<span>{{ model.departmentName }}</span>
</el-form-item>
<el-form-item label="所属库房:">
<span>{{model.stockRoomName}}</span>
<span>{{ model.backStockRoomName || model.stockRoomName }}</span>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { updateOutboundRecord } from '@/api/inventory'
import { updateOutboundRecord } from "@/api/inventory";
// 移动属性
export default {
name: 'updateNumModal',
data () {
name: "updateNumModal",
data() {
var validateNum = (rule, value, callback) => {
if (value === '') {
callback(new Error('数量不能为空'))
if (value === "") {
callback(new Error("数量不能为空"));
} else {
let myReg = /^\d{1,}$/
let myReg = /^\d{1,}$/;
if (!myReg.test(value)) {
callback(new Error('数量必须为正整数'))
callback(new Error("数量必须为正整数"));
}
callback()
callback();
}
}
};
return {
validateNum: validateNum,
visible: false,
title: null,
loading: false,
id: null,
model: {}
}
model: {},
};
},
methods: {
init () {
init() {
this.$nextTick(() => {
this.$refs.attributeForm.clearValidate()
})
this.$refs.attributeForm.clearValidate();
});
},
update(row){
this.id = null
let obj = JSON.stringify(row)
this.title="修改出库数量"
this.init()
this.model = JSON.parse(obj)
this.visible= true
update(row) {
this.id = null;
let obj = JSON.stringify(row);
this.title = "修改出库数量";
this.init();
this.model = JSON.parse(obj);
this.visible = true;
},
// 提交保存
submit () {
submit() {
this.$refs.attributeForm.validate((valid) => {
if (valid) {
// 验证通过
updateOutboundRecord({id: this.model.id,outboundNum: this.model.outboundNum}).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
updateOutboundRecord({
id: this.model.id,
outboundNum: this.model.outboundNum,
})
.then((res) => {
this.loading = false;
this.visible = false;
this.$emit("ok");
})
.catch((err) => {
this.loading = false;
});
}
})
});
},
close () {
this.visible = false
}
}
}
close() {
this.visible = false;
},
},
};
</script>
<style scoped>
.input-width {
width: 200px;
}
.input-width {
width: 200px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment