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

20221117

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