Commit 01e9384f authored by 柳 佳乐's avatar 柳 佳乐
Browse files

202211201

parent 979e03ac
......@@ -3,7 +3,7 @@ ENV = 'development'
# base api 后端url
#VUE_APP_BASE_API = 'http://192.168.10.107:7080'
VUE_APP_BASE_API = 'http://192.168.10.109:11523'
VUE_APP_BASE_API = 'http://192.168.0.109:11523'
#VUE_APP_BASE_API = 'http://www.aishuhong.com:11549/prod-api/'
#VUE_APP_BASE_API = 'http://192.168.31.100:7081'
......@@ -32,3 +32,11 @@ export function getFileUrl(fileName) {
method: 'post'
})
}
//删除文件
export function delFile(data) {
return request({
url: '/companyFile/delete',
method: 'post',
data
})
}
......@@ -10,7 +10,6 @@ export const downloadPDFFile = function (url, fileName) {
url,
responseType: 'blob'
}).then((res) => {
// console.log('headers', res.headers)
// handle(res.data, fileName)
if (!res.data) {
return
......
// 身份证验证
export function chinaIdentityValid(rule, value, callback) {
if (!value) {
console.log("身份证验证返回")
return callback(new Error('员工身份证号不能为空'))
}
let city = {
......@@ -68,7 +67,6 @@ export function chinaIdentityValid(rule, value, callback) {
}
}
}
console.log("身份证验证返回")
callback()
}
//银行卡号检测
......@@ -89,7 +87,6 @@ export function bankAccountValid(rule, value, callback) {
// 电话号码验证
export function checkPhone(rule, value, callback) {
if (!value) {
// console.log(1)
return callback(new Error('手机号不能为空'));
} else {
const reg = /(^1\d{10}$)|(^[0-9]\d{7}$)/
......
import axios from 'axios'
import { MessageBox, Message } from 'element-ui'
import store from '@/store'
import router from '@/router'
import { getToken } from '@/utils/auth'
// create an axios instance
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
......@@ -11,6 +15,7 @@ const service = axios.create({
crossDomain: true
})
// request interceptor
service.interceptors.request.use(
config => {
......@@ -25,7 +30,6 @@ service.interceptors.request.use(
},
error => {
// do something with request error
console.log(error) // for debug
return Promise.reject(error)
}
)
......@@ -37,18 +41,24 @@ service.interceptors.response.use(
const res = response.data
// if the custom code is not 20000, it is judged as an error.
if (res.code !== 20000) {
// Message({
// message: res.data || 'Error',
// type: 'error',
// duration: 5 * 1000
// })
if(res.code == 4){
store.dispatch("user/logout");
window.location.href = "/";
Message({
message: "登录失效,请重新登录",
type: 'error',
})
}
return res
} else {
return res
}
},
error => {
console.log('err' + error) // for debug
Message({
message: error.message,
type: 'error',
......
......@@ -270,14 +270,67 @@
title="查看详情"
:visible.sync="drawer"
:direction="direction"
size="40%"
size="45%"
>
<el-form>
<el-descriptions
:column="6"
border
title="基本信息"
style="padding: 20px"
label-class-name="my-label"
>
<el-form label-width="180px">
<el-row>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="审批状态">
<el-descriptions-item label="出差理由" :span="6">
<span>{{ paramlist.tripReason }}</span>
</el-descriptions-item>
<el-descriptions-item label="附件数量" :span="3">
<span>{{ paramlist.enclosureNumber }}</span>
</el-descriptions-item>
<el-descriptions-item label="出发地点" :span="3">
<span>{{ paramlist.fromPlace }}</span>
</el-descriptions-item>
<el-descriptions-item label="目的地点" :span="3">
<span>{{ paramlist.purposePlace }}</span>
</el-descriptions-item>
<el-descriptions-item label="天数" :span="3">
<span>{{ paramlist.days }}</span>
</el-descriptions-item>
<el-descriptions-item label="交通工具" :span="3">
<span>{{ paramlist.vehicle }}</span>
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column="6"
border
title="费用详情"
style="padding: 20px"
label-class-name="my-label"
>
<el-descriptions-item label="伙食补贴" :span="3">
<span>{{ paramlist.foodAllowance }}</span>
</el-descriptions-item>
<el-descriptions-item label="公杂补贴" :span="3">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-descriptions-item>
<el-descriptions-item label="火车/汽车/轮船费(元)" :span="3">
<span>{{ paramlist.tripCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="机票费" :span="3">
<span>{{ paramlist.planeTicket }}</span>
</el-descriptions-item>
<el-descriptions-item label="汽油费" :span="3">
<span>{{ paramlist.trafficCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="住宿费" :span="3">
<span>{{ paramlist.lodgingCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="其他费用" :span="3">
<span>{{ paramlist.otherCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="审批状态" :span="3">
<el-tag
size="mini"
:type="
paramlist.tripStatus == 0
? 'info'
......@@ -300,76 +353,25 @@
: "不存在"
}}
</el-tag>
</el-form-item>
<el-form-item label="附件数量">
<span>{{ paramlist.enclosureNumber }}</span>
</el-form-item>
<el-form-item label="出差理由">
<span>{{ paramlist.tripReason }}</span>
</el-form-item>
<el-form-item label="出发地点">
<span>{{ paramlist.fromPlace }}</span>
</el-form-item>
<el-form-item label="目的地点">
<span>{{ paramlist.purposePlace }}</span>
</el-form-item>
<el-form-item label="经过地点">
<span>{{ paramlist.transitPlace }}</span>
</el-form-item>
<el-form-item label="交通工具">
<span>{{ paramlist.vehicle }}</span>
</el-form-item>
</el-descriptions-item>
<el-form-item label="伙食补贴(元)">
<span>{{ paramlist.foodAllowance }}</span>
</el-form-item>
<el-form-item label="公杂补贴(元)">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-form-item>
<el-form-item label="随人员">
<el-descriptions-item label="备注" :span="6">
<span>{{ paramlist.remarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="无票据说明" :span="6">
<span>{{ paramlist.nobillExplain }}</span>
</el-descriptions-item>
<el-descriptions-item label="随人员" :span="6">
<el-tag
type="warning"
size="medium"
size="mini"
v-for="item in paramlist.entouragelist"
:key="item.id"
style="margin: 0px 5px"
>{{ item.personnelName }}</el-tag
>
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple-light">
<el-form-item label="火车/汽车/轮船费(元)">
<span>{{ paramlist.tripCost }}</span>
</el-form-item>
<el-form-item label="机票费(元)">
<span>{{ paramlist.planeTicket }}</span>
</el-form-item>
<el-form-item label="汽油费(元)">
<span>{{ paramlist.trafficCost }}</span>
</el-form-item>
<el-form-item label="住宿费(元)">
<span>{{ paramlist.lodgingCost }}</span>
</el-form-item>
<el-form-item label="其他费用(元)">
<span>{{ paramlist.otherCost }}</span>
</el-form-item>
<el-form-item label="备注">
<span>{{ paramlist.remarks }}</span>
</el-form-item>
<el-form-item label="无票据说明">
<span>{{ paramlist.nobillExplain }}</span>
</el-form-item>
<el-form-item label="是否领取补贴">
<span>{{ paramlist.receiveSubsidy == 0 ? "否" : "是" }}</span>
</el-form-item>
<el-form-item label="天数">
<span>{{ paramlist.days }}</span>
</el-form-item>
</div>
</el-col>
</el-row>
</el-descriptions-item>
</el-descriptions>
</el-form>
</el-drawer>
</div>
......@@ -694,7 +696,7 @@ export default {
// 展示数据的方法
getpagelist(pager = 1) {
this.queryitem.pageNum = pager;
queryBypagefinance(this.queryitem).then(async (res) => {
queryBypagefinance(this.queryitem).then((res) => {
if (res.success) {
this.total = res.data.total;
this.tableData = res.data.list;
......@@ -714,11 +716,6 @@ export default {
} else {
//业务逻辑
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -763,7 +760,7 @@ export default {
this.agreeOrapproval.tripStatus = 3;
this.agreeOrapproval.tripId = this.financelistData.tripId;
this.agreeOrapproval.financeTime = this.time();
finApproval(this.agreeOrapproval).then(async (res) => {
finApproval(this.agreeOrapproval).then((res) => {
if (res.success) {
this.$message({
type: "success",
......@@ -772,11 +769,6 @@ export default {
this.getpagelist();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
this.dialogVisible = false;
......@@ -806,17 +798,12 @@ export default {
this.agreeOrapproval.tripStatus = 4;
this.agreeOrapproval.tripId = this.financelistData.tripId;
this.agreeOrapproval.financeTime = this.time();
finApproval(this.agreeOrapproval).then(async (res) => {
finApproval(this.agreeOrapproval).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.getpagelist();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
this.dialogVisible = false;
......@@ -856,7 +843,7 @@ export default {
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then(async (res) => {
.then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
this.getinvoivelist.forEach((e) => {
......@@ -876,12 +863,6 @@ export default {
});
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
})
.catch((error) => {
......@@ -996,7 +977,7 @@ export default {
selectImage(row) {
this.queryDTO.tripId = row.tripId;
this.proutlist1.Id = row.tripId;
selectByIdF(this.queryDTO).then(async (res) => {
selectByIdF(this.queryDTO).then((res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
......@@ -1010,12 +991,6 @@ export default {
}
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -1033,18 +1008,13 @@ export default {
//刷新附件
Refresh() {
this.queryDTO.tripId = this.proutlist1.Id;
selectByIdF(this.queryDTO).then(async (res) => {
selectByIdF(this.queryDTO).then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
//业务逻辑
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -1072,7 +1042,10 @@ export default {
};
</script>
<style scoped>
<style>
.my-label{
width: 100px;
}
.container_top {
padding: 15px;
}
......
......@@ -232,14 +232,67 @@
title="查看详情"
:visible.sync="drawer"
:direction="direction"
size="40%"
size="45%"
>
<el-form>
<el-descriptions
:column="6"
border
title="基本信息"
style="padding: 20px"
label-class-name="my-label"
>
<el-form label-width="180px">
<el-row>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="审批状态">
<el-descriptions-item label="出差理由" :span="6">
<span>{{ paramlist.tripReason }}</span>
</el-descriptions-item>
<el-descriptions-item label="附件数量" :span="3">
<span>{{ paramlist.enclosureNumber }}</span>
</el-descriptions-item>
<el-descriptions-item label="出发地点" :span="3">
<span>{{ paramlist.fromPlace }}</span>
</el-descriptions-item>
<el-descriptions-item label="目的地点" :span="3">
<span>{{ paramlist.purposePlace }}</span>
</el-descriptions-item>
<el-descriptions-item label="天数" :span="3">
<span>{{ paramlist.days }}</span>
</el-descriptions-item>
<el-descriptions-item label="交通工具" :span="3">
<span>{{ paramlist.vehicle }}</span>
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column="6"
border
title="费用详情"
style="padding: 20px"
label-class-name="my-label"
>
<el-descriptions-item label="伙食补贴" :span="3">
<span>{{ paramlist.foodAllowance }}</span>
</el-descriptions-item>
<el-descriptions-item label="公杂补贴" :span="3">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-descriptions-item>
<el-descriptions-item label="火车/汽车/轮船费(元)" :span="3">
<span>{{ paramlist.tripCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="机票费" :span="3">
<span>{{ paramlist.planeTicket }}</span>
</el-descriptions-item>
<el-descriptions-item label="汽油费" :span="3">
<span>{{ paramlist.trafficCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="住宿费" :span="3">
<span>{{ paramlist.lodgingCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="其他费用" :span="3">
<span>{{ paramlist.otherCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="审批状态" :span="3">
<el-tag
size="mini"
:type="
paramlist.tripStatus == 0
? 'info'
......@@ -262,76 +315,25 @@
: "不存在"
}}
</el-tag>
</el-form-item>
<el-form-item label="附件数量">
<span>{{ paramlist.enclosureNumber }}</span>
</el-form-item>
<el-form-item label="出差理由">
<span>{{ paramlist.tripReason }}</span>
</el-form-item>
<el-form-item label="出发地点">
<span>{{ paramlist.fromPlace }}</span>
</el-form-item>
<el-form-item label="目的地点">
<span>{{ paramlist.purposePlace }}</span>
</el-form-item>
<el-form-item label="经过地点">
<span>{{ paramlist.transitPlace }}</span>
</el-form-item>
<el-form-item label="交通工具">
<span>{{ paramlist.vehicle }}</span>
</el-form-item>
</el-descriptions-item>
<el-form-item label="伙食补贴(元)">
<span>{{ paramlist.foodAllowance }}</span>
</el-form-item>
<el-form-item label="公杂补贴(元)">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-form-item>
<el-form-item label="随人员">
<el-descriptions-item label="备注" :span="6">
<span>{{ paramlist.remarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="无票据说明" :span="6">
<span>{{ paramlist.nobillExplain }}</span>
</el-descriptions-item>
<el-descriptions-item label="随人员" :span="6">
<el-tag
type="warning"
size="medium"
size="mini"
v-for="item in paramlist.entouragelist"
:key="item.id"
style="margin: 0px 5px"
>{{ item.personnelName }}</el-tag
>
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple-light">
<el-form-item label="火车/汽车/轮船费(元)">
<span>{{ paramlist.tripCost }}</span>
</el-form-item>
<el-form-item label="机票费(元)">
<span>{{ paramlist.planeTicket }}</span>
</el-form-item>
<el-form-item label="汽油费(元)">
<span>{{ paramlist.trafficCost }}</span>
</el-form-item>
<el-form-item label="住宿费(元)">
<span>{{ paramlist.lodgingCost }}</span>
</el-form-item>
<el-form-item label="其他费用(元)">
<span>{{ paramlist.otherCost }}</span>
</el-form-item>
<el-form-item label="备注">
<span>{{ paramlist.remarks }}</span>
</el-form-item>
<el-form-item label="无票据说明">
<span>{{ paramlist.nobillExplain }}</span>
</el-form-item>
<el-form-item label="是否领取补贴">
<span>{{ paramlist.receiveSubsidy == 0 ? "否" : "是" }}</span>
</el-form-item>
<el-form-item label="天数">
<span>{{ paramlist.days }}</span>
</el-form-item>
</div>
</el-col>
</el-row>
</el-descriptions-item>
</el-descriptions>
</el-form>
</el-drawer>
</div>
......@@ -413,55 +415,6 @@
</div>
</el-row>
</el-card>
<!-- 附件上传 -->
<!-- <el-card
class="box-card"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0"
>
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
ref="upload1"
drag
:action="action1"
:file-list="fileList1"
:on-remove="delfile1"
:auto-upload="false"
:on-change="onChangepdf"
:on-success="Refresh"
:data="proutlist1"
multiple
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>
</el-upload>
</div>
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-card> -->
<div class="box-card" v-show="getshow == 3"></div>
</el-drawer>
</div>
......@@ -562,20 +515,16 @@ export default {
this.total = res.data.total;
this.tableData = res.data.list;
res.data.list.forEach((item) => {
selectAll({ tripId: item.tripId }).then(async (resu) => {
selectAll({ tripId: item.tripId }).then( (resu) => {
if (resu.success) {
item.entouragelist = resu.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(resu.msg);
}
});
});
}else{
this.$message.error(res.msg);
}
});
},
......@@ -609,7 +558,7 @@ export default {
this.agreeOrapproval.tripStatus = 1;
this.agreeOrapproval.tripId = data.tripId;
this.agreeOrapproval.headmanTime = this.time();
Approval(this.agreeOrapproval).then(async (res) => {
Approval(this.agreeOrapproval).then( (res) => {
if (res.success) {
this.$message({
type: "success",
......@@ -618,12 +567,6 @@ export default {
this.getpagelist();
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
});
......@@ -648,17 +591,12 @@ export default {
this.agreeOrapproval.tripStatus = 2;
this.agreeOrapproval.tripId = data.tripId;
this.agreeOrapproval.headmanTime = this.time();
Approval(this.agreeOrapproval).then(async (res) => {
Approval(this.agreeOrapproval).then( (res) => {
if (res.success) {
this.$message.success("操作成功");
this.getpagelist();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
});
......@@ -676,7 +614,7 @@ export default {
},
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId).then(async (res) => {
selectAllById(this.getinvoiveId).then( (res) => {
if (res.success) {
this.getinvoivelist = res.data;
this.getinvoivelist.forEach((e) => {
......@@ -694,12 +632,6 @@ export default {
});
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -733,7 +665,7 @@ export default {
selectImage(row) {
this.queryDTO.tripId = row.tripId;
this.proutlist1.Id = row.tripId;
selectByIdF(this.queryDTO).then(async (res) => {
selectByIdF(this.queryDTO).then( (res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
......@@ -748,11 +680,6 @@ export default {
} else {
//业务逻辑
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -770,18 +697,12 @@ export default {
//刷新附件
Refresh() {
this.queryDTO.tripId = this.proutlist1.Id;
selectByIdF(this.queryDTO).then(async (res) => {
selectByIdF(this.queryDTO).then( (res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -808,7 +729,10 @@ export default {
};
</script>
<style scoped>
<style>
.my-label{
width: 100px;
}
.container_top {
padding: 15px;
}
......
......@@ -13,7 +13,12 @@
:column="3"
border
>
<el-descriptions-item labelClassName="required" label="报销项目">
<el-descriptions-item
labelClassName="required"
label="报销项目"
:labelStyle="{ width: '110px', height: '60px' }"
:contentStyle="rowCenter"
>
<!-- projectId -->
<el-form-item prop="projectId">
<el-select
......@@ -80,9 +85,7 @@
<el-descriptions-item labelClassName="required" label="交通工具">
<!-- vehicle -->
<el-form-item prop="vehicle">
<el-input
v-model.trim="spendreimbursementform.vehicle"
></el-input>
<el-input v-model.trim="spendreimbursementform.vehicle"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item labelClassName="required" label="申请时间">
......@@ -118,7 +121,6 @@
:disabled="
spendreimbursementform.receiveSubsidy == 1 ? false : true
"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -130,7 +132,6 @@
:disabled="
spendreimbursementform.receiveSubsidy == 1 ? false : true
"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -143,7 +144,6 @@
<el-form-item prop="tripCost">
<el-input
v-model.trim="spendreimbursementform.tripCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -152,7 +152,6 @@
<el-form-item prop="planeTicket">
<el-input
v-model.trim="spendreimbursementform.planeTicket"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -164,7 +163,6 @@
<el-form-item prop="trafficCost">
<el-input
v-model.trim="spendreimbursementform.trafficCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -173,7 +171,6 @@
<el-form-item prop="lodgingCost">
<el-input
v-model.trim="spendreimbursementform.lodgingCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -182,7 +179,6 @@
<el-form-item prop="insuranceCost">
<el-input
v-model.trim="spendreimbursementform.insuranceCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -191,7 +187,6 @@
<el-form-item prop="otherCost">
<el-input
v-model.trim="spendreimbursementform.otherCost"
@change="addnum(spendreimbursementform)"
></el-input>
</el-form-item>
</el-descriptions-item>
......@@ -217,7 +212,7 @@
label="申报总金额(大写)"
>
<!-- applyTotalAmountLarge -->
<el-form-item prop="applyTotalAmountLarge">
<el-form-item>
<el-input
disabled
v-model.trim="spendreimbursementform.applyTotalAmountLarge"
......@@ -305,6 +300,8 @@
:headers="fileUploadHeader"
:auto-upload="false"
multiple
:on-remove="fileError"
:on-success="fileSuccess"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
......@@ -315,7 +312,7 @@
</el-descriptions-item>
</el-descriptions>
</el-main>
<el-footer>
<el-footer style="margin: 5 px 2%">
<el-button type="primary" @click="submitForm()">提交</el-button>
<el-button @click="resetForm()">重置</el-button>
<el-button @click="back()">返回</el-button>
......@@ -327,9 +324,9 @@
import {
insert,
selectTypeitem,
selectProjectitem,
selectProjectpeople,
} from "@/api/spendreimbursement.js";
import { selectAll as projectSelectAll } from "@/api/project";
import { selectAllBystatus } from "@/api/project";
import { money } from "@/utils/myValidate";
export default {
......@@ -464,6 +461,9 @@ export default {
startTime: [{ required: true, message: "此项不能为空!" }],
endTime: [{ required: true, message: "此项不能为空!" }],
},
rowCenter: {
"text-align": "center",
},
};
},
methods: {
......@@ -481,10 +481,29 @@ export default {
list.forEach((val) => {
sum += val.money;
});
if (this.spendreimbursementform.invoiceIdList.length < 1) {
this.spendreimbursementform.applyTotalAmountLarge = null;
this.spendreimbursementform.applyTotalAmountSmall = 0;
} else {
this.spendreimbursementform.applyTotalAmountSmall = sum;
}
this.convertCurrency(sum);
return sum;
},
//上传失败的回调
//上传失败的回调
fileError(){
this.$message.error("附件上传失败");
},
//上传成功
fileSuccess(res){
if(res.success){
this.$message.success(res.msg)
}else{
this.$message.error(res.msg);
}
},
//查询发票编号
Selectinsertlsit() {
let param = {
......@@ -494,16 +513,12 @@ export default {
userId: this.$store.getters.info.userId,
};
selectAllBystatus(param)
.then(async (res) => {
.then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.back();
}
})
.catch((error) => {
......@@ -516,10 +531,12 @@ export default {
this.$refs.ruleform.validate((valid) => {
if (valid) {
// 除发票以外所有的金额
let sum1 = this.addnum(this.spendreimbursementform);
// console.log(sum1);
let sum1 = parseFloat(this.addnum(this.spendreimbursementform));
console.log(sum1);
// 申报总金额
let sum2 = this.spendreimbursementform.applyTotalAmountSmall;
let sum2 = parseFloat(
this.spendreimbursementform.applyTotalAmountSmall
);
if (sum1 == sum2) {
// 判断随行人员 是否为空
if (this.peopleListName == "") {
......@@ -548,15 +565,10 @@ export default {
this.back();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
} else {
this.$message.warning("发票金额不同,无法提交");
this.$message.warning("申报总金额有误,无法提交");
}
}
});
......@@ -571,30 +583,19 @@ export default {
this.collectType = res.data;
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
// 项目类型
reimebursementprojectItem() {
const params = {
companyId: this.$store.getters.companyId,
userId: this.$store.getters.info.userId
};
selectProjectitem(params).then((res) => {
projectSelectAll(params).then((res) => {
if (res.success) {
this.collectProject = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -603,17 +604,11 @@ export default {
const params = {
companyId: this.$store.getters.companyId,
};
selectProjectpeople(params).then(async (res) => {
selectProjectpeople(params).then((res) => {
if (res.success) {
this.collectProjectpeople = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -690,6 +685,7 @@ export default {
},
//重置
resetForm() {
this.timeSlot = "";
this.$refs.ruleform.resetFields();
},
// 删除附件
......@@ -821,10 +817,7 @@ export default {
let a7 = parseFloat(obj.insuranceCost);
let a8 = parseFloat(obj.otherCost);
let sum = parseFloat(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8).toFixed(2);
// console.log(sum);
// 转换大小写
this.convertCurrency(sum);
return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
return sum;
},
},
};
......@@ -861,4 +854,8 @@ export default {
cursor: pointer;
}
}
.contract-description-form {
width: 95%;
margin: 20px 2%;
}
</style>
\ No newline at end of file
......@@ -291,14 +291,67 @@
title="查看详情"
:visible.sync="drawer"
:direction="direction"
size="40%"
size="45%"
>
<el-form>
<el-descriptions
:column="6"
border
title="基本信息"
style="padding: 20px"
label-class-name="my-label"
>
<el-form label-width="180px">
<el-row>
<el-col :span="12">
<div class="grid-content bg-purple">
<el-form-item label="审批状态">
<el-descriptions-item label="出差理由" :span="6">
<span>{{ paramlist.tripReason }}</span>
</el-descriptions-item>
<el-descriptions-item label="附件数量" :span="3">
<span>{{ paramlist.enclosureNumber }}</span>
</el-descriptions-item>
<el-descriptions-item label="出发地点" :span="3">
<span>{{ paramlist.fromPlace }}</span>
</el-descriptions-item>
<el-descriptions-item label="目的地点" :span="3">
<span>{{ paramlist.purposePlace }}</span>
</el-descriptions-item>
<el-descriptions-item label="天数" :span="3">
<span>{{ paramlist.days }}</span>
</el-descriptions-item>
<el-descriptions-item label="交通工具" :span="3">
<span>{{ paramlist.vehicle }}</span>
</el-descriptions-item>
</el-descriptions>
<el-descriptions
:column="6"
border
title="费用详情"
style="padding: 20px"
label-class-name="my-label"
>
<el-descriptions-item label="伙食补贴" :span="3">
<span>{{ paramlist.foodAllowance }}</span>
</el-descriptions-item>
<el-descriptions-item label="公杂补贴" :span="3">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-descriptions-item>
<el-descriptions-item label="火车/汽车/轮船费(元)" :span="3">
<span>{{ paramlist.tripCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="机票费" :span="3">
<span>{{ paramlist.planeTicket }}</span>
</el-descriptions-item>
<el-descriptions-item label="汽油费" :span="3">
<span>{{ paramlist.trafficCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="住宿费" :span="3">
<span>{{ paramlist.lodgingCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="其他费用" :span="3">
<span>{{ paramlist.otherCost }}</span>
</el-descriptions-item>
<el-descriptions-item label="审批状态" :span="3">
<el-tag
size="mini"
:type="
paramlist.tripStatus == 0
? 'info'
......@@ -321,76 +374,25 @@
: "不存在"
}}
</el-tag>
</el-form-item>
<el-form-item label="附件数量">
<span>{{ paramlist.enclosureNumber }}</span>
</el-form-item>
<el-form-item label="出差理由">
<span>{{ paramlist.tripReason }}</span>
</el-form-item>
<el-form-item label="出发地点">
<span>{{ paramlist.fromPlace }}</span>
</el-form-item>
<el-form-item label="目的地点">
<span>{{ paramlist.purposePlace }}</span>
</el-form-item>
<el-form-item label="经过地点">
<span>{{ paramlist.transitPlace }}</span>
</el-form-item>
<el-form-item label="交通工具">
<span>{{ paramlist.vehicle }}</span>
</el-form-item>
</el-descriptions-item>
<el-form-item label="伙食补贴(元)">
<span>{{ paramlist.foodAllowance }}</span>
</el-form-item>
<el-form-item label="公杂补贴(元)">
<span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
</el-form-item>
<el-form-item label="随人员">
<el-descriptions-item label="备注" :span="6">
<span>{{ paramlist.remarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="无票据说明" :span="6">
<span>{{ paramlist.nobillExplain }}</span>
</el-descriptions-item>
<el-descriptions-item label="随人员" :span="6">
<el-tag
type="warning"
size="medium"
size="mini"
v-for="item in paramlist.entouragelist"
:key="item.id"
style="margin: 0px 5px"
>{{ item.personnelName }}</el-tag
>
</el-form-item>
</div>
</el-col>
<el-col :span="12">
<div class="grid-content bg-purple-light">
<el-form-item label="火车/汽车/轮船费(元)">
<span>{{ paramlist.tripCost }}</span>
</el-form-item>
<el-form-item label="机票费(元)">
<span>{{ paramlist.planeTicket }}</span>
</el-form-item>
<el-form-item label="汽油费(元)">
<span>{{ paramlist.trafficCost }}</span>
</el-form-item>
<el-form-item label="住宿费(元)">
<span>{{ paramlist.lodgingCost }}</span>
</el-form-item>
<el-form-item label="其他费用(元)">
<span>{{ paramlist.otherCost }}</span>
</el-form-item>
<el-form-item label="备注">
<span>{{ paramlist.remarks }}</span>
</el-form-item>
<el-form-item label="无票据说明">
<span>{{ paramlist.nobillExplain }}</span>
</el-form-item>
<el-form-item label="是否领取补贴">
<span>{{ paramlist.receiveSubsidy == 0 ? "否" : "是" }}</span>
</el-form-item>
<el-form-item label="天数">
<span>{{ paramlist.days }}</span>
</el-form-item>
</div>
</el-col>
</el-row>
</el-descriptions-item>
</el-descriptions>
</el-form>
</el-drawer>
</div>
......@@ -399,6 +401,7 @@
<el-pagination
layout="->, total, prev, pager, next"
:total="total"
:current-page.sync="queryitem.pageNum"
:page-size="queryitem.pageSize"
@current-change="getpagelist"
>
......@@ -557,7 +560,7 @@ export default {
projectName: null,
tripStatus: null,
pageNum: 1,
pageSize: 10,
pageSize: 5,
},
//抽屉
drawer: false,
......@@ -653,11 +656,6 @@ export default {
});
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -685,12 +683,7 @@ export default {
if (res.success) {
this.collectProjectpeople = res.data;
} else {
this.$message.error("失败");
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
});
},
......@@ -727,21 +720,12 @@ export default {
if (resu.success) {
e.entouragelist = resu.data;
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(resu.msg);
}
});
});
} else {
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(res.msg);
}
});
},
......@@ -759,15 +743,11 @@ export default {
this.invoicestatus = true;
} else {
this.invoicestatus = false;
this.back();
}
} else {
this.$message.error(res.msg);
this.back();
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -779,11 +759,6 @@ export default {
this.getpagelist();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -803,11 +778,6 @@ export default {
this.getpagelist();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
});
......@@ -841,11 +811,6 @@ export default {
});
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -881,11 +846,6 @@ export default {
}
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -904,7 +864,7 @@ export default {
updatecard() {
this.getshow = 0;
this.disabled = true;
this.delfile1();
this.clearFile();
},
//删除附件
deleteProject(row) {
......@@ -918,17 +878,16 @@ export default {
this.visible = false;
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
//清除附件文件
delfile1(file) {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.$message.error("上传附件失败");
},
//清除附件文件
clearFile(){
this.fileList1 = []
this.fileTypepdf = false;
this.proutlist1.enclosureDescribe = "";
},
......@@ -939,18 +898,14 @@ export default {
this.$refs.upload1.submit();
this.getshow = 1; //隐藏与显示
this.disabled = false;
this.$message({
showClose: true,
message: "上传附件成功",
type: "success",
});
this.Refresh();
} else {
this.$message.error("请添加附件,在进行提交");
}
},
//刷新附件
Refresh() {
Refresh(res) {
this.$message.success("上传附件成功");
if (res.success) {
const params = {
tripId: this.proutlist1.Id,
companyId: this.$store.getters.companyId,
......@@ -961,24 +916,22 @@ export default {
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
}else{
this.$message.error(res.msg);
}
},
//附件取消
remove() {
if (this.queryDTOList.length > 0) {
this.getshow = 1;
this.disabled = false;
this.delfile1();
this.clearFile();
} else {
this.getshow = 3;
this.disabled = false;
this.delfile1();
this.clearFile();
}
},
//附件文件校验
......@@ -1011,7 +964,10 @@ export default {
};
</script>
<style scoped>
<style>
.my-label {
width: 100px;
}
.total_content {
padding: 0px 15px;
}
......
......@@ -442,9 +442,6 @@ export default {
tripId: this.$route.query.tripid,
}).then((res) => {
if (res.success) {
// console.log(res.data);
//获取数据(把data里的数据放在数组里面)
//this.spendreimbursementform = res.data;
this.spendreimbursementform = {
...res.data,
invoiceIdList: [], //发票信息
......@@ -461,12 +458,7 @@ export default {
let d = array.join("");
this.peopleListName = d;
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
this.$message.error(resu.msg);
}
});
if (res.data.receiveSubsidy == 1) {
......@@ -478,12 +470,6 @@ export default {
this.timeSlot.push(res.data.endTime);
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -495,22 +481,13 @@ export default {
};
selectAllById(param).then((res) => {
if (res.success) {
//this.spendreimbursementform.invoiceIdList = [];
res.data.forEach((e) => {
this.selectgetinvoivelist.push(e);
this.spendreimbursementform.invoiceIdList.push(e.invoiceId);
});
console.log(this.spendreimbursementform.invoiceIdList);
console.log(this.selectgetinvoivelist);
} else {
this.$message.error(res.msg);
this.back();
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -528,11 +505,6 @@ export default {
this.Selectlsitinvoice();
} else {
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -541,11 +513,11 @@ export default {
this.$refs.ruleform.validate((valid) => {
if (valid) {
// 除发票以外所有的金额
let sum1 = this.addnum(this.spendreimbursementform);
// console.log(sum1);
let sum1 = parseFloat(this.addnum(this.spendreimbursementform));
// 申报总金额
let sum2 = this.spendreimbursementform.applyTotalAmountSmall;
// console.log(sum2);
let sum2 = parseFloat(
this.spendreimbursementform.applyTotalAmountSmall
);
// 判断金额是否相等
if (sum1 == sum2) {
// 判断随行人员 是否为空
......@@ -554,47 +526,22 @@ export default {
this.spendreimbursementform.tripRersonnel[0] =
this.$store.getters.name;
} else {
// 如果不为空 就把文本框里面的内容 提交上去
this.spendreimbursementform.tripRersonnel = [];
let k = this.peopleListName.split("");
this.spendreimbursementform.tripRersonnel = k;
// let m = this.$store.getters.name;
// k.forEach((e) => {
// this.spendreimbursementform.tripRersonnel.push(m, e);
// });
}
// 修改的方法
update(this.spendreimbursementform).then((res) => {
if (res.success) {
// let addpeopleList = [];
// let a = this.colleagepeopleList.split(",");
// a.forEach((e) => {
// if (e != null && e != "") {
// addpeopleList.push({
// personnelName: e,
// tripId: res.data,
// });
// }
// });
// // 第二个方法 添加随从人员
// insertId(addpeopleList).then((result) => {
// if (result.success) {
// } else {
// this.$message.error(result.msg);
// }
// });
this.$message.success("修改成功!");
this.$router.push("/spendreimbursementList");
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
} else {
this.$message.warning("发票金额不同,无法提交");
this.$message.warning("申报总金额有误,无法提交");
}
}
});
......@@ -609,12 +556,6 @@ export default {
this.collectType = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -628,12 +569,6 @@ export default {
this.collectProject = res.data;
} else {
this.$message.error(res.msg);
//业务逻辑
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
});
},
......@@ -724,6 +659,7 @@ export default {
},
//重置
resetForm() {
this.timeSlot = [];
this.$refs.ruleform.resetFields();
},
// 大小写
......@@ -837,10 +773,9 @@ export default {
let a7 = parseFloat(obj.insuranceCost);
let a8 = parseFloat(obj.otherCost);
let sum = parseFloat(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8).toFixed(2);
// console.log(sum);
// 转换大小写
this.convertCurrency(sum);
return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
return sum;
},
},
};
......
......@@ -210,7 +210,6 @@ export default {
//负责人添加
grtselect() {
if (this.options.length > 0) {
console.log(this.user.userId);
this.FixedAssetsAddDTO.fixedController = this.user.userId;
} else {
this.$message.error("没有负责人哦亲");
......
......@@ -95,16 +95,6 @@
>{{scope.row.fixedState == '0' ? '未使用' : scope.row.fixedState == '1' ? '已使用':'已丢失'}}</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="资产使用情况" width="130px">
<template slot-scope="scope">
<el-button
type="primary"
@click="selectFrom(scope.row)"
size="mini"
icon="el-icon-search"
>查询使用</el-button>
</template>
</el-table-column>-->
<el-table-column prop="prop" label="操作" align="center">
<template slot-scope="scope">
<el-button
......@@ -295,11 +285,11 @@ export default {
message: "丢失备注是成功"
});
} else {
this.$message.error("丢失备注失败");
this.$message.error(res.msg);
}
})
.catch(e => {
this.$message.error(e.msg);
this.$message.error("丢失备注失败");
});
})
.catch(() => {
......
......@@ -238,7 +238,6 @@ export default {
},
//查询资产使用情况
getList() {
console.log(this.FixedUseQueryDTO);
queryByPageByFixedId(this.FixedUseQueryDTO)
.then(res => {
if (res.success) {
......@@ -247,7 +246,7 @@ export default {
}
})
.catch(e => {
this.$message.error(e.msg);
this.$message.error("查询使用情况失败");
});
},
//借用
......@@ -351,7 +350,7 @@ export default {
}
})
.catch(e => {
this.$message.error(e.msg);
this.$message.error("添加借用失败");
});
}
});
......@@ -361,7 +360,6 @@ export default {
this.timestampToTime();
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)
......@@ -380,7 +378,7 @@ export default {
}
})
.catch(e => {
this.$message.error(e.msg);
this.$message.error("归还失败");
});
}
});
......
......@@ -169,7 +169,6 @@ export default {
this.FixedAssetsAddDTO.fixedController = this.user.userId;
this.falesId = true;
this.name = "修改负责人";
console.log(this.FixedAssetsAddDTO.fixedController);
} else {
this.$message.error("没有负责人哦亲");
}
......@@ -234,7 +233,6 @@ export default {
//提交
submitForm() {
this.timestampToTime();
console.log(this.FixedAssetsAddDTO);
this.$refs.ruleForm.validate(valid => {
if (valid) {
if (this.FixedAssetsAddDTO.fixedController!=null) {
......
......@@ -73,6 +73,7 @@
size="mini"
icon="el-icon-edit"
@click="goUpdate(scope.row)"
:disabled="scope.row.fixedState=='2'?true:false"
>修改资产信息</el-button>
</template>
</el-table-column>
......@@ -132,7 +133,7 @@ export default {
methods: {
//分页
handleCurrentChange(val) {
console.log(val);
this.queryDTO.pageNum = val;
this.selectAssets();
},
......
......@@ -135,7 +135,7 @@ export default {
}
})
.catch(e => {
this.$$message.error(e.msg);
this.$$message.error("查询失败");
});
}
}
......
......@@ -171,7 +171,7 @@ export default {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.push("/companyList")
}else{
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error)=>{
this.$message.error("添加失败")
......
......@@ -61,7 +61,7 @@
</div>
<!-- 管理员抽屉 -->
<div>
<el-drawer title="我是标题" :visible.sync="drawer" :before-close="handleClose" size="40%">
<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">
......@@ -154,7 +154,7 @@ export default {
total: 0,
companyList: [],
drawer: false,
userlist: [],
userlist: {},
passwordData: {
staffPassword: null,
......@@ -191,11 +191,11 @@ export default {
this.total = res.data.total;
this.companyList = res.data.list;
} else {
this.$message.error(res.data);
this.$message.error(res.msg);
}
})
.catch(error => {
console.log(error);
this.$message.error("查询公司失败")
});
},
//换页
......@@ -227,17 +227,15 @@ export default {
selectByAdminget(row) {
this.passReset();
this.drawer = true;
console.log(row);
selectByAdministrators({ companyId: row.companyId })
.then(res => {
if (res.code == 20000) {
if (res.success) {
this.userlist = res.data;
this.passwordData.userId = res.data.userId;
console.log(this.passwordData.userId);
}
})
.catch(e => {
this.$message.error(e.msg);
this.$message.error("查询管理员失败");
});
},
//关闭抽屉
......@@ -247,7 +245,6 @@ export default {
},
//切换
handleClick(tab, event) {
console.log(tab, event);
this.userupdata = true;
this.passReset();
......@@ -275,7 +272,7 @@ export default {
}
})
.catch(e => {
this.$message.error(e.msg);
this.$message.error("修改密码失败");
});
}
});
......
......@@ -113,15 +113,25 @@ export default {
},
//下载
async download(row) {
console.log(row);
getFileUrl(row.companyFile)
.then((res) => {
if (res.success) {
let url = res.data;
console.log(url);
var a = document.createElement("a"); //创建一个<a></a>标
a.href = (await getFileUrl(row.companyFile)).data;
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.href = url; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
a.target = "_blank";
a.style.display = "none"; // 障眼法藏起来a标签
document.body.appendChild(a); // 将a标签追加到文档对象中
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
} else {
this.$message.error("下载失败");
}
})
.catch((e) => {
this.$message.error("下载失败");
});
},
//查询
querycompanyFile() {
......@@ -130,23 +140,11 @@ export default {
},
//分页查询(查询全公司的)
getCompanyFileList() {
// if (this.companyFileQurey.conmpanyFileName != null) {
// this.companyFileQurey.conmpanyFileName =
// this.companyFileQurey.conmpanyFileName
// .replace("%", "\\%")
// .replace("_", "\\_");
// }
queryBypage(this.companyFileQurey)
.then((res) => {
if (res.success) {
this.companyFIleList = res.data.list;
this.total = res.data.total;
// if (this.companyFileQurey.conmpanyFileName != null) {
// this.companyFileQurey.conmpanyFileName =
// this.companyFileQurey.conmpanyFileName
// .replace("\\%", "%")
// .replace("\\_", "_");
// }
} else {
this.$message.error(res.msg);
}
......
......@@ -49,11 +49,14 @@
</el-table-column>
<el-table-column prop="submitTime" label="上传时间" align="center">
</el-table-column>
<el-table-column prop="prop" label="操作" width="130px" align="center">
<el-table-column prop="prop" label="操作" width="170px" align="center">
<template slot-scope="scope">
<el-button type="success" size="mini" @click="download(scope.row)"
>点击下载</el-button
>
<el-button type="danger" size="mini" @click="del(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -74,7 +77,7 @@
</template>
<script>
import { queryBypageByuserId ,getFileUrl } from "@/api/companyFile";
import { queryBypageByuserId ,getFileUrl,delFile } from "@/api/companyFile";
export default {
data() {
return {
......@@ -128,8 +131,6 @@ export default {
},
//下载
async download(row) {
console.log(row);
var a = document.createElement("a"); //创建一个<a></a>标签
a.href=(await getFileUrl(row.companyFile)).data
// //a.href = process.env.VUE_APP_BASE_API + row.companyFile; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
......@@ -139,6 +140,22 @@ export default {
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
a.remove(); // 一次性的,用完就删除a标签
},
//删除
del(row){
delFile(row).then(res=>{
if(res.success){
this.$message.success("删除成功")
if(this.selFileList.length == 1 && this.selFileQurey.pageNum != 1){
this.selFileQurey.pageNum--
}
this.getselFileList()
}else{
this.$message.error(res.msg)
}
}).catch(error=>{
this.$message.error("删除失败")
})
},
//换页
handleCurrentChange(val) {
this.selFileQurey.pageNum = val;
......
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