Commit 2465684e authored by 黄媛媛's avatar 黄媛媛
parents d9984cb1 85d278da
<template>
<div class="assetsList InventoryDetail">
<div class="routerTitle">
<span class="pageTitle">报溢<span @click="Backto" style="position:relative;top:-5px" class="backTo">返回</span></span>
<span @click="savePan" style="margin-left:20px" class="chaxunSpan">确认报溢</span>
</div>
<div class="padContent">
<table style="width:100%;" class="myTable" border="0" cellspacing="0" cellpadding="0">
<thead>
<th><input class="color-input-red" type="checkbox" v-model="isCheckAll" @click="selectAll()"></th>
<th style="width:60px;">状态</th>
<th style="width:80px;">物料编号</th>
<th>物料名称</th>
<th>规格</th>
<th style="width:50px;">库存</th>
<th style="width:70px;">实际数量</th>
<th></th>
<th>最新单价</th>
<th>备注</th>
<th style="width:150px;">盘点人/时间</th>
<th style="width:70px;">处理状态</th>
</thead>
<tbody>
<tr v-for="(item,index) in tableData" :key="index">
<td>
<input class="color-input-red" type="checkbox" :disabled="item.DealStatus!=2" v-model="checkList" :value="item" @change="selectionChange">
</td>
<td>
<span class="ColorSpan huangSpan" v-if="item.CheckStatus == 1"></span>
<span class="ColorSpan greenSpan" v-if="item.CheckStatus == 2"></span>
<span class="ColorSpan purpleSpan" v-if="item.CheckStatus == 3"></span>
<span class="ColorSpan redSpan" v-if="item.CheckStatus == 4"></span>
<span>{{item.CheckStatusName}}</span>
</td>
<td>{{item.SuppliesNo}}</td>
<td>{{item.SuppliesName}}</td>
<td>
<span v-for="(x,y) in item.SpecificationList" :key="y">{{x}} <span
v-if="item.SpecificationList.length !== y+1"> , </span></span>
</td>
<td>{{item.InventoryNum}}</td>
<td>{{item.RealityNum}}</td>
<td>
<span style="color:green;">{{getNum(item)}}</span>
</td>
<td><el-input type='text' class="w80" v-model="item.Unit_Money" @keyup.native="checkInteger(item,'Unit_Money')" /></td>
<td style="width:300px;">{{item.Remark}}</td>
<td>{{item.CheckEmpName}}/{{item.CheckDate}}</td>
<td>
<span v-if="item.DealStatus==1" style="color:green">已处理</span>
<span v-if="item.DealStatus==2" style="color:red">未处理</span>
</td>
</tr>
<tr v-show="tableData.length==0">
<td colspan="12" align="center">暂无数据</td>
</tr>
</tbody>
</table>
<el-pagination @current-change="currentChange" background :page-size="msg.pageSize" layout="prev, pager, next"
:total="total" :current-page.sync="msg.pageIndex">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: "InventoryBoyi",
components: {},
data() {
return {
morequery: false,
dateList: [],
currentPage: 1,
tableData: [],
loading: false,
total: 0,
//盘点报损报溢msg
msg: {
pageIndex: 1,
pageSize: 99999999,
CheckId: 0,
SuppliesId: 0,
SuppliesName: '',
CheckStatus: 3, //盘亏
DealStatus: 0 //盈亏处理状态 1已处理 2未处理
},
saveMsg: {
ID: 0,
WarehouseId: 0, //仓库id
CheckId: 0, //盘点id
CheckStatus: 3,
DetailList: []
},
isCheckAll:false,
checkList:[]
};
},
mounted() {
this.msg.CheckId = this.$route.query.CheckId;
this.saveMsg.CheckId = this.$route.query.CheckId;
this.saveMsg.WarehouseId = this.$route.query.WarehouseId;
this.getList();
},
methods: {
currentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
Backto() {
this.$router.push({
path: "/InventoryDetail",
query: {
CheckId: this.msg.CheckId
}
});
},
//查看报损
getList() {
this.loading = true;
this.apiJavaPost(
"/api/supplies/GetSuppliesCheckDetailBreakagePageList",
this.msg,
res => {
this.loading = false;
if (res.data.resultCode === 1) {
this.tableData = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Error(res.data.message);
}
},
null
);
},
//单选
selectionChange(){
if(this.checkList.length < this.tableData.length) {
this.isCheckAll = false
} else {
this.isCheckAll = true
}
},
// 选择所有
selectAll(){
if(this.isCheckAll == true) {
this.checkList = [];
} else {
this.checkList=[];
this.tableData.forEach(item => {
if(item.DealStatus==2){
this.checkList.push(item)
}
})
}
},
//获取损
getNum(row) {
return row.RealityNum - row.InventoryNum;
},
//保存
savePan() {
this.saveMsg.DetailList=[];
if(this.checkList.length==0){
this.Error('请选择报损单据');
}else{
this.checkList.forEach(x=>{
var obj={
SuppliesId:x.SuppliesId,
GoodsName:x.SuppliesName,
SpecificationName:x.SpecificationList.toString(),
CheckDetailId:x.Id,
ReportLossNum: x.RealityNum - x.InventoryNum, //盈/亏数
ReportLossPrice:(x.RealityNum - x.InventoryNum)*x.Unit_Money //总价格(请先用盈/亏价 乘以 赢/亏数)
}
this.saveMsg.DetailList.push(obj);
})
this.apiJavaPost(
"/api/supplies/SetSuppliesReportLoss",
this.saveMsg,
res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
},
null
);
}
},
}
};
</script>
<style>
.InventoryDetail .dateList .el-date-editor .el-range__icon {
line-height: 24px;
}
.InventoryDetail .dateList .el-date-editor .el-range-separator {
line-height: 22px;
}
.InventoryDetail .MyEditForm .dateList.el-input__inner {
width: 300px;
}
.assetsList .MyEditForm .baseform .el-form-item:nth-child(4n) {
margin-right: 0;
}
.assetsList .zczt1 {
background: #ffe4d5;
color: #ffa87c;
}
.assetsList .zczt2 {
background: #beeff0;
color: #089bab;
}
.assetsList .zczt3 {
background: #ffd6d5;
color: #ff7874;
}
.assetsList .zczt4 {
background: #d7d6ff;
color: #7b78ff;
}
.assetsList .Commonzczt {
display: inline-block;
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
border-radius: 50%;
font-size: 12px;
font-family: "Microsoft YaHei";
}
.assetsList {
width: 100%;
height: 100%;
}
.w80 {
width: 80px !important;
}
</style>
......@@ -10,8 +10,10 @@
<img v-show="morequery" class="roatImg" style="width:12px;height:12px" src="../../assets/img/more.png" alt="" />
</span>
<span @click="getList" style="margin-left:20px" class="chaxunSpan">查询</span>
<span @click="outerVisible=true" style="margin-left:20px" class="chaxunSpan">导入</span>
<span @click="goBaosun" style="margin-left:20px" class="chaxunSpan">查看报损/报溢</span>
<span style="margin-left:20px" class="chaxunSpan">批量保存</span>
<span @click="outerVisible=true" style="margin-left:20px" class="chaxunSpan">盘点导入</span>
<span @click="goBaosun('InventoryBosun')" style="margin-left:20px" class="chaxunSpan">查看报损</span>
<span @click="goBaosun('InventoryBoyi')" style="margin-left:20px" class="chaxunSpan">查看报溢</span>
<span @click="complePandian" style="margin-left:20px" class="chaxunSpan">完成盘点</span>
</div>
......@@ -39,7 +41,7 @@
</li>
</ul>
<vxe-table stripe style="margin-top:15px" :loading="loading" :data="tableData">
<vxe-table-column field="Name" title="状态">
<vxe-table-column field="Name" title="状态" width="120">
<template v-slot="{ row }">
<span class="ColorSpan huangSpan" v-if="row.CheckStatus == 1"></span>
<span class="ColorSpan greenSpan" v-if="row.CheckStatus == 2"></span>
......@@ -48,25 +50,34 @@
<span>{{row.CheckStatusName}}</span>
</template>
</vxe-table-column>
<vxe-table-column field="SuppliesNo" title="物料编号"></vxe-table-column>
<vxe-table-column field="SuppliesId" title="物料id"></vxe-table-column>
<vxe-table-column field="SuppliesName" title="物料名称"></vxe-table-column>
<vxe-table-column field="SpecificationList" title="规格">
<vxe-table-column field="SuppliesNo" title="物料编号" width="100"></vxe-table-column>
<vxe-table-column field="SuppliesName" title="物料名称" width="200"></vxe-table-column>
<vxe-table-column field="SpecificationList" title="规格" width="220">
<template v-slot="{ row }">
<span v-for="(x,y) in row.SpecificationList" :key="y">{{x}} <span
v-if="row.SpecificationList.length !== y+1"> , </span></span>
</template>
</vxe-table-column>
<vxe-table-column field="InventoryNum" title="库存"></vxe-table-column>
<vxe-table-column field="InventoryNum" title="库存" width="100"></vxe-table-column>
<vxe-table-column field="RealityNum" title="实际数量">
<template v-slot="{ row }">
<el-input type='text' class="w80" v-model="row.RealityNum" />
<el-input type='text' class="w80" @keyup.native="checkInteger(row,'RealityNum')" v-model="row.RealityNum" />
</template>
</vxe-table-column>
<vxe-table-column field="Remark" title="备注"></vxe-table-column>
<vxe-table-column field="Remark" title="备注" width="200"></vxe-table-column>
<vxe-table-column field="CheckEmpName" title="盘点人名称"></vxe-table-column>
<vxe-table-column field="CheckDate" title="盘点时间"></vxe-table-column>
<vxe-table-column field="CheckEmpName" title="盘点人/时间" width="200">
<template v-slot="{ row }">
<span v-if="row.CheckEmpName||row.CheckDate">{{row.CheckEmpName}}/{{row.CheckDate}}</span>
</template>
</vxe-table-column>
<vxe-table-column field="ImageList" title="图片" width="200">
<template v-slot="{row}">
<div class="Inven_imgList" v-for="(item,index) in row.ImageList" :key="index">
<img :src="item" />
</div>
</template>
</vxe-table-column>
<vxe-table-column field="address" title="操作">
<template v-slot="{ row }">
......@@ -80,9 +91,8 @@
<img style="width:24px;height:20px" @click="getRow(row)" src="../../assets/img/pic.png" alt="" />
</el-upload>
</el-tooltip>
<el-tooltip class="item" effect="dark"
content="修改备注" placement="top">
<img style="width:24px;height:24px" @click="getRowRemark(row)" src="../../assets/img/edit.png" alt="" />
<el-tooltip class="item" effect="dark" content="修改备注" placement="top">
<img style="width:24px;height:24px" @click="getRowRemark(row)" src="../../assets/img/edit.png" alt="" />
</el-tooltip>
</template>
</vxe-table-column>
......@@ -97,6 +107,7 @@
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
<div style="color:red;margin:0 0 10px 95px;">注意:上传附件后会更新盘点数据,请谨慎操作</div>
</el-dialog>
<!-- 单个修改备注 -->
......@@ -127,8 +138,8 @@
components: {},
data() {
return {
dialogState:false,
morequery: false,
dialogState: false,
morequery: true,
dateList: [],
currentPage: 1,
tableData: [],
......@@ -158,12 +169,15 @@
//单条图片
commonId: 0,
//单条保存备注
Content:'',
commonRow:{}
Content: '',
commonRow: {},
//仓库id
WarehouseId: 0
};
},
mounted() {
this.msg.CheckId = this.$route.query.CheckId;
this.WarehouseId = this.$route.query.WarehouseId;
this.getList();
this.getCheckStatus();
//上传接口路径
......@@ -214,30 +228,39 @@
});
},
//跳转至报损报溢
goBaosun() {
goBaosun(path) {
this.$router.push({
path: "/InventoryBosun",
path: path,
query: {
CheckId: this.msg.CheckId
CheckId: this.msg.CheckId,
WarehouseId: this.WarehouseId
}
});
},
//完成盘点
complePandian() {
let msg = {
CheckId: this.msg.CheckId
}
this.apiJavaPost(
"/api/supplies/SetSuppliesCheckComplete", msg,
res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
},
null
);
this.$confirm("是否确定盘点?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning'
}).then(() => {
let msg = {
CheckId: this.msg.CheckId
}
this.apiJavaPost(
"/api/supplies/SetSuppliesCheckComplete", msg,
res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
} else {
this.Error(res.data.message);
}
},
null
);
}).catch(() => {
this.$message.info('已取消拒绝!')
});
},
beforeAvatarUpload(file) {
return;
......@@ -286,24 +309,21 @@
this.Type = 2;
this.commonId = row.Id;
this.ImageList = row.ImageList;
this.commonRow = row;
},
//点击修改备注
getRowRemark(row){
this.Content=row.Remark;
this.dialogState=true;
this.commonRow=row;
getRowRemark(row) {
this.Type = 3;
this.Content = row.Remark;
this.dialogState = true;
this.commonRow = row;
},
//点击确定
saveRemark(){
this.dialogState=false;
// this.tableData.forEach(x=>{
// if(x.Id==this.commonId){
// x.Remark=this.Content
// }
// })
saveRemark() {
this.dialogState = false;
let msg = {
CheckDetailId: this.commonRow.Id,
Type: 3,
Type: this.Type,
Reality: this.commonRow.RealityNum,
ImageList: this.commonRow.ImageList,
Remark: this.Content
......@@ -313,6 +333,7 @@
res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
......@@ -352,14 +373,17 @@
file.file.size < 1024 ?
file.file.size :
(file.file.size / 1024).toFixed(0);
this.tableData.forEach(y => {
var data=JSON.parse(JSON.stringify(this.tableData));
data.forEach(y => {
if (y.Id == this.commonId) {
y.ImageList.push(
this.domainManager().ViittoFileUrl + x.data.FilePath
)
}
this.tableData=data;
console.log(this.tableData,'table');
})
this.Success("上传成功");
this.saveRemark();
});
},
......@@ -427,4 +451,16 @@
width: 80px !important;
}
.Inven_imgList {
width: 50px;
height: 50px;
display: inline-block;
margin-right: 5px;
}
.Inven_imgList img {
width: 100%;
height: 100%;
}
</style>
......@@ -268,7 +268,8 @@ export default {
this.$router.push({
path: path,
query: {
CheckId:item.Id
CheckId:item.Id,
WarehouseId:item.WarehouseId
}
});
......@@ -398,6 +399,7 @@ export default {
if (res.data.resultCode === 1) {
this.tableData = res.data.data.pageData;
this.total = res.data.data.count;
console.log(this.tableData,'tableData');
} else {
this.Error(res.data.message);
}
......
......@@ -235,13 +235,18 @@ export default {
name: 'InventoryDetail',
component: resolve => require(['@/components/Materialman/InventoryDetail'], resolve),
},
// 耗材报损报溢
// 耗材报损
{
path: '/InventoryBosun',
name: 'InventoryBosun',
component: resolve => require(['@/components/Materialman/InventoryBosun'], resolve),
},
//耗材报溢
{
path: '/InventoryBoyi',
name: 'InventoryBoyi',
component: resolve => require(['@/components/Materialman/InventoryBoyi'], resolve),
},
// 现存量查询
{
path: '/SpotQuery',
......
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