Browse Source

新增单据导出,合同没转译的问题

Lijy 2 năm trước cách đây
mục cha
commit
4f1ea90c4d

+ 21 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/contract/index.vue

@@ -193,7 +193,13 @@
             {{statusList[contractForm.status].label}}
           </el-form-item>
           <el-form-item :label="$t('dismissreason')" v-if="contractForm.status == 2">
-            {{contractForm.msg ? contractForm.msg : ''}}
+            <span v-if="userNameNeedTranslate == 1">
+              <span><ww-open-data type='userName' :openid='contractForm.msg.name'></ww-open-data></span>
+              <span>{{contractForm.msg.text}}</span>
+            </span>
+            <span v-else>
+              {{contractForm.msg ? contractForm.msg : ''}}
+            </span>
           </el-form-item>
           <el-form-item :label="$t('founder')">
             <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='contractForm.creatorName'></ww-open-data></span>
@@ -680,7 +686,20 @@ export default {
     },
     lookover(row){
       // console.log('lookover',row);
-      this.contractForm = row
+      if(this.user.userNameNeedTranslate == 1) {
+        let obj = {name: '',text: ''}
+        if(row.msg.indexOf('$userName=') != '-1') {
+          let str = row.msg.split('$userName=')[1]
+          let arr = str.split('$')
+          obj.name = arr[0]
+          obj.text = arr[1]
+        } else {
+          obj.text = row.msg
+        }
+        this.contractForm = obj
+      } else {
+        this.contractForm = row
+      }
       this.fileList = this.contractForm.files ? this.contractForm.files : []
       for(let i in this.fileList){
         this.fileList[i].name = this.fileList[i].documentName

+ 66 - 16
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -222,26 +222,31 @@
               </el-select>
             </el-form-item>
             <!-- 填报日期 -->
-            <el-form-item :label="$t('fillinthedate')" >
-              <el-date-picker
-                v-model="date"
-                type="daterange"
-                value-format="yyyy-MM-dd"
-                size="small"
-                :range-separator="$t('other.to')"
-                :start-placeholder="$t('time.startDate')"
-                :end-placeholder="$t('time.endDate')"
-                style="width: 280px">
-              </el-date-picker>
-            </el-form-item>
-            <el-form-item>
-              <el-button @click="getList" size="small">{{ $t('find') }}</el-button>
-            </el-form-item>
+            <div style="display: inline-block;padding-left: 15px">
+              <el-form-item :label="$t('fillinthedate')" >
+                <el-date-picker
+                  v-model="date"
+                  type="daterange"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  :range-separator="$t('other.to')"
+                  :start-placeholder="$t('time.startDate')"
+                  :end-placeholder="$t('time.endDate')"
+                  style="width: 280px">
+                </el-date-picker>
+              </el-form-item>
+              <el-form-item>
+                <el-button @click="getList" size="small">{{ $t('find') }}</el-button>
+              </el-form-item>
+              <el-form-item v-if="currentClick == '2-1'">
+                <el-button @click="exportDocument()" size="small">单据导出</el-button>
+              </el-form-item>
+            </div>
           </el-form>
         </div>
         <el-divider ></el-divider>
         <!--列表-->
-          <el-table ref="tab" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" :summary-method="getSummaries" show-summary>
+          <el-table ref="tab" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight - currentClickNum" style="width: 100%;" :summary-method="getSummaries" show-summary>
               <el-table-column prop="code" :label="$t('ticketnumber')"></el-table-column>
               <el-table-column prop="totalAmount" :label="$t('amountof')+ '('+$t('yuan')+')'" align="center">
                 <template slot-scope="scope" >
@@ -622,6 +627,8 @@ export default {
       diz: 'http://worktime.ttkuaiban.com',
       importDialog: false,
       importingData: false,
+      currentClick: '',
+      currentClickNum: 0,
 
       // 费用类型自定义
       customTypeDialog: false,
@@ -934,6 +941,10 @@ export default {
         this.displayTable = true;
         this.getList();
       }
+      // currentClick
+      // console.log(key, keyPath)
+      this.currentClick = key
+      key == '2-1' ? this.currentClickNum = 70 : this.currentClickNum = 0
     },
     bills(audit) { // 控制
       this.isAuditList = audit;
@@ -1304,6 +1315,7 @@ export default {
         this.$refs.staff.style.width = '95%'
         this.$refs.xiaomian.style.width = '100%'
         this.$refs.headHe.style.paddingLeft = '20px'
+        this.currentClickNum = 0
       } else {
         this.$refs.sidebars.style.width = '200px'
         this.$refs.sid.style.left = '200px'
@@ -1313,6 +1325,7 @@ export default {
         this.$refs.staff.style.width = '81%'
         this.$refs.xiaomian.style.width = '85%'
         this.$refs.headHe.style.paddingLeft = '220px'
+        this.currentClickNum = 70
       }
     },
     // 费用金额失去焦点时触发
@@ -1507,6 +1520,43 @@ export default {
         } else if(obj.distinction == '3') {
           this.ParticularsList.ownerId = obj.id
         }
+      },
+      // 单据导出
+      exportDocument() {
+        var stat = ''
+        var end = ''
+        if(this.date) {
+          stat = this.date[0]
+          end = this.date[1]
+        }
+        this.http.post('/expense-sheet/exportList', {
+          code: this.code,
+          startDate: stat,
+          endDate: end,
+          ownerId:this.ownerId,
+          type:this.type,
+        },
+        res => {
+            if (res.code == "ok") {
+                var filePath = res.data;
+                const a = document.createElement('a'); // 创建a标签
+                a.setAttribute('download', '费用报销单据列表');// download属性
+                a.setAttribute('href', filePath);// href链接
+                a.click(); //自执行点击事件
+                a.remove();
+            } else {
+                this.$message({
+                message: res.msg,
+                type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
       }
   },
 };