main-20240105
赵夫琳 8 months ago
commit a713686e0e

@ -16,7 +16,7 @@
<RMList :moreLoading.sync="moreLoading" :refreshing.sync="refreshing" :finished.sync="finished" @onLoad="handleLoad" @onRefresh="handleRefresh" isMore :tableList="tableList">
<div class="new-item-box" v-for="(item,index) in tableList" :key="index">
<div class="new-lf">
<van-checkbox v-model="item.checked" shape="square" @change="handleSetCheck(index,item,true)"></van-checkbox>
<van-checkbox :disabled="disabled" v-model="item.checked" shape="square" @change="handleSetCheck(index,item,true)"></van-checkbox>
<!-- <van-image @click="handleShowImg(item)" width="2.5rem" height="2.5rem" src="https://img01.yzcdn.cn/vant/cat.jpeg" /> -->
</div>
<div class="new-cr" @click="handleSetCheck(index,item)" v-if="invoiceType == '01'">
@ -78,7 +78,8 @@ export default {
isExist: Boolean, //
tripPartners: Array, //
list: Array, //
type: [Number, String]
type: [Number, String],
disabled:Boolean
},
components: {
RePick: () => import('@/components/ReComponents/RePick'),
@ -121,10 +122,12 @@ export default {
}
},
created() {
this.$nextTick(() => {
this.invoiceIdsCopy = this.invoiceIds
this.getList('init')
})
// this.$nextTick(() => {
// this.invoiceIdsCopy = this.invoiceIds
// console.log(this.invoiceIds)
// console.log('212121')
// this.getList('init')
// })
},
watch: {
isOpen: {
@ -154,21 +157,40 @@ export default {
// deep: true,
// immediate: true
// }
invoiceIds:{
handler(newData){
this.invoiceIdsCopy =newData
this.getList('init')
},
deep:true,
immediate:true
},
},
methods: {
handleSetCheck(index,item,type) {
if(this.disabled){
return;
}
// this.tableList
let _this = this
if(!type){
this.$set(this.tableList[index], 'checked', !this.tableList[index].checked)
}
console.log(this.tableList[index].checked)
if (this.tableList[index].checked) {
if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) {
_this.invoiceIdsCopy[_this.invoiceType] = [];
}
_this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id)
if (!_this.invoiceIdsCopy[_this.invoiceType].includes(_this.tableList[index].id)) {
_this.invoiceIdsCopy[_this.invoiceType].push(_this.tableList[index].id);
}
// _this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id)
} else {
_this.invoiceIdsCopy[_this.invoiceType].splice(index, 1)
_this.invoiceIdsCopy[_this.invoiceType].forEach(function (item,indexs){
if(item == _this.tableList[index].id){
_this.invoiceIdsCopy[_this.invoiceType].splice(indexs, 1)
}
})
}
this.$forceUpdate()
console.log(_this.invoiceIdsCopy)

@ -9,7 +9,7 @@
<van-field v-model="cn" disabled label="公司名称" clear-trigger="always" input-align="right" />
<van-field v-model="userInfo.nickname" disabled label="申请人" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
<van-field v-model="userInfo.dept.name" disabled label="申请部门" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
<van-field v-model="form.projectName" :disabled="disabled" label="项目名称" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.projectName" :disabled="disabled" label="项目名称" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" />
<van-field v-model="form.reason" :disabled="disabled" name="reason" autosize rows="2" label="报销事由" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<van-field v-model="form.remark" :disabled="disabled" name="remark" autosize rows="2" label="备注信息" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<RePick v-model="form.costDeptId" :disabled="disabled" label="费用归属部门" :name="`costDeptId`" :list="userDeptTree" isRequrie isCascader isShowSearch title="费用归属部门" titleKey="name" isCell clearable />
@ -83,10 +83,10 @@
</van-field>
<van-field v-model="nitem.remark" :disabled="disabled" name="reason" autosize rows="2" label="备注" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<div @click="handleShowIe('1',index,nIndex)">
<van-field disabled :class="nitem.invoiceName ? 'actived-disabled tag-blue':'tag-blue'" v-model="nitem.invoiceName" name="reason" autosize rows="2" label="关联发票" clear-trigger="always" input-align="right" placeholder="请关联" />
<van-field disabled :class="nitem.invoiceName ? 'actived-disabled tag-blue':'tag-blue'" v-model="nitem.invoiceName" name="reason" autosize rows="2" label="关联发票" clear-trigger="always" input-align="right" :placeholder="nitem.invoiceCount>0?'已关联发票':'请关联'" />
</div>
<!--关联发票 -->
<ConnectInvoice :list="nitem.ieList" :temClaimNo="form.claimNo" :invoiceIds="nitem.invoiceIds" @onCancel="nitem.show = false" :isOpen="nitem.show" @onConfirm="(arr)=>{handleConfirmIe(arr,index,nIndex)}" />
<ConnectInvoice :disabled="disabled" :list="nitem.ieList" :temClaimNo="form.claimNo" :invoiceIds="nitem.invoiceIds" @onCancel="nitem.show = false" :isOpen="nitem.show" @onConfirm="(arr)=>{handleConfirmIe(arr,index,nIndex)}" />
</div>
</div>
<div class="add-box" style="margin-bottom:0.3rem" v-if="['edit','add'].includes(typeStr)">
@ -140,10 +140,10 @@
</van-field>
<van-field v-model="nitem.remark" :disabled="disabled" name="reason" autosize rows="2" label="备注" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<div @click="handleShowIe1(nIndex)">
<van-field disabled :class="nitem.invoiceName ? 'actived-disabled tag-blue':'tag-blue'" v-model="nitem.invoiceName" name="reason" autosize rows="2" label="关联发票" clear-trigger="always" input-align="right" placeholder="请关联" />
<van-field disabled :class="nitem.invoiceName ? 'actived-disabled tag-blue':'tag-blue'" v-model="nitem.invoiceName" name="reason" autosize rows="2" label="关联发票" clear-trigger="always" input-align="right" :placeholder="nitem.invoiceCount>0?'已关联发票':'请关联'" />
</div>
<!--关联发票 -->
<ConnectInvoice :list="nitem.ieList" :invoiceIds="nitem.invoiceIds" @onCancel="nitem.show = false" :isOpen="nitem.show" @onConfirm="(arr)=>{handleConfirmIe1(arr,nIndex)}" />
<ConnectInvoice :disabled="disabled" :list="nitem.ieList" :invoiceIds="nitem.invoiceIds" @onCancel="nitem.show = false" :isOpen="nitem.show" @onConfirm="(arr)=>{handleConfirmIe1(arr,nIndex)}" />
<div style="color:red;margin-top:10px" v-if="nitem.amount > handleCountAmount(form.expenseClaimDetails)">
费用明细超出费控设置金额,费控设置金额为{{handleCountAmount(form.expenseClaimDetails)}}
</div>
@ -153,10 +153,8 @@
<van-button type="info" round @click.stop="handleAddAccount1(index)" native-type="button" icon="plus" size="small">添加费用</van-button>
</div>
</div>
<!-- 日常费用列表结束 -->
<div class="section mt5" v-if="['show'].includes(typeStr)"> <span class="line"> </span>审批流程</div>
<ApprovalProcess v-if="['show'].includes(typeStr)" :processInstanceId="form.processInstanceId" @onSetId="handleSetAccessId" />
<!-- 申请单关联 -->
<div class="section mt5"> <span class="line"> </span>申请单关联</div>
<RePick v-model="form.expenseApplyIds" isShowSearch :disabled="disabled" inputAlign="left" multiple titleKey="title" idKey="id" label="申请单" :name="`expenseApplyIds`" :list="expenseApplyList" isCell clearable />
@ -164,6 +162,9 @@
<div style="color:red;font-size:0.8rem;margin-top:0.5rem" v-if="form.budgetAmountInfo">
{{form.budgetAmountInfo}}
</div>
<!-- 日常费用列表结束 -->
<div class="section mt5" v-if="['show'].includes(typeStr)"> <span class="line"> </span>审批流程</div>
<ApprovalProcess v-if="['show'].includes(typeStr)" :processInstanceId="form.processInstanceId" @onSetId="handleSetAccessId" />
</van-form>
</div>
<BottomBtn ref="BottomBtn" :isAuthorised="isAuthorised" @onBtConfirm="handleBtConfirm" :accessId="accessId" />
@ -279,6 +280,7 @@ export default {
}
]
},
times:null
};
},
//
@ -543,12 +545,13 @@ export default {
})
},
handleShowIe(type, index, nIndex) {
if (this.disabled) return
// if (this.disabled) return
// this.indexOne = index
// this.indexTwo = nIndex
// this.claimType = type
// let obj = this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex]
// this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'ieList', arr)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', true)
console.log('form......', this.form);
// this.handleFilterList(obj.invoiceIds || {}).then((arr) => {
@ -556,7 +559,7 @@ export default {
// })
},
handleShowIe1(nIndex) {
if (this.disabled) return
// if (this.disabled) return
// let obj = this.form.expenseClaimDetails[nIndex]
// this.$set(this.form.expenseClaimDetails[nIndex], 'ieList', arr)
@ -566,6 +569,7 @@ export default {
// })
},
handleConfirmIe(arr, index, nIndex) {
console.log(arr)
// let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('')
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceIds', arr)
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'show', false)
@ -573,6 +577,7 @@ export default {
this.$set(this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], 'invoiceName', this.totalCount(arr) == 0 ? '请关联' : '已关联发票')
},
handleConfirmIe1(arr, nIndex) {
console.log(arr)
// let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('')
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceIds', arr)
this.$set(this.form.expenseClaimDetails[nIndex], 'show', false)
@ -819,7 +824,8 @@ export default {
disabled: item.status != 2 ? true : false
}
})
console.log('...', this.expenseApplyList);
console.log(this.expenseApplyList)
console.log('dkldsjlkdsjl')
resolve()
this.$loading(false)
})

Loading…
Cancel
Save