|
@@ -57,26 +57,16 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
<!-- 费用类型 -->
|
|
|
- <van-field
|
|
|
- v-model="editForm.type"
|
|
|
- label="费用类型"
|
|
|
- @click="typeShow = true"
|
|
|
- readonly
|
|
|
- clickable
|
|
|
- >
|
|
|
- <template #input>{{ typeList[editForm.type] }}</template>
|
|
|
- </van-field>
|
|
|
- <van-popup v-model="typeShow" position="bottom" v-if="canEdit">
|
|
|
- <van-picker
|
|
|
+ <van-field v-model="editForm.type" label="费用主类型" @click="typeShow = true" readonly clickable>
|
|
|
+ <template #input>{{expenseMainType.text}}</template>
|
|
|
+ </van-field>
|
|
|
+ <van-popup v-model="typeShow" position="bottom" v-if="canEdit">
|
|
|
+ <van-picker
|
|
|
show-toolbar
|
|
|
:columns="typeList"
|
|
|
@confirm="typeChange"
|
|
|
- @cancel="
|
|
|
- typeShow = false;
|
|
|
- $forceUpdate();
|
|
|
- "
|
|
|
- />
|
|
|
- </van-popup>
|
|
|
+ @cancel="typeShow = false;$forceUpdate();"/>
|
|
|
+ </van-popup>
|
|
|
<!-- 备注 -->
|
|
|
<van-field v-model="editForm.remark" label="备注" :readonly="!canEdit" type="textarea"></van-field>
|
|
|
<!-- 发票 -->
|
|
@@ -295,6 +285,9 @@ export default {
|
|
|
allexTypeList: [],
|
|
|
inexTypeList: [],
|
|
|
uploader: [[]],
|
|
|
+ expenseMainType:{
|
|
|
+ text:''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -336,6 +329,7 @@ export default {
|
|
|
// }
|
|
|
this.getProjectList()
|
|
|
}
|
|
|
+ this.getExpensMainTypes()
|
|
|
},
|
|
|
methods: {
|
|
|
back(){
|
|
@@ -368,8 +362,13 @@ export default {
|
|
|
this.createDateShow = false
|
|
|
},
|
|
|
typeChange(value,key){
|
|
|
- this.editForm.type = key
|
|
|
+ this.editForm.type = value.id
|
|
|
+ this.expenseMainType.text=value.name
|
|
|
this.typeShow = false
|
|
|
+ for(let i in this.invoiceList){
|
|
|
+ this.invoiceList[i].expenseType=''
|
|
|
+ }
|
|
|
+ console.log(this.editForm.type)
|
|
|
this.inexTypeList = this.allexTypeList.filter(a=>a.mainType == this.editForm.type)
|
|
|
},
|
|
|
ticNumChange(value){
|
|
@@ -390,6 +389,22 @@ export default {
|
|
|
this.invoiceList.pop()
|
|
|
}
|
|
|
},
|
|
|
+ getExpensMainTypes(){
|
|
|
+ this.$axios.post("/expense-main-type/list", {})
|
|
|
+ .then(res => {
|
|
|
+ if(res.code == "ok") {
|
|
|
+ for(var i in res.data) {
|
|
|
+ res.data[i].text = res.data[i].name
|
|
|
+ }
|
|
|
+ this.typeList=res.data
|
|
|
+ this.expenseMainType.text=res.data[0].name
|
|
|
+ this.editForm.type=res.data[0].id
|
|
|
+ this.getExTypeList
|
|
|
+ } else {
|
|
|
+ this.$toast.fail('获取失败');
|
|
|
+ }
|
|
|
+ }).catch(err=> {this.$toast.clear();console.log(err)});
|
|
|
+ },
|
|
|
addInvoice(){
|
|
|
this.invoiceList.push({
|
|
|
projectId: '',
|