浏览代码

费用报销补充提交

Min 2 年之前
父节点
当前提交
2aa73662c9

+ 33 - 18
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

@@ -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: '',

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue

@@ -167,7 +167,7 @@
                         </div>
                         <div><span>填报日期:</span><span>{{item.createDate}}</span></div>
                         <div><span>发票张数:</span><span>{{item.ticketNum}}</span></div>
-                        <div><span>费用类型:</span><span>{{typeList[item.type]}}</span></div>
+                        <div><span>费用类型:</span><span>{{item.expenseMainTypeName}}</span></div>
                         <!-- <div><span>状态:</span><span>{{item.status}}</span></div> -->
                         <!-- <div><span>驳回原因:</span><span>{{item.denyReason}}</span></div> -->
                         <div><span>备注:</span><span>{{item.remark}}</span></div>
@@ -206,7 +206,7 @@
                         </div>
                         <div><span>填报日期:</span><span>{{item.createDate}}</span></div>
                         <div><span>发票张数:</span><span>{{item.ticketNum}}</span></div>
-                        <div><span>费用类型:</span><span>{{typeList[item.type]}}</span></div>
+                        <div><span>费用类型:</span><span>{{item.expenseMainTypeName}}</span></div>
                         <!-- <div><span>状态:</span><span>{{item.status}}</span></div> -->
                         <!-- <div><span>驳回原因:</span><span>{{item.denyReason}}</span></div> -->
                         <div><span>备注:</span><span>{{item.remark}}</span></div>