Просмотр исходного кода

fix(销售签约指标): 自测bug修复

likai 2 лет назад
Родитель
Сommit
aaa55dc484
2 измененных файлов с 38 добавлено и 3 удалено
  1. 21 0
      src/views/contract/components/ApplyContract.vue
  2. 17 3
      src/views/contract/target/index.vue

+ 21 - 0
src/views/contract/components/ApplyContract.vue

@@ -223,6 +223,27 @@
                 this.loading = false
               })
           })
+        } else {
+          this.loading = true
+          let data = JSON.parse(JSON.stringify(this.form))
+          data.shares = this.shares
+          contractApi
+            .commitWithFileUrl(data)
+            .then((res) => {
+              if (res.code == 200) {
+                this.$message.success('提交成功')
+                this.visible = false
+                this.$emit('refresh')
+              } else {
+                this.$message.success('系统异常')
+                console.error(res)
+              }
+              this.loading = false
+            })
+            .catch((err) => {
+              console.error(err)
+              this.loading = false
+            })
         }
       },
       // 修改分成比例

+ 17 - 3
src/views/contract/target/index.vue

@@ -35,7 +35,13 @@
           :http-request="uploadRequest"
           :show-file-list="false"
           style="margin: 0 10px 10px 0 !important">
-          <el-button v-permissions="['contract/target/import']" icon="el-icon-upload2" type="primary">导入</el-button>
+          <el-button
+            v-permissions="['contract/target/import']"
+            icon="el-icon-upload2"
+            :loading="importLoading"
+            type="primary">
+            导入
+          </el-button>
         </el-upload>
       </vab-query-form-left-panel>
       <vab-query-form-right-panel :span="12">
@@ -54,7 +60,7 @@
         show-overflow-tooltip
         :sortable="item.sortable">
         <template #default="{ row }">
-          <span v-if="item.prop.indexOf('完成率') >= 0">
+          <span v-if="item.label.indexOf('完成率') >= 0">
             {{ row[item.prop] + '%' }}
           </span>
           <span v-else>{{ row[item.prop] }}</span>
@@ -86,6 +92,7 @@
     },
     data() {
       return {
+        importLoading: false,
         height: this.$baseTableHeight(3),
         listLoading: false,
         layout: 'total, sizes, prev, pager, next, jumper',
@@ -359,6 +366,7 @@
       },
       // 上传
       uploadRequest(option) {
+        this.importLoading = true
         let _this = this
         let url = process.env.VUE_APP_UPLOAD_WEED
         axios
@@ -372,8 +380,12 @@
                   excelUrl: fileUrl,
                 }
                 const [err, res] = await to(targetApi.importSaleTarget(params))
-                if (err) return
+                if (err) {
+                  this.importLoading = false
+                  return
+                }
                 if (res.code == 200) {
+                  this.importLoading = false
                   _this.$message({
                     type: 'success',
                     message: '操作成功',
@@ -382,6 +394,7 @@
                 }
               })
             } else {
+              this.importLoading = false
               _this.$message({
                 type: 'warning',
                 message: '未上传成功!请刷新界面重新上传!',
@@ -389,6 +402,7 @@
             }
           })
           .catch(function () {
+            this.importLoading = false
             _this.$message({
               type: 'warning',
               message: '未上传成功!请重新上传!',