Commit 1aa4bf55 by wangyalan-git

bug解决

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