codeMan 2 anos atrás
pai
commit
73ff74fe6a

+ 43 - 8
src/HManagement/clueManage/clue_rule/modules/select_agent.vue

@@ -1,11 +1,25 @@
 <template>
   <div>
     <el-drawer title="添加经销商" append-to-body :visible.sync="dialogTableVisible" size="70%">
-      <el-form size="small" inline label-position="right" label-width="50px" :model="search">
-        <el-form-item label="搜索">
-          <el-input v-model="params.content.where.condition" prefix-icon="el-icon-search" placeholder="编号,经销商名称" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
-        </el-form-item>
-      </el-form>
+      <div style="margin-bottom:10px;padding-left: 10px;">
+        <el-input 
+          style="width:200px"
+          v-model="params.content.where.condition" 
+          prefix-icon="el-icon-search" 
+          placeholder="编号,业务员名称" 
+          size="small"
+          @clear="listData(params.content.pageNumber = 1)" 
+          @keyup.native.enter="listData(params.content.pageNumber = 1)" 
+          clearable
+        ></el-input>
+        <uploadAllData
+          class="inline-16"
+          :total="total"
+          @handlePullApi="handlePullApi"
+          @handleUploadApi="handleUploadApi"
+          @onSuccess="onSuccess"
+        ></uploadAllData>
+      </div>
       <tablelayout :layout="tablecols" :data="list" :custom="true" :checkbox="true" height="calc(100vh - 452px)" @checkboxCallBack="checkboxCallBack">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'province'">
@@ -36,9 +50,11 @@
 
 <script>
 import tablelayout from '@/components/table/index.vue'
+import uploadAllData from '@/components/uploadAllData/index'
 export default {
   components:{
-    tablelayout
+    tablelayout,
+    uploadAllData
   },
   data () {
     return {
@@ -88,8 +104,7 @@ export default {
     },
     async onSubmit () {
       const res = await this.$api.requested({
-        "classname":"webmanage.saletool.orderclue.ordercluerule",
-        "method": "insertOrderclueruleArea",
+        "id":20230408101002,
         "content": {
           "cluetype":"经销商",
           "sat_orderclue_areas":this.selection
@@ -100,6 +115,26 @@ export default {
         this.$emit('onSuccess')
       })
     },
+    /*拉取数据*/
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
+      pullApi.id = this.params.id
+      /*pullApi.content.sa_projectid = this.$route.query.id*/
+    },
+    /*上传数据*/
+    handleUploadApi (uploadApi,data) {
+      uploadApi.id = 20230408101002
+      uploadApi.content = {
+        "cluetype": '业务员', //订单ID
+        "sat_orderclue_areas": data
+      }
+    },
+    onSuccess () {
+      console.log('成功')
+      this.list = []
+      this.dialogTableVisible = false
+      this.$emit('onSuccess')
+    },
   },
   created () {
     //获取表结构

+ 46 - 9
src/HManagement/clueManage/clue_rule/modules/select_saler.vue

@@ -1,11 +1,26 @@
 <template>
   <div>
     <el-drawer title="添加业务员" append-to-body :visible.sync="dialogTableVisible" size="70%">
-      <el-form size="small" inline label-position="right" label-width="50px" :model="search">
-        <el-form-item label="搜索">
-          <el-input v-model="params.content.where.condition" prefix-icon="el-icon-search" placeholder="编号,业务员名称" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
-        </el-form-item>
-      </el-form>
+      <div style="margin-bottom:10px;padding-left: 10px;display:flex;justify-content:space-between">
+        <el-input 
+          style="width:200px"
+          v-model="params.content.where.condition" 
+          prefix-icon="el-icon-search" 
+          placeholder="编号,业务员名称" 
+          size="small"
+          @clear="listData(params.content.pageNumber = 1)" 
+          @keyup.native.enter="listData(params.content.pageNumber = 1)" 
+          clearable
+        ></el-input>
+        <uploadAllData
+          class="inline-16"
+          :total="total"
+          dataType="业务员"
+          @handlePullApi="handlePullApi"
+          @handleUploadApi="handleUploadApi"
+          @onSuccess="onSuccess"
+        ></uploadAllData>
+      </div>
       <tablelayout :layout="tablecols" :data="list" :custom="true" :checkbox="true" height="calc(100vh - 452px)" @checkboxCallBack="checkboxCallBack">
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname === 'province'">
@@ -36,9 +51,12 @@
 
 <script>
 import tablelayout from '@/components/table/index.vue'
+import uploadAllData from '@/components/uploadAllData/index'
+
 export default {
   components:{
-    tablelayout
+    tablelayout,
+    uploadAllData
   },
   data () {
     return {
@@ -88,8 +106,7 @@ export default {
     },
     async onSubmit () {
       const res = await this.$api.requested({
-        "classname":"webmanage.saletool.orderclue.ordercluerule",
-        "method": "insertOrderclueruleArea",
+        "id":20230408101002,
         "content": {
           "cluetype":"业务员",
           "sat_orderclue_areas":this.selection
@@ -100,10 +117,30 @@ export default {
         this.$emit('onSuccess')
       })
     },
+    /*拉取数据*/
+    handlePullApi (pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
+      pullApi.id = this.params.id
+      /*pullApi.content.sa_projectid = this.$route.query.id*/
+    },
+    /*上传数据*/
+    handleUploadApi (uploadApi,data) {
+      uploadApi.id = 20230408101002
+      uploadApi.content = {
+        "cluetype": '业务员', //订单ID
+        "sat_orderclue_areas": data
+      }
+    },
+    onSuccess () {
+      console.log('成功')
+      this.list = []
+      this.dialogTableVisible = false
+      this.$emit('onSuccess')
+    },
   },
   created () {
     //获取表结构
-    this.tablecols = this.tool.tabelCol(this.$route.name)['salerTable'].tablecols
+    this.tablecols = this.tool.tabelCol(this.$route.name)['salerTable'].tablecols.splice(0,this.tool.tabelCol(this.$route.name)['salerTable'].tablecols.length - 1)
   }
 }
 

+ 6 - 2
src/components/uploadAllData/index.vue

@@ -41,6 +41,10 @@ export default {
     },
     idName: {
       type: [Number,String]
+    },
+    dataType:{
+      type:[String],
+      default:() => '商品'
     }
   },
   computed:{
@@ -51,7 +55,7 @@ export default {
     /* 一键选择所有商品 */
     allProduct () {
       if (this.total > this.dataSize) {
-        this.$confirm(`总共有${this.total}个商品,是否确定${this.type == 'upload' ? '提交' : '删除'}`,'提示',{
+        this.$confirm(`总共有${this.total}个${this.dataType},是否确定${this.type == 'upload' ? '提交' : '删除'}`,'提示',{
           confirmButtonText:'确定',
           cancelButtonText:'取消',
           type:'warning'
@@ -64,7 +68,7 @@ export default {
           }
         })
       } else {
-        this.$confirm(`总共有${this.total}个商品,是否确定${this.type == 'upload' ? '提交' : '删除'}`,'提示',{
+        this.$confirm(`总共有${this.total}个${this.dataType},是否确定${this.type == 'upload' ? '提交' : '删除'}`,'提示',{
           confirmButtonText:'确定',
           cancelButtonText:'取消',
           type:'warning'