Commit 62c2528c authored by 黄媛媛's avatar 黄媛媛

采购物资

parent 773fb990
......@@ -38,7 +38,7 @@
size="small"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<div class="searchInput" style="width:250px">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:225px;height:30px"
......@@ -48,7 +48,7 @@
size="small"
clearable>
</el-input>
<span @click="getList" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<span @click="Clearconditions" v-if="msg.Name!='' || msg.CategoryIds!='' || (dateList && dateList.length>0)" class='blue point'>清空筛选条件</span>
</div>
......
......@@ -172,7 +172,16 @@
<li class="menu_item" :class="{'Fchecked':isChecked=='/empowerManage'}" @click="isChecked='/empowerManage',CommonJump('empowerManage')">
<i class="el-icon-menu"></i><span>授权列表</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/materialQuery'}" @click="isChecked='/materialQuery',CommonJump('materialQuery')">
<i class="el-icon-menu"></i><span>物料查询</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/procurementMaage'}" @click="isChecked='/procurementMaage',CommonJump('procurementMaage')">
<i class="el-icon-menu"></i><span>采购管理</span>
</li>
<li class="menu_item" :class="{'Fchecked':isChecked=='/Materialwarehouse'}" @click="isChecked='/Materialwarehouse',CommonJump('Materialwarehouse')">
<i class="el-icon-menu"></i><span>物料仓库</span>
</li>
</ul>
</div>
</div>
......
<style>
.Materialwarehouse .template_comheader {
padding: 13px 20px;
border-bottom: 1px solid #EBEEF5;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
}
.Materialwarehouse .template_comheader>div {
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: row;
}
.Materialwarehouse .temp_content {
margin-top: 10px;
background: #fff;
padding: 20px;
}
.Materialwarehouse .temp_imgStyle {
display: inline-block;
margin-right: 10px;
}
.Materialwarehouse .app-add-cat .el-checkbox-group{
font-size: 14px!important;
}
.Materialwarehouse .app-add-cat .el-checkbox {
margin-right: 0;
}
.Materialwarehouse .app-add-cat .el-dialog__body{
padding:10px 20px!important;
}
.Materialwarehouse .app-add-cat .tag-box .tag-item {
margin-right: 5px;
}
.Materialwarehouse .app-add-cat .tag-box {
margin: 20px 0;
}
.Materialwarehouse .app-add-cat .app-goods-cat-list .active {
background: #FAFAFA;
}
.Materialwarehouse .app-add-cat .app-goods-cat-list .cat-item {
cursor: pointer;
padding: 5px 10px;
}
.Materialwarehouse .app-add-cat .app-goods-cat-list {
border: 1px solid #E8EAEE;
border-radius: 5px;
margin-top: -5px;
padding: 10px 0;
overflow: scroll;
height: 400px;
}
.Materialwarehouse .el-table td, .el-table th{
padding: 5px 0;
font-size: 14px;
}
</style>
<template>
<div class="Materialwarehouse">
<div class="template_comheader">
<div>
<span>物料仓库</span>
<el-button type="primary" size="small" @click="flDig=true,addMsg.Id = 0,addMsg.Name=''">新增仓库</el-button>
</div>
</div>
<div class="temp_content">
<div>
<div class="searchInput" style="width:250px;margin-right: 10px;">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:225px;height:30px"
placeholder="请输入商品名称"
v-model="msg.Name"
@clear="msg.pageIndex=1,getList()"
size="small"
clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
</div>
<el-table :data="dataList" border style="width: 100%;margin-Top:10px">
<el-table-column prop="Name" label="仓库名称" ></el-table-column>
<el-table-column prop="UpdateDate" label="操作时间" ></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img src="../../assets/img/setup/edit.png" alt="" class="temp_imgStyle" @click="EditeTemplate(scope.row)">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../assets/img/setup/del.png" alt="" class="temp_imgStyle" @click="DeleteTemplate(scope.row)">
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :current-page.sync="msg.pageIndex"
:page-size="msg.pageSize" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
<!-- 选择分类 -->
<el-dialog custom-class="app-add-cat" :title="addMsg.Id == 0 ?'新增仓库':'编辑仓库' " :visible.sync="flDig" width="700px">
<el-form
:model="addMsg"
:rules="rules"
ref="addMsg"
label-width="100px"
>
<el-form-item label="仓库名称" size="small" prop="Name">
<el-input
type="text"
size="small"
maxlength="200"
v-model="addMsg.Name"
>
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="flDig = false">取 消</el-button>
<el-button @click="submitForm('addMsg')" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
dataList: [],
msg: {
pageIndex: 1,
pageSize: 15,
Name:'',
},
addMsg:{
Id:0,
Name:'',
Contact:'',
Mobile:'',
},
flDig:false,
total: 0,
rules:{
Name: [
{ required: true, message: '请输入仓库名称', trigger: 'blur' }
]
},
};
},
created() {
},
methods: {
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList() {
this.apiJavaPost("/api/Supplies/GetWareHousePageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
}
})
},
submitForm(msg){
this.$refs[msg].validate(valid => {
if (valid) {
this.apiJavaPost(
"/api/Supplies/SetWareHouseInfo",
this.addMsg,
res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.flDig=false;
this.getList();
} else {
this.Info(res.data.message);
}
}
);
} else {
return false;
}
});
},
EditeTemplate(row){
this.addMsg.Id = row.Id;
this.addMsg.Name = row.Name;
this.flDig=true
},
DeleteTemplate(row){
let Id=row.Id;
this.$confirm("确认删除该仓库?","提示", {
confirmButtonText:"确定",
cancelButtonText: "取消",
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/Supplies/DelWareHouseInfo",{WareHouseId:Id},
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
}).catch(() => {
this.$message.info('已取消删除!')
});
}
},
mounted() {
this.getList();
}
};
</script>
......@@ -126,7 +126,7 @@ export default {
methods: {
//获取集团授权信息
getEmployeeData(data) {
this.apipost(
this.assetsApipost(
"/api/Authorize/GetAuthorizeModel",
{
Type:data.Type,
......@@ -149,7 +149,7 @@ export default {
);
},
getEmployeeList(){
this.apipost(
this.assetsApipost(
"/api/Employee/GetEmployeeList",
{},
res => {
......@@ -164,7 +164,7 @@ export default {
submitForm(msg){
this.$refs[msg].validate(valid => {
if (valid) {
this.apipost(
this.assetsApipost(
"/api/Authorize/SetAuthorize",
this.msg,
res => {
......
......@@ -97,7 +97,7 @@
this.getList();
},
getList() {
this.apipost("/api/Authorize/GetAuthorizePageList", this.msg, res => {
this.assetsApipost("/api/Authorize/GetAuthorizePageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
......@@ -117,7 +117,7 @@
DeleteTemplate(item) {
let that = this;
that.Confirm("是否删除?", function () {
that.apipost("/api/Authorize/DelERPAuthorize", {
that.assetsApipost("/api/Authorize/DelERPAuthorize", {
ID: item.ID,
}, res => {
if (res.data.resultCode == 1) {
......
......@@ -81,7 +81,7 @@ export default {
//获取集团授权信息
GetWeiXinAppConfig() {
// type 1-个人,2-集团
this.apipost(
this.assetsApipost(
"/api/Authorize/GetAuthorizeModel",
{Type:2},
res => {
......@@ -99,7 +99,7 @@ export default {
submitForm(msg){
this.$refs[msg].validate(valid => {
if (valid) {
this.apipost(
this.assetsApipost(
"/api/Authorize/SetAuthorize",
{
ID:this.msg.ID? this.msg.ID:0,
......
<style>
.materialQuery .template_comheader {
padding: 13px 20px;
border-bottom: 1px solid #EBEEF5;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
}
.materialQuery .template_comheader>div {
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: row;
}
.materialQuery .temp_content {
margin-top: 10px;
background: #fff;
padding: 20px;
}
.materialQuery .temp_imgStyle {
display: inline-block;
margin-right: 10px;
}
.materialQuery .app-add-cat .el-checkbox-group{
font-size: 14px!important;
}
.materialQuery .app-add-cat .el-checkbox {
margin-right: 0;
}
.materialQuery .app-add-cat .el-dialog__body{
padding:10px 20px!important;
}
.materialQuery .app-add-cat .tag-box .tag-item {
margin-right: 5px;
}
.materialQuery .app-add-cat .tag-box {
margin: 20px 0;
}
.materialQuery .app-add-cat .app-goods-cat-list .active {
background: #FAFAFA;
}
.materialQuery .app-add-cat .app-goods-cat-list .cat-item {
cursor: pointer;
padding: 5px 10px;
}
.materialQuery .app-add-cat .app-goods-cat-list {
border: 1px solid #E8EAEE;
border-radius: 5px;
margin-top: -5px;
padding: 10px 0;
overflow: scroll;
height: 400px;
}
.materialQuery .el-table td, .el-table th{
padding: 5px 0;
font-size: 14px;
}
</style>
<template>
<div class="materialQuery">
<div class="template_comheader">
<div>
<span>物料查询</span>
<el-button type="primary" size="small" @click="flDig=true">同步商品</el-button>
</div>
</div>
<div class="temp_content">
<div>
<div class="searchInput" style="width:150px;margin-right: 0px;">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:125px;height:30px"
placeholder="请输入仓库id"
v-model="msg.WareHouseId"
@clear="msg.pageIndex=1,getList()"
size="small"
clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<div class="searchInput" style="width:150px;margin-right: 10px;">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:125px;height:30px"
placeholder="请输入商品id"
v-model="msg.GoodsId"
@clear="msg.pageIndex=1,getList()"
size="small"
clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<div class="searchInput" style="width:250px;margin-right: 10px;">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:225px;height:30px"
placeholder="请输入商品名称"
v-model="msg.Name"
@clear="msg.pageIndex=1,getList()"
size="small"
clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
</div>
<el-table :data="dataList" border style="width: 100%;margin-Top:10px">
<el-table-column prop="Id" label="ID" width="60"></el-table-column>
<el-table-column prop="Name" label="商品名称" width="400"></el-table-column>
<el-table-column prop="Money" label="成本价格"></el-table-column>
<el-table-column prop="Units" label="单位"></el-table-column>
<el-table-column label="图片列表" align="center">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.ImageList" :key="index" style="width: 50px; height: 50px;">
<img :src="item" alt="" style="width: 50px; height: 50px;">
</div>
</template>
</el-table-column>
<el-table-column prop="Remark" label="备注"></el-table-column>
<el-table-column prop="SupplierName" label="供应商名称"></el-table-column>
<el-table-column prop="SuppliesNum" label="物料编码"></el-table-column>
<el-table-column prop="InventoryNum" label="库存(选择仓库后有值)"></el-table-column>
<el-table-column label="商品规格列表">
<template slot-scope="scope">
<span v-for="(item,index2) in scope.row.GoodsSpecificationList" :key="index2" >{{item}} </span>
</template>
</el-table-column>
<el-table-column label="商品分类列表">
<template slot-scope="scope">
<span v-for="(item,index3) in scope.row.GoodsCategoryList" :key="index3" >{{item}} </span>
</template>
</el-table-column>
<el-table-column prop="UpdateDate" label="操作时间"></el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange" :current-page.sync="msg.pageIndex"
:page-size="msg.pageSize" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
<!-- 选择分类 -->
<el-dialog custom-class="app-add-cat" title="选择分类" :visible.sync="flDig" width="1100px">
<el-row>
<el-col :span="8" style="padding:0 10px;box-sizing:border-box">
<h3 style="padding:15px 0">一级分类</h3>
<div class="app-goods-cat-list active">
<el-checkbox-group v-model="checkList">
<div v-for="(item,index) in fenleiData" :key="index" flex="dir:left box:first" class="cat-item">
<el-checkbox :label="item">
<span style="display: none;">{{item.Name}}</span>
</el-checkbox>
<div flex="box:last cross:center">
<span>{{item.Name}}</span>
<i v-if="item.ChildList.length>0" @click="getChild2(item.ChildList)" class="el-icon-arrow-right"></i>
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
<el-col v-show="childList2.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
<h3 style="padding:15px 0">二级分类</h3>
<div class="app-goods-cat-list active">
<el-checkbox-group v-model="checkList">
<div v-for="(item,index) in childList2" :key="index" flex="dir:left box:first" class="cat-item">
<el-checkbox :label="item">
<span style="display: none;">{{item.Name}}</span>
</el-checkbox>
<div flex="box:last cross:center">
<span>{{item.Name}}</span>
<i v-if="item.ChildList.length>0" @click="getChild3(item.ChildList)" class="el-icon-arrow-right"></i>
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
<el-col v-show="childList3.length>0" :span="8" style="padding:0 10px;box-sizing:border-box">
<h3 style="padding:15px 0">三级分类</h3>
<div class="app-goods-cat-list active">
<el-checkbox-group v-model="checkList">
<div v-for="(item,index) in childList3" :key="index" flex="dir:left box:first" class="cat-item">
<el-checkbox :label="item">
<span style="display: none;">{{item.Name}}</span>
</el-checkbox>
<div flex="box:last cross:center">
<span>{{item.Name}}</span>
<i class="el-icon-arrow-right"></i>
</div>
</div>
</el-checkbox-group>
</div>
</el-col>
</el-row>
<div class="tag-box">
<el-tag @close="exitCheck(item)" v-for="(item,index) in checkList" :key="index" type="warning" closable style="margin-right:5px">{{item.Name}}</el-tag>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="flDig = false">取 消</el-button>
<el-button @click="chooseFl" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
dataList: [],
fenleiData:[],
childList2:[],
childList3:[],
checkList:[],
msg: {
pageIndex: 1,
pageSize: 15,
WareHouseId:'',
GoodsId:'',
Name:'',
},
flDig:false,
total: 0
};
},
created() {
},
methods: {
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList() {
if(this.msg.WareHouseId!=''){
this.msg.WareHouseId = Number(this.msg.WareHouseId)
}
if(this.msg.GoodsId!=''){
this.msg.GoodsId = Number(this.msg.GoodsId)
}
this.assetsApipost("/api/property/GetMaterialPageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
}
})
},
getTree(){
let msg1={
Id:0,
Name:'',
Tier:0,
ParentId:0,
Enabled:1,
IsShow:1,
}
this.apipost("/api/product/GetProductCategoryTreeList", msg1, res => {
if(res.data.resultCode==1){
let pageData=res.data.data;
this.fenleiData=pageData;
}
})
},
setSyncGoodsToMaterial(CategoryIds){
this.assetsApipost("/api/property/SetSyncGoodsToMaterial", {CategoryIds:CategoryIds}, res => {
if(res.data.resultCode==1){
}else{
this.Info(res.data.message);
}
})
},
chooseFl(){
let CategoryIds=[];
console.log(this.checkList)
this.checkList.forEach(item=>{
CategoryIds.push(item.Id)
})
this.msg.pageIndex=1
console.log(CategoryIds)
// this.getList();
this.setSyncGoodsToMaterial(CategoryIds)
this.flDig=false;
},
getChild3(ChildList){
this.childList3=ChildList;
},
getChild2(ChildList){
this.childList2=ChildList;
},
exitCheck(item,index){
this.checkList.forEach((list,k)=>{
if(list.Id==item.Id){
this.checkList.splice(k,1);
}
})
},
},
mounted() {
this.getList();
this.getTree();
}
};
</script>
<style>
.materialQuery .template_comheader {
padding: 13px 20px;
border-bottom: 1px solid #EBEEF5;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
}
.materialQuery .template_comheader>div {
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: row;
}
.materialQuery .temp_content {
margin-top: 10px;
background: #fff;
padding: 20px;
}
.materialQuery .temp_imgStyle {
display: inline-block;
margin-right: 10px;
}
.materialQuery .app-add-cat .el-checkbox-group {
font-size: 14px !important;
}
.materialQuery .app-add-cat .el-checkbox {
margin-right: 0;
}
.materialQuery .app-add-cat .el-dialog__body {
padding: 10px 20px !important;
}
.materialQuery .app-add-cat .tag-box .tag-item {
margin-right: 5px;
}
.materialQuery .app-add-cat .tag-box {
margin: 20px 0;
}
.materialQuery .app-add-cat .app-goods-cat-list .active {
background: #FAFAFA;
}
.materialQuery .app-add-cat .app-goods-cat-list .cat-item {
cursor: pointer;
padding: 5px 10px;
}
.materialQuery .app-add-cat .app-goods-cat-list {
border: 1px solid #E8EAEE;
border-radius: 5px;
margin-top: -5px;
padding: 10px 0;
overflow: scroll;
height: 400px;
}
.materialQuery .el-table td,
.el-table th {
padding: 5px 0;
font-size: 14px;
}
.materialQuery .el-form-item {
margin-bottom: 15px;
}
.materialQuery .flDig_choose {
display: flex;
flex-direction: row;
align-items: center;
}
.materialQuery .flDig_choose_item {
color: #089bab;
padding: 6px 12px;
border: 1px solid #089bab;
border-radius: 20px;
cursor: pointer;
}
.materialQuery .el-tag{
color: #000;
}
.materialQuery .AttrList{
margin-top: 10px; position: relative; margin-right: 15px;
overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
}
.materialQuery .Attrlist_item{
width: 55%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.materialQuery .Detaildata_box{
margin-top: 50px;
width: 100%;
}
.materialQuery .Detaildata_box .Detaildata_item{
display: flex;
flex-direction: row;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #f5f5f5;
}
.materialQuery .Detaildata_item_r{
display: flex;
flex-direction: column;
justify-content: space-around;
height: 100px;
padding: 10px 0;
}
</style>
<template>
<div class="materialQuery">
<div class="template_comheader">
<div>
<span>采购列表</span>
<el-button type="primary" size="small" @click="flDig=true">新增采购单</el-button>
</div>
</div>
<div class="temp_content">
<div>
<div class="searchInput" style="width:250px;margin-right: 0px;">
<el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:225px;height:30px"
placeholder="请输入商品名称" v-model="msg.GoodsName" @clear="msg.pageIndex=1,getList()" size="small" clearable>
</el-input>
<span @click="msg.pageIndex=1,getList()" class="el-icon-search"
style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
<el-date-picker v-model="dateList" @change="msg.pageIndex=1,getList()" size="small" type="datetimerange"
range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</div>
<el-table :data="dataList" border style="width: 100%;margin-Top:10px">
<el-table-column prop="Id" label="ID" width="60"></el-table-column>
<el-table-column prop="WareHouseName" label="仓库名称"></el-table-column>
<el-table-column prop="TotalCostMoney" label="总价格"></el-table-column>
<el-table-column prop="TotalNumber" label="总数量" width="90"></el-table-column>
<el-table-column prop="Remark" label="备注"></el-table-column>
<el-table-column prop="FinanceId" label="绑定财务单据id"></el-table-column>
<el-table-column prop="CreateDate" label="创建时间"></el-table-column>
<el-table-column prop="StockInStatus" label="入库状态" width="90">
<template slot-scope="scope">
<span v-if="scope.row.StockInStatus==1">未入库</span>
<span v-if="scope.row.StockInStatus==2">部分入库</span>
<span v-if="scope.row.StockInStatus==3">已入库</span>
</template>
</el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="入库" placement="top" v-if="scope.row.StockInStatus==1 || scope.row.StockInStatus==2 ">
<img src="../../assets/img/userman/status_4_active.png" alt="" class="temp_imgStyle" @click="putstorage(scope.row)" style="width:20px;height:20px" >
</el-tooltip>
<el-tooltip class="item" effect="dark" content="详情" placement="top" >
<img src="../../assets/img/userman/s_3_active.png" alt="" class="temp_imgStyle" style="width:20px;height:20px" @click="EditeTemplate(scope.row)">
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange"
:current-page.sync="msg.pageIndex" :page-size="msg.pageSize" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
<!-- 生成采购单 -->
<el-dialog custom-class="app-add-cat" title="新增采购单" :visible.sync="flDig" width="1100px">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="135px" style="width:50%">
<el-form-item label="账户类型" prop="IsPublic">
<el-select v-model="addMsg.IsPublic" placeholder="请选择" size="small" filterable>
<el-option :label="item.Name" :value="item.Id" v-for="(item,index) in AccountList" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="供应商" prop="SupplierId">
<el-select v-model="addMsg.SupplierId" placeholder="请选择" size="small" filterable>
<el-option :label="item.Name" :value="item.ID" v-for="(item,index) in options" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="WareHouseId">
<el-select v-model="addMsg.WareHouseId" placeholder="请选择" size="small" filterable>
<el-option :label="item.Name" :value="item.Id" v-for="(item,index) in getWareHouseList" :key="index"></el-option>
</el-select>
</el-form-item>
<div class="flDig_choose">
<div class="flDig_choose_item" @click="addGoods">
<span>+选择商品</span>
</div>
<div class="flDig_choose_item" style="margin-left: 20px;" @click="selectGoods=[],AttrArray=[],addMsg.DetailList = []">
<span>-移除商品</span>
</div>
</div>
</el-form>
<div>
<el-table :data="selectGoods" border style="width: 100%;margin-Top:10px">
<el-table-column prop="Id" label="ID" width="100"></el-table-column>
<el-table-column prop="Name" label="商品名称"></el-table-column>
<el-table-column label="封面图" width="100">
<template slot-scope="scope">
<img :src="scope.row.CoverImage" alt="" style="width: 50px; height: 50px;">
</template>
</el-table-column>
<el-table-column prop="CostPrice" label="成本价格" width="100"></el-table-column>
</el-table>
<div class="Attrlist" v-if="AttrArray.length>0">
<div v-for="(item,index) in AttrArray" :key="index" style="margin-top:15px" class="Attrlist_item">
<div>
<span class="el-tag el-tag--medium el-tag--light" style="top: 5px; position: relative; margin-right: 5px;max-width:300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
<span v-for="(x,y) in item.AttrList" :key="y">{{x}} <span v-if="item.AttrList.length !== y+1"> , </span></span>
</span>
</div>
<span style="margin-left:30px">数量:
<el-input size='small' v-model="addMsg.DetailList[index].Number" placeholder="请输入内容" style="display:inline-block;width:150px"></el-input>
</span>
</div>
</div>
<el-button type="text" @click="AtterDig=true" v-if='selectGoods.length>0'>+规格选择</el-button>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="flDig = false">取 消</el-button>
<el-button @click="chooseFl('addMsg')" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
<!-- 商品列表 -->
<el-dialog custom-class="app-add-cat" title="商品选择" :visible.sync="goodsDig" width="1100px">
<div class="temp_content attr">
<div>
<div class="searchInput" style="width:250px;margin-right: 0px;">
<el-input @keyup.enter.native="goodsMsg.pageIndex=1,getgoodslist()"
style="display:inline-block;width:225px;height:30px" placeholder="请输入商品名称" v-model="goodsMsg.Name"
@clear="goodsMsg.pageIndex=1,getgoodslist()" size="small" clearable>
</el-input>
<span @click="goodsMsg.pageIndex=1,getgoodslist()" class="el-icon-search"
style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
</div>
</div>
<el-table :data="goodList" border style="width: 100%;margin-Top:10px" v-loading="loading" >
<el-table-column label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="goodsId" :label="scope.row.Id"><i></i></el-radio>
</template>
</el-table-column>
<el-table-column prop="Id" label="ID" width="100"></el-table-column>
<el-table-column prop="Name" label="商品名称"></el-table-column>
<el-table-column label="封面图" width="100">
<template slot-scope="scope">
<img :src="scope.row.CoverImage" alt="" style="width: 50px; height: 50px;">
</template>
</el-table-column>
<el-table-column prop="CostPrice" label="成本价格" width="100"></el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange2"
:current-page.sync="goodsMsg.pageIndex" :page-size="goodsMsg.pageSize" layout="prev, pager, next"
:total="total2">
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="goodsDig = false">取 消</el-button>
<el-button @click="choosegoods" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
<!-- 规格选择 -->
<el-dialog custom-class="app-add-cat" title="规格选择" :visible.sync="AtterDig" width="1100px">
<div class="temp_content" v-if="selectGoods.length>0">
<span class="el-tag el-tag--small el-tag--light AttrList" :style="{color: item.IScheck == true?'#409eff':'#000'}"
v-for="(item,index) in selectGoods[0].SpecificationList" :key="index"
@click="chooseAttr(index)"
>
<span v-for="(x,y) in item.AttrList" :key="y">{{x}}<span v-if="item.AttrList.length !== y+1"> , </span></span>
</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="AtterDig = false">取 消</el-button>
<el-button @click="chooseA" size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
<!-- 详情 -->
<el-dialog custom-class="app-add-cat" title="采购详情" :visible.sync="DetailDig" width="1100px">
<div class="temp_content">
<span >仓库名称:{{Detaildata.WareHouseName}}</span>
<span style="margin-left:30px">总价格:¥{{Detaildata.TotalCostMoney}}</span>
<span style="margin-left:30px">总数量:{{Detaildata.TotalNumber}}</span>
<span style="margin-left:30px">绑定财务单据id:{{Detaildata.FinanceId}}</span>
<div style="margin-top:10px">
<span >创建时间:{{Detaildata.CreateDate}}</span>
<span style="margin-left:30px">备注:{{Detaildata.Remark}}</span>
</div>
<div class="Detaildata_box">
<div class="Detaildata_item" v-for="(item,index) in Detaildata.DetailList" :key="index">
<img :src="item.MaterialModel.ImageList[0]" alt="" style="width: 100px; height: 100px;">
<div style="margin-left:20px" class="Detaildata_item_r">
<div>{{item.MaterialModel.Name}}</div>
<div style="color:'#409eff'">
<span class="el-tag el-tag--small el-tag--light" style="top: 5px; position: relative; margin-right: 5px;max-width:300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; ">
<span v-for="(x,y) in item.MaterialModel.GoodsSpecificationList" :key="y">{{x}} <span v-if="item.MaterialModel.GoodsSpecificationList.length !== y+1"> , </span></span>
</span>
</div>
<div>成本价格:{{item.MaterialModel.Money}} <span style="margin-left:30px">数量:{{item.Number}}{{item.MaterialModel.Units}}</span></div>
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
dataList: [],
goodList: [],
dateList: [],
selectGoods: [],
flDig: false,
goodsDig: false,
AtterDig:false,
DetailDig:false,
Detaildata:{},
AttrArray:[],
msg: {
pageIndex: 1,
pageSize: 15,
GoodsName: '',
StartTime: '',
EndTime: '',
},
addMsg: {
IsPublic: '',
SupplierId: '',
WareHouseId: '',
DetailList: [],
},
goodsMsg: {
pageIndex: 1,
pageSize: 10,
Name: '',
GoodsStatus: 0,
CategoryIds: '',
SupplierId: 0,
},
goodsId: 0,
total: 0,
total2: 0,
AccountList: [],
options: [],
getWareHouseList:[],
rules: {
IsPublic: [{
required: true,
message: '请选择账户类型',
trigger: 'change'
}],
SupplierId: [{
required: true,
message: '请选择供应',
trigger: 'change'
}],
WareHouseId: [{
required: true,
message: '请选择仓库',
trigger: 'change'
}],
},
};
},
created() {
},
methods: {
changeMsg(e) {
console.log(e);
this.$forceUpdate();
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
handleCurrentChange2(val) {
this.goodsMsg.pageIndex = val;
this.getgoodslist();
},
getList() {
if (this.dateList && this.dateList.length > 0) {
this.msg.StartTime = this.dateList[0];
this.msg.EndTime = this.dateList[1];
} else {
this.msg.StartTime = '';
this.msg.EndTime = '';
}
this.assetsApipost("/api/property/GetProcurementPageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
}
})
},
// 账户类型
getAccount() {
this.apipost("/api/finance/GetAccountTypeList", {}, res => {
this.AccountList = res.data.data;
})
},
//供应商
getSupplierList() {
this.apipost("/api/Supplier/GetSupplierAllList", {}, res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.options = res.data.data;
}
});
},
// 仓库列表
getWareHouse(){
this.apiJavaPost("/api/Supplies/GetWareHouseList",{Name:''},
res => {
if (res.data.resultCode === 1) {
this.getWareHouseList=res.data.data;
} else {
this.Error(res.data.message);
}
},
null
);
},
//商品列表
getgoodslist() {
this.loading = true
this.assetsApipost("/api/property/GetGoodsToProcurementPageList", this.goodsMsg, res => {
this.loading = false
if (res.data.resultCode == 1) {
var tempArray = res.data.data.pageData;
this.goodList = tempArray;
this.total2 = res.data.data.count;
} else {
this.Info(res.data.message);
}
})
},
choosegoods() { //确实的选择商品事的确认
this.selectGoods=[]
for(let i = 0;i<this.goodList.length;i++){
if(this.goodsId == this.goodList[i].Id){
this.selectGoods.push(this.goodList[i])
}
}
this.selectGoods[0].SpecificationList.forEach(x=>{
x.IScheck=false
})
this.goodsMsg.pageIndex = 1;
this.goodsDig = false
},
addGoods() {
if (this.addMsg.SupplierId == '') {
this.Error('请选择供应商!');
return
}
this.goodsDig = true;
this.goodsMsg.SupplierId = this.addMsg.SupplierId;
this.getgoodslist()
},
//生成采购单
chooseFl(msg) {
console.log(this.addMsg)
this.$refs[msg].validate(valid => {
if (valid) {
if(this.selectGoods.length==0){
this.Error('请选择商品');
return
}
if(this.addMsg.DetailList.length==0){
this.Error('请选择规格');
return
}
this.assetsApipost(
"/api/property/SetProcurementInfo",
this.addMsg,
res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.flDig=false;
this.getList();
this.addMsg.IsPublic = '';
this.addMsg.SupplierId = '';
this.addMsg.WareHouseId = '';
this.addMsg.DetailList = [];
this.goodsId = 0;
this.AttrArray = [];
this.selectGoods=[];
} else {
this.Info(res.data.message);
}
}
);
} else {
return false;
}
});
},
chooseAttr(row){
this.selectGoods[0].SpecificationList[row].IScheck = !this.selectGoods[0].SpecificationList[row].IScheck
this.$forceUpdate()
},
chooseA(){
this.AtterDig =false
let data = this.selectGoods[0].SpecificationList;
let newArray = []
let newArray2 = []
data.forEach(x=>{
if(x.IScheck==true){
let obj ={}
obj.GoodsId = x.GoodsId,
obj.CostMoney=this.selectGoods[0].CostPrice,
obj.Number=1,
obj.SpecificationKey=x.SpecificationSort,
newArray.push(obj)
newArray2.push(x)
}
})
this.addMsg.DetailList = newArray
this.AttrArray = newArray2
},
EditeTemplate(row){
this.DetailDig=true;
this.Detaildata=row;
},
putstorage(row){
this.CommonJump('putinStorage', {
ID: row.Id,
});
}
},
mounted() {
this.getList();
this.getAccount()
this.getSupplierList();
this.getWareHouse()
}
};
</script>
<style>
.putinStorage .mimitBody {
padding: 20px;
background-color: #fff;
margin: 10px 0 20px 0;
display: table;
width: 100%;
}
.putinStorage .tpEdit_header {
padding: 18px;
background: #fff;
color: #606266;
margin-bottom: 10px;
}
.putinStorage .mimitList {
margin-bottom: 15px;
display: flex;
flex-direction: row;
}
.putinStorage .mimitBody .el-tag {
min-width: 120px;
padding-right: 50px;
}
.putinStorage .el-button--small {
padding: 9px 25px;
}
</style>
<template>
<div class="putinStorage">
<div class="tpEdit_header">
<span style="color:rgb(64, 158, 255);cursor:pointer;" @click="CommonJump('procurementMaage')">采购管理</span><span
style="margin:0 9px;color:#C0C4CC">/</span><span>入库</span>
</div>
<div class="mimitBody">
<div>
<span>仓库名称:{{Detaildata.WareHouseName}}</span>
<span style="margin-left:30px">备注:{{Detaildata.Remark}}</span>
</div>
<el-table :data="Detaildata.DetailList" border style="width: 100%;margin-Top:20px">
<el-table-column prop="Id" label="ID" width="60"></el-table-column>
<el-table-column prop="ImageList" label="图片" width="80" align='center'>
<template slot-scope="scope">
<img :src="scope.row.MaterialModel.ImageList[0]" alt="" style="width: 50px; height: 50px;">
</template>
</el-table-column>
<el-table-column prop="Name" label="商品名称" >
<template slot-scope="scope">
<span>{{scope.row.MaterialModel.Name}}</span>
</template>
</el-table-column>
<el-table-column prop="GoodsSpecificationList" label="规格" >
<template slot-scope="scope">
<span v-for="(x,y) in scope.row.MaterialModel.GoodsSpecificationList" :key="y">{{x}} <span v-if="scope.row.MaterialModel.GoodsSpecificationList.length !== y+1"> , </span></span>
</template>
</el-table-column>
<el-table-column prop="Number" label="数量" width="60"></el-table-column>
<el-table-column prop="StockInNum" label="已入数量" width="80">
<template slot-scope="scope">
<span>{{scope.row.StockInNum!=null?scope.row.StockInNum:0}}</span>
</template>
</el-table-column>
<el-table-column prop="" label="入库数量" width="200">
<template slot-scope="scope">
<el-input v-model="scope.row.InStockNum" type="number" :min='0'
:max="scope.row.Number -(scope.row.StockInNum!=null?scope.row.StockInNum:0)"
:disabled="(scope.row.Number -(scope.row.StockInNum!=null?scope.row.StockInNum:0))==0? true:false"
placeholder="请输入"></el-input>
</template>
</el-table-column>
</el-table>
</div>
<el-button size="small" type="primary" @click="submitForm()" >入库</el-button
>
</div>
</template>
<script>
export default {
data() {
return {
Detaildata:{}
};
},
created() {},
methods: {
getProcurementInfo(data) {
console.log(data)
this.assetsApipost("/api/property/GetProcurementInfo", {ProcurementId:data.ID}, res => {
if (res.data.resultCode == 1) {
let data = res.data.data
data.DetailList.forEach(x => {
x.InStockNum = 0
});
this.Detaildata = data
} else {
this.Error(res.data.message);
}
})
},
submitForm(){
let msg = {
Id:0,
DetailList:[]
};
msg.Id = this.Detaildata.Id;
let showtis = false
this.Detaildata.DetailList.forEach(x=>{
if(x.InStockNum.length== 0){
showtis=true
}
let obj = {}
obj.GoodsId = x.MaterialModel.GoodsId;
obj.SpecificationKey = x.MaterialModel.SpecificationKey;
obj.InStockNum = x.InStockNum;
msg.DetailList.push(obj)
})
if(showtis == true){
this.Error('请输入入库数量');
return
}
this.assetsApipost("/api/property/SetProcurementStockIn", msg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
// this.getProcurementInfo(this.$route.query)
this.CommonJump('procurementMaage')
} else {
this.Error(res.data.message);
}
})
}
},
mounted() {
this.getProcurementInfo(this.$route.query)
}
};
</script>
......@@ -56,8 +56,8 @@ export default {
let domainUrl = '';
// domainUrl = "https://mallapi.oytour.com";
// domainUrl = "https://localhost:5001";
domainUrl = "http://192.168.2.65";
// domainUrl = "http://192.168.2.16:8088";
// domainUrl = "http://192.168.2.65";
domainUrl = "http://192.168.2.16:8088";
let locationName = window.location.hostname;
......@@ -69,6 +69,10 @@ export default {
var obj = {
//主地址npm
DomainUrl: domainUrl,
//资产管理
javaUrl: "http://192.168.2.65:8018",
// javaUrl: "http://192.168.2.16:8087",
// javaUrl: "http://property.oytour.com",
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
ImageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com',
......@@ -275,6 +279,94 @@ export default {
}
return postData
},
//HTTP提交数据资产
Vue.prototype.assetsApipost = function(cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetAssetsPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
}, faildCall)
}
//获取请求参数
Vue.prototype.GetAssetsPostData = function(cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId = 0; //员工编号【员工登录时使用】
var ERPGroupId = 0;
var ERPEmpId = 0;
var ERPBranchId = 0;
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId = this.getLocalStorage().EmpId;
ERPGroupId = this.getLocalStorage().ERPGroupId;
ERPEmpId = this.getLocalStorage().ERPEmpId;
ERPBranchId = this.getLocalStorage().ERPBranchId;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
ERPGroupId: ERPGroupId,
ERPEmpId: ERPEmpId,
ERPBranchId: ERPBranchId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
}
return postData
},
//文件下载
Vue.prototype.GetLocalFile = function(cmd, msg, fileName, newCmd, successCall) {
var apiurl = this.domainManager().DomainUrl + cmd;
......@@ -293,6 +385,64 @@ export default {
link.click();
successCall(res);
}).catch(function(res) {});
},
//调用资产的接口
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().javaUrl + cmd;
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var uid = "0"
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
uid =this.getLocalStorage().ERPEmpId
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`msg=YXZCGL2020&timestamp=${timestamp}&token=${token}&key=${key}`);
// var md5Str = md5(`msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"MallBaseId": MallBaseId,
"TenantId": TenantId,
'uid':uid
}
if (localStorage.g && localStorage.g != 'undefined') {
// postData.groupId = parseInt(JSON.parse(localStorage.g).i)
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
})
} else if (res.data.resultCode == 10005) {
this.$router.go(-1)
} else {
successCall(res)
}
}, faildCall)
}
}
}
\ No newline at end of file
......@@ -122,12 +122,37 @@ export default new Router({
name: 'empowerManage',
component: resolve => require(['@/components/empower/empowerManage'], resolve),
},
//授权中心 授权管理
//授权中心 授权详情
{
path: '/empowerEdit',
name: 'empowerEdit',
component: resolve => require(['@/components/empower/empowerEdit'], resolve),
},
//授权中心 物料管理
{
path: '/materialQuery',
name: 'materialQuery',
component: resolve => require(['@/components/empower/materialQuery'], resolve),
},
//授权中心 采购管理
{
path: '/procurementMaage',
name: 'procurementMaage',
component: resolve => require(['@/components/empower/procurementMaage'], resolve),
},
//授权中心 物料仓库
{
path: '/Materialwarehouse',
name: 'Materialwarehouse',
component: resolve => require(['@/components/empower/Materialwarehouse'], resolve),
},
//授权中心 入库
{
path: '/putinStorage',
name: 'putinStorage',
component: resolve => require(['@/components/empower/putinStorage'], resolve),
},
]
},
{
......
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