ggooalice 2 anni fa
parent
commit
9af9a2fa36

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -528,7 +528,7 @@
                             //5- 出差消息
                             this.$router.push("/awayOffice");
                             this.drawer = false;
-                        } else if (type == 6 || type == 7) {
+                        } else if (type == 6 || type == 7 || type == 8) {
                             // 6、7 合同通过、驳回
                             this.$router.push("/contract");
                             this.drawer = false;

+ 42 - 19
fhKeeper/formulahousekeeper/timesheet/src/views/contract/index.vue

@@ -63,16 +63,18 @@
     </el-col>
 
     <el-table :data="contractList" v-loading="listLoading" :height="tableHeight" border highlight-current-row>
-      <el-table-column prop="number" :label="$t('contractno')" min-width="150"></el-table-column>
-      <el-table-column prop="name" :label="$t('he-tong-ming-cheng')" min-width="150"></el-table-column>
-      <el-table-column prop="amounts" :label="$t('contractamount')" min-width="150"></el-table-column>
-      <el-table-column prop="typeName" :label="$t('he-tong-lei-xing')" min-width="150"></el-table-column>
-      <el-table-column prop="status" :label="$t('state.states')" min-width="150">
+      <el-table-column prop="number" :label="$t('contractno')" min-width="190"></el-table-column>
+      <el-table-column prop="name" :label="$t('he-tong-ming-cheng')" min-width="190"></el-table-column>
+      <el-table-column prop="amounts" :label="$t('contractamount')" min-width="130" align="right" header-align="center">
+        <span slot-scope="scope">¥ {{scope.row.amounts ? scope.row.amounts.toFixed(2) : '0.00'}}</span>
+      </el-table-column>
+      <el-table-column prop="typeName" :label="$t('he-tong-lei-xing')" min-width="140" align="center"></el-table-column>
+      <el-table-column prop="status" :label="$t('state.states')" min-width="100" align="center">
         <template slot-scope="scope">
           <span :style="statusList[scope.row.status].color">{{statusList[scope.row.status].label}}</span>
         </template>
       </el-table-column>
-      <el-table-column prop="indate" :label="$t('creationtime')" min-width="150"></el-table-column>
+      <el-table-column prop="indate" :label="$t('creationtime')" min-width="100" align="center"></el-table-column>
       <el-table-column width="300" :label="$t('operation')" align="left" fixed="right">
         <template slot-scope="scope">
           <el-button v-if="permissions.contractView || permissions.contractManagement" size="mini" @click="lookover(scope.row)">{{$t('cha-kan')}}</el-button>
@@ -99,13 +101,15 @@
       <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
         <el-form ref="contractForm" :model="contractForm" :rules="rules" label-width="120px" class="contractForm">
           <el-form-item :label="$t('contractno')">
-            <el-input v-model="contractForm.number" :placeholder="$t('peaseenterthe')" clearable></el-input>
+            <el-input v-model="contractForm.number" :maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable></el-input>
           </el-form-item>
           <el-form-item :label="$t('he-tong-ming-cheng')" prop='name'>
-            <el-input v-model="contractForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
+            <el-input v-model="contractForm.name" :maxlength="100" show-word-limit :placeholder="$t('peaseenterthe')" clearable></el-input>
           </el-form-item>
           <el-form-item :label="$t('contractamount')">
-            <el-input v-model="contractForm.amounts" :placeholder="$t('peaseenterthe')" clearable></el-input>
+            <el-input v-model="contractForm.amounts" id="contract_amount" :placeholder="$t('peaseenterthe')" @keyup.native="restrictNumber('contract_amount')" clearable>
+              <span slot="prefix">¥</span>
+            </el-input>
           </el-form-item>
           <el-form-item :label="$t('he-tong-lei-xing')">
             <el-select v-model="contractForm.typeId" :placeholder="$t('defaultText.pleaseChoose')" style="width:100%">
@@ -178,7 +182,7 @@
             {{contractForm.name}}
           </el-form-item>
           <el-form-item :label="$t('contractamount')">
-            {{contractForm.amounts}}
+            {{contractForm.amounts}}
           </el-form-item>
           <el-form-item :label="$t('he-tong-lei-xing')">
             {{contractForm.typeName}}
@@ -261,9 +265,9 @@
 
     <el-dialog :title="$t('dao-ru-he-tong')" :visible.sync="importDialog" v-if="importDialog" width="30%">
       <!-- 模板? -->
-      <!-- <p>1. {{$t('other.download')}}
+      <p>1. {{$t('other.download')}}
         <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('he-tong-guan-li-dao-ru-mo-ban')+'.xlsx'" :download="$t('he-tong-guan-li-dao-ru-mo-ban')+'.xlsx'">{{$t('he-tong-guan-li-dao-ru-mo-ban')+ '.xlsx'}}</el-link>
-      </p> -->
+      </p>
       <div slot="footer" class="dialog-footer" style="text-align:center;">
         <el-upload ref="upload" action="#" :limit="1" :http-request="importContract" :show-file-list="false">
           <el-button type="primary" :loading="importLoading">{{ $t('dao-ru-he-tong') }}</el-button>
@@ -354,10 +358,27 @@ export default {
     this.getContractType()
   },
   methods: {
-    test(row){
-      console.log('test',row);
-      // this.$refs.uploadFile.submit()
-    },
+    // test(row){
+    //   console.log('test',row);
+    //   // this.$refs.uploadFile.submit()
+    // },
+    restrictNumber(targetId) {
+                let inpu = document.getElementById(targetId);
+                inpu.value = inpu.value.replace(/[^\d.]/g, "");  //仅保留数字和"."
+                inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
+                inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
+                inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
+                if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
+                  inpu.value = parseFloat(inpu.value);
+                  
+                }
+                if(inpu.value.split('.')[0].length > 9){
+                    inpu.value = inpu.value.split('.')[0].substring(0,9) + (inpu.value.split('.')[1] ? '.' + inpu.value.split('.')[1] : '')
+                    
+                    this.contractForm.amounts = inpu.value
+                  }
+                
+            },
 
     searchFilter(){
       this.page = 1
@@ -589,6 +610,7 @@ export default {
     processR(row,status){
       this.denyReasonDialog = true
       this.denyrowId = row.id
+      this.denyReason = ''
     },
     process(row,status){
       let parameter
@@ -608,6 +630,7 @@ export default {
       res => {
         if(res.code == 'ok'){
           this.getContractList()
+          this.denyReasonDialog = false
           this.$message({
             message: status == 0 ? this.$t('state.alreadyPassed') : this.$t('state.rejected'),
             type: 'success'
@@ -626,7 +649,7 @@ export default {
       })
     },
     lookover(row){
-      console.log('lookover',row);
+      // console.log('lookover',row);
       this.contractForm = row
       this.fileList = this.contractForm.files ? this.contractForm.files : []
       for(let i in this.fileList){
@@ -677,7 +700,7 @@ export default {
       this.fileList.push(file)
     },
     fileDelete(row){
-      console.log(row,this.fileList);
+      // console.log(row,this.fileList);
       this.$confirm(this.$t('que-ding-yao-shan-chu-gai-wen-jian-ma'), this.$t('other.prompts'), {
         confirmButtonText: this.$t('btn.determine'),
         cancelButtonText: this.$t('btn.cancel'),
@@ -733,7 +756,7 @@ export default {
       })
     },
     submitFile(){
-      console.log('submitFile',this.fileList);
+      // console.log('submitFile',this.fileList);
       let formData = new FormData();
       for(let i in this.fileList){
         if(this.fileList[i].needUpload){