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
......@@ -19,12 +19,14 @@
<div class="text-subtitle2 text-weight-bold q-mb-md row items-center q-pb-none" >
<span>列表</span>
<q-space />
<q-btn color="primary" size="11px" @click="showhaocai">选择耗材</q-btn>
<q-btn color="primary" size="11px" @click="showhaocai" v-if="model.Type===2">选择耗材</q-btn>
<q-btn color="primary" size="11px" @click="addclass_haocai" v-if="model.Type===1">添加</q-btn></q-btn>
</div>
<div class="q-mt-md">
<!-- 班级相关 -->
<q-table :pagination="pageInfo" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-header-table sticky-right-column-table no-bottom-table" separator="none"
:data="dataList" :columns="model.Type===1?columns:columns2" row-key="name">
:data="dataList_class" :columns="columns" row-key="name" v-if="model.Type!=2">
<template v-slot:body-cell-SchoolName="props">
<q-td :props="props" class="text-negative">
<q-select dense standout behavior="menu" filled v-model="props.row.SchoolId" ref="school"
......@@ -39,11 +41,63 @@
:rules="[val => !!val || '请选择班级']" @input ='filterCourseFn($event,props.rowIndex)'/>
</q-td>
</template>
<template v-slot:body-cell-CourseName="props">
<template v-slot:body-cell-Name="props">
<q-td :props="props">
<div v-for="item in props.row.haocaiList" :key="item.id" class="td_height">
{{ item.Name||'/' }}
</div>
</q-td>
</template>
<template v-slot:body-cell-BrandName="props">
<q-td :props="props" >
<div v-for="item in props.row.haocaiList" :key="item.id" class="td_height">
{{ item.BrandName||'/' }}
</div>
</q-td>
</template>
<template v-slot:body-cell-CategoryName="props">
<q-td :props="props" >
<div v-for="item in props.row.haocaiList" :key="item.id" class="td_height">
{{ item.CategoryName||'/' }}
</div>
</q-td>
</template>
<template v-slot:body-cell-SupplierName="props">
<q-td :props="props" >
<div v-for="item in props.row.haocaiList" :key="item.id" class="td_height">
{{ item.SupplierName||'/' }}
</div>
</q-td>
</template>
<template v-slot:body-cell-InventoryNum="props">
<q-td :props="props" >
<div v-for="item in props.row.haocaiList" :key="item.id" class="td_height">
{{ item.InventoryNum}}
</div>
</q-td>
</template>
<template v-slot:body-cell-Number="props">
<q-td :props="props" class="text-negative">
<div v-for="(item,index) in props.row.haocaiList" :key="item.id">
<q-input standout filled v-model.number="item.Number" type="number" ref="number" :min='0' :max='item.InventoryNum' dense @input="chukuNum_class(item.Number,item.InventoryNum,index,props.rowIndex)"/>
</div>
</q-td>
</template>
<template v-slot:body-cell-caozuo="props">
<q-td :props="props" class="text-negative">
{{props.CourseName}}
<q-btn color="primary" size="11px" class="q-mr-md" @click="showhaocai(props.rowIndex)">选择耗材</q-btn>
<q-btn color="primary" size="11px" @click="delhaocai_class(props.rowIndex)">删除</q-btn>
</q-td>
</template>
<template v-slot:bottom>
</template>
</q-table>
<!-- 其他业务 -->
<q-table :pagination="pageInfo" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-header-table sticky-right-column-table no-bottom-table" separator="none"
:data="dataList" :columns="columns2" row-key="name" v-if="model.Type===2">
<template v-slot:body-cell-Number="props">
<q-td :props="props" class="text-negative">
<q-input standout filled v-model.number="props.row.Number" type="number" ref="number" :min='0' :max='props.row.InventoryNum' dense @input="chukuNum(props.row.Number,props.row.InventoryNum,props.rowIndex)"/>
......@@ -67,8 +121,8 @@
</q-card-actions>
<!-- 选择耗材 -->
<q-dialog v-model="haochaidig" persistent>
<q-card class="q-px-md" style="width:1000px;max-width:1000px;">
<q-card-section class="row items-center q-pb-none">
<q-card class="q-px-md" style="width:1000px;max-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 />
......@@ -176,16 +230,15 @@
return {
typeOption: [{
id: 1,
name: "班级相关"
name: "主营业务"
},
{
id: 2,
name: "其他业务"
}
],
model: {
Type:"",
Type:1,
Remark:"",
DetailList:[]
},
......@@ -331,7 +384,16 @@
courseList: [], //课程列表
schoolList:[],
classList:[],
dataList_class:[
{
SchoolName:"",
SchoolId:-1,
ClassName:"",
ClassId:0,
CourseName:"",
haocaiList:[]
},
],
dataList: [
// {
// SchoolName:"",
......@@ -387,13 +449,37 @@
initObj() {
this.dataList=[]
},
//保存报价
//创建出库
saveStockOut() {
this.$refs.type.validate();
if (
!this.$refs.type.hasError
) {
console.log(11,this.model)
if(this.model.Type===1){
this.model.DetailList=[]
this.dataList_class.map(item=>{
if(item.haocaiList.length>0){
item.haocaiList.map(_item=>{
let obj= {
SchoolName:item.SchoolName,
SchoolId:item.SchoolId,
ClassName:item.ClassName,
ClassId:item.ClassId,
CourseName:item.CourseName,
SuppliesId:_item.Id,
Number:_item.Number
}
this.model.DetailList.push(obj)
})
}else{
return
}
})
}else{
this.model.DetailList=[]
this.dataList.map(item=>{
let obj= {
......@@ -403,14 +489,23 @@
ClassId:item.ClassId,
CourseName:item.CourseName,
SuppliesId:item.Id,
Number:item.Number
Number:item.Number||0
}
this.model.DetailList.push(obj)
})
}
// SuppliesStockOutApply(this.model).then(res=>{
// console.log(res)
// })
SuppliesStockOutApply(this.model).then(res=>{
if(res.data.resultCode===1){
this.$parent.$parent.$parent.closePop()
}
this.$q.notify({
position: 'top',
timeout: 2000,
textColor: 'white',
message: res.data.message,
})
})
}
},
//获取校区列表
......@@ -450,20 +545,29 @@
})
},
filterSchoolFn(val,index) {
console.log(val)
let school=this.schoolList.filter(item=>{
return item.SId==val
})
this.dataList[index].SchoolName=school[0].SchoolName
if(this.model.Type===1){
this.dataList_class[index].SchoolName=school[0].SName
}else{
this.dataList[index].SchoolName=school[0].SName
}
this.$forceUpdate();
},
filterCourseFn(val,index) {
console.log(val)
let course=this.classList.filter(item=>{
return item.ClassId==val
})
this.dataList[index].CourseName=course[0].CourseName
this.dataList[index].ClassName=course[0].ClassName
if(this.model.Type===1){
this.dataList_class[index].CourseName=course[0].CourseName
this.dataList_class[index].ClassName=course[0].ClassName
}else{
this.dataList[index].CourseName=course[0].CourseName
this.dataList[index].ClassName=course[0].ClassName
}
this.$forceUpdate();
},
//显示耗材列表
......@@ -524,22 +628,32 @@
this.hcItemList.push(item);
});
if(this.model.Type===1){
this.dataList=Array.from(new Set(this.hcItemList))
this.dataList.forEach(item=>{
item.SchoolName=""
item.SchoolId=-1
item.ClassName=""
item.ClassId=0,
item.CourseName=""
// item.Number=0
})
let haocaidata=Array.from(new Set(this.hccheckList))
haocaidata.forEach(item=>{
item.Number=0
})
this.dataList_class[this.chooseHcIndex].haocaiList=haocaidata
}else if(this.model.Type===2){
this.dataList=Array.from(new Set(this.hcItemList))
}
})
},
addclass_haocai(){
let obj= {
SchoolName:"",
SchoolId:-1,
ClassName:"",
ClassId:0,
CourseName:"",
haocaiList:[]
}
this.dataList_class.push(obj)
},
//删除耗材
delhaocai_class(index){
this.dataList_class.splice(index, 1);
},
delhaocai(index){
this.dataList.splice(index, 1);
},
......@@ -548,6 +662,14 @@
this.haochaimsg.pageIndex = val;
this.gethaocai();
},
chukuNum_class(val,maxVal,index,rowIndex){
if(val>maxVal){
this.dataList_class[rowIndex].haocaiList[index].Number=maxVal
}else if(val<0||!val){
this.dataList_class[rowIndex].haocaiList[index].Number=0
}
this.$forceUpdate();
},
chukuNum(val,maxVal,index){
this.$forceUpdate();
......@@ -728,9 +850,7 @@
cursor: pointer;
}
.borderTable tr:nth-child(even) {
/* background:#F6F9FB!important; */
}
/* .borderTable .trNobottom{
......@@ -843,4 +963,11 @@
color: #F56C6C;
margin-right: 4px;
}
td .q-field--with-bottom{
padding-bottom: 0px
}
td .td_height{
height: 40px;
line-height: 40px;
}
</style>
......@@ -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