Commit 183715f0 authored by 罗超's avatar 罗超

新增耗材出库

parent 3c91adc3
......@@ -44,4 +44,39 @@ import request from '../../utils/request_zc'
method: 'post',
data
})
}
/**
* 出库申请 - 出库
*
*/
export function SuppliesStockOut(data) {
return request({
url: '/supplies/SetSuppliesApplyForStockOut',
method: 'post',
data
})
}
/**
* 获取仓库
*
*/
export function GetWareHouse(data) {
return request({
url: '/Supplies/GetWareHouseList',
method: 'post',
data
})
}
/**
* 设置出库申请状态
*
*/
export function SetSuppliesStockOutApplyForState(data) {
return request({
url: '/supplies/SetSuppliesStockOutApplyForState',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div class="PropertyProcurementDetails padContent ck_detail" v-loading="pageLoad">
<div style="border-bottom: 1px solid #e2e4eb; padding-bottom: 10px;display:flex;align-items:center;height:50px">
<span class="pageTitle" style="float: inherit">耗材出库详情</span>
<el-button @click="backTo" round style="background-color:#089bab;color:#fff;margin-left:15px" >返回</el-button>
<el-button @click="backTo" round style="background-color:#2961fe;color:#fff;margin-left:15px" >返回</el-button>
</div>
<div
style="
......@@ -42,7 +42,8 @@
</p>
</el-col>
<el-col :span="12">
<el-button @click="SetPropertyProcurementStockIn" round style="float: right;background-color:#089bab;color:#fff" :disabled="GetDetail.StockOutStatus === 3">出库</el-button>
<el-button @click="setStockoutdig=true" round style="float: right;background-color:#2961fe;color:#fff;margin-left:10px" v-if="isSelfCreate" :disabled="GetDetail.AuditStatus == 2">修改状态</el-button>
<el-button @click="SetStockout" round style="float: right;background-color:#2961fe;color:#fff;" :disabled="GetDetail.AuditStatus != 2||GetDetail.StockOutStatus === 3">出库</el-button>
</el-col>
</el-row>
<el-row>
......@@ -72,11 +73,19 @@
<span>总数量 :</span>
<span>{{ GetDetail.TotalNumber }}</span>
</el-col>
<el-col :span="12" style="display:flex">
<span>仓库 :</span>
<div>
<q-select filled use-input input-debounce="0" option-value="Id"
option-label="Name" v-model="GetDetail.WareHouseId" :options="storeList" dense
emit-value map-options>
</q-select>
</div>
</el-col>
<el-col :span="24">
<span>备注 :</span>
<span>{{ GetDetail.AuditRemark }}</span>
<span>{{ GetDetail.Remark }}</span>
</el-col>
</el-row>
</el-col>
......@@ -119,7 +128,7 @@
<td>{{ item.Number }}</td>
<td>{{ item.StockOutNum }}</td>
<td>
<el-input v-model.number="item.WaitStockOutNum" type="number" @input="inputval(item.WaitStockOutNum,item.Number,index)" :min="0" :max="item.Number" :disabled="GetDetail.StockOutStatus === 3"></el-input>
<q-input v-model.number="item.WaitStockOutNum" type="number" @input="inputval(item.WaitStockOutNum,item.Number,index)" :min="0" :max="item.Number" :disable="GetDetail.AuditStatus != 2||GetDetail.StockOutStatus === 3"></q-input>
</td>
</tr>
......@@ -129,36 +138,97 @@
</tbody>
</table>
</div>
<q-dialog v-model="setStockoutdig">
<q-card class="q-px-md" style="width:1000px;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">修改状态</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-6 q-mt-lg">
<q-select filled use-input input-debounce="0" option-value="id" label="类型"
option-label="name" v-model="stateMsg.Type" :options="stateOption"
emit-value map-options>
</q-select>
</div>
</div>
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-12 q-mt-lg">
<q-input v-model="stateMsg.Remark" label="备注" type="textarea" filled></q-input>
</div>
</div>
<div class="col row wrap q-mr-lg q-col-gutter-md q-mb-lg">
<div class="col-12 q-mt-lg" >
<q-btn color="primary" label="提交" style="float:right" class="q-ml-sm" @click="SetStockoutState"></q-btn>
<q-btn text-color="primary" label="取消" style="float:right" @click="setStockoutdig=false"></q-btn>
</div>
</div>
</q-card>
</q-dialog>
</div>
</template>
<script>
import {GetSuppliesStockOutApplyForDetail} from '../../api/sale/StockOutApplyFor'
import {GetSuppliesStockOutApplyForDetail,SuppliesStockOut,GetWareHouse,SetSuppliesStockOutApplyForState} from '../../api/sale/StockOutApplyFor'
export default {
data() {
return {
ApplyForId: 0,
isSelfCreate:false,//出库单是否是登录人创建
images: [],
imageOptions: {
navbar: false,
title: false,
},
pageLoad: false,
storeList:[],
GetDetail: {
WareHouseId:0,
DetailList: [
],
},
uploadImgList: [],
setStockoutdig:false,
stateMsg:{
ApplyForId:0,
Type:1,
Remark:"",
},
stateOption:[
{
id:1,
name:"取消"
},
{
id:2,
name:"审核通过"
},
{
id:3,
name:"审核驳回"
}
]
};
},
created() {
this.ApplyForId = this.$route.query.Id;
this.stateMsg.ApplyForId=this.$route.query.Id;
this.getDetail();
this.getWareHouse();
},
mounted() {
},
mounted() {},
methods: {
getWareHouse(){
GetWareHouse({}).then(res=>{
this.storeList=res.data.data
})
},
inputval(val,maxVal,index){
this.$forceUpdate();
if(val>maxVal){
......@@ -172,45 +242,55 @@ export default {
},
getDetail() {
this.pageLoad = true;
let that=this
GetSuppliesStockOutApplyForDetail({ApplyForId:this.ApplyForId}).then(res=>{
this.pageLoad = false;
if(res.data.resultCode===1){
console.log(res.data.data)
this.GetDetail=res.data.data
this.GetDetail.DetailList.forEach(item=>{
item.WaitStockOutNum=item.StockOutNum
})
that.isSelf();
}
})
},
//采购单入
SetPropertyProcurementStockIn() {
// let msg = {
// ProcurementId: this.GetDetail.Id,
// StockInDate: this.GetDetail.BuyDate,
// DetailList: [],
// };
// this.GetDetail.DetailList.map((item) => {
// let obj = {
// Id:item.Id,
// MaterialId: item.MaterialId,
// WaitStockInNum: item.WaitStockInNum,
// };
// msg.DetailList.push(obj);
// });
// this.apiJavaPost(
// "/api/supplies/SetSuppliesProcurementStockIn",
// msg,
// (res) => {
// if (res.data.resultCode === 1) {
// this.Success(res.data.message)
// } else {
// this.Error(res.data.message);
// }
// },
// null
// );
//
SetStockout() {
let msg = {
Id: this.GetDetail.Id,
WareHouseId: this.GetDetail.WareHouseId,
DetailList: [],
};
this.GetDetail.DetailList.map((item) => {
let obj = {
Id:item.Id,
WaitStockOutNum:item.WaitStockOutNum
};
msg.DetailList.push(obj);
});
SuppliesStockOut(msg).then(res=>{
})
},
SetStockoutState(){
SetSuppliesStockOutApplyForState(this.stateMsg).then(res=>{
if(res.data.resultCode===1){
this.Success(res.data.message)
}else {
this.Error(res.data.message);
}
})
},
//判断登录人是否是创建人
isSelf(){
let loginId= JSON.parse(localStorage.getItem('loginUserInfo')).data.Id
if(this.GetDetail.CreateBy===loginId){
this.isSelfCreate=true
}else{
this.isSelfCreate=false
}
}
},
};
</script>
......
......@@ -163,7 +163,7 @@
<template v-slot:top="props">
<div class="col-2 q-table__title">出库管理</div>
<q-space />
<q-btn color="primary" size="11px" @click="showAdd">新增出库单</q-btn>
<q-btn color="accent" size="11px" icon="add" @click="showAdd">新增出库单</q-btn>
</template>
<template v-slot:body-cell-StockOutStatus="props">
<q-td :props="props">
......@@ -422,6 +422,9 @@
// 显示新增出库单
showAdd(){
this.showaddStockOut=true
},
closePop(){
this.showaddStockOut=false
}
}
}
......
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