فهرست منبع

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

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