Commit 2b231389 authored by 柳 佳乐's avatar 柳 佳乐
Browse files

20221117

parent e785a20b
......@@ -26,3 +26,4 @@ export function selectById(data) {
data
})
}
......@@ -68,3 +68,11 @@ export function updateRole(data){
data:data
})
}
//查询公司管理员
export function selectByAdministrators(data) {
return request({
url: '/user/selectByAdministrators',
method: 'post',
data
})
}
......@@ -128,7 +128,7 @@ export function money(rule, value, callback) {
//定义金额校验
export function money_valid(rule, value, callback) {
let RegExp = /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^0-9]\.[0-9]([0-9])?$)/;
let RegExp = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^0-9]\.[0-9]([0-9])?$)/;
if (value === null || value === undefined || value === '') {
callback(new Error('金额不能为空'))
} else if (RegExp.test(value)) {
......
......@@ -36,8 +36,28 @@
<el-form-item label="登记备注">
<el-input v-model="FixedAssetsAddDTO.registerRemarks" laceholder="请输入登记备注"></el-input>
</el-form-item>
<el-form-item label="资产负责人">
<el-input v-model="FixedAssetsAddDTO.fixedControllerName" :disabled="true"></el-input>
<el-form-item label="资产负责人" style="width:500px;">
<div>
<el-select
v-model="user.userId"
:multiple="false"
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading"
:disabled="attrId!=0?true:false"
@change="grtselect()"
>
<el-option
v-for="item in options"
:key="item.userId"
:label="item.userName"
:value="item.userId"
></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item style="margin-top:60px">
<el-button type="success" @click="submitForm()">提交</el-button>
......@@ -52,7 +72,8 @@
<script>
import { selectByFixedId, updates } from "@/api/assets";
import { money,account_password_valid } from "@/utils/myValidate";
import { money, account_password_valid } from "@/utils/myValidate";
import { secletAllStaff } from "@/api/user";
export default {
data() {
return {
......@@ -74,9 +95,7 @@ export default {
fixedName: [
{ required: true, message: "请输入活动名称", trigger: "change" }
],
fixedCode: [
{ validator:account_password_valid, trigger: "blur" }
],
fixedCode: [{ validator: account_password_valid, trigger: "blur" }],
fixedAddress: [
{
required: true,
......@@ -90,7 +109,16 @@ export default {
trigger: "change"
}
]
}
},
user: {
companyId: null,
userName: null,
userId: null
},
loading: false,
options: [],
list: [],
attrId: null
};
},
computed: {
......@@ -99,7 +127,9 @@ export default {
}
},
created() {
this.attrId = this.$route.query.attrId;
this.selectget();
this.ggb();
},
methods: {
......@@ -109,6 +139,7 @@ export default {
.then(res => {
if (res.success) {
this.FixedAssetsAddDTO = res.data;
this.user.userId = this.FixedAssetsAddDTO.fixedControllerName;
} else {
this.$message.error(res.msg);
}
......@@ -126,7 +157,11 @@ export default {
message: "修改资产信息成功",
type: "success"
});
if (this.attrId == 0) {
this.$router.push("/assetslist");
} else {
this.$router.push("/administrationlsit");
}
} else {
this.$message.error(res.msg);
}
......@@ -136,9 +171,51 @@ export default {
});
},
//返回
back(){
back() {
if (this.attrId == 0) {
this.$router.push("/assetslist");
} else {
this.$router.push("/administrationlsit");
}
},
//下拉框的搜索
ggb() {
this.user.companyId = this.$store.getters.companyId;
secletAllStaff(this.user)
.then(res => {
if (res.code == 20000) {
this.list = res.data;
}
})
.catch(error => {
this.$message.error("没有当前负责人");
});
},
//输入关键字出名字
remoteMethod(query) {
if (query !== "") {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return (
item.userName.toLowerCase().indexOf(query.toLowerCase()) > -1
);
});
}, 200);
} else {
this.options = [];
}
},
//负责人添加
grtselect() {
if (this.options.length > 0) {
console.log(this.user.userId);
this.FixedAssetsAddDTO.fixedController = this.user.userId;
} else {
this.$message.error("没有负责人哦亲");
}
}
}
};
</script>
......
......@@ -68,7 +68,12 @@
<template slot-scope="scope">
<el-row :gutter="20">
<el-col :span="4">
<el-button type="danger" size="mini" @click="open(scope.row)">丢失登记</el-button>
<el-button
type="danger"
:disabled="scope.row.fixedState=='2'?true:false"
size="mini"
@click="open(scope.row)"
>丢失登记</el-button>
</el-col>
<el-col :span="8" style="margin-left:5px">
<el-button
......@@ -77,12 +82,14 @@
style="margin-left:40px"
icon="el-icon-edit"
@click="goUpdate(scope.row)"
:disabled="scope.row.fixedState=='2'?true:false"
>修改资产信息</el-button>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<div class="footle">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="queryDTO.pageNum"
......@@ -91,6 +98,7 @@
:total="total"
></el-pagination>
</div>
</div>
<!-- 抽屉 -->
</div>
......@@ -278,7 +286,10 @@ export default {
</script>
<style>
.hangeg .el-form-item{
.hangeg .el-form-item {
margin-left: 20px;
}
.footle {
text-align: right;
}
</style>
\ No newline at end of file
......@@ -21,7 +21,7 @@
<el-form-item style="margin-left:0px">
<el-button type="primary" icon="el-icon-search" @click="selectgetlist()">查询</el-button>
<el-button type="info" icon="el-icon-refresh" @click="backget()">重置</el-button>
<el-button type="success" icon="el-icon-success" @click="Uselist()">使用</el-button>
<el-button type="success" icon="el-icon-success" @click="Uselist1()">使用</el-button>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
......@@ -64,6 +64,7 @@
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="footle">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="FixedUseQueryDTO.pageNum"
......@@ -71,11 +72,18 @@
layout="total, prev, pager, next"
:total="total"
></el-pagination>
</div>
<!-- 抽屉 -->
<el-drawer title="使用登记" :visible.sync="drawer" :direction="direction" size="40%">
<div v-show="showid==0" style="width:80%;margin-left:10%;margin-top:60px;">
<el-form :model="addDTO" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="借用姓名">
<el-form
:model="user"
:rules="rules"
ref="ruleForm1"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="借用姓名" prop="userId">
<el-select
v-model="user.userId"
:multiple="false"
......@@ -96,7 +104,7 @@
</el-select>
</el-form-item>
<el-form-item label="借用备注" prop="startRemarks">
<el-form-item label="借用备注">
<el-input v-model="addDTO.startRemarks" style="width:300px"></el-input>
</el-form-item>
<el-form-item>
......@@ -106,8 +114,14 @@
</div>
<div v-show="showid==1" style="width:80%;margin-left:10%;margin-top:60px;">
<el-form :model="addDTOs" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="归还姓名">
<el-form
:model="user"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="归还姓名" prop="userId">
<el-select
v-model="user.userId"
:multiple="false"
......@@ -181,7 +195,7 @@ export default {
addDTO: {
fixedId: null, //资产ID
useState: 0,
startRemarks: '', //借用备注
startRemarks: "", //借用备注
useStartTime: null, //借用时间
userId: null //使用人
},
......@@ -205,7 +219,10 @@ export default {
direction: "rtl",
currentTime: new Date(), // 获取当前时间
///抽屉
showid: 1
showid: 1,
rules: {
userId: [{ required: true, message: "请输入姓名", trigger: "change" }]
}
};
},
created() {
......@@ -215,7 +232,7 @@ export default {
methods: {
//分页
handleCurrentChange(val) {
this.projectQurey.pageNum = val;
this.FixedUseQueryDTO.pageNum = val;
this.getList();
},
//查询资产使用情况
......@@ -232,27 +249,30 @@ export default {
this.$$message.error(e.msg);
});
},
//使用
Uselist(row) {
if (row != null) {
this.drawer = true;
this.showid = 1;
this.addDTOs.id = row.id;
//借用
Uselist1(showid= 0) {
this.showid =showid;
console.log(this.showid);
this.options = [];
this.addDTO = {
fixedId: null, //资产ID
useState: 0,
startRemarks: '', //借用备注
startRemarks: "", //借用备注
useStartTime: null, //借用时间
userId: null //使用人
};
this.user.userId = null;
this.user.userName = null;
this.drawer = true;
this.selectupdates();
let query = null;
} else {
},
//归还
Uselist(row) {
console.log(row.id);
this.drawer = true;
this.showid = 0;
this.showid = 1;
this.addDTOs = {
id: null,
id: row.id,
useState: 1,
endRemarks: "", //归还备注
fixedId: null, //资产id
......@@ -260,7 +280,6 @@ export default {
userId: 0 //归还人
};
this.selectupdates();
}
},
//下拉框的搜索
selectupdates() {
......@@ -316,6 +335,8 @@ export default {
this.timestampToTime();
this.addDTO.userId = this.user.userId;
this.addDTO.fixedId = this.FixedUseQueryDTO.fixedId;
this.$refs.ruleForm1.validate(valid => {
if (valid) {
useRegistered(this.addDTO)
.then(res => {
if (res.success) {
......@@ -332,14 +353,17 @@ export default {
.catch(e => {
this.$message.error(e.msg);
});
}
});
},
//添加归还
grtselectA() {
this.timestampToTime();
console.log(this.user);
this.addDTOs.fixedId = this.FixedUseQueryDTO.fixedId;
this.addDTOs.userId = this.user.userId;
console.log(this.addDTOs);
this.$refs.ruleForm.validate(valid => {
if (valid) {
returnRegistration(this.addDTOs)
.then(res => {
if (res.success) {
......@@ -347,6 +371,7 @@ export default {
message: "恭喜您归还申请成功",
type: "success"
});
this.$refs.ruleForm1.resetFields();
this.drawer = false;
this.getList();
} else {
......@@ -356,6 +381,8 @@ export default {
.catch(e => {
this.$message.error(e.msg);
});
}
});
},
//返回
back() {
......@@ -363,22 +390,25 @@ export default {
},
//重置
backget() {
this.FixedUseQueryDTO= {
this.FixedUseQueryDTO = {
pageSize: 10,
pageNum: 1,
fixedId: this.$route.query.fixedId,
fixedCode: null, //资产编号
useState: null, //归还状态
fixedName: null //资产名称
}
};
this.getList();
},
//搜索
selectgetlist() {
this.getList();
},
}
}
};
</script>
<style>
.footle {
text-align: right;
}
</style>
\ No newline at end of file
......@@ -68,53 +68,24 @@
</el-table-column>
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="Updateget(scope.row)">修改管理者</el-button>
<el-button
type="primary"
size="mini"
icon="el-icon-edit"
@click="goUpdate(scope.row)"
>修改资产信息</el-button>
<!-- <el-button type="danger" size="mini" @click="Updateget(scope.row)">修改管理者</el-button> -->
</template>
</el-table-column>
</el-table>
<div class="footle">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="queryDTO.pageNum"
:page-size="queryDTO.pageSize"
layout="total, prev, pager, next"
:total="total"
></el-pagination>
</div>
<!-- 修改管理张的抽屉 -->
<div>
<el-dialog
title="修改管理人员"
:visible.sync="drawer"
:direction="direction"
:before-close="handleClose"
width="30%"
>
<div style="margin:30px 10%;height:130px;">
<el-select
v-model="user.userName"
:multiple="false"
filterable
remote
reserve-keyword
placeholder="请输入资产负责人姓名"
:remote-method="remoteMethod"
:loading="loading"
:disabled=" falesId"
>
<el-option
v-for="item in options"
:key="item.userId"
:label="item.userName"
:value="item.userId"
></el-option>
</el-select>
<el-button
type="primary"
style="width:110px;margin:20px 10px"
@click="grtselect()"
>{{fzname}}</el-button>
</div>
</el-dialog>
></el-pagination></div>
</div>
</div>
</template>
......@@ -153,28 +124,11 @@ export default {
assetslist: [], //表格资产
total: null,
drawer: false, //修改管理值抽屉
///抽屉的修改
user: {
companyId: null,
userId: null,
userName: null
},
options: [],
list: [],
loading: false,
direction: "rtl",
falesId: true,
fzname: "修改管理者",
updateDTO: {
fixedId: null,
fixedController: null
} ///抽屉
};
},
created() {
this.queryDTO.companyId = this.$store.getters.companyId; //查询资产获取Id
this.selectAssets();
this.selectupdates();
},
methods: {
//分页
......@@ -219,97 +173,22 @@ export default {
Upedatassets() {
this.$router.push("/assetsUpedata");
},
//下拉框的搜索
selectupdates() {
let user = {
companyId: this.$store.getters.companyId,
};
secletAllStaff(user)
.then(res => {
if (res.code == 20000) {
this.list = res.data;
}
})
.catch(error => {
this.$message.error("没有当前负责人");
});
},
//修改管理者
Updateget(row) {
this.drawer = true;
this.updateDTO.fixedId = row.fixedId;
this.updateDTO.fixedController = row.fixedController;
this.user.userName = row.fixedControllerName;
console.log(row);
},
//输入关键字出名字
remoteMethod(query) {
if (query !== "") {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return (
item.userName.toLowerCase().indexOf(query.toLowerCase()) > -1
);
});
}, 200);
} else {
this.options = [];
}
},
//负责人添加
grtselect() {
if (this.falesId != false) {
this.falesId = false;
this.fzname = "确定管理者";
} else {
if (this.options.length > 0) {
this.updateDTO.fixedController = this.user.userName;
console.log(this.updateDTO);
update(this.updateDTO)
.then(res => {
if (res.success) {
this.$message({
showClose: true,
message: "管理员修改成功",
type: "success"
});
this.drawer = false;
this.falesId = true;
this.selectAssets();
} else {
this.$message({
showClose: true,
message: "修改失败",
type: "warning"
});
//修改资产信息
goUpdate(row) {
this.$router.push({
path: "/administrationUpdate",
query: {
id: row.fixedId,
attrId:0,
}
})
.catch(e => {
this.$message.error(e.msg);
});
} else {
this.$message({
showClose: true,
message: "还没有修改负责人哦亲",
type: "warning"
});
this.drawer = false;
}
}
},
//关闭抽屉
handleClose(done) {
this.falesId = true;
this.drawer = true;
this.fzname = "修改管理者";
this.options = [];
done();
}
}
};
</script>
<style>
.footle{
text-align: right;
}
</style>
\ No newline at end of file
......@@ -57,6 +57,7 @@
</template>
</el-table-column>
</el-table>
<div class="footle">
<el-pagination
@current-change="handleCurrentChange"
:current-page.sync="queryDTO.pageNum"
......@@ -65,6 +66,7 @@
:total="total"
></el-pagination>
</div>
</div>
</template>
<script>
......@@ -89,10 +91,7 @@ export default {
value: 1,
label: "已归还"
},
{
value: 2,
label: "已丢失"
}
],
tableData: [],
total: null
......@@ -110,14 +109,14 @@ export default {
},
//重置
backget() {
this.queryDTO= {
this.queryDTO = {
pageNum: 1,
pageSize: 10,
userId: this.$store.getters.urId,
fixedCode: null, //资产编号
useState: null, //资产状态
fixedName: null //资产名称
}
};
this.getlist();
},
//搜索
......@@ -143,4 +142,7 @@ export default {
};
</script>
<style>
.footle {
text-align: right;
}
</style>
\ No newline at end of file
......@@ -23,17 +23,30 @@
<el-table
:data="companyList"
style="width: 100%;text-align: center;"
border>
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
>
<el-table-column label="序号" width="50px">
<template
slot-scope="scope"
>{{ (companyQurey.pageNum - 1) * companyQurey.pageSize + scope.$index + 1 }}</template>
</el-table-column>
<el-table-column prop="companyName" label="公司名称" />
<el-table-column prop="companyAddress" label="公司地址" />
<el-table-column prop="companyPhone" label="公司联系电话" />
<el-table-column prop="companyCreateTime" label="公司注册时间" />
<el-table-column prop="companyInformation" label="公司其他信息" />
<el-table-column prop="prop" label="操作">
<template slot-scope="scope">
{{ (companyQurey.pageNum - 1) * companyQurey.pageSize + scope.$index + 1 }}
<el-button
type="primary"
size="mini"
icon="el-icon-edit"
@click="selectByAdminget(scope.row)"
>查看公司管理员</el-button>
</template>
</el-table-column>
<el-table-column prop="companyName" label="公司名称"/>
<el-table-column prop="companyAddress" label="公司地址"/>
<el-table-column prop="companyPhone" label="公司联系电话"/>
<el-table-column prop="companyCreateTime" label="公司注册时间"/>
<el-table-column prop="companyInformation" label="公司其他信息"/>
</el-table>
</div>
......@@ -43,86 +56,242 @@
:current-page.sync="companyQurey.pageNum"
:page-size="companyQurey.pageSize"
layout="total, prev, pager, next"
:total="total">
</el-pagination>
:total="total"
></el-pagination>
</div>
<!-- 管理员抽屉 -->
<div>
<el-drawer title="我是标题" :visible.sync="drawer" :before-close="handleClose" size="40%">
<div class="container">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="个人信息" name="first">
<el-form ref="userform" :model="userlist" label-width="120px" style="width:80%;">
<el-form-item label="姓名" prop="userName">
<el-input v-model="userlist.userName" disabled></el-input>
</el-form-item>
<el-form-item label="性别" prop="userSex">
<el-select v-model="userlist.userSex" placeholder="请选择" disabled>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="账号">
<el-input v-model="userlist.userAdmin" disabled></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="userlist.userPhone" disabled></el-input>
</el-form-item>
<el-form-item label="身份证号">
<el-input v-model="userlist.userIdentification" disabled></el-input>
</el-form-item>
<el-form-item label="银行卡号">
<el-input v-model="userlist.userBankNumber" disabled></el-input>
</el-form-item>
<el-form-item label="开户银行">
<el-input v-model="userlist.userBankAddress" disabled></el-input>
</el-form-item>
<el-form-item label="现任角色">
<template>
<el-tag v-for="item in userlist.roleList" :key="item.rlId">{{item.rlName}}</el-tag>
</template>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="修改密码" name="second" style="width:80%; margin:40px 0px">
<el-row :gutter="20">
<el-form
:model="passwordData"
label-width="120px"
:rules="rules"
class="demo-ruleForm"
ref="ruleForm"
>
<el-col :span="20">
<el-form-item label="确认密码" prop="staffPassword">
<el-input type="password" v-model="passwordData.staffPassword"></el-input>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="passReset()"
>重置信息</el-button>
<el-button type="success" icon="el-icon-upload2" @click="changePassword">更换密码</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
</el-tab-pane>
</el-tabs>
</div>
</el-drawer>
</div>
</div>
</template>
<script>
import {select} from '@/api/company'
import { staffpassword,selectByAdministrators} from "@/api/user";
import { select } from "@/api/company";
import { account_password_valid } from "@/utils/myValidate";
export default {
data(){
return{
companyQurey:{
companyName:null,
companyAddress:null,
companyPhone:null,
pageSize:10,
pageNum:1,
data() {
return {
companyQurey: {
companyName: null,
companyAddress: null,
companyPhone: null,
pageSize: 10,
pageNum: 1
},
total:0,
companyList:[],
total: 0,
companyList: [],
drawer: false,
userlist: [],
passwordData: {
staffPassword: null,
userId: null
},
options: [
{
value: "1",
label: ""
},
{
value: "0",
label: ""
}
],
userupdata: true,
activeName: "first",
rules: {
staffPassword: [
{ required: true, validator: account_password_valid, trigger: "blur" }
]
}
};
},
created(){
this.getCompany()
created() {
this.getCompany();
},
methods:{
methods: {
//查询公司
getCompany(){
select(this.companyQurey).then((res)=>{
if(res.status = "success"){
this.total = res.data.total
this.companyList = res.data.list
}else{
this.$message.error(res.data)
getCompany() {
select(this.companyQurey)
.then(res => {
if ((res.status = "success")) {
this.total = res.data.total;
this.companyList = res.data.list;
} else {
this.$message.error(res.data);
}
}).catch((error)=>{
console.log(error)
})
.catch(error => {
console.log(error);
});
},
//换页
handleCurrentChange(val){
this.companyQurey.pageNum = val
handleCurrentChange(val) {
this.companyQurey.pageNum = val;
this.getCompany();
},
//添加公司
addcompany(){
this.$router.push("/companyadd")
addcompany() {
this.$router.push("/companyadd");
},
//查询
qurey(){
this.companyQurey.pageNum = 1
qurey() {
this.companyQurey.pageNum = 1;
this.getCompany();
},
//重置
reset(){
this.companyQurey={
companyName:null,
companyAddress:null,
companyPhone:null,
pageSize:10,
pageNum:1,
}
reset() {
this.companyQurey = {
companyName: null,
companyAddress: null,
companyPhone: null,
pageSize: 10,
pageNum: 1
};
this.getCompany();
},
//查询管理员
selectByAdminget(row) {
this.passReset();
this.drawer = true;
console.log(row);
selectByAdministrators({ companyId: row.companyId })
.then(res => {
if (res.code == 20000) {
this.userlist = res.data;
this.passwordData.userId = res.data.userId;
console.log(this.passwordData.userId);
}
})
.catch(e => {
this.$message.error(e.msg);
});
},
//关闭抽屉
handleClose(done) {
this.passReset();
done();
},
//切换
handleClick(tab, event) {
console.log(tab, event);
this.userupdata = true;
this.passReset();
},
passReset() {
if (this.activeName == "second") {
this.passwordData.staffPassword = null;
this.$refs.ruleForm.resetFields();
}
},
//修改密码
changePassword() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
staffpassword(this.passwordData)
.then(res => {
if (res.status == "success") {
this.$message({
showClose: true,
message: "修改密码成功",
type: "success"
});
this.drawer = false;
}
})
.catch(e => {
this.$message.error(e.msg);
});
}
}
});
}
}
};
</script>
<style scoped>
.container{
.container {
padding: 10px;
}
.conter{
.conter {
margin-bottom: 10px;
}
.footer{
.footer {
text-align: right;
}
</style>
\ No newline at end of file
......@@ -127,8 +127,6 @@
</span>
</div>
</div>
<!-- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传pdf文件,且不超过500kb</div> -->
</el-upload>
</el-descriptions-item>
......@@ -345,6 +343,7 @@ export default {
},
addContractFile(contractId) {
this.fileParams.Id = String(contractId)
this.fileParams.companyId = this.companyId || this.$store.getters.companyId
this.uploadChange && this.$refs.uploadContractFile.submit()
},
getContractTypeList() {
......
......@@ -199,7 +199,7 @@
</div>
<!-- 添加区域 -->
<div class="getadd" v-show="!isgetid" style="margin-left: 5%">
<el-row v-loading="loading" element-loading-text="提交中。。。">
<el-row v-loading="loading" element-loading-text="图片上传中。。。">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form
style="width: 100%; margin: 30px 0px"
......@@ -522,10 +522,11 @@ export default {
},
//发票提交页面的提交
getlistForm() {
this.loading = true
if (this.fileTypeJpg == true) {
this.$refs.addTO.validate((valid) => {
if (valid) {
this.loading = true
this.addTO.userId = this.$store.getters.urId;
this.addTO.companyId = this.$store.getters.companyId;
insertList(this.addTO)
......@@ -537,10 +538,12 @@ export default {
this.$refs.upload.submit();
this.$message.success(res.msg);
} else {
this.loading = false
this.$message.error(res.msg);
}
})
.catch((e) => {
this.loading = false
this.$message.error("发票添加失败,检测是否重复");
});
}
......
......@@ -23,7 +23,7 @@
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="handleEdit(scope)">编辑角色信息和分配角色路由</el-button>
<el-button type="danger" size="small" @click="handleDelete(scope)">删除角色</el-button>
<el-button type="danger" size="small" :disabled="rolesid==1?true:false" @click="handleDelete(scope)">删除角色</el-button>
</template>
</el-table-column>
</el-table>
......@@ -94,12 +94,14 @@ export default {
rules: {
rlName: [{ required: true, message: "角色名称不能为空" ,trigger: 'blur' }],
rlDesc: [{ required: true, message: "角色描述不能为空" ,trigger: 'blur' }]
}
},
rolesid:0,
}
},
created() {
this.roleQuery.companyId = this.$store.getters.companyId
this.companyId = this.$store.getters.companyId;
this.rolesid=this.$store.getters.roles[0];
this.getRoutes()
this.getRoles()
},
......
......@@ -152,14 +152,11 @@ export default {
this.userupdata = true
this.userData = this.backupsData
this.passReset()
},
//密码重置信息
passReset(){
this.passwordData={
originalPassword:null,
newPassword:null,
confirmPassword:null,
}
this.$refs.passwordform.resetFields();
},
//获取个人信息
getUser(){
......
......@@ -185,9 +185,9 @@ export default {
return
}
this.dialogVisible = dialogVisible
this.$$nextTick(()=>{
this.$refs['dialogForm'].resetFields();
})
},
getRepayDetailList() {
......
......@@ -55,11 +55,11 @@
<el-input v-model="expendFrom.expendBody"></el-input>
</el-form-item>
<el-form-item label="支出附言">
<el-form-item label="支出附言" prop="expendRemarks">
<el-input v-model="expendFrom.expendRemarks"></el-input>
</el-form-item>
<el-form-item label="支出详情">
<el-form-item label="支出详情" prop="expendInformation">
<el-input
type="textarea"
:autosize="{ minRows: 4, maxRows: 8 }"
......@@ -126,8 +126,6 @@
<script>
import {
selectByProjectId,
insertList,
queryBypageIncomeAdd,
selectAllBystatus,
updatesubmit
} from "@/api/project";
......@@ -160,6 +158,7 @@ export default {
rules: {
expendMoney: [
{
required: true,
validator: money,
trigger: "change"
}
......
......@@ -147,7 +147,7 @@
<el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
</div>
<el-button
......@@ -240,7 +240,7 @@
<el-popover placement="top" width="60" v-model="scope.row.visible">
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin:0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="DeleteFrom(scope.row)">确定</el-button>
</div>
<el-button type="danger" icon="el-icon-delete" size="mini" slot="reference"></el-button>
......
......@@ -2,7 +2,12 @@
<div class="container">
<el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form ref="form" :model="incomeFrom" label-width="120px" :rules="rules">
<el-form
ref="form"
:model="incomeFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="incomeFrom.projectName" disabled></el-input>
</el-form-item>
......@@ -22,7 +27,6 @@
v-model="invoiceListAdd"
multiple
filterable
default-first-option
placeholder="请选择发票编号"
>
......@@ -51,10 +55,10 @@
<el-form-item label="收入用途" prop="incomeBody">
<el-input v-model="incomeFrom.incomeBody"></el-input>
</el-form-item>
<el-form-item label="收入附言">
<el-form-item label="收入附言" prop="incomeRemarks">
<el-input v-model="incomeFrom.incomeRemarks"></el-input>
</el-form-item>
<el-form-item label="收入详情">
<el-form-item label="收入详情" prop="incomeInformation">
<el-input
type="textarea"
:autosize="{ minRows: 4, maxRows: 8 }"
......@@ -66,15 +70,17 @@
</el-col>
<!-- 附件上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract">
<el-button type="primary" @click="dialogFormVisible = true">上传附件</el-button>
<el-button type="primary" @click="dialogFormVisible = true"
>上传附件</el-button
>
<el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%">
<div style="width:60%;margin-left:30px">
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
......@@ -87,30 +93,37 @@
:on-change="onChangepdf"
:data="proutlist1"
multiple
style="margin:20px 0px;"
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left:75%;">
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button
type="primary"
@click="dialogFormVisible = false"
style="margin-top:20px;"
>确 定</el-button>
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-dialog>
</el-col>
<!-- 按钮 -->
<el-col :span="24" style="margin-left:120px;">
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-col :span="24" style="margin-left: 120px">
<el-button type="success" icon="el-icon-upload2" @click="submitForm()"
>提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button>
</el-col>
</el-row>
......@@ -121,7 +134,7 @@
import {
selectByProjectId,
selectAllBystatus,
updatesubmit
updatesubmit,
} from "@/api/project";
import { selectAll } from "@/api/type";
import { insert } from "@/api/imcome";
......@@ -141,31 +154,31 @@ export default {
projectId: null,
userId: null,
projectName: null,
incomebaoxioa: null //报销的字段
incomebaoxioa: null, //报销的字段
},
rules: {
projectName: [
{ required: true, message: "请选择项目", trigger: "change" }
{ required: true, message: "请选择项目", trigger: "change" },
],
incomeType: [
{ required: true, message: "请选择收入类型", trigger: "change" }
{ required: true, message: "请选择收入类型", trigger: "change" },
],
incomeObject: [
{ required: true, message: "没有输入对方户名", trigger: "change" }
{ required: true, message: "没有输入对方户名", trigger: "change" },
],
incomeBody: [
{ required: true, message: "没有输入对收入内容", trigger: "change" }
{ required: true, message: "没有输入对收入内容", trigger: "change" },
],
incomeMoney: [
{
required: true,
validator: money,
trigger: "change"
}
trigger: "change",
},
],
incomeTime: [
{ required: true, message: "请选择收到时间", trigger: "change" }
{ required: true, message: "请选择收到时间", trigger: "change" },
],
},
invoiceListAdd: [], //选择的发票号
getinvoivelist: [], //查询的能选择的表单信息
......@@ -178,22 +191,22 @@ export default {
enclosureDescribe: "",
status: 0, //0收入 1支出
companyId: null,
userId: null
userId: null,
},
//查询发票编号的参数
getinvoiveId: {
userId: null,
companyId: null,
type: 0
type: 0,
},
//附件
dialogFormVisible: false
dialogFormVisible: false,
};
},
computed: {
projectId() {
return this.$route.query.id;
}
},
},
created() {
//用户id
......@@ -233,10 +246,10 @@ export default {
},
//提交
submitForm() {
this.$refs.form.validate(valid => {
this.$refs.form.validate((valid) => {
if (valid) {
insert(this.incomeFrom)
.then(res => {
.then((res) => {
if (res.success) {
//判断是否有附件文件
if (this.fileTypepdf) {
......@@ -247,14 +260,14 @@ export default {
if (this.invoiceListAdd.length > 0) {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.invoiceListAdd.forEach(item => {
this.invoiceListAdd.forEach((item) => {
list.push({
invoiceId: item,
incomeId: res.data,
status: 1
status: 1,
});
});
updatesubmit(list).then(res => {
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.back();
......@@ -269,7 +282,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("提交失败");
});
}
......@@ -288,8 +301,8 @@ export default {
path: "/incomeList",
query: {
id: this.$route.query.id,
backid: this.$route.query.backid
}
backid: this.$route.query.backid,
},
});
},
//合同文件校验
......@@ -309,10 +322,10 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 0
typeCategory: 0,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.typeList = res.data;
} else {
......@@ -320,7 +333,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
this.back();
});
......@@ -328,10 +341,10 @@ export default {
//获取项目
getProject() {
let param = {
projectId: this.projectId
projectId: this.projectId,
};
selectByProjectId(param)
.then(res => {
.then((res) => {
if (res.success) {
this.projectData = res.data;
this.incomeFrom.projectName = res.data.projectName;
......@@ -341,7 +354,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取项目失败");
this.back();
});
......@@ -349,7 +362,7 @@ export default {
//查询发票编号
Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
......@@ -357,7 +370,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
......@@ -365,15 +378,15 @@ export default {
//清楚合同文件
delfile1() {
this.fileTypepdf = false;
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
},
//取消
remove() {
this.proutlist1.enclosureDescribe = null;
this.delfile1();
this.dialogFormVisible = false;
}
}
},
},
};
</script>
......
......@@ -161,7 +161,7 @@
<el-popover placement="top" width="60" v-model="scope.row.visible">
<p>确定要删除该发票吗</p>
<div style="text-align: right; margin:0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="DeleteFrom(scope.row)">确定</el-button>
</div>
<el-button type="danger" icon="el-icon-delete" size="mini" slot="reference"></el-button>
......
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