|
@@ -11,27 +11,30 @@
|
|
<div class="edit" v-if="active == 0">
|
|
<div class="edit" v-if="active == 0">
|
|
<van-form class="edit_form" label-width="140">
|
|
<van-form class="edit_form" label-width="140">
|
|
<!-- 报销人 -->
|
|
<!-- 报销人 -->
|
|
- <van-field label="报销人" @click="ownerIdShow = true" readonly clickable required>
|
|
|
|
|
|
+ <van-field label="报销人" @click="ownerIdShowCli(1)" readonly clickable required>
|
|
<template #input>
|
|
<template #input>
|
|
<span v-if="user.userNameNeedTranslate == 1 && formshowText.name"><ww-open-data type='userName'
|
|
<span v-if="user.userNameNeedTranslate == 1 && formshowText.name"><ww-open-data type='userName'
|
|
:openid='formshowText.name'></ww-open-data></span>
|
|
:openid='formshowText.name'></ww-open-data></span>
|
|
<span v-else>{{ formshowText.name }}</span>
|
|
<span v-else>{{ formshowText.name }}</span>
|
|
</template>
|
|
</template>
|
|
</van-field>
|
|
</van-field>
|
|
|
|
+ <div v-if="auditTypeItem.auditType == 2">
|
|
|
|
+ <van-field label="第一审核人" @click="ownerIdShowCli(2)" readonly clickable required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName'
|
|
|
|
+ :openid='firstCheckerText.name'></ww-open-data></span>
|
|
|
|
+ <span v-else>{{ firstCheckerText.name }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-field label="第二审核人" @click="ownerIdShowCli(3)" readonly clickable required>
|
|
|
|
+ <template #input>
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName'
|
|
|
|
+ :openid='secondCheckerText.name'></ww-open-data></span>
|
|
|
|
+ <span v-else>{{ secondCheckerText.name }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ </div>
|
|
<van-popup v-model="ownerIdShow" position="bottom" v-if="canExamine" style="height: 90%">
|
|
<van-popup v-model="ownerIdShow" position="bottom" v-if="canExamine" style="height: 90%">
|
|
- <!-- <div style="minHeight:300px;">
|
|
|
|
- <van-radio-group v-model="userRadio" v-if="user.userNameNeedTranslate == '1'">
|
|
|
|
- <van-radio v-for="item in userList" :key="item.id" :name="item" class="userCheckbox">
|
|
|
|
- <ww-open-data type='userName' :openid='item.name'></ww-open-data>
|
|
|
|
- </van-radio>
|
|
|
|
- </van-radio-group>
|
|
|
|
- <van-radio-group v-model="userRadio" v-else>
|
|
|
|
- <van-radio v-for="item in userList" :key="item.id" :name="item" class="userCheckbox">{{
|
|
|
|
- item.name }}</van-radio>
|
|
|
|
- </van-radio-group>
|
|
|
|
- <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;"
|
|
|
|
- @click="ownerIdChange()">确定</van-button>
|
|
|
|
- </div> -->
|
|
|
|
<div class="popupDiv paddingTop">
|
|
<div class="popupDiv paddingTop">
|
|
<div class="popupCon conBorder">
|
|
<div class="popupCon conBorder">
|
|
<van-radio-group v-model="userRadio" v-if="user.userNameNeedTranslate == '1'">
|
|
<van-radio-group v-model="userRadio" v-if="user.userNameNeedTranslate == '1'">
|
|
@@ -111,11 +114,23 @@
|
|
<template #input>¥{{ getTaxValue(item.amount, item.taxPercent) }}</template>
|
|
<template #input>¥{{ getTaxValue(item.amount, item.taxPercent) }}</template>
|
|
</van-field>
|
|
</van-field>
|
|
<van-field label="备注:" v-model="item.remark" autosize maxlength="100"></van-field>
|
|
<van-field label="备注:" v-model="item.remark" autosize maxlength="100"></van-field>
|
|
- <van-field label="报销凭证:" @click="invoiceIndex = index" clickable>
|
|
|
|
|
|
+ <!-- <van-field label="报销凭证:" @click="invoiceIndex = index" clickable>
|
|
<template #input>
|
|
<template #input>
|
|
<van-uploader v-model="uploader[index]" :before-read="beforeRead"
|
|
<van-uploader v-model="uploader[index]" :before-read="beforeRead"
|
|
:after-read="afterRead" @delete="item.pic = null" :max-count="1" />
|
|
:after-read="afterRead" @delete="item.pic = null" :max-count="1" />
|
|
</template>
|
|
</template>
|
|
|
|
+ </van-field> -->
|
|
|
|
+ <van-field @click="invoiceIndex = index" clickable label-width="0em">
|
|
|
|
+ <template #input>
|
|
|
|
+ <div class="imgListVan">
|
|
|
|
+ <div>报销凭证:</div>
|
|
|
|
+ <div class="vanUploaderImg">
|
|
|
|
+ <van-uploader v-model="uploader[index]" :before-read="beforeRead" multiple
|
|
|
|
+ :after-read="afterRead" @delete="(file, Item) => {deteleImg(file, Item, index)}" :max-count="10" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
</van-field>
|
|
</van-field>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -301,6 +316,7 @@ export default {
|
|
},
|
|
},
|
|
userRadio: null,
|
|
userRadio: null,
|
|
ownerIdShow: false,
|
|
ownerIdShow: false,
|
|
|
|
+ ownerIdShowType: 1, // 1,报销人, 2第一审核人, 3第二审核人
|
|
createDateShow: false,
|
|
createDateShow: false,
|
|
typeShow: false,
|
|
typeShow: false,
|
|
typeList: [],
|
|
typeList: [],
|
|
@@ -352,7 +368,9 @@ export default {
|
|
expenseMainType: {
|
|
expenseMainType: {
|
|
text: ''
|
|
text: ''
|
|
},
|
|
},
|
|
- projectSelectVal: ''
|
|
|
|
|
|
+ projectSelectVal: '',
|
|
|
|
+ firstCheckerText: {},
|
|
|
|
+ secondCheckerText: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -442,8 +460,16 @@ export default {
|
|
|
|
|
|
// #region 费用报销
|
|
// #region 费用报销
|
|
ownerIdChange() {
|
|
ownerIdChange() {
|
|
- this.editForm.ownerId = this.userRadio.id
|
|
|
|
- this.formshowText.name = this.userRadio.name
|
|
|
|
|
|
+ if(this.ownerIdShowType == 1) {
|
|
|
|
+ this.editForm.ownerId = this.userRadio.id
|
|
|
|
+ this.formshowText.name = this.userRadio.name
|
|
|
|
+ } else if(this.ownerIdShowType == 2) {
|
|
|
|
+ this.$set(this.firstCheckerText, 'id', this.userRadio.id)
|
|
|
|
+ this.$set(this.firstCheckerText, 'name', this.userRadio.name)
|
|
|
|
+ } else if(this.ownerIdShowType == 3) {
|
|
|
|
+ this.$set(this.secondCheckerText, 'id', this.userRadio.id)
|
|
|
|
+ this.$set(this.secondCheckerText, 'name', this.userRadio.name)
|
|
|
|
+ }
|
|
this.ownerIdShow = false
|
|
this.ownerIdShow = false
|
|
},
|
|
},
|
|
createDateChange(value, key) {
|
|
createDateChange(value, key) {
|
|
@@ -522,24 +548,59 @@ export default {
|
|
|
|
|
|
// 上传报销凭证
|
|
// 上传报销凭证
|
|
beforeRead(file) {
|
|
beforeRead(file) {
|
|
- if (file.type != 'image/jpeg' && file.type != 'image/png') {
|
|
|
|
- this.$toast.fail('请选择jpg或png格式的图片')
|
|
|
|
- return false
|
|
|
|
|
|
+ // console.log(file, file.length)
|
|
|
|
+ // console.log(Array.isArray(file))
|
|
|
|
+ // if (file.type != 'image/jpeg' && file.type != 'image/png' && file.type != 'image/jpg') {
|
|
|
|
+ // this.$toast.fail('请选择jpg或png格式的图片')
|
|
|
|
+ // return false
|
|
|
|
+ // }
|
|
|
|
+ // return true
|
|
|
|
+
|
|
|
|
+ let newFile = Array.isArray(file) ? file : [file]
|
|
|
|
+ for(var i in newFile) {
|
|
|
|
+ const fileItem = newFile[i]
|
|
|
|
+ if (fileItem.type != 'image/jpeg' && fileItem.type != 'image/png' && fileItem.type != 'image/jpg') {
|
|
|
|
+ this.$toast.fail('请选择jpg或png格式的图片')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return true
|
|
return true
|
|
},
|
|
},
|
|
afterRead(file) {
|
|
afterRead(file) {
|
|
|
|
+ // let formData = new FormData();
|
|
|
|
+ // formData.append("multipartFile", file.file);
|
|
|
|
+ // this.$axios.post("/common/uploadFile", formData)
|
|
|
|
+ // .then(res => {
|
|
|
|
+ // if (res.code == "ok") {
|
|
|
|
+ // this.invoiceList[this.invoiceIndex].pic = res.data
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$toast.fail('上传失败');
|
|
|
|
+ // this.uploader[this.invoiceIndex] = []
|
|
|
|
+ // }
|
|
|
|
+ // }).catch(err => { this.$toast.clear(); console.log(err); this.uploader[this.invoiceIndex] = [] });
|
|
|
|
+
|
|
|
|
+ let newFile = Array.isArray(file) ? file : [file]
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
- formData.append("multipartFile", file.file);
|
|
|
|
- this.$axios.post("/common/uploadFile", formData)
|
|
|
|
- .then(res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- this.invoiceList[this.invoiceIndex].pic = res.data
|
|
|
|
- } else {
|
|
|
|
- this.$toast.fail('上传失败');
|
|
|
|
- this.uploader[this.invoiceIndex] = []
|
|
|
|
- }
|
|
|
|
- }).catch(err => { this.$toast.clear(); console.log(err); this.uploader[this.invoiceIndex] = [] });
|
|
|
|
|
|
+ for(var i in newFile) {
|
|
|
|
+ formData.append("multipartFiles", newFile[i].file);
|
|
|
|
+ }
|
|
|
|
+ this.$axios.post("/common/uploadFileArray", formData)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ let newPic = this.invoiceList[this.invoiceIndex].pic || []
|
|
|
|
+ let newData = res.data.split(';')
|
|
|
|
+ this.invoiceList[this.invoiceIndex].pic = [...newPic, ...newData]
|
|
|
|
+ console.log(this.invoiceList[this.invoiceIndex].pic, '<=== 合计图片')
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('上传失败');
|
|
|
|
+ this.uploader[this.invoiceIndex] = []
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => { this.$toast.clear(); console.log(err); this.uploader[this.invoiceIndex] = [] });
|
|
|
|
+ },
|
|
|
|
+ // 删除图片
|
|
|
|
+ deteleImg(file, item, arrIndex) {
|
|
|
|
+ let index = item.index
|
|
|
|
+ this.invoiceList[arrIndex].pic = this.invoiceList[arrIndex].pic.filter((item,i) => i != index)
|
|
},
|
|
},
|
|
|
|
|
|
// 提交
|
|
// 提交
|
|
@@ -552,6 +613,16 @@ export default {
|
|
this.$toast.fail('请选择填报日期')
|
|
this.$toast.fail('请选择填报日期')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if(this.auditTypeItem.auditType == 2) {
|
|
|
|
+ if(!this.firstCheckerText.id || !this.secondCheckerText.id) {
|
|
|
|
+ this.$toast.fail(`${!this.firstCheckerText.id ? '请选择第一审核人' : '请选择第二审核人'}`)
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ this.editForm.firstCheckerId = this.firstCheckerText.id
|
|
|
|
+ this.editForm.secondCheckerId = this.secondCheckerText.id
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
let required1 = false
|
|
let required1 = false
|
|
let required2 = false
|
|
let required2 = false
|
|
let required3 = false
|
|
let required3 = false
|
|
@@ -591,7 +662,15 @@ export default {
|
|
for (let i in this.invoiceList) {
|
|
for (let i in this.invoiceList) {
|
|
this.invoiceList[i].taxValue = this.getTaxValue(this.invoiceList[i].amount, this.invoiceList[i].taxPercent)
|
|
this.invoiceList[i].taxValue = this.getTaxValue(this.invoiceList[i].amount, this.invoiceList[i].taxPercent)
|
|
}
|
|
}
|
|
- this.editForm.items = JSON.stringify(this.invoiceList)
|
|
|
|
|
|
+
|
|
|
|
+ let newList = JSON.parse(JSON.stringify(this.invoiceList))
|
|
|
|
+ for(let i in newList) {
|
|
|
|
+ if(newList[i].pic) {
|
|
|
|
+ newList[i].pic = newList[i].pic.join(',')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // this.editForm.items = JSON.stringify(this.invoiceList)
|
|
|
|
+ this.editForm.items = JSON.stringify(newList)
|
|
this.editForm.totalAmount = this.totalCost
|
|
this.editForm.totalAmount = this.totalCost
|
|
// 获取新的票据编号
|
|
// 获取新的票据编号
|
|
this.confirmLoading = true
|
|
this.confirmLoading = true
|
|
@@ -616,6 +695,8 @@ export default {
|
|
// name: '',
|
|
// name: '',
|
|
// inProjectName: []
|
|
// inProjectName: []
|
|
// }
|
|
// }
|
|
|
|
+ this.$set(this, 'firstCheckerText', {})
|
|
|
|
+ this.$set(this, 'secondCheckerText', {})
|
|
this.formshowText.name = ''
|
|
this.formshowText.name = ''
|
|
this.formshowText.inProjectName = []
|
|
this.formshowText.inProjectName = []
|
|
this.expenseMainType.text=''
|
|
this.expenseMainType.text=''
|
|
@@ -803,6 +884,11 @@ export default {
|
|
this.$toast.fail('获取失败');
|
|
this.$toast.fail('获取失败');
|
|
}
|
|
}
|
|
}).catch(err => { this.$toast.clear(); console.log(err) });
|
|
}).catch(err => { this.$toast.clear(); console.log(err) });
|
|
|
|
+ },
|
|
|
|
+ ownerIdShowCli(type) {
|
|
|
|
+ this.ownerIdShowType = type
|
|
|
|
+ this.userRadio = ''
|
|
|
|
+ this.ownerIdShow = true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -849,6 +935,23 @@ export default {
|
|
text-align: right;
|
|
text-align: right;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .imgListVan {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ }
|
|
|
|
+ .vanUploaderImg {
|
|
|
|
+ // display: flex;
|
|
|
|
+ margin-top: 6px;
|
|
|
|
+ /deep/ .van-uploader__preview-image {
|
|
|
|
+ width: 70px;
|
|
|
|
+ height: 70px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /deep/ .van-uploader__upload {
|
|
|
|
+ width: 70px;
|
|
|
|
+ height: 70px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.list {
|
|
.list {
|