浏览代码

整理接口文件

howie 3 年之前
父节点
当前提交
a495df56f2

+ 274 - 0
src/api/policy_list.js

@@ -0,0 +1,274 @@
+import request from '@/utils/request'
+
+
+// 销售政策
+export function getList(params) {
+  return request({
+    url: '/policy/list',
+    method: 'get',
+    params
+  })
+}
+//新增政策
+export function addPoliy(params) {
+  return request({
+    url: '/policy/add',
+    method: 'post',
+    data: params
+  })
+}
+//新增政策条件
+
+export function addPoliyCondition(params) {
+  return request({
+    url: '/policy/condition/add',
+    method: 'post',
+    data: params
+  })
+}
+//政策条件列表
+export function getConditionList(params) {
+  return request({
+    url: '/policy/condition/list',
+    method: 'get',
+    params
+  })
+}
+
+export function updatePolicy(params) {
+  return request({
+    url: '/policy/update',
+    method: 'post',
+    data: params
+  })
+}
+
+export function deletePolicy(params) {
+  return request({
+    url: '/policy/delete',
+    method: 'post',
+    params
+  })
+}
+
+export function getConditionMaterialDetail(params) {
+  return request({
+    url: '/policy/condition/detail',
+    method: 'get',
+    params
+  })
+}
+//政策条件的机型列表
+export function getConditionMaterialList(params) {
+  return request({
+    url: '/policy/condition/material/list',
+    method: 'get',
+    params
+  })
+}
+//经销商api
+
+export function getCrList(params) {
+  return request({
+    url: '/customer/list',
+    method: 'get',
+    params
+  })
+}
+
+//政策销售商列表
+export function getCustomerList(params) {
+  return request({
+    url: '/policy/customer/list',
+    method: 'get',
+    params
+  })
+}
+//获取销售政策编号
+export function getId(params) {
+  return request({
+    url: '/policy/id',
+    method: 'get',
+    params
+  })
+}
+
+
+
+export function deleteCondition(params) {
+  return request({
+    url: '/policy/condition/delete',
+    method: 'post',
+    params
+  })
+}
+export function toExamine(params) {
+  return request({
+    url: '/policy/examine',
+    method: 'post',
+    params
+  })
+}
+//导入政策货品
+// /policy/material/import
+
+//政策货品列表
+export function getMaterialList(params) {
+  return request({
+    url: '/policy/material/list',
+    method: 'get',
+    params
+  })
+}
+//提审政策
+export function getpolicySubmit(params) {
+  return request({
+    url: '/policy/policy/submit',
+    method: 'post',
+    params
+  })
+}
+
+//删除政策货品
+
+export function deleteMaterialPolicy(params) {
+  return request({
+    url: '/policy/material/delete',
+    method: 'post',
+    params
+  })
+}
+
+//获取经销商详情
+export function getPolicyDetail(params) {
+  return request({
+    url: '/policy/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 对应经销商
+
+export function getCustomerlist(params) {
+  return request({
+    url: '/policy/customer_count/list',
+    method: 'get',
+    params
+  })
+}
+
+export function eidtBatch(params) {
+  return request({
+    url: '/policy/customer_count/batch',
+    method: 'post',
+    params
+  })
+}
+
+
+
+//销售类型
+
+export function getTypeList(params) {
+  return request({
+    url: '/sale/type/list',
+    method: 'get',
+    params
+  })
+}
+
+export function DeleteData(params) {
+  return request({
+    url: '/policy/material/delete',
+    method: 'psot',
+    params
+  })
+}
+
+export function addData(params) {
+  return request({
+    url: '/sale/type/add',
+    method: 'post',
+    data: params
+  })
+}
+
+export function delTypeData(params) {
+  return request({
+    url: '/sale/type/delete',
+    method: 'post',
+    params
+  })
+}
+
+export function getDetail(params) {
+  return request({
+    url: '/sale/type/detail',
+    method: 'post',
+    data: params
+  })
+}
+
+export function updateType(params) {
+  return request({
+    url: '/sale/type/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 返利钱包列表
+
+export function getWalletList(params) {
+  return request({
+    url: '/wallet/rebate/list',
+    method: 'get',
+    params
+  })
+}
+
+
+export function addWallet(params) {
+  return request({
+    url: '/wallet/add',
+    method: 'post',
+    data: params
+  })
+}
+
+
+export function getWalletDetail(params) {
+  return request({
+    url: '/wallet/rebate/detail',
+    method: 'get',
+    params
+  })
+}
+
+export function updateWallet(params) {
+  return request({
+    url: '/wallet/update',
+    method: 'post',
+    data: params
+  })
+}
+
+
+// 销售品类
+export function getDictList(params) {
+  return request({
+    url: '/common/dict/list',
+    method: 'get',
+    params
+  })
+}
+
+// 产品品类
+export function getProductList(params) {
+  return request({
+    url: '/product-category/list',
+    method: 'get',
+    params
+  })
+}

+ 0 - 254
src/api/supply/sales.js

@@ -9,257 +9,3 @@ export function getList(params) {
     params
   })
 }
-//新增政策
-export function addPoliy(params) {
-  return request({
-    url: '/policy/add',
-    method: 'post',
-    data: params
-  })
-}
-//新增政策条件
-
-export function addPoliyCondition(params) {
-  return request({
-    url: '/policy/condition/add',
-    method: 'post',
-    data: params
-  })
-}
-//政策条件列表
-export function getConditionList(params) {
-  return request({
-    url: '/policy/condition/list',
-    method: 'get',
-    params
-  })
-}
-
-export function updatePolicy(params) {
-  return request({
-    url: '/policy/update',
-    method: 'post',
-    data: params
-  })
-}
-
-export function deletePolicy(params) {
-  return request({
-    url: '/policy/delete',
-    method: 'post',
-    params
-  })
-}
-
-export function getConditionMaterialDetail(params) {
-  return request({
-    url: '/policy/condition/detail',
-    method: 'get',
-    params
-  })
-}
-//政策条件的机型列表
-export function getConditionMaterialList(params) {
-  return request({
-    url: '/policy/condition/material/list',
-    method: 'get',
-    params
-  })
-}
-//经销商api
-
-export function getCrList(params) {
-  return request({
-    url: '/customer/list',
-    method: 'get',
-    params
-  })
-}
-
-//政策销售商列表
-export function getCustomerList(params) {
-  return request({
-    url: '/policy/customer/list',
-    method: 'get',
-    params
-  })
-}
-//获取销售政策编号
-export function getId(params) {
-  return request({
-    url: '/policy/id',
-    method: 'get',
-    params
-  })
-}
-
-
-
-export function deleteCondition(params) {
-  return request({
-    url: '/policy/condition/delete',
-    method: 'post',
-    params
-  })
-}
-export function toExamine(params) {
-  return request({
-    url: '/policy/examine',
-    method: 'post',
-    params
-  })
-}
-//导入政策货品
-// /policy/material/import
-
-//政策货品列表
-export function getMaterialList(params) {
-  return request({
-    url: '/policy/material/list',
-    method: 'get',
-    params
-  })
-}
-//提审政策
-export function getpolicySubmit(params) {
-  return request({
-    url: '/policy/policy/submit',
-    method: 'post',
-    params
-  })
-}
-
-//删除政策货品
-
-export function deleteMaterialPolicy(params) {
-  return request({
-    url: '/policy/material/delete',
-    method: 'post',
-    params
-  })
-}
-
-//获取经销商详情
-export function getPolicyDetail(params) {
-  return request({
-    url: '/policy/detail',
-    method: 'get',
-    params
-  })
-}
-
-// 对应经销商
-
-export function getCustomerlist(params) {
-  return request({
-    url: '/policy/customer_count/list',
-    method: 'get',
-    params
-  })
-}
-
-export function eidtBatch(params) {
-  return request({
-    url: '/policy/customer_count/batch',
-    method: 'post',
-    params
-  })
-}
-
-
-
-//销售类型
-
-export function getTypeList(params) {
-  return request({
-    url: '/sale/type/list',
-    method: 'get',
-    params
-  })
-}
-
-export function DeleteData(params) {
-  return request({
-    url: '/policy/material/delete',
-    method: 'psot',
-    params
-  })
-}
-
-export function addData(params) {
-  return request({
-    url: '/sale/type/add',
-    method: 'post',
-    data: params
-  })
-}
-
-export function delTypeData(params) {
-  return request({
-    url: '/sale/type/delete',
-    method: 'post',
-    params
-  })
-}
-
-export function getDetail(params) {
-  return request({
-    url: '/sale/type/detail',
-    method: 'post',
-    data: params
-  })
-}
-
-export function updateType(params) {
-  return request({
-    url: '/sale/type/update',
-    method: 'post',
-    data: params
-  })
-}
-
-// 返利钱包列表
-
-export function getWalletList(params) {
-  return request({
-    url: '/wallet/rebate/list',
-    method: 'get',
-    params
-  })
-}
-
-
-export function addWallet(params) {
-  return request({
-    url: '/wallet/add',
-    method: 'post',
-    data: params
-  })
-}
-
-
-export function getWalletDetail(params) {
-  return request({
-    url: '/wallet/rebate/detail',
-    method: 'get',
-    params
-  })
-}
-
-export function updateWallet(params) {
-  return request({
-    url: '/wallet/update',
-    method: 'post',
-    data: params
-  })
-}
-
-
-// 销售品类
-export function getDictList(params) {
-  return request({
-    url: '/common/dict/list',
-    method: 'get',
-    params
-  })
-}

+ 4 - 4
src/views/basic_data/material/relation_list.vue

@@ -13,10 +13,11 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="产品名称" prop="materialName">
               <el-select placeholder="请选择产品品类" v-model="screenForm.name">
+              <el-option label="默认" value=""></el-option>
                 <el-option
                   v-for="item in materialLis"
                   :label="item.name"
-                  :value="item.id"
+                  :value="item.name"
                   :key="item.id"
                 ></el-option>
               </el-select>
@@ -290,7 +291,6 @@
         </el-pagination>
       </div>
     </div>
-
     <!-- 弹窗 -->
     <el-dialog
       title="产品信息"
@@ -389,10 +389,10 @@
     </el-dialog>
   </div>
 </template>
-<!-- /product-compose/export -->
+
 <script>
 import Mixin from "@/mixin/index";
-import { downloadFiles, handleImport } from "@/utils/util";
+import { downloadFiles } from "@/utils/util";
 import {
   getProductList,
   getProductEdit,

+ 1 - 1
src/views/sales_policy/codealer_list.vue

@@ -114,7 +114,7 @@
 </template>
 
 <script>
-import { getCustomerlist } from "@/api/supply/sales";
+import { getCustomerlist } from "@/api/policy_list";
 import Minxin from "@/mixin";
 import Distributor from "./components/Distributor";
 export default {

+ 28 - 23
src/views/sales_policy/components/AddCondition.vue

@@ -114,7 +114,7 @@
                     align="center"
                     prop="materialName"
                   >
-                    <template slot-scope="scope">{{ scope.row.date }}</template>
+                    <template slot-scope="scope">{{ scope.row.materialName }}</template>
                   </el-table-column>
                   <el-table-column
                     prop="specification"
@@ -145,6 +145,7 @@
               v-for="(len, index) in conditionBoxs.length - 1"
             >
               <el-form-item :label="'配提' + (index + 1) + '比例'">
+              {{index}}
                 <el-input
                   size="small"
                   v-model="popArr['line_' + index]"
@@ -367,7 +368,7 @@ import {
   getConditionMaterialList,
   getMaterialList,
   getConditionMaterialDetail,
-} from "@/api/supply/sales";
+} from "@/api/policy_list";
 import TabelTransfer from "./TabelTransfer.vue";
 
 import { mapState } from "vuex";
@@ -381,6 +382,10 @@ export default {
       type: String,
       default: "",
     },
+    policyId:{
+      type:String,
+      default:""
+    }
   },
   data() {
     return {
@@ -442,34 +447,34 @@ export default {
     },
     getCommonApi() {
       if (this.id) {
-        var i = 1;
-        getConditionMaterialDetail({ id: this.id }).then((res) => {
-          console.log(res.data,'id');
-          this.pop = res.data ? res.data.pop:''
-          if (res.data && res.data.pop) {
+
+        getConditionMaterialDetail({ id: this.policyId }).then((res) => {
+          this.pop = res.data.pop
+
             let pop = res.data.pop.split(":");
             for (let i = 0; i < pop.length; i++) {
-              if (i == 0) {
-                this.limit = pop[i];
-                return;
-              }
-              this.popArr["line_" + i] = pop[i];
+                 if (i == 0) {
+                   this.limit = pop[i];
+                   continue
+               }
+
+              this.$set(this.popArr,"line_" + i-1,pop[i])
             }
-            while (i <= 2) {
-              getConditionMaterialList({
+
+              for (let k = 0; k <pop.length ; k++) {
+               getConditionMaterialList({
                 pageNum: 1,
                 pageSize: -1,
-                policyConditionId: this.id,
-                popType: i,
-              }).then((res) => {
+                policyConditionId:res.data.id,
+                popType: k+1,
+                  }).then((res) => {
+
                 this.conditionBoxs.push(res.data.records);
-                i++;
-              });
+                  });
+              }
+                  console.log(this.conditionBoxs);
 
-              i++;
-            }
-          }
-        });
+        })
       }
     },
     toggleSelection(rows) {

+ 1 - 1
src/views/sales_policy/components/AddPolicy.vue

@@ -284,7 +284,7 @@ import {
   deleteCondition,
   getConditionList,
   deleteMaterialPolicy,
-} from "@/api/supply/sales";
+} from "@/api/policy_list";
 import { downloadFiles, handleImport } from "@/utils/util";
 import Transfer from "./Transfer";
 import AddCondition from "./AddCondition";

+ 1 - 1
src/views/sales_policy/components/Distributor.vue

@@ -205,7 +205,7 @@ import {
   getPolicyDetail,
   getCustomerList,
   eidtBatch,
-} from "@/api/supply/sales";
+} from "@/api/policy_list";
 import Minxin from "@/mixin";
 
 export default {

+ 9 - 5
src/views/sales_policy/components/Examine.vue

@@ -64,9 +64,9 @@
               <!-- <el-button size="small">查看</el-button> -->
             </el-col>
             <el-col :span="12" class="tr">
-              <el-button size="small" @click="$parent.isShow = 10"
+              <!-- <el-button size="small" @click="$parent.isShow = 10"
                 >查看条件</el-button
-              >
+              > -->
             </el-col>
           </el-row>
           <el-divider></el-divider>
@@ -161,7 +161,11 @@
               限定条件{{scope.$index+1}}
             </template>
           </el-table-column>
-
+         <el-table-column  label="操作" align="center"   width="80">
+            <template slot-scope="scope">
+               <el-button type="text" size="small" @click="$parent.isShow = 10,$parent.policyId=scope.row.id " >查看条件</el-button>
+            </template>
+          </el-table-column>
         </el-table>
         <el-row>
           <el-divider></el-divider>
@@ -244,7 +248,7 @@
           </el-row>
           <el-row>
             <el-button type="primary" size="small" @click="handleSubmit"
-              >审核</el-button
+              >审核通过</el-button
             >
           </el-row>
         </div>
@@ -260,7 +264,7 @@ import {
   getCustomerList,
   getConditionList,
   toExamine,
-} from "@/api/supply/sales";
+} from "@/api/policy_list";
 import Minxin from "@/mixin";
 import { ok } from "assert";
 

+ 1 - 1
src/views/sales_policy/components/TabelTransfer.vue

@@ -4,7 +4,7 @@
 
 <script>
 import Minxin from "@/mixin";
-import { getId, getMaterialList } from "@/api/supply/sales";
+import { getId, getMaterialList } from "@/api/policy_list";
 import Pagination from "./Pagination";
 export default {
   mixins: [Minxin],

+ 2 - 3
src/views/sales_policy/components/Transfer.vue

@@ -121,7 +121,7 @@
 
 <script>
 import Minxin from "@/mixin";
-import { getCrList } from "@/api/supply/sales";
+import { getCrList } from "@/api/policy_list";
 export default {
   mixins: [Minxin],
   data() {
@@ -151,7 +151,7 @@ export default {
       const customerParams = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        keyword: this.region == 1 || this.region =='' ? '' : this.keyword,
+        keyword: this.region == 1 || this.region == "" ? "" : this.keyword,
         region: this.region == 1 ? this.keyword : "",
       };
       // 获取经销商列表
@@ -198,7 +198,6 @@ export default {
       }
     },
     handleSubmit() {
-
       this.$emit("handleAddPolicy", this.dataR);
     },
   },

+ 6 - 3
src/views/sales_policy/policy_list.vue

@@ -183,7 +183,7 @@
               type="text"
                  v-if="scope.row.examineStatus=='WAIT'"
               @click="
-                (isShow = 8), (id = scope.row.id), (code = scope.row.code)
+                (isShow = 8), (id = scope.row.id),policyId=scope.row.policyId, (code = scope.row.code)
               "
               size="small"
               >审核</el-button
@@ -302,7 +302,7 @@
     </div>
   </div>
   <AddPolicy v-else-if="isShow == 2" />
-  <AddCondition v-else-if="isShow == 10 " :id="id" />
+  <AddCondition v-else-if="isShow == 10 " :id="id" :policyId="policyId"/>
   <Examine v-else />
 </template>
 
@@ -313,7 +313,7 @@ import {
   deletePolicy,
   getpolicySubmit,
   toExamine,
-} from "@/api/supply/sales";
+} from "@/api/policy_list";
 import Minxin from "@/mixin";
 import { downloadFiles, handleImport } from "@/utils/util";
 import AddPolicy from "./components/AddPolicy";
@@ -330,6 +330,7 @@ export default {
       id: "",
       code: "",
       codeId: "",
+      policyId:"",
       isShow: 1,
       dataList: [],
       screenForm: {
@@ -407,6 +408,7 @@ export default {
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;
+        this.listTotal = res.data.total
       });
       const paramsType = {
         pageNum: 1,
@@ -462,6 +464,7 @@ export default {
     handlesubmit(e) {
         getpolicySubmit({ policyId: e.id }).then((res) => {
           this.$successMsg("已提交");
+          this.getList()
         });
       // if (e.examineStatus == "SAVE") {
 

+ 51 - 28
src/views/sales_rebate/salestype_list.vue

@@ -4,7 +4,6 @@
       <el-form
         ref="screenForm"
         :model="screenForm"
-
         size="small"
         label-position="left"
       >
@@ -149,12 +148,16 @@
       </div>
     </div>
     <div>
-      <el-dialog :visible.sync="dialogVisible" width="50%"  @close="resetForm"
-          :close-on-click-modal="false">
+      <el-dialog
+        :visible.sync="dialogVisible"
+        width="50%"
+        @close="resetForm"
+        :close-on-click-modal="false"
+      >
         <el-form
           ref="dialogForm"
           :model="dialogForm"
-           :rules="type==1?rules:''"
+          :rules="type == 1 ? rules : ''"
           label-width="120px"
           size="normal"
         >
@@ -162,10 +165,20 @@
             <el-input v-model="dialogForm.saleCode"></el-input>
           </el-form-item>
           <el-form-item label="销售类型名称" prop="saleName">
-            <el-input v-model="dialogForm.saleName" ></el-input>
+            <el-input v-model="dialogForm.saleName"></el-input>
           </el-form-item>
           <el-form-item label="品类" prop="mainName">
-            <el-input v-model="dialogForm.mainName"></el-input>
+            <el-select v-model="dialogForm.mainName">
+              <el-option
+                v-for="(item, index) in productList"
+                :key="index"
+                :label="item.productCategoryName"
+                :value="item.productCategoryName"
+              >
+              </el-option>
+            </el-select>
+
+            <!-- <el-input v-model="dialogForm.mainName"></el-input> -->
           </el-form-item>
           <el-form-item label="状态" prop="status">
             <el-switch
@@ -178,7 +191,9 @@
           </el-form-item>
         </el-form>
         <span slot="footer" class="dialog-footer">
-          <el-button @click="dialogVisible = false,resetForm()">取 消</el-button>
+          <el-button @click="(dialogVisible = false), resetForm()"
+            >取 消</el-button
+          >
           <el-button type="primary" @click="handelInfo">确 定</el-button>
         </span>
       </el-dialog>
@@ -195,6 +210,7 @@ import {
   addData,
   updateType,
   getDetail,
+  getProductList,
 } from "@/api/supply/sales";
 
 export default {
@@ -280,10 +296,17 @@ export default {
         },
       ],
       rules: {
-        saleCode: [{required: true,message: '请输入销售类型编码', trigger: 'blur'}],
-        saleName: [{required: true,message: '请输入销售类型名称', trigger: 'blur'}],
-           mainName: [{required: true,message: '请输入品类名称', trigger: 'blur'}],
+        saleCode: [
+          { required: true, message: "请输入销售类型编码", trigger: "blur" },
+        ],
+        saleName: [
+          { required: true, message: "请输入销售类型名称", trigger: "blur" },
+        ],
+        mainName: [
+          { required: true, message: "请输入品类名称", trigger: "blur" },
+        ],
       },
+      productList: [],
     };
   },
   methods: {
@@ -301,6 +324,12 @@ export default {
         this.listTotal = res.data.total;
         this.listLoading = false;
       });
+      getProductList({
+        productCategoryName: "",
+        productCategoryNumber: "",
+      }).then((res) => {
+        this.productList = res.data;
+      });
     },
     hanleDatele(id) {
       this.hanleDeleteAllPromise(id).then((ids) => {
@@ -331,25 +360,22 @@ export default {
       this.type = 3;
     },
     handelInfo() {
-
       if (this.type == 1) {
-            this.$refs.dialogForm.validate((valid) => {
+        this.$refs.dialogForm.validate((valid) => {
           if (valid) {
-          const params = {
-          ...this.dialogForm,
-        };
-        addData(params).then((res) => {
-          console.log(res);
-          this.$successMsg("添加成功");
-          this.hanleReset();
-
-        });
+            const params = {
+              ...this.dialogForm,
+            };
+            addData(params).then((res) => {
+              console.log(res);
+              this.$successMsg("添加成功");
+              this.hanleReset();
+            });
           } else {
-            console.log('error submit!!');
+            console.log("error submit!!");
             return false;
           }
         });
-
       } else if (this.type == 0) {
         const upParams = {
           ...this.dialogForm,
@@ -358,18 +384,15 @@ export default {
           this.$successMsg("修改成功");
 
           this.hanleReset();
-
         });
       } else {
         this.dialogVisible = false;
       }
     },
-     resetForm(formName) {
-        this.$refs.dialogForm.resetFields();
-
+    resetForm(formName) {
+      this.$refs.dialogForm.resetFields();
     },
     hanleReset() {
-
       this.dialogForm = {
         id: "",
         saleCode: "",