Commit df74d72d authored by 黄媛媛's avatar 黄媛媛

update

parent 88da8563
<template>
<div class="Supplierman">
<div class="routerTitle">
<span class="pageTitle">耗材时间管理</span>
<span @click="morequery=!morequery" style="display:inline-flex;align-items:center;cursor: pointer;" class="f12 cd6">
<span style="margin-right:5px">高级查询</span>
<img v-show="!morequery" style="width:12px;height:12px" src="../../assets/img/more.png" alt="">
<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="chongzhi" style="margin-left:20px" class="addSpan">重置</span> -->
<span @click="addSupplier" style="margin-left:20px" class="addSpan">
<img style="width:10px;height:10px;margin-right:6px" src="../../assets/img/add.png" alt="">
新增</span>
</div>
<div class="padContent">
<ul v-show="morequery" class="queryul">
<li>
<el-select filterable size="small" v-model="msg.BranchId" placeholder="公司">
<el-option label="通用" :value="-1"></el-option>
<el-option
v-for="item in BranchList"
:key="item.Id"
:label="item.BName"
:value="item.Id">
</el-option>
</el-select>
</li>
<li>
<el-select filterable size="small" v-model="msg.Enabled" placeholder="状态">
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="2"></el-option>
</el-select>
</li>
</ul>
<vxe-table stripe style="margin-top:15px" :loading="loading"
:data="tableData">
<vxe-table-column field="BranchName" title="公司"></vxe-table-column>
<vxe-table-column field="Contact" title="申请时间">
<template v-slot="{ row }">
<span v-for="(item,index) in row.WeekdayList" :key="index">{{item.Weekday}}
<span v-if="index<row.WeekdayList.length-1"></span>
</span>
</template>
</vxe-table-column>
<vxe-table-column field="Enabled" title="状态">
<template v-slot="{ row }">
<span v-if="row.Enabled==1"></span>
<span v-else></span>
</template>
</vxe-table-column>
<vxe-table-column field="UpdateBy" title="操作人/时间">
<template v-slot="{ row }">
<p>{{row.UpdateBy}}</p>
<p>{{row.UpdateDate}}</p>
</template>
</vxe-table-column>
<vxe-table-column field="address" title="操作">
<template v-slot="{ row }">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<img @click="Edit(row)" style="width:24px;height:24px" src="../../assets/img/edit.png" alt="">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="启用" placement="top">
<img v-if="row.Enabled==2" @click="qiyong(row)" style="width:24px;height:24px" src="../../assets/img/qiyong.png" alt="">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="禁用" placement="top">
<img v-if="row.Enabled==1" @click="jinyong(row)" style="width:24px;height:24px" src="../../assets/img/jinyong.png" alt="">
</el-tooltip>
</template>
</vxe-table-column>
</vxe-table>
<el-pagination
@current-change="currentChange"
background
:page-size="msg.pageSize"
layout="prev, pager, next"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
name: 'Supplierman',
data(){
return{
morequery:false,
currentPage:1,
tableData: [],
loading:false,
total:0,
msg:{
pageIndex:1,
pageSize:15,
Name:'',
Contact:'',
Mobile:'',
},
BranchList:[],
}
},
mounted(){
this.getList();
this.getBranch();
},
methods:{
addSupplier(){
this.$router.push({
path: "/consumablesManRule",
query: {
}
});
},
currentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getBranch(){
this.apiJavaPost("/api/User/GetBranchList",{},
res => {
if (res.data.resultCode === 1) {
this.BranchList=res.data.data;
} else {
this.Error(res.data.message);
}
},
null
);
},
getList(){
this.loading=true;
this.apiJavaPost("/api/Supplies/GetApplyForSetPageList",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
);
},
Edit(item){
let obj={
Id:item.Id,
BranchId:item.BranchId,
SpecialList:item.SpecialList,
WeekdayList:item.WeekdayList,
}
let data=JSON.stringify(obj);
this.$router.push({
path: "/consumablesManRule",
query: {
obj:encodeURIComponent(data)
}
});
},
qiyong(item){
let Id=item.Id;
this.$confirm("确认启用?","提示", {
confirmButtonText:"确定",
cancelButtonText: "取消",
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/Supplies/SetApplyForStatus",{ApplyforId: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('已取消删除!')
});
},
jinyong(item){
let Id=item.Id;
this.$confirm("确认禁用?","提示", {
confirmButtonText:"确定",
cancelButtonText: "取消",
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/Supplies/SetApplyForStatus",{ApplyforId: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('已取消删除!')
});
},
},
}
</script>
<style scoped>
.Supplierman{
box-sizing: border-box;
}
</style>
This diff is collapsed.
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