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

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 3 лет назад
Родитель
Сommit
1fcf0ad8a9
55 измененных файлов с 3761 добавлено и 1384 удалено
  1. 78 71
      src/api/basic_data/dealer.js
  2. 21 13
      src/api/finance/standbook_list.js
  3. 33 25
      src/api/finance/wallet.js
  4. 4 4
      src/api/policy_list.js
  5. 18 0
      src/api/supply/reserve.js
  6. 66 0
      src/components/Common/edit-date-dialog.vue
  7. 77 0
      src/components/Common/edit-date-time-dialog.vue
  8. 5 1
      src/views/basic_data/dealer/components/dealer_list-detail.vue
  9. 79 53
      src/views/basic_data/dealer/dealer_stock.vue
  10. 2 2
      src/views/basic_data/material/components/material_list-detail.vue
  11. 34 17
      src/views/basic_data/material/components/modify_list-apply.vue
  12. 1 1
      src/views/basic_data/wallet/wallet_list.vue
  13. 7 7
      src/views/dashboard/index.vue
  14. 124 5
      src/views/engin_deposit/components/refund_list-detail.vue
  15. 38 31
      src/views/engin_deposit/deposit_list.vue
  16. 93 20
      src/views/engin_deposit/refund_list.vue
  17. 26 24
      src/views/finance/change_apply.vue
  18. 13 1
      src/views/finance/change_list.vue
  19. 19 7
      src/views/finance/components/receivable_list-add.vue
  20. 24 23
      src/views/finance/rebate_form.vue
  21. 53 3
      src/views/finance/rebate_list.vue
  22. 14 0
      src/views/finance/receipt_list.vue
  23. 77 25
      src/views/finance/standbook_list.vue
  24. 38 73
      src/views/finance/tax_rate.vue
  25. 108 19
      src/views/finance/wallet.vue
  26. 126 113
      src/views/login/index.vue
  27. 72 57
      src/views/sales_policy/components/AddCondition.vue
  28. 20 32
      src/views/sales_policy/components/AddPolicy.vue
  29. 775 0
      src/views/sales_policy/components/EditCondition.vue
  30. 785 261
      src/views/sales_policy/components/Examine.vue
  31. 10 11
      src/views/sales_policy/policy_list.vue
  32. 15 19
      src/views/sales_rebate/rebate_list.vue
  33. 5 11
      src/views/sales_rebate/salestype_list.vue
  34. 3 3
      src/views/setting/role.vue
  35. 1 16
      src/views/supply/apply/components/apply_detail.vue
  36. 2 64
      src/views/supply/apply/components/apply_examine.vue
  37. 2 59
      src/views/supply/apply/components/engin_examine.vue
  38. 1 18
      src/views/supply/deliver/components/commerce_detail.vue
  39. 0 5
      src/views/supply/deliver/components/deliver_detail.vue
  40. 1 18
      src/views/supply/deliver/components/home_detail.vue
  41. 39 4
      src/views/supply/engin/commerce_list.vue
  42. 4 3
      src/views/supply/engin/components/commerce_form.vue
  43. 5 4
      src/views/supply/engin/components/engin_form.vue
  44. 4 3
      src/views/supply/engin/components/home_form.vue
  45. 39 3
      src/views/supply/engin/engin_list.vue
  46. 39 4
      src/views/supply/engin/home_list.vue
  47. 1 1
      src/views/supply/implement/implement_list.vue
  48. 3 1
      src/views/supply/policy/components/retail_examine.vue
  49. 200 114
      src/views/supply/policy/components/retail_form2.vue
  50. 34 6
      src/views/supply/policy/policy_list.vue
  51. 127 23
      src/views/supply/reserve/components/reserve_form.vue
  52. 2 2
      src/views/supply/reserve/reserve_list.vue
  53. 1 1
      src/views/supply/retail/components/retail_detail.vue
  54. 10 9
      src/views/supply/retail/components/retail_form.vue
  55. 383 94
      src/views/supply/retail/retail_list.vue

+ 78 - 71
src/api/basic_data/dealer.js

@@ -1,141 +1,148 @@
-import request from '@/utils/request'
-
+import request from "@/utils/request";
 
 //获取经销商列表
 export function getDealerList(params) {
   return request({
-    url: '/customer/list',
-    method: 'get',
-    params
-  })
+    url: "/customer/list",
+    method: "get",
+    params,
+  });
 }
 //经销商详情
 export function getDealerInfo(params) {
   return request({
-    url: '/customer/detail',
-    method: 'get',
-    params
-  })
+    url: "/customer/detail",
+    method: "get",
+    params,
+  });
 }
 
 //经销商客户存货分类列表
 export function getDealerStockList(params) {
   return request({
-    url: '/customer/pt/list',
-    method: 'get',
-    params
-  })
+    url: "/customer/pt/list",
+    method: "get",
+    params,
+  });
 }
 //新增经销商客户存货分类
 export function getDealerStockAdd(data) {
   return request({
-    url: '/customer/pt/add',
-    method: 'post',
-    data
-  })
+    url: "/customer/pt/add",
+    method: "post",
+    data,
+  });
 }
 //删除经销商客户存货分类
 export function deleDealerStockList(params) {
   return request({
-    url: '/customer/pt/delete',
-    method: 'post',
-    params
-  })
+    url: "/customer/pt/delete",
+    method: "post",
+    params,
+  });
 }
 //经销商工程机配置列表
 export function getDealerDepositList(params) {
   return request({
-    url: '/customer/deposit/list',
-    method: 'get',
-    params
-  })
+    url: "/customer/deposit/list",
+    method: "get",
+    params,
+  });
 }
 //新增经销商工程机配置
 export function getDealerDepositAdd(data) {
   return request({
-    url: '/customer/deposit/add',
-    method: 'post',
-    data
-  })
+    url: "/customer/deposit/add",
+    method: "post",
+    data,
+  });
 }
 //删除经销商工程机配置
 export function deleDealerDeposit(params) {
   return request({
-    url: '/customer/deposit/delete',
-    method: 'post',
-    params
-  })
+    url: "/customer/deposit/delete",
+    method: "post",
+    params,
+  });
 }
 //修改经销商工程机配置
 export function editDealerDeposit(data) {
   return request({
-    url: '/customer/deposit/update',
-    method: 'post',
-    data
-  })
+    url: "/customer/deposit/update",
+    method: "post",
+    data,
+  });
 }
 //经销商工程机配置详情
 export function infoDealerDeposit(params) {
   return request({
-    url: '/customer/deposit/detail',
-    method: 'get',
-    params
-  })
+    url: "/customer/deposit/detail",
+    method: "get",
+    params,
+  });
 }
 //经销商申请列表
 export function getDealerApplyList(params) {
   return request({
-    url: '/customer/apply/list',
-    method: 'get',
-    params
-  })
+    url: "/customer/apply/list",
+    method: "get",
+    params,
+  });
 }
 
 //字典
 export function getDictionaries(params) {
   return request({
-    url: '/common/dict/list',
-    method: 'get',
-    params
-  })
+    url: "/common/dict/list",
+    method: "get",
+    params,
+  });
 }
 //产品品类列表
 export function getProductCategoryList(params) {
   return request({
-    url: '/product-category/list',
-    method: 'get',
-    params
-  })
+    url: "/product-category/list",
+    method: "get",
+    params,
+  });
 }
 //根据父级查询部门
 export function getAdminWebsitByparent(params) {
   return request({
-    url: '/admin/websit/byparent',
-    method: 'get',
-    params
-  })
+    url: "/admin/websit/byparent",
+    method: "get",
+    params,
+  });
 }
 //帐号列表
 export function getAdminUserList(params) {
   return request({
-    url: '/admin/user/list',
-    method: 'get',
-    params
-  })
+    url: "/admin/user/list",
+    method: "get",
+    params,
+  });
 }
 //经销商客户存货分类-详情
 export function getCustomerPtDetail(params) {
   return request({
-    url: '/customer/pt/detail',
-    method: 'get',
-    params
-  })
+    url: "/customer/pt/detail",
+    method: "get",
+    params,
+  });
 }
 //修改经销商客户存货分类
 export function getCustomerPtUpdate(data) {
   return request({
-    url: '/customer/pt/update',
-    method: 'post',
-    data
-  })
-}
+    url: "/customer/pt/update",
+    method: "post",
+    data,
+  });
+}
+//经销商钱包列表
+export function getWalletCustomerList(params) {
+  return request({
+    url: "/wallet/customer/list",
+    method: "get",
+    params,
+  });
+}

+ 21 - 13
src/api/finance/standbook_list.js

@@ -1,18 +1,26 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 
 // 台账列表
 export function getStandbookList(params) {
-    return request({
-      url: '/finance/standing/book/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/finance/standing/book/list",
+    method: "get",
+    params,
+  });
+}
 // 字典
 export function getDictList(params) {
-    return request({
-      url: '/common/dict/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/common/dict/list",
+    method: "get",
+    params,
+  });
+}
+// 经销商列表
+export function getCustomerList(params) {
+  return request({
+    url: "/customer/list",
+    method: "get",
+    params,
+  });
+}

+ 33 - 25
src/api/finance/wallet.js

@@ -1,34 +1,42 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 
 // 返利钱包列表
 export function getRebateList(params) {
-    return request({
-      url: '/wallet/rebate/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/wallet/rebate/list",
+    method: "get",
+    params,
+  });
+}
 // 钱包列表(非返利钱包)
 export function getWalletList(params) {
-    return request({
-      url: '/wallet/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/wallet/list",
+    method: "get",
+    params,
+  });
+}
 // 经销商一键生成钱包
 export function getfinanceInit(params) {
-    return request({
-      url: '/finance/init',
-      method: 'post',
-      params
-    })
-  }
+  return request({
+    url: "/finance/init",
+    method: "post",
+    params,
+  });
+}
 // 设置特定的经销商返利钱包的返利额度
 export function getWalletRebateRateUpdate(params) {
-    return request({
-      url: '/wallet/rebate_rate/update',
-      method: 'post',
-      params
-    })
-  }
+  return request({
+    url: "/wallet/rebate_rate/update",
+    method: "post",
+    params,
+  });
+}
+// 经销商列表
+export function getCustomerList(params) {
+  return request({
+    url: "/customer/list",
+    method: "get",
+    params,
+  });
+}

+ 4 - 4
src/api/policy_list.js

@@ -286,7 +286,7 @@ export function getProductList(params) {
 //获取轮播图列表
 export function getImgCarouseList(params) {
   return request({
-    url:'/record/list',
+    url: '/record/list',
     method: 'get',
     params
   })
@@ -295,7 +295,7 @@ export function getImgCarouseList(params) {
 //轮播图显示与隐藏
 export function handleImgIsShow(params) {
   return request({
-    url:'/record/updateImgStatus',
+    url: '/record/updateImgStatus',
     method: 'post',
     params
   })
@@ -304,7 +304,7 @@ export function handleImgIsShow(params) {
 //增加轮播图
 export function addImgCarousel(params) {
   return request({
-    url:'/record/carousel/add',
+    url: '/record/carousel/add',
     method: 'post',
     data: params
   })
@@ -313,7 +313,7 @@ export function addImgCarousel(params) {
 //修改轮播图
 export function editImgCarousel(params) {
   return request({
-    url:'/record/update',
+    url: '/record/update',
     method: 'post',
     data: params
   })

+ 18 - 0
src/api/supply/reserve.js

@@ -52,4 +52,22 @@ export function editData(params) {
     method: 'post',
     data: params
   })
+}
+
+// 查询经销商列表
+export function checkDealerList(params) {
+  return request({
+    url: '/reserve/detailCustomer',
+    method: 'get',
+    params
+  })
+}
+
+// 查询物料列表
+export function checkMaterialList(params) {
+  return request({
+    url: '/reserve/detailMaterialNumber',
+    method: 'get',
+    params
+  })
 }

+ 66 - 0
src/components/Common/edit-date-dialog.vue

@@ -0,0 +1,66 @@
+<template>
+  <div>
+    <el-dialog title="修改订单日期" :visible.sync="isShow" :show-close="false" width="400px" :close-on-click-modal="false">
+      <el-form ref="dateForm" :model="dateForm" :rules="dateFormRules" label-position="left" label-width="80px">
+        <el-form-item label="选择日期" prop="date">
+          <el-date-picker
+            v-model="dateForm.date"
+            type="date"
+            value-format="yyyy-MM-dd"
+            style="width: 100%;"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelDateForm">取 消</el-button>
+        <el-button type="primary" @click="submitDateForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'EditDateDialog',
+  props: {
+    isShow: {
+      type: Boolean,
+      default: false
+    },
+    dateForm: {
+      type: Object,
+      default: {
+        date: '',
+      }
+    }
+  },
+  data() {
+    return {
+      dateFormRules: {
+        date: [
+          { required: true, message: '请选择订单日期', trigger: 'change' }
+        ],
+      },
+    }
+  },
+  methods: {
+    cancelDateForm() {
+      this.$emit('update:isShow', false);
+    },
+
+    submitDateForm() {
+      this.$refs.dateForm.validate((valid) => {
+        if (valid) {
+          this.$parent.submitDateForm();
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>

+ 77 - 0
src/components/Common/edit-date-time-dialog.vue

@@ -0,0 +1,77 @@
+<template>
+  <div>
+    <el-dialog
+      title="修改订单日期"
+      :visible.sync="isShow"
+      :show-close="false"
+      width="400px"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        ref="dateForm"
+        :model="dateForm"
+        :rules="dateFormRules"
+        label-position="left"
+        label-width="80px"
+      >
+        <el-form-item label="选择日期" prop="date">
+          <el-date-picker
+            v-model="dateForm.date"
+            type="datetime"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            default-time="00:00:00"
+            style="width: 100%"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelDateForm">取 消</el-button>
+        <el-button type="primary" @click="submitDateForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "EditDateTimeDialog",
+  props: {
+    isShow: {
+      type: Boolean,
+      default: false,
+    },
+    dateForm: {
+      type: Object,
+      default: {
+        date: "",
+      },
+    },
+  },
+  data() {
+    return {
+      dateFormRules: {
+        date: [
+          { required: true, message: "请选择订单日期", trigger: "change" },
+        ],
+      },
+    };
+  },
+  methods: {
+    cancelDateForm() {
+      this.$emit("update:isShow", false);
+    },
+
+    submitDateForm() {
+      this.$refs.dateForm.validate((valid) => {
+        if (valid) {
+          this.$parent.submitDateForm();
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style></style>

+ 5 - 1
src/views/basic_data/dealer/components/dealer_list-detail.vue

@@ -244,7 +244,11 @@
       </div>
       <div class="diy-table-1">
         <el-row :gutter="0" class="xyed">
-          <div v-for="(v, i) in infoList.customerWallets" :key="i">
+          <div
+            v-for="(v, i) in infoList.customerWallets"
+            :key="i"
+            v-show="v.type == 'COMMONLY'"
+          >
             <el-col :span="12" class="item">
               <div class="label">信用额度</div>
               <div class="value">{{ v.freeCreditAmount }}</div>

+ 79 - 53
src/views/basic_data/dealer/dealer_stock.vue

@@ -92,8 +92,8 @@
           ></el-table-column>
           <el-table-column
             align="center"
-            label="产品大类(钱包)"
-            prop="mainName"
+            label="钱包名称"
+            prop="customerWalletName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -190,41 +190,41 @@
         label-width="100px"
         label-position="right"
       >
-        <el-form-item label="经销商编码" prop="">
+        <el-form-item label="经销商编码" prop="customerId">
           <el-select
             filterable
             class="selectStyle"
             v-model="addForm.customerId"
             placeholder="请选择"
+            @change="changeFn"
           >
             <el-option
               v-for="item in dealerList"
               :key="item.id"
-              :label="item.number"
+              :label="item.name"
               :value="item.id"
             >
             </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="经销商名称" prop="">
-          <el-input disabled v-model="addForm.customerName"></el-input>
+          <el-input disabled v-model="addForm.customerNumber"></el-input>
           <!-- <template slot-scope="scope">
             {{ scope.row }}
           </template> -->
         </el-form-item>
-        <el-form-item label="产品大类" prop="mainId">
+        <el-form-item label="钱包" prop="customerWalletId">
           <el-select
             class="selectStyle"
-            v-model="addForm.mainId"
+            v-model="addForm.customerWalletId"
             placeholder="请选择"
             filterable
-            @change="changeSelectFn"
           >
             <el-option
-              v-for="item in categoryList"
-              :key="item.productCategoryId"
-              :label="item.productCategoryName"
-              :value="item.productCategoryId"
+              v-for="item in walletList"
+              :key="item.customerWalletId"
+              :label="item.customerWalletName"
+              :value="item.customerWalletId"
             >
             </el-option>
           </el-select>
@@ -235,6 +235,7 @@
             v-model="addForm.oneParentId"
             placeholder="请选择"
             filterable
+            @change="changeOneFn"
           >
             <el-option
               v-for="item in oneList"
@@ -251,6 +252,7 @@
             class="selectStyle"
             v-model="addForm.twoParentId"
             placeholder="请选择"
+            @change="changeTwoFn"
           >
             <el-option
               v-for="item in twoList"
@@ -267,6 +269,7 @@
             v-model="addForm.threeParentId"
             placeholder="请选择"
             filterable
+            @change="changeThreeFn"
           >
             <el-option
               v-for="item in threeList"
@@ -313,6 +316,7 @@ import {
   getAdminUserList,
   getCustomerPtDetail,
   getCustomerPtUpdate,
+  getWalletCustomerList,
 } from "@/api/basic_data/dealer";
 import { getDealerList } from "@/api/basic_data/dealer";
 
@@ -329,15 +333,15 @@ export default {
         twoParentId: "",
         threeParentId: "",
         serviceId: "",
-        mainId: "",
+        customerWalletId: "",
       },
       mainId: null,
       rules: {
-        mainId: [
-          { required: true, message: "请选择存货分类", trigger: "blur" },
-        ],
         customerId: [
-          { required: true, message: "请选择经销商", trigger: "blur" },
+          { required: true, message: "请选择经销商名称", trigger: "blur" },
+        ],
+        customerWalletId: [
+          { required: true, message: "请选择经销商钱包", trigger: "blur" },
         ],
         oneParentId: [
           { required: true, message: "请选择一级区域", trigger: "blur" },
@@ -363,8 +367,8 @@ export default {
       dataList: [], // 列表数据
       listLoading: false, // 列表加载loading
       dealerList: [],
-      selectList: [],
-      categoryList: [], //产品大类列表
+      // selectList: [],
+      walletList: [], //产品大类列表
       oneList: [], //一级区域数据
       twoList: [], //二级区域数据
       threeList: [], //三级区域数据
@@ -374,27 +378,32 @@ export default {
     };
   },
   async created() {
+    this.getAdminWebsit(1);
     this.getList({ pageNum: 1, pageSize: 10 });
     this.getDealerDataList({ pageNum: -1, pageSize: 10 });
-    this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
-    this.getCategoryList();
-    this.getAdminWebsit(0);
+    // this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
   },
   computed: {},
   watch: {
     "addForm.customerId": async function (newValue) {
       if (newValue) {
+        // this.addForm.customerWalletId = "";
         const res = this.dealerList.filter((i) => i.id == newValue);
 
         this.addForm.customerName = res[0].name;
         this.addForm.customerNumber = res[0].number;
+        let res2 = await getWalletCustomerList({
+          customerId: newValue,
+          type: "COMMONLY",
+        });
+        this.walletList = res2.data;
       }
     },
     "addForm.oneParentId": async function (newValue) {
       if (newValue) {
         let res = await getAdminWebsitByparent({
           parentId: newValue,
-          mainId: this.mainId,
+          // mainId: this.mainId,
         });
         this.twoList = res.data;
       }
@@ -403,7 +412,7 @@ export default {
       if (newValue) {
         let res = await getAdminWebsitByparent({
           parentId: newValue,
-          mainId: this.mainId,
+          // mainId: this.mainId,
         });
         this.threeList = res.data;
       }
@@ -421,21 +430,35 @@ export default {
     },
   },
   methods: {
-    //改变产品大类
-    changeSelectFn(value) {
-      const res = this.categoryList.filter((v) => v.productCategoryId == value);
-      console.log(res);
-      this.mainId = res[0].productCategoryNumber;
-    },
+    // //改变产品大类
+    // changeSelectFn(value) {
+    //   // const res = this.categoryList.filter((v) => v.productCategoryId == value);
+    //   // console.log(res);
+    //   // this.mainId = res[0].productCategoryNumber;
+    // },
     //编辑
-
+    async changeFn(v) {
+      this.addForm.customerWalletId = "";
+    },
+    async changeOneFn(v) {
+      this.addForm.twoParentId = "";
+      this.addForm.threeParentId = "";
+      this.addForm.serviceId = "";
+    },
+    async changeTwoFn(v) {
+      this.addForm.threeParentId = "";
+      this.addForm.serviceId = "";
+    },
+    async changeThreeFn(v) {
+      this.addForm.serviceId = "";
+    },
     async editFn(id) {
       this.title = "经销商业务关系管理 ";
       this.rowID = id;
       let res = await getCustomerPtDetail({ id });
       console.log(res);
       this.addForm.customerId = res.data.customerId;
-      this.addForm.mainId = res.data.mainId;
+      this.addForm.customerWalletId = res.data.customerWalletId;
       this.addForm.oneParentId = res.data.adminWebsitId1;
       this.addForm.twoParentId = res.data.adminWebsitId2;
       this.addForm.threeParentId = res.data.adminWebsitId3;
@@ -451,16 +474,16 @@ export default {
     async getAdminWebsit(data) {
       let res = await getAdminWebsitByparent({
         parentId: data,
-        mainId: this.mainId,
+        // mainId: this.mainId,
       });
       this.oneList = res.data;
     },
-    //获取产品品类数据
-    async getCategoryList() {
-      let res = await getProductCategoryList();
-      console.log(res);
-      this.categoryList = res.data;
-    },
+    // //获取产品品类数据
+    // async getCategoryList() {
+    //   let res = await getProductCategoryList();
+    //   console.log(res);
+    //   this.categoryList = res.data;
+    // },
     // 筛选部分数据或者单个
     hanleSelect(selection) {
       // this.ids = selection.map((k) => {
@@ -469,12 +492,12 @@ export default {
       console.log(selection);
       this.ids = selection.map((v) => v.id);
     },
-    //存货分类
-    async getSelectList(data) {
-      const res = await getDictionaries(data);
-      console.log(res);
-      this.selectList = res.data;
-    },
+    // //存货分类
+    // async getSelectList(data) {
+    //   const res = await getDictionaries(data);
+    //   console.log(res);
+    //   this.selectList = res.data;
+    // },
     //删除
     async deleFn(id) {
       this.ids.push(id);
@@ -491,19 +514,22 @@ export default {
     async addDataListFn() {
       await this.$refs.addForm.validate();
 
-      let data2 = this.categoryList.filter((v) => {
-        return v.productCategoryId == this.addForm.mainId;
+      let data2 = this.walletList.filter((v) => {
+        return v.customerWalletId == this.addForm.customerWalletId;
       });
       let data3 = this.userList.filter((v) => {
         return v.adminUserId == this.addForm.serviceId;
       });
+      console.log(data3);
+      console.log(data2, 22222);
 
       let value = {
         customerId: this.addForm.customerId,
-        customerName: this.addForm.cusotmerName,
+        customerName: this.addForm.customerName,
         customerNumber: this.addForm.customerNumber,
-        mainId: this.addForm.mainId,
-        mainName: data2[0].productCategoryName,
+        customerWalletId: this.addForm.customerWalletId,
+        customerWalletName: data2[0].customerWalletName,
+
         serviceId: this.addForm.serviceId,
         serviceName: data3[0].nickName,
       };
@@ -518,7 +544,7 @@ export default {
       }
       this.addForm.customerId = "";
       this.addForm.customerName = "";
-      this.addForm.mainId = "";
+      this.addForm.customerWalletId = "";
       this.addForm.oneParentId = "";
       this.addForm.twoParentId = "";
       this.addForm.threeParentId = "";
@@ -533,8 +559,8 @@ export default {
     async cancelFn() {
       await this.$refs.addForm.clearValidate();
       this.addForm.customerId = "";
-      this.addForm.customerName = "";
-      this.addForm.mainId = "";
+      this.addForm.customerNumber = "";
+      this.addForm.customerWalletId = "";
       this.addForm.oneParentId = "";
       this.addForm.twoParentId = "";
       this.addForm.threeParentId = "";

+ 2 - 2
src/views/basic_data/material/components/material_list-detail.vue

@@ -55,7 +55,7 @@
               </el-col>
 
               <el-col>
-                <el-form-item label="旧物料编码" size="small">
+                <el-form-item label="金蝶编码" size="small">
                   <el-input v-model="detail.number"></el-input>
                 </el-form-item>
               </el-col>
@@ -177,7 +177,7 @@
 
                 <el-col :span="24">
                   <el-form-item label="存货类别" size="small">
-                    <el-input v-model="detail.categoryId"></el-input>
+                    <el-input v-model="detail.categoryName"></el-input>
                   </el-form-item>
                 </el-col>
 

+ 34 - 17
src/views/basic_data/material/components/modify_list-apply.vue

@@ -99,7 +99,7 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  @click="hanleDeleInd(scope.$index)"
+                  @click="hanleDeleInd(scope.$index,scope.row.cid)"
                   >删除</el-button
                 >
               </template>
@@ -121,7 +121,7 @@
                     <el-option
                       v-for="item in scope.row.saleTypes"
                       :label="item.saleName"
-                      :value="item.mainId"
+                      :value="item.id"
                     ></el-option>
                   </el-select>
                   <!-- <el-select
@@ -195,7 +195,7 @@
             >
               <template slot-scope="scope">
                 <el-form-item>
-                  <el-input v-model="scope.row.unit"></el-input>
+                  <el-input disabled  v-model="scope.row.unit"></el-input>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -915,21 +915,23 @@ export default {
   },
   methods: {
     handleSale(e, index,saleTypes) {
+
+      let saleArr = []
       this.rebateList = this.rebateList.filter((k) => {
-        return (
-          this.typeList.filter((i) => {
-               console.log(k,i);
-            return e == i.mainId;
 
-          })[0].id === k.saleTypeId
-        );
+          saleArr = saleTypes.filter((i) => {
+            return e == i.id;
+          })
+          return saleArr[0].id === k.saleTypeId
+
       });
 
-      this.items[index].mainId = saleArr.mainId
-      this.items[index].mainName = saleArr.mainName
-      this.items[index].saleTypeId = saleArr.id
-      this.items[index].saleTypeName = saleName
-      this.$set(this.items[index], "rebateWallets", this.rebateList);
+
+      this.items[index].mainName = saleArr[0].mainName
+      this.items[index].saleTypeId = saleArr[0].id
+      this.items[index].saleTypeName = saleArr[0].saleName
+      this.$set(this.items[index], "rebateList", this.rebateList);
+      console.log(this.rebateList,this.items[index]);
       this.fang = false;
     },
     // xua
@@ -1013,7 +1015,20 @@ export default {
     indexMethod(index) {
       console.log(index);
     },
-    hanleDeleInd(index) {
+    hanleDeleInd(index,id) {
+        if (id) {
+          const dataArr = JSON.parse(JSON.stringify(this.dataList))
+          for (let j = 0; j < dataArr.length; j++) {
+             if (id== dataArr[j].id) {
+
+                  dataArr[j].disabled = false
+                 this.$set(dataArr[j],'disabled',false)
+            }}
+
+            this.dataList = dataArr
+
+        }
+
       this.items.splice(index, 1);
     },
     handleDetermine() {
@@ -1027,7 +1042,7 @@ export default {
           this.items.push({
             baseUnitId: "",
             batchPrice: "",
-            unit: "",
+            unit: this.selectData[i].baseUnitId,
             billId: "",
             endDate: "",
             isPromote: "",
@@ -1130,8 +1145,10 @@ export default {
      */
     selectable: function (row, index) {
       // row.disabled == undefined 才能被选中
-      if (row.disabled == undefined) {
+      if (row.disabled == undefined || row.disabled == false) {
         return true;
+      }else{
+        return false
       }
       // 函数必须有返回值且是布尔值
       // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)

+ 1 - 1
src/views/basic_data/wallet/wallet_list.vue

@@ -104,7 +104,7 @@
                 class="textColor"
                 v-if="$checkBtnRole('edit', $route.meta.roles)"
                 @click="setFn(scope.row)"
-                >设置产品大类</el-button
+                >设置</el-button
               >
             </template>
           </el-table-column>

+ 7 - 7
src/views/dashboard/index.vue

@@ -295,7 +295,7 @@ export default {
     this.getDataList({
       pageSize: this.pageSize,
       pageNum: this.currentPage,
-      readFlag: true,
+      readFlag: false,
     });
   },
   computed: {
@@ -334,7 +334,7 @@ export default {
         this.getDataList({
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          readFlag: true,
+          readFlag: false,
         });
       });
     },
@@ -387,7 +387,7 @@ export default {
         this.getDataList({
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          readFlag: true,
+          readFlag: false,
         });
       }
       if (this.type == 2) {
@@ -401,7 +401,7 @@ export default {
         this.getRebateList({
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          isSecondExamine: true,
+          isSecondExamine: false,
         });
       }
     },
@@ -412,7 +412,7 @@ export default {
         this.getDataList({
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          readFlag: true,
+          readFlag: false,
         });
       }
       if (this.type == 2) {
@@ -426,7 +426,7 @@ export default {
         this.getRebateList({
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          isSecondExamine: true,
+          isSecondExamine: false,
         });
       }
     },
@@ -450,7 +450,7 @@ export default {
         this.getDataList({
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          readFlag: true,
+          readFlag: false,
         });
       }
       if (v == 2) {

+ 124 - 5
src/views/engin_deposit/components/refund_list-detail.vue

@@ -234,7 +234,38 @@
             prop="fileUrl"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-image
+                ref="img"
+                :src="imageURL + item.url"
+                :preview-src-list="previewImages"
+                v-if="checkFileType(scope.row.fileUrl) == 'image'"
+                style="width: 120px; height: 120px"
+                fit="cover"
+              ></el-image>
+              <img
+                class="file"
+                src="@/assets/common/word.png"
+                v-if="checkFileType(scope.row.fileUrl) == 'word'"
+              />
+              <img
+                class="file"
+                src="@/assets/common/excel.png"
+                v-if="checkFileType(scope.row.fileUrl) == 'excel'"
+              />
+              <img
+                class="file"
+                src="@/assets/common/ppt.png"
+                v-if="checkFileType(scope.row.fileUrl) == 'ppt'"
+              />
+              <img
+                class="file"
+                src="@/assets/common/pdf.png"
+                v-if="checkFileType(scope.row.fileUrl) == 'pdf'"
+              />
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="下载文件名称"
@@ -248,8 +279,11 @@
             min-width="160"
             show-overflow-tooltip
           >
-            <template slot-scope="">
-              <el-button type="text" class="textColor" slot="reference"
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                class="textColor"
+                @click="downLoadFn(scope.row.fileUrl)"
                 >下载</el-button
               >
             </template>
@@ -276,7 +310,7 @@
     </div>
     <h3>审批</h3>
     <el-divider></el-divider>
-    <div class="diy-table-1">
+    <div v-if="detailList.examineStatus == 'WAIT'" class="diy-table-1">
       <el-row :gutter="0">
         <el-col :xs="12" :sm="12" :lg="12" class="item">
           <div class="label">验收人</div>
@@ -313,9 +347,61 @@
         </el-col>
       </el-row>
     </div>
+    <div
+      v-if="
+        detailList.examineStatus == 'OK' || detailList.examineStatus == 'FAIL'
+      "
+      class="diy-table-1"
+    >
+      <el-row :gutter="0">
+        <el-col :xs="12" :sm="12" :lg="12" class="item">
+          <div class="label">验收人</div>
+          <div class="value">{{ detailList.checkBy }}</div>
+        </el-col>
+        <el-col :xs="12" :sm="12" :lg="12" class="item">
+          <div class="label">验收日期</div>
+          <div class="value">
+            <el-date-picker
+              prefix-icon="''"
+              class="selectStyle"
+              v-model="detailList.checkDate"
+              type="datetime"
+              placeholder=""
+              default-time="00:00:00"
+              value-format="yyyy-MM-dd HH:mm:ss"
+            >
+            </el-date-picker>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="24" :lg="24" class="item">
+          <div class="label">是否退押</div>
+          <div class="value">
+            <el-radio-group v-model="detailList.isRefundDeposit">
+              <el-radio :label="true">是</el-radio>
+              <el-radio :label="false">否</el-radio>
+            </el-radio-group>
+          </div>
+        </el-col>
+        <el-col :xs="12" :sm="24" :lg="24" class="item">
+          <div class="label">验收说明</div>
+          <div class="value">
+            <el-input
+              v-model="detailList.checkNote"
+              placeholder="请输入内容"
+            ></el-input>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
     <br />
     <!-- 按钮 -->
-    <div class="btn-group clearfix">
+    <!-- detailList.examineStatus != 'OK' || detailList.examineStatus != 'FAIL' -->
+    <div
+      class="btn-group clearfix"
+      v-if="
+        detailList.examineStatus == 'SAVE' || detailList.examineStatus == 'WAIT'
+      "
+    >
       <div class="fl">
         <el-button type="primary" size="small" @click="adoptFn"
           >审批通过</el-button
@@ -329,6 +415,7 @@
 </template>
 
 <script>
+import IMAGEUPLOAD from "@/components/Common/image-upload.vue";
 import { mapGetters } from "vuex";
 import {
   getDepositManageDetail,
@@ -341,11 +428,13 @@ export default {
       required: true,
     },
   },
+  components: { IMAGEUPLOAD },
   computed: {
     ...mapGetters(["name"]),
   },
   data() {
     return {
+      imageURL: this.$imageUrl,
       listLoading: false, // 列表加载loading
       dataList: [], // 列表数据
       detailList: {},
@@ -356,10 +445,36 @@ export default {
     };
   },
   created() {
+    console.log(this.$imageUrl, 8888);
     this.checkBy = this.name;
     this.getData({ id: this.detailId });
   },
   methods: {
+    //下载
+    downLoadFn(v) {
+      window.open(this.imageURL + v);
+    },
+    // 检查文件类型
+    checkFileType(url) {
+      if (!url) return "";
+      const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
+
+      if (["jpg", "jpeg", "png"].includes(fileSuffix)) {
+        return "image";
+      } else if (["doc", "docx", "dot", "wps", "wpt"].includes(fileSuffix)) {
+        return "word";
+      } else if (["xls", "xlsx", "xlt", "et", "ett"].includes(fileSuffix)) {
+        return "excel";
+      } else if (
+        ["ppt", "pptx", "dps", "dpt", "pot", "pps"].includes(fileSuffix)
+      ) {
+        return "ppt";
+      } else if (["pdf"].includes(fileSuffix)) {
+        return "pdf";
+      } else {
+        return "";
+      }
+    },
     //审批驳回
     async rejectFn() {
       let data = {
@@ -371,6 +486,8 @@ export default {
         examineResult: 0,
       };
       await getDepositManageExamine(data);
+      this.$message.success("审批驳回");
+      this.$parent.showSurrender = true;
     },
     //审批通过
     async adoptFn() {
@@ -383,6 +500,8 @@ export default {
         examineResult: 1,
       };
       await getDepositManageExamine(data);
+      this.$message.success("审批驳回");
+      this.$parent.showSurrender = false;
     },
     async getData(data) {
       const res = await getDepositManageDetail(data);

+ 38 - 31
src/views/engin_deposit/deposit_list.vue

@@ -59,7 +59,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
+            <!-- <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="产品名称" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
@@ -68,19 +68,22 @@
               <el-form-item label="规格型号" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
-            </el-col>
-
-            <el-col :xs="24" :sm="24" :lg="12">
+            </el-col> -->
+            <el-col :xs="24" :sm="24" :lg="24">
               <el-form-item label="" class="fr">
-                <el-button size="small" @click="resetScreenForm">清空</el-button>
-                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+                <el-button size="small" @click="resetScreenForm"
+                  >清空</el-button
+                >
+                <el-button size="small" type="primary" @click="submitScreenForm"
+                  >搜索</el-button
+                >
               </el-form-item>
             </el-col>
           </el-row>
         </el-form>
       </div>
       <!-- 按钮 -->
-      <div class="btn-group clearfix" style="display:flex">
+      <div class="btn-group clearfix" style="display: flex">
         <el-button type="primary" size="small" @click="hanleDownloadFiles"
           >导出</el-button
         >
@@ -108,11 +111,7 @@
             @select-all="handleSelectionAllChange"
             @selection-change="handleSelectionAllChange"
           >
-            <el-table-column
-              align="center"
-              type="selection"
-              width="55"
-            >
+            <el-table-column align="center" type="selection" width="55">
             </el-table-column>
             <el-table-column
               align="center"
@@ -241,10 +240,20 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <el-button type="text" class="textColor" @click="detailFn(scope.row)"
+                <el-button
+                  type="text"
+                  class="textColor"
+                  @click="detailFn(scope.row)"
                   >详情</el-button
                 >
-                <el-button type="text" class="textColor"  v-if="scope.row.examineStatus == 'SAVE'" @click="surrenderFn(scope.row)"
+                <el-button
+                  type="text"
+                  class="textColor"
+                  v-if="
+                    scope.row.examineStatus == 'SAVE' &&
+                    $checkBtnRole('apply', $route.meta.roles)
+                  "
+                  @click="surrenderFn(scope.row)"
                   >申请退押</el-button
                 >
                 <!-- <el-button type="text" class="textColor" slot="reference"
@@ -309,9 +318,9 @@ export default {
       listLoading: false, // 列表加载loading
       deduction: "全部",
       showPage: 1,
-      importFileList:[],
-      selectData:[],
-      baseURL:''
+      importFileList: [],
+      selectData: [],
+      baseURL: "",
     };
   },
 
@@ -322,12 +331,12 @@ export default {
     },
     //申请退押
     surrenderFn(row) {
-      this.depositManageId = row.depositManageId
+      this.depositManageId = row.depositManageId;
       this.showPage = 4;
     },
     detailFn(row) {
-      this.depositManageId = row.depositManageId
-      this.refEnginRecordNo = row.refEnginRecordNo
+      this.depositManageId = row.depositManageId;
+      this.refEnginRecordNo = row.refEnginRecordNo;
       this.showPage = 2;
     },
     getList() {
@@ -343,20 +352,19 @@ export default {
         this.listTotal = res.data.total;
       });
     },
-    handleRadio(){
-      this.getList()
+    handleRadio() {
+      this.getList();
     },
     hanleDownloadFiles() {
       if (this.selectData.length) {
-        const arr = []
+        const arr = [];
         for (let i = 0; i < this.selectData.length; i++) {
-            arr.push( this.selectData[i].depositManageId)
+          arr.push(this.selectData[i].depositManageId);
         }
-       downloadFiles("/deposit-manage/export",{id:arr});
-      }else{
-        this.$errorMsg('请选择押金项')
+        downloadFiles("/deposit-manage/export", { id: arr });
+      } else {
+        this.$errorMsg("请选择押金项");
       }
-
     },
     // 导入
     async handleImport(param) {
@@ -381,10 +389,9 @@ export default {
         });
       }
     },
-     handleSelectionAllChange(e) {
+    handleSelectionAllChange(e) {
       this.selectData = e;
     },
-
   },
 };
 </script>
@@ -393,7 +400,7 @@ export default {
 .dateStyle {
   width: 100%;
 }
-.import-btn{
+.import-btn {
   margin-left: 10px;
 }
 </style>

+ 93 - 20
src/views/engin_deposit/refund_list.vue

@@ -20,36 +20,64 @@
         >
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程登录(信息)编号" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="工程登录(信息)编号" prop="refEnginRecordNo">
+                <el-input
+                  v-model="searchForm.refEnginRecordNo"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商编码" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="经销商编码" prop="customerKeyword">
+                <el-input
+                  v-model="searchForm.customerKeyword"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商名称" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="经销商名称" prop="customerKeyword">
+                <el-input
+                  v-model="searchForm.customerKeyword"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程名称" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="工程名称" prop="refProjectName">
+                <el-input
+                  v-model="searchForm.refProjectName"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="发货申请日期" prop="">
+              <el-form-item label="发货申请开始日期" prop="startDeliverTime">
                 <el-date-picker
                   class="dateStyle"
-                  type="date"
-                  placeholder="选择日期"
+                  v-model="searchForm.startDeliverTime"
+                  type="datetime"
+                  placeholder=""
+                  default-time="00:00:00"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货申请结束日期" prop="endDeliverTime">
+                <el-date-picker
+                  v-model="searchForm.endDeliverTime"
+                  class="dateStyle"
+                  type="datetime"
+                  placeholder=""
+                  default-time="23:59:59"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="产品名称" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
@@ -58,12 +86,14 @@
               <el-form-item label="规格型号" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
-            </el-col>
+            </el-col> -->
 
-            <el-col :xs="24" :sm="24" :lg="6">
+            <el-col :xs="24" :sm="24" :lg="24">
               <el-form-item label="" class="fr">
-                <el-button size="small">清空</el-button>
-                <el-button size="small" type="primary">搜索</el-button>
+                <el-button size="small" @click="resetFn">清空</el-button>
+                <el-button size="small" type="primary" @click="searchFn"
+                  >搜索</el-button
+                >
               </el-form-item>
             </el-col>
           </el-row>
@@ -131,9 +161,9 @@
             >
               <template v-slot="{ row }">
                 <el-tag v-show="row.examineStatus == 'SAVE'">保存</el-tag>
-                <el-tag v-show="row.examineStatus == 'WAIT'">保存</el-tag>
-                <el-tag v-show="row.examineStatus == 'OK'">保存</el-tag>
-                <el-tag v-show="row.examineStatus == 'FAIL'">保存</el-tag>
+                <el-tag v-show="row.examineStatus == 'WAIT'">待审核</el-tag>
+                <el-tag v-show="row.examineStatus == 'OK'">通过</el-tag>
+                <el-tag v-show="row.examineStatus == 'FAIL'">不通过</el-tag>
               </template>
             </el-table-column>
             <el-table-column
@@ -146,11 +176,25 @@
                 <el-button
                   type="text"
                   class="textColor"
+                  v-if="
+                    scope.row.examineStatus == 'WAIT' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
                   @click="examineFn(scope.row.depositManageId)"
                   >审批</el-button
                 >
 
-                <el-button type="text" class="textColor">详情</el-button>
+                <el-button
+                  type="text"
+                  class="textColor"
+                  v-if="
+                    scope.row.examineStatus == 'SAVE' ||
+                    scope.row.examineStatus == 'OK' ||
+                    scope.row.examineStatus == 'FAIL'
+                  "
+                  @click="infoFn(scope.row.depositManageId)"
+                  >详情</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -185,7 +229,13 @@ export default {
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       dataList: [], // 列表数据
-      searchForm: {}, //搜索表单
+      searchForm: {
+        refEnginRecordNo: "",
+        customerKeyword: "",
+        refProjectName: "",
+        startDeliverTime: "",
+        endDeliverTime: "",
+      }, //搜索表单
       listLoading: false, // 列表加载loading
       examine: "全部",
       showSurrender: true,
@@ -210,6 +260,29 @@ export default {
     });
   },
   methods: {
+    //重置
+    resetFn() {
+      this.$refs.searchForm.resetFields();
+    },
+    //搜索
+    searchFn() {
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        confirmName: "",
+        createName: "",
+        enginOrderNo: "",
+        enginOrderType: "",
+        examineStatus: "",
+        refUseUnit: "",
+        ...this.searchForm,
+      });
+    },
+    //详情
+    infoFn(id) {
+      this.detailId = id;
+      this.showSurrender = false;
+    },
     async getDataList(data) {
       const res = await getDepositManageList(data);
       this.dataList = res.data.records;

+ 26 - 24
src/views/finance/change_apply.vue

@@ -230,10 +230,13 @@ export default {
     // },
 
     resetFn() {
+      this.searchForm.theTime = null;
       this.dataList.forEach((v) => {
         v.money = "";
         v.bz = "";
+        v.name = "";
       });
+      this.dataList[1].customerId = "";
     },
 
     // //返利类型数据
@@ -282,30 +285,27 @@ export default {
       let initiatorRemark;
       let receiverRemark;
       let amount;
-      // let res = this.func(this.dataList, 0);
-      // console.log(res);
-      // if (this.dataList[res[0]].money > 0) {
-      //   receiverWalletRebateId = this.dataList[res[0]].customerWalletId;
-      //   initiatorWalletRebateId = this.dataList[res[1]].customerWalletId;
-      //   receiverRemark = this.dataList[res[0]].bz;
-      //   initiatorRemark = this.dataList[res[1]].bz;
-      //   amount = this.dataList[res[0]].money;
-      // } else {
-      //   receiverWalletRebateId = this.dataList[res[1]].customerWalletId;
-      //   initiatorWalletRebateId = this.dataList[res[0]].customerWalletId;
-      //   receiverRemark = this.dataList[res[1]].bz;
-      //   initiatorRemark = this.dataList[res[0]].bz;
-      //   amount = this.dataList[res[1]].money;
-      // }
-      // await getTransferAdd({
-      //   receiverWalletRebateId,
-      //   initiatorWalletRebateId,
-      //   receiverRemark,
-      //   initiatorRemark,
-      //   amount: amount * 1,
-      // });
 
-      await this.$refs.searchForm.validate(["theTime"]);
+      await this.$refs.searchForm.validate();
+      let aaa = this.dataList.find((v) => {
+        if (v.money == "") {
+          this.$message.error("请输入返利金额");
+          return v;
+        }
+        if (v.customerId == "") {
+          this.$message.error("请选择经销商");
+          return v;
+        }
+        if (v.name == "") {
+          this.$message.error("请选择返利类型");
+          return v;
+        }
+      });
+      console.log(aaa);
+      if (aaa != undefined) {
+        return;
+      }
+
       if (this.dataList[0].money > 0) {
         receiverWalletRebateId = this.dataList[0].name;
         initiatorWalletRebateId = this.dataList[1].name;
@@ -327,7 +327,9 @@ export default {
         initiatorRemark,
         amount: amount * 1,
       });
-      this.$message.success("保存成功");
+
+      this.$router.push("/finance/change_list");
+      this.$message.success("申请成功");
     },
     async getUserInfoFn() {
       const res = await getUserInfo({ adminUserId: this.userid });

+ 13 - 1
src/views/finance/change_list.vue

@@ -99,7 +99,19 @@
               prop="applyTime"
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <!-- <template slot-scope="scope">
+                <div>
+                  <span>{{ scope.row.applyTime }}</span>
+                  <el-button
+                    type="text"
+                    icon="el-icon-edit"
+                    style="padding: 0; margin-left: 6px"
+                    @click="editDate(scope.row)"
+                  ></el-button>
+                </div>
+              </template> -->
+            </el-table-column>
             <el-table-column
               align="center"
               label="发起方经销商编号"

+ 19 - 7
src/views/finance/components/receivable_list-add.vue

@@ -325,25 +325,37 @@ export default {
 
     //新增
     async addFn() {
-      let aaa = this.dataList.map((v) => {
+      if (this.dataList.length == 0) {
+        this.$message.error("请添加数据");
+        return;
+      }
+      let aaa = this.dataList.find((v) => {
         if (v.afterTaxAmount == "") {
           this.$message.error("请输入不含税金额");
-          return 1;
+          return v;
+        }
+        if (v.customerId == "") {
+          this.$message.error("请选择经销商");
+          return v;
+        }
+        if (!v.walletId) {
+          this.$message.error("请选择现金钱包");
+          return v;
         }
         if (v.tax == "") {
           this.$message.error("请输入税额");
-          return 1;
+          return v;
         }
         if (v.totalAmount == "") {
           this.$message.error("请输入总金额");
-          return 1;
+          return v;
         }
       });
-
-      let bbb = aaa.indexOf(1);
-      if (bbb != -1) {
+      console.log(aaa);
+      if (aaa != undefined) {
         return;
       }
+
       this.dataList.forEach((v) => {
         let res = this.customerList.filter((i) => i.id == v.customerId);
         console.log(res);

+ 24 - 23
src/views/finance/rebate_form.vue

@@ -19,12 +19,13 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="返利日期" prop="theTime">
+            <el-form-item label="返利日期" prop="">
               <el-date-picker
+                disabled
                 class="selectStyle"
                 v-model="searchForm.theTime"
                 type="datetime"
-                placeholder="选择日期时间"
+                placeholder="系统自动生成"
                 default-time="23:59:59"
                 value-format="yyyy-MM-dd HH:mm:ss"
               >
@@ -304,9 +305,9 @@
     <div class="btn-group clearfix">
       <div class="fl">
         <el-button type="primary" size="small" @click="addFn">保存</el-button>
-        <el-button type="primary" size="small" @click="submitFn"
+        <!-- <el-button type="primary" size="small" @click="submitFn"
           >提交审批</el-button
-        >
+        > -->
         <el-button type="primary" size="small" @click="cancelFn"
           >重置</el-button
         >
@@ -344,21 +345,21 @@ export default {
       listLoading: false, // 列表加载loading
       customerData: [],
       searchForm: {
-        theTime: "",
+        // theTime: "",
 
         remark: "",
         createBy: "",
       },
       delIndex: null,
-      rules: {
-        theTime: [
-          {
-            required: true,
-            message: "请选择返利日期",
-            trigger: "blur",
-          },
-        ],
-      },
+      // rules: {
+      //   theTime: [
+      //     {
+      //       required: true,
+      //       message: "请选择返利日期",
+      //       trigger: "blur",
+      //     },
+      //   ],
+      // },
     };
   },
 
@@ -411,15 +412,15 @@ export default {
     delRowFn() {
       this.dataList.splice(this.delIndex, 1);
     },
-    //提交审批
-    async submitFn() {
-      let res = await getRebateOrderList({ pageSize: -1, pageNum: 1 });
-      console.log(res);
-      let index = res.data.records.length - 1;
-      let arr = res.data.records;
-      await getRebateOrderApply({ id: arr[index].rebateOrderId });
-      this.$message.success("提交审批成功");
-    },
+    // //提交审批
+    // async submitFn() {
+    //   let res = await getRebateOrderList({ pageSize: -1, pageNum: 1 });
+    //   console.log(res);
+    //   let index = res.data.records.length - 1;
+    //   let arr = res.data.records;
+    //   await getRebateOrderApply({ id: arr[index].rebateOrderId });
+    //   this.$message.success("提交审批成功");
+    // },
     //新增
     async addFn() {
       let arr;

+ 53 - 3
src/views/finance/rebate_list.vue

@@ -142,9 +142,21 @@
               align="center"
               label="返利日期"
               prop="theTime"
-              min-width="160"
+              min-width="180"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                <div>
+                  <span>{{ scope.row.theTime }}</span>
+                  <el-button
+                    type="text"
+                    icon="el-icon-edit"
+                    style="padding: 0; margin-left: 6px"
+                    @click="editDate(scope.row)"
+                  ></el-button>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column
               v-if="isCustomer"
               align="center"
@@ -404,7 +416,11 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  v-if="!isCustomer && $checkBtnRole('edit', $route.meta.roles)"
+                  v-if="
+                    !isCustomer &&
+                    $checkBtnRole('edit', $route.meta.roles) &&
+                    scope.row.examineStatus != 'FAIL_ONE'
+                  "
                   @click="editFn(scope.row.rebateOrderId)"
                   >编辑</el-button
                 >
@@ -506,6 +522,7 @@
         </div>
       </div>
     </div>
+
     <RebateListApply :detailId="detailId" v-else-if="showPage == 2" />
     <RebateListExamine
       @updateList="updateList"
@@ -532,6 +549,10 @@
       :detailId="detailId"
       v-else-if="showPage == 7"
     />
+    <EditDateTimeDialog
+      :isShow.sync="isShowEditDateDialog"
+      :dateForm.sync="dateForm"
+    />
   </div>
 </template>
 
@@ -539,6 +560,7 @@
 import {
   getRebateOrderList,
   getRebateOrderApply,
+  getRebateOrderUpdate,
 } from "@/api/finance/rebate_list";
 import RebateListApply from "./components/rebate_list-apply.vue";
 import RebateListExamine from "./components/rebate_list-examine.vue";
@@ -546,6 +568,7 @@ import RebateListReview from "./components/rebate_list-review.vue";
 import RebateListDetail from "./components/rebate_list-detail";
 import RebateListConfirm from "./components/rebate_list-confirm";
 import RebateListEdit from "./components/rebate_list-edit.vue";
+import EditDateTimeDialog from "@/components/Common/edit-date-time-dialog.vue";
 
 export default {
   components: {
@@ -555,6 +578,7 @@ export default {
     RebateListReview,
     RebateListConfirm,
     RebateListEdit,
+    EditDateTimeDialog,
   },
   data() {
     return {
@@ -575,6 +599,11 @@ export default {
       isCustomer: null,
       secondId: null,
       isShow: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: "",
+      },
+      editId: null,
     };
   },
   created() {
@@ -590,6 +619,27 @@ export default {
     }
   },
   methods: {
+    // 提交 修改订单日期
+    submitDateForm() {
+      getRebateOrderUpdate({
+        id: this.editId,
+        theTime: this.dateForm.date,
+      }).then((res) => {
+        this.isShowEditDateDialog = false;
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+        });
+        this.$successMsg("修改成功");
+      });
+    },
+    // 打开 修改订单日期
+    editDate(item) {
+      console.log(item);
+      this.editId = item.rebateOrderId;
+      this.dateForm.date = item.theTime;
+      this.isShowEditDateDialog = true;
+    },
     //清除
     cancelFn() {
       this.$refs.searchForm.resetFields();

+ 14 - 0
src/views/finance/receipt_list.vue

@@ -259,6 +259,8 @@
         <!-- 分页 -->
         <div class="fr">
           <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-sizes="[10, 20, 30, 50]"
             :page-size="10"
@@ -304,6 +306,17 @@ export default {
     this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
   },
   methods: {
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getDataList({ pageNum: this.currentPage, pageSize: this.pageSize });
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getDataList({ pageNum: this.currentPage, pageSize: this.pageSize });
+    },
     //清空
     cancelFn() {
       this.$refs.searchForm.resetFields();
@@ -320,6 +333,7 @@ export default {
       const res = await getK3ReceiptList(data);
       console.log(res);
       this.dataList = res.data.records;
+      this.listTotal = res.data.total;
     },
     seeFn(id) {
       this.detailId = id;

+ 77 - 25
src/views/finance/standbook_list.vue

@@ -12,7 +12,7 @@
     </el-radio-group>
     <br /><br /> -->
     <el-radio-group v-model="bill" @change="checkFn" size="">
-      <el-radio-button label="COMMONLY">款台账</el-radio-button>
+      <el-radio-button label="COMMONLY">款台账</el-radio-button>
       <el-radio-button label="REBATE">返利台账</el-radio-button>
     </el-radio-group>
     <h1></h1>
@@ -27,6 +27,24 @@
       >
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="经销商名称" prop="">
+              <el-select
+                class="selectStyle"
+                v-model="searchForm.customerId"
+                placeholder="请选择"
+                filterable
+              >
+                <el-option
+                  v-for="(v, i) in customerList"
+                  :key="i"
+                  :label="v.name"
+                  :value="v.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="钱包" prop="walletRebateId">
               <el-select
                 class="selectStyle"
@@ -78,7 +96,7 @@
             </el-form-item>
           </el-col>
 
-          <el-col :xs="24" :sm="24" :lg="24">
+          <el-col :xs="24" :sm="24" :lg="18">
             <el-form-item label="" class="fr">
               <el-button size="small" @click="resetFn">清空</el-button>
               <el-button size="small" type="primary" @click="searchFn"
@@ -346,8 +364,8 @@
             ></el-table-column>
             <el-table-column
               align="center"
-              label="返利类"
-              prop="mainName"
+              label="返利类"
+              prop="walletName"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
@@ -386,11 +404,19 @@
               prop=""
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{
+                  scope.row.amountType == "OUT"
+                    ? scope.row.amount
+                    : -scope.row.amount
+                }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="结存"
-              prop=""
+              prop="balanceAmount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
@@ -417,10 +443,16 @@
 <script>
 import { mapGetters } from "vuex";
 import { getWalletCustomerList } from "@/api/finance/change_apply";
-import { getStandbookList, getDictList } from "@/api/finance/standbook_list";
+import {
+  getStandbookList,
+  getDictList,
+  getCustomerList,
+} from "@/api/finance/standbook_list";
+import { number } from "echarts";
 export default {
   data() {
     return {
+      customerList: [],
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -429,8 +461,10 @@ export default {
       dataList: [],
       selectList: [],
       dictList: [],
-
+      customerName: null,
+      customerNumber: null,
       searchForm: {
+        customerId: "",
         startTime: "",
         endTime: "",
         billNo: "",
@@ -460,11 +494,20 @@ export default {
         type: this.bill,
       });
     }
+    this.getCustomerDataList();
     this.getWalletList();
     this.getDataDict();
-    console.log(this.$route.query, 1111111);
   },
   methods: {
+    //获取经销商列表
+    async getCustomerDataList() {
+      let res = await getCustomerList({
+        pageNum: 1,
+        pageSize: -1,
+      });
+      this.customerList = res.data.records;
+    },
+
     // 更改每页数量
     handleSizeChange(val) {
       this.pageSize = val;
@@ -487,6 +530,8 @@ export default {
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
+          customerName: this.customerName,
+          customerNumber: this.customerNumber,
         });
       }
     },
@@ -511,6 +556,8 @@ export default {
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
+          customerName: this.customerName,
+          customerNumber: this.customerNumber,
         });
       }
     },
@@ -523,23 +570,23 @@ export default {
     //重置
     resetFn() {
       this.mainId = "";
+      this.searchForm.customerId = "";
       this.$refs.searchForm.resetFields();
     },
     //查询
     searchFn() {
-      console.log(this.mainId);
-      // console.log(this.searchForm);
-      // const res = this.selectList.filter(
-      //   (v) => v.walletRebateId == this.searchForm.walletRebateId
-      // );
-      // console.log(res);
-      // this.getDataList({
-      //   ...this.searchForm,
-      //   mainId: this.mainId,
-      //   type: this.bill,
-      //   pageSize: this.pageSize,
-      //   pageNum: this.currentPage,
-      // });
+      this.customerName = null;
+      this.customerNumber = null;
+      let res = this.customerList.filter((v) => {
+        return v.id == this.searchForm.customerId;
+      });
+      console.log(res);
+      // return;
+      if (res.length > 0) {
+        this.customerName = res[0].name;
+        this.customerNumber = res[0].number;
+      }
+
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
         this.getDataList({
           ...this.searchForm,
@@ -553,6 +600,8 @@ export default {
       } else {
         this.getDataList({
           ...this.searchForm,
+          customerName: this.customerName,
+          customerNumber: this.customerNumber,
           mainId: this.mainId,
           pageSize: this.pageSize,
           pageNum: this.currentPage,
@@ -571,12 +620,13 @@ export default {
     },
     //切换列表
     checkFn(v) {
-      this.resetFn();
       // this.getDataList({
       //   pageSize: 10,
       //   pageNum: 1,
       //   type: v,
       // });
+      this.pageSize = 10;
+      this.currentPage = 1;
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
         this.getDataList({
           ...this.searchForm,
@@ -591,8 +641,10 @@ export default {
         this.getDataList({
           ...this.searchForm,
           mainId: this.mainId,
-          pageSize: 10,
-          pageNum: 1,
+          customerName: this.customerName,
+          customerNumber: this.customerNumber,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
           type: v,
         });
       }

+ 38 - 73
src/views/finance/tax_rate.vue

@@ -12,7 +12,7 @@
           label-width="120px"
           label-position="right"
         >
-          <el-form-item label="仓存费税率" prop="nickName">
+          <el-form-item label="仓存费税率" prop="">
             <el-input
               v-model="mainForm.storageFeeTax"
               autocomplete="off"
@@ -20,7 +20,7 @@
               ><i class="el-input__icon" slot="suffix">% </i></el-input
             >
           </el-form-item>
-          <el-form-item label="工程价差税率" prop="nickName">
+          <el-form-item label="工程价差税率" prop="">
             <el-input
               v-model="mainForm.enginPriceDifTax"
               autocomplete="off"
@@ -28,7 +28,7 @@
               ><i class="el-input__icon" slot="suffix">% </i></el-input
             >
           </el-form-item>
-          <el-form-item label="运输费税率" prop="nickName">
+          <el-form-item label="运输费税率" prop="">
             <el-input
               v-model="mainForm.transportTax"
               autocomplete="off"
@@ -36,7 +36,7 @@
               ><i class="el-input__icon" slot="suffix">% </i></el-input
             >
           </el-form-item>
-          <el-form-item label="安装费税率" prop="nickName">
+          <el-form-item label="安装费税率" prop="">
             <el-input
               v-model="mainForm.installTax"
               autocomplete="off"
@@ -44,7 +44,7 @@
               ><i class="el-input__icon" slot="suffix">% </i></el-input
             >
           </el-form-item>
-          <el-form-item label="库存商品税率" prop="nickName">
+          <el-form-item label="库存商品税率" prop="">
             <el-input
               v-model="mainForm.stockTax"
               autocomplete="off"
@@ -52,63 +52,15 @@
               ><i class="el-input__icon" slot="suffix">% </i></el-input
             >
           </el-form-item>
+          <el-form-item label="押金通用比例" prop="">
+            <el-input
+              v-model="mainForm.depositTax"
+              autocomplete="off"
+              placeholder="请输入"
+              ><i class="el-input__icon" slot="suffix">% </i></el-input
+            >
+          </el-form-item>
         </el-form>
-        <!-- <el-form label-position="left" label-width="100px">
-          <el-row>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="仓存费税率" prop="">
-                <el-input placeholder="请输入">
-                  <i class="el-input__icon" slot="suffix">% </i>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :xs="24" :sm="24" :lg="6">
-              <el-form-item label="工程价差税率" prop="">
-                <el-input placeholder="请输入">
-                  <i class="el-input__icon" slot="suffix">% </i>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :xs="24" :sm="24" :lg="6">
-              <el-form-item label="运输费税率" prop="">
-                <el-input placeholder="请输入">
-                  <i class="el-input__icon" slot="suffix">% </i>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :xs="24" :sm="24" :lg="6">
-              <el-form-item label="安装费税率" prop="">
-                <el-input placeholder="请输入">
-                  <i class="el-input__icon" slot="suffix">% </i>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :xs="24" :sm="24" :lg="6">
-              <el-form-item label="库存商品税率" prop="">
-                <el-input placeholder="请输入">
-                  <i class="el-input__icon" slot="suffix">% </i>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col :xs="24" :sm="24" :lg="24">
-              <el-form-item label="" class="">
-                <el-button size="small">修改</el-button>
-                <el-button size="small" type="primary">确定</el-button>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form> -->
       </el-card>
     </div>
 
@@ -127,11 +79,12 @@ export default {
   data() {
     return {
       mainForm: {
-        storageFeeTax: "",
-        enginPriceDifTax: "",
-        transportTax: "",
-        installTax: "",
-        stockTax: "",
+        storageFeeTax: null,
+        enginPriceDifTax: null,
+        transportTax: null,
+        installTax: null,
+        stockTax: null,
+        depositTax: null,
       },
     };
   },
@@ -141,18 +94,30 @@ export default {
   methods: {
     //修改
     async editFn() {
-      await getCommonTaxConfig(this.mainForm);
+      await getCommonTaxConfig({
+        storageFeeTax: Number((this.mainForm.storageFeeTax / 100).toFixed(2)),
+        enginPriceDifTax: Number(
+          (this.mainForm.enginPriceDifTax / 100).toFixed(2)
+        ),
+        transportTax: Number((this.mainForm.transportTax / 100).toFixed(2)),
+        installTax: Number((this.mainForm.installTax / 100).toFixed(2)),
+        stockTax: Number((this.mainForm.stockTax / 100).toFixed(2)),
+        depositTax: Number((this.mainForm.depositTax / 100).toFixed(2)),
+      });
+      this.$message.success("修改成功");
+      this.getData();
     },
     //获取税率数据
     async getData() {
       const res = await getCommonTaxGet();
       console.log(res);
       this.mainForm = {
-        storageFeeTax: res.data.storageFeeTax,
-        enginPriceDifTax: res.data.enginPriceDifTax,
-        transportTax: res.data.transportTax,
-        installTax: res.data.installTax,
-        stockTax: res.data.stockTax,
+        storageFeeTax: res.data.storageFeeTax * 100,
+        enginPriceDifTax: res.data.enginPriceDifTax * 100,
+        transportTax: res.data.transportTax * 100,
+        installTax: res.data.installTax * 100,
+        stockTax: res.data.stockTax * 100,
+        depositTax: res.data.depositTax * 100,
       };
     },
   },
@@ -199,4 +164,4 @@ export default {
   cursor: pointer;
   user-select: none;
 }
-</style>
+</style>

+ 108 - 19
src/views/finance/wallet.vue

@@ -3,18 +3,60 @@
     <div class="sty" v-show="this.$route.query.id">
       <el-page-header @back="goBack"> </el-page-header>
     </div>
+    <br />
+    <!-- 筛选条件 -->
+    <div v-if="!isShow">
+      <el-form
+        ref="searchForm"
+        :model="searchForm"
+        :rules="rulesSearchForm"
+        label-width="100px"
+        size="small"
+        label-position="left"
+      >
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="经销商名称" prop="customerId">
+              <el-select
+                class="selectStyle"
+                v-model="searchForm.customerId"
+                placeholder="请选择"
+                filterable
+              >
+                <el-option
+                  v-for="(v, i) in customerList"
+                  :key="i"
+                  :label="v.name"
+                  :value="v.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :lg="18">
+            <el-form-item label="" class="fr">
+              <el-button size="small" @click="resetFn">清空</el-button>
+              <el-button size="small" type="primary" @click="searchFn"
+                >搜索</el-button
+              >
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
 
     <el-row>
       <el-col :xs="24" :sm="12" :lg="12">
         <div class="styl">现金钱包</div>
       </el-col>
-      <el-col :xs="24" :sm="12" :lg="12">
+      <!-- <el-col :xs="24" :sm="12" :lg="12">
         <div class="fr">
           <el-button size="small" type="primary" @click="generateFn"
             >一键生成钱包</el-button
           >
         </div>
-      </el-col>
+      </el-col> -->
     </el-row>
     <el-divider></el-divider>
     <!-- 列表 -->
@@ -186,11 +228,17 @@ import { mapGetters } from "vuex";
 import {
   getfinanceInit,
   getWalletRebateRateUpdate,
+  getCustomerList,
 } from "@/api/finance/wallet";
 import { getWalletCustomerList } from "@/api/finance/change_apply";
 export default {
   data() {
     return {
+      isShow: JSON.parse(localStorage.getItem("supply_user")).isCustomer,
+      searchForm: {
+        customerId: null,
+      },
+      customerList: [],
       listLoading: false, // 列表加载loading
       walletList: [],
       rebateList: [],
@@ -198,6 +246,15 @@ export default {
         rebateRate: null,
       },
       dialogForm: false,
+      rulesSearchForm: {
+        customerId: [
+          {
+            required: true,
+            message: "请选择经销商",
+            trigger: "blur",
+          },
+        ],
+      },
       rules: {
         rebateRate: [
           {
@@ -210,7 +267,7 @@ export default {
     };
   },
   created() {
-    console.log(this.$route.query.id, 11, this.customerId);
+    // console.log(this.$route.query.id, 11, this.customerId);
     if (this.$route.query.id) {
       this.getDataWallet({
         customerId: this.$route.query.id,
@@ -221,20 +278,49 @@ export default {
         type: "REBATE",
       });
     } else {
-      this.getDataWallet({
-        customerId: this.customerId,
-        type: "COMMONLY",
-      });
-      this.getDataRebate({
-        customerId: this.customerId,
-        type: "REBATE",
-      });
+      if (this.isShow) {
+        this.getDataWallet({
+          customerId: this.customerId,
+          type: "COMMONLY",
+        });
+        this.getDataRebate({
+          customerId: this.customerId,
+          type: "REBATE",
+        });
+      } else {
+        this.$message("请选择经销商");
+        this.getCustomerDataList();
+      }
     }
   },
   computed: {
     ...mapGetters(["customerId"]),
   },
   methods: {
+    //清空
+    resetFn() {
+      this.$refs.searchForm.resetFields();
+    },
+    //搜索
+    async searchFn() {
+      await this.$refs.searchForm.validate();
+      this.getDataWallet({
+        customerId: this.searchForm.customerId,
+        type: "COMMONLY",
+      });
+      this.getDataRebate({
+        customerId: this.searchForm.customerId,
+        type: "REBATE",
+      });
+    },
+    //获取经销商列表
+    async getCustomerDataList() {
+      let res = await getCustomerList({
+        pageNum: 1,
+        pageSize: -1,
+      });
+      this.customerList = res.data.records;
+    },
     //返回
     goBack() {
       this.$router.push("/finance/balance_sum");
@@ -257,7 +343,7 @@ export default {
         });
       } else {
         this.getDataRebate({
-          customerId: this.customerId,
+          customerId: this.searchForm.customerId,
           type: "REBATE",
         });
       }
@@ -270,13 +356,13 @@ export default {
       this.addForm.rebateRate = v.rebateRate * 100;
       this.dialogForm = true;
     },
-    //一键生成
-    async generateFn() {
-      await getfinanceInit({ customerId: this.customerId });
-      this.getDataWallet();
-      this.getDataRebate();
-      this.$message.success("已生成");
-    },
+    // //一键生成
+    // async generateFn() {
+    //   await getfinanceInit({ customerId: this.customerId });
+    //   this.getDataWallet();
+    //   this.getDataRebate();
+    //   this.$message.success("已生成");
+    // },
     //
     async getDataRebate(data) {
       let res = await getWalletCustomerList(data);
@@ -294,4 +380,7 @@ export default {
 .styl {
   padding-top: 14px;
 }
+.selectStyle {
+  width: 100%;
+}
 </style>

+ 126 - 113
src/views/login/index.vue

@@ -9,7 +9,7 @@
           class="login-form"
           auto-complete="on"
           label-position="left"
-         @submit.native.prevent="handleLogin"
+          @submit.native.prevent="handleLogin"
         >
           <div class="flex">
             <div class="image-container">
@@ -46,146 +46,151 @@
                     微信登录
                   </div>
                 </div>
-                  <transition name="slide">
+                <transition name="slide">
                   <div v-if="acitve == 'pas'">
-                  <el-form-item prop="username" class="input-box">
-                    <span class="svg-container">
-                      <el-image
-                        style="width: 20px; height: 20px"
-                        :src="require('@/assets/login/icon_001.png')"
-                        fit="contain "
-                      ></el-image>
-                    </span>
-                    <el-input
-                      ref="username"
-                      v-model="loginForm.username"
-                      placeholder="请输入用户名"
-                      name="username"
-                      type="text"
-                      tabindex="1"
-                      auto-complete="on"
-                    />
-                  </el-form-item>
-
-                  <el-form-item prop="password" class="input-box">
-                    <span class="svg-container">
-                      <el-image
-                        style="width: 20px; height: 20px"
-                        :src="require('@/assets/login/icon_002.png')"
-                        fit="contain "
-                      ></el-image>
-                    </span>
-                    <el-input
-                      :key="passwordType"
-                      ref="password"
-                      v-model="loginForm.password"
-                      :type="passwordType"
-                      placeholder="请输入密码"
-                      name="password"
-                      tabindex="2"
-                      auto-complete="off"
-                      @keyup.enter.native="handleLogin"
-                    />
-                    <span class="show-pwd" @click="showPwd">
-                      <svg-icon
-                        :icon-class="
-                          passwordType === 'password' ? 'eye' : 'eye-open'
-                        "
+                    <el-form-item prop="username" class="input-box">
+                      <span class="svg-container">
+                        <el-image
+                          style="width: 20px; height: 20px"
+                          :src="require('@/assets/login/icon_001.png')"
+                          fit="contain "
+                        ></el-image>
+                      </span>
+                      <el-input
+                        ref="username"
+                        v-model="loginForm.username"
+                        placeholder="请输入用户名"
+                        name="username"
+                        type="text"
+                        tabindex="1"
+                        auto-complete="on"
                       />
-                    </span>
-                  </el-form-item>
+                    </el-form-item>
 
-                  <div class="input-box">
-                    <el-form-item prop="codeValue">
+                    <el-form-item prop="password" class="input-box">
                       <span class="svg-container">
                         <el-image
                           style="width: 20px; height: 20px"
-                          :src="require('@/assets/login/icon_003.png')"
+                          :src="require('@/assets/login/icon_002.png')"
                           fit="contain "
                         ></el-image>
                       </span>
                       <el-input
-                        ref="codeValue"
-                        v-model="loginForm.codeValue"
-                        placeholder="请输入验证码"
-                        name="codeValue"
-                        type="text"
-                        tabindex="3"
+                        :key="passwordType"
+                        ref="password"
+                        v-model="loginForm.password"
+                        :type="passwordType"
+                        placeholder="请输入密码"
+                        name="password"
+                        tabindex="2"
                         auto-complete="off"
                         @keyup.enter.native="handleLogin"
                       />
+                      <span class="show-pwd" @click="showPwd">
+                        <svg-icon
+                          :icon-class="
+                            passwordType === 'password' ? 'eye' : 'eye-open'
+                          "
+                        />
+                      </span>
                     </el-form-item>
-                    <div class="code" @click.stop="getCode">
-                      <img
-                        :src="'data:image/jpeg;base64,' + codeImage"
-                        alt=""
-                      />
+
+                    <div class="input-box">
+                      <el-form-item prop="codeValue">
+                        <span class="svg-container">
+                          <el-image
+                            style="width: 20px; height: 20px"
+                            :src="require('@/assets/login/icon_003.png')"
+                            fit="contain "
+                          ></el-image>
+                        </span>
+                        <el-input
+                          ref="codeValue"
+                          v-model="loginForm.codeValue"
+                          placeholder="请输入验证码"
+                          name="codeValue"
+                          type="text"
+                          tabindex="3"
+                          auto-complete="off"
+                          @keyup.enter.native="handleLogin"
+                        />
+                      </el-form-item>
+                      <div class="code" @click.stop="getCode">
+                        <img
+                          :src="'data:image/jpeg;base64,' + codeImage"
+                          alt=""
+                        />
+                      </div>
                     </div>
-                  </div>
 
-                  <div class="checkbox">
-                    <div class="check-yes">
-                      <el-image
-                        style="width: 16px; height: 16px"
-                        :src="require('@/assets/login/icon_004.png')"
-                        fit="contain "
-                      ></el-image>
-                      <el-image
-                        v-if="isRemenberPw"
-                        class="yes"
-                        style="width: 11px; height: 11px"
-                        :src="require('@/assets/login/icon_005.png')"
-                        fit="contain "
-                      ></el-image>
+                    <div class="checkbox">
+                      <div class="check-yes">
+                        <el-image
+                          style="width: 16px; height: 16px"
+                          :src="require('@/assets/login/icon_004.png')"
+                          fit="contain "
+                        ></el-image>
+                        <el-image
+                          v-if="isRemenberPw"
+                          class="yes"
+                          style="width: 11px; height: 11px"
+                          :src="require('@/assets/login/icon_005.png')"
+                          fit="contain "
+                        ></el-image>
+                      </div>
+                      <el-checkbox v-model="isRemenberPw"
+                        >记住账号密码</el-checkbox
+                      >
                     </div>
-                    <el-checkbox v-model="isRemenberPw"
-                      >记住账号密码</el-checkbox
-                    >
-                  </div>
 
-                  <div class="button-container">
-                    <el-button
-                      :loading="loading"
-                      type="primary"
-                      @click.native.prevent="handleLogin"
-                      >登录</el-button
-                    >
+                    <div class="button-container">
+                      <el-button
+                        :loading="loading"
+                        type="primary"
+                        @click.native.prevent="handleLogin"
+                        >登录</el-button
+                      >
+                    </div>
                   </div>
-                </div>
-                <div v-else class="wei">
-                  <div style="width: 250px; height: 250px">
-                    <!-- <el-image
+                  <div v-else class="wei">
+                    <div style="width: 250px; height: 250px">
+                      <!-- <el-image
                       style="width: 250px; height: 250px"
                       :src="require('@/assets/login/icon_001.png')"
                       fit="contain "
                     ></el-image> -->
+                    </div>
+                    <div>
+                      <div class="wei-item-tip">使用手机微信扫码登录</div>
+                      <div class="wei-item-text">
+                        网页版微信需要配合手机使用
+                      </div>
+                    </div>
                   </div>
-                  <div>
-                    <div class="wei-item-tip">使用手机微信扫码登录</div>
-                    <div class="wei-item-text">网页版微信需要配合手机使用</div>
-                  </div>
-                </div>
-                  </transition>
-
+                </transition>
               </div>
             </div>
           </div>
         </el-form>
       </div>
-      <div class="info" >
+      <div class="info">
         <div class="info-item">
           <a :href="companyList[0].icpRecordLink">{{
             companyList[0].icpRecord
           }}</a>
-          <div style="margin: 0 20px" v-if=" companyList[0].companyName && companyList[0].icpRecordLink">|</div>
+          <div
+            style="margin: 0 20px"
+            v-if="companyList[0].companyName && companyList[0].icpRecordLink"
+          >
+            |
+          </div>
           <a :href="companyList[0].pubSecurityRecordLink">
-          <el-image
-            style="width: 14px; height: 16px;"
-            :src="require('@/assets/login/icon_0001.png')"
-          ></el-image>
-          {{
-            companyList[0].pubSecurityRecord
-          }}</a>
+            <el-image
+              style="width: 14px; height: 16px"
+              :src="require('@/assets/login/icon_0001.png')"
+            ></el-image>
+            {{ companyList[0].pubSecurityRecord }}</a
+          >
         </div>
         <div>{{ companyList[0].companyName }}</div>
       </div>
@@ -285,13 +290,11 @@ export default {
     getCompanyList() {
       getCompanyList().then((res) => {
         this.companyList = res.data;
-
       });
     },
     getList() {
       getList().then((res) => {
         this.banner = res.data;
-
       });
     },
     hanleTabs(val) {
@@ -311,7 +314,7 @@ export default {
 
     // 登录
     handleLogin() {
-      console.log(this.loginForm,'lll');
+      console.log(this.loginForm, "lll");
       this.$refs.loginForm.validate((valid) => {
         if (valid) {
           this.loading = true;
@@ -321,7 +324,7 @@ export default {
               console.log(this.redirect);
               this.$router.push({ path: this.redirect || "/" });
               this.saveUnAndPw();
-                this.$store.commit("user/showMessage", "yes");
+              this.$store.commit("user/showMessage", "yes");
               this.loading = false;
             })
             .catch(() => {
@@ -493,7 +496,7 @@ $back: #333;
     transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
   }
 
-  .slide-fade-leave-active  {
+  .slide-fade-leave-active {
     transform: translateX(10px);
     opacity: 0;
   }
@@ -551,7 +554,7 @@ $light_gray: #eee;
   font-size: 24px;
   color: #666666;
   line-height: 40px;
-  border-bottom: 3px solid #FFFFFF;
+  border-bottom: 3px solid #ffffff;
 }
 .acitve {
   font-weight: bold;
@@ -697,6 +700,16 @@ $light_gray: #eee;
   }
 }
 
+::v-deep .el-form-item__error {
+  color: #f56c6c;
+  font-size: 12px;
+  line-height: 1;
+  padding-top: 6px;
+  position: absolute;
+  top: 100%;
+  left: 0;
+}
+
 @media only screen and (max-width: 600px) {
   .image-container {
     display: none;

+ 72 - 57
src/views/sales_policy/components/AddCondition.vue

@@ -1,10 +1,7 @@
 <template>
   <el-container>
     <el-header height="50px" class="header">
-      <el-page-header
-        @back="handleBack"
-        :content="!id ? '添加页面' : '详情页面'"
-      >
+      <el-page-header @back="handleBack" :content="!id ? '新增' : '详情页面'">
       </el-page-header>
     </el-header>
     <div class="line">
@@ -489,33 +486,28 @@ export default {
       // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
       // 如果没有返回值则默认返回false(全部无法选中)
     },
-    getCommonApi() {
+    async getCommonApi() {
       if (this.id) {
-        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];
-              continue;
-            }
-
-            this.$set(this.popArr, `line_${i - 1}`, pop[i]);
+        const res = await getConditionMaterialDetail({ id: this.policyId });
+        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];
+            continue;
           }
-          console.log(this.popArr);
+          this.$set(this.popArr, `line_${i - 1}`, pop[i]);
+        }
+        for (let k = 0; k < pop.length; k++) {
+          const { data } = await getConditionMaterialList({
+            pageNum: 1,
+            pageSize: -1,
+            policyConditionId: res.data.id,
+            popType: k + 1,
+          });
 
-          for (let k = 0; k < pop.length; k++) {
-            getConditionMaterialList({
-              pageNum: 1,
-              pageSize: -1,
-              policyConditionId: res.data.id,
-              popType: k + 1,
-            }).then((res) => {
-              this.conditionBoxs.push(res.data.records);
-            });
-          }
-          console.log(this.conditionBoxs);
-        });
+          this.conditionBoxs.push(data.records);
+        }
       }
     },
     toggleSelection(rows) {
@@ -532,6 +524,8 @@ export default {
     },
     handleSubmit() {
       var tableData = [];
+
+      this.newConditionBox.push(JSON.parse(JSON.stringify(this.conditionBox)));
       for (let i = 0; i < this.conditionBox.length; i++) {
         for (let j = 0; j < this.conditionBox[i].length; j++) {
           this.conditionBox[i][j].popType = i + 1;
@@ -541,6 +535,7 @@ export default {
         }
         tableData = [...tableData, ...this.conditionBox[i]];
       }
+
       if (!tableData.length) {
         this.$errorMsg("请选择机型");
         return;
@@ -559,7 +554,7 @@ export default {
       };
       addPoliyCondition(params).then((res) => {
         this.$successMsg("添加成功");
-        this.newConditionBox.push(this.conditionBox)
+
         this.conditionBox = [[], []];
         this.conditionBoxs = [];
         this.limit = "";
@@ -584,15 +579,15 @@ export default {
       console.log(this.ids);
     },
     handleDeleteRow(index) {
-        if (this.arrIndex == index && this.ids.length) {
-          var arr=[];
-          for(var i = 0; i < this.conditionBox[index].length; i++){
-                if(this.ids.indexOf(this.conditionBox[index][i].id) == -1){
-                    arr.push(this.conditionBox[index][i]);
-                }
-            }
-        this.conditionBox[index] = []
-        this.$set(this.conditionBox,index,arr)
+      if (this.arrIndex == index && this.ids.length) {
+        var arr = [];
+        for (var i = 0; i < this.conditionBox[index].length; i++) {
+          if (this.ids.indexOf(this.conditionBox[index][i].id) == -1) {
+            arr.push(this.conditionBox[index][i]);
+          }
+        }
+        this.conditionBox[index] = [];
+        this.$set(this.conditionBox, index, arr);
       }
     },
     // 更改每页数量
@@ -623,27 +618,47 @@ export default {
         for (let j = 0; j < this.conditionBox.length; j++) {
           datas = [...datas, ...this.conditionBox[j]];
         }
-
-          console.log(this.newConditionBox);
-          if (this.newConditionBox.length) {
-                 console.log(this.newConditionBox);
-                 this.conditList=[]
-          } else {
-        const newData = datas
-        if (newData.length) {
-          for (let i = 0; i < res.data.records.length; i++) {
-            for (let k = 0; k < newData.length; k++) {
-              if (newData[k].id == res.data.records[i].id) {
-                res.data.records[i].disabled = true;
+        /**
+         * @value newConditionBox 首页保存的所有选中者,即条件1
+         * @value res.data.records,this.conditList 每次点击添加获取的最新数据
+         * @value disabled 添加条件都进行比较上一个条件或者所有条件当中的限定机型和配提机型,
+         * 如:上一个或者所有条件中已经存在disabled
+         */
+        if (this.newConditionBox.length) {
+          this.conditList = res.data.records;
+          for (let j = 0; j < this.newConditionBox.length; j++) {
+            for (let o = 0; o < this.newConditionBox[j].length; o++) {
+              if (o == index) {
+                console.log(this.newConditionBox[j][o], "dier");
+                for (let i = 0; i < res.data.records.length; i++) {
+                  for (let k = 0; k < this.newConditionBox[j][o].length; k++) {
+                    if (
+                      this.newConditionBox[j][o][k].id == res.data.records[i].id
+                    ) {
+                      res.data.records[i].disabled = true;
+                    }
+                  }
+                }
+              } else {
+                this.conditList = res.data.records;
               }
             }
           }
-        }
-        this.conditList = res.data.records;
-        this.listTotal = res.data.total;
+          this.conditList = res.data.records;
+        } else {
+          const newData = datas;
+          if (newData.length) {
+            for (let i = 0; i < res.data.records.length; i++) {
+              for (let k = 0; k < newData.length; k++) {
+                if (newData[k].id == res.data.records[i].id) {
+                  res.data.records[i].disabled = true;
+                }
+              }
+            }
           }
-
-
+          this.conditList = res.data.records;
+          this.listTotal = res.data.total;
+        }
       });
     },
     handleSelectionAllChange(e) {
@@ -674,11 +689,11 @@ export default {
     },
     //去掉相同数据
     resArr(arr1, arr2) {
-      return arr1.filter((v) => arr2.every((val) => val.id!= v.id));
+      return arr1.filter((v) => arr2.every((val) => val.id != v.id));
     },
     handleDelete() {
       if (this.type == 2) {
-        this.conditList2 = this.resArr(this.conditList2,this.rightData)
+        this.conditList2 = this.resArr(this.conditList2, this.rightData);
         this.rightData = [];
       }
     },

+ 20 - 32
src/views/sales_policy/components/AddPolicy.vue

@@ -4,7 +4,7 @@
       <el-header height="50px" class="header">
         <el-page-header
           @back="($parent.isShow = 1), ($parent.isFlag = '')"
-          content="详情页面"
+          content="新增"
         >
         </el-page-header>
       </el-header>
@@ -14,7 +14,7 @@
           <el-divider></el-divider>
           <el-form
             :model="searchForm"
-            :rules="rules"
+
             ref="searchForm"
             label-width="120px"
             size="small"
@@ -22,7 +22,7 @@
           >
             <el-row>
               <el-col :xs="24" :ms="12" :lg="12">
-                <el-form-item label="销售政策编号" prop="code">
+                <el-form-item label="销售政策编号" >
                   <el-input
                     disabled
                     v-model="searchForm.code"
@@ -56,7 +56,7 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :xs="24" :ms="12" :lg="12">
+              <!-- <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="产品品类" prop="mainId">
                   <el-select
                     v-model="searchForm.mainId"
@@ -67,11 +67,11 @@
                     <el-option
                       v-for="item in dictList"
                       :label="item.dictValue"
-                      :value="item.sysDictId"
+                      :value="item.dictCode"
                     ></el-option>
                   </el-select>
                 </el-form-item>
-              </el-col>
+              </el-col> -->
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="生效日期" prop="startTime">
                   <el-date-picker
@@ -103,7 +103,7 @@
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
-                <el-form-item label="政策封面图" prop="imgSrc">
+                <el-form-item label="政策封面图" >
                   <ImageUpload :fileList="fileList" :multiple="false" />
                 </el-form-item>
               </el-col>
@@ -120,7 +120,7 @@
                 </h4>
                 <template>
                   <el-upload
-                    v-show="fang == true"
+
                     class="import-btn"
                     :action="baseURL + 'student/import'"
                     :http-request="handleImport"
@@ -130,13 +130,7 @@
                     <el-button size="small">导入货品价格表</el-button>
                   </el-upload>
                 </template>
-                <el-button
-                  size="small"
-                  class="import-btn"
-                  v-show="fang == false"
-                  @click="handelStop"
-                  >导入货品价格表</el-button
-                >
+
                 <el-button size="small" @click="hanleDownloadFiles"
                   >下载模板</el-button
                 >
@@ -357,12 +351,7 @@ export default {
         type: "",
       },
       listLoading: false,
-      rules: {
-        name: [
-          { required: true, message: "", trigger: "click" },
-          { min: 3, max: 5, message: "", trigger: "click" },
-        ],
-      },
+
       importFileList: [],
       fileList: [],
       options: {},
@@ -493,7 +482,7 @@ export default {
       const formData = new FormData();
       formData.append("file", file);
       formData.append("policyId", this.searchForm.code);
-        formData.append("mainId", this.searchForm.mainId);
+        // formData.append("mainId", this.searchForm.mainId);
       let result = await handleImport("/policy/material/import", formData);
       this.importLoading = false;
       this.importFileList = [];
@@ -537,13 +526,12 @@ export default {
     },
     // 提交审核
     handleAddPolicy(policyCustomers) {
-      if (!this.conditionList.length) {
-           this.$errorMsg("请添加条件信息 ");
-           return
-      }
+      // if (!this.conditionList.length) {
+      //      this.$errorMsg("请添加条件信息 ");
+      //      return
+      // }
       if (policyCustomers.length) {
         var arr = [];
-
         policyCustomers.forEach((el) => {
           arr.push({
             customerId: el.id,
@@ -557,11 +545,11 @@ export default {
             remark: "",
           });
         });
-        this.dictList.forEach((k) => {
-          if (k.sysDictId == this.searchForm.mainId) {
-            this.searchForm.mainName = k.dictValue;
-          }
-        });
+        // this.dictList.forEach((k) => {
+        //   if (k.dictCode == this.searchForm.mainId) {
+        //     this.searchForm.mainName = k.dictValue;
+        //   }
+        // });
         const params = {
           adminCompanyId: "",
           code: "",

+ 775 - 0
src/views/sales_policy/components/EditCondition.vue

@@ -0,0 +1,775 @@
+<template>
+  <el-container>
+    <el-header height="50px" class="header">
+      <el-page-header @back="handleBack" content="编辑"> </el-page-header>
+    </el-header>
+    <div class="line">
+      <el-divider></el-divider>
+      <h4>限定条件</h4>
+      <el-divider></el-divider>
+    </div>
+    <el-main v-if="id">
+      <el-row>
+        <el-row :gutter="50">
+          <el-col
+            :xs="24"
+            :sm="24"
+            :lg="24"
+            class="mgb"
+            v-for="(item, index) in conditionBox"
+            :key="index"
+          >
+            <el-row>
+              <el-row class="pdt">
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="(VisibleModle = true), getMaterialLists(index)"
+                  >添加机型</el-button
+                >
+
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="handleDeleteRow(index)"
+                  >删除机型</el-button
+                >
+              </el-row>
+              <el-row>
+                <el-table
+                  style="width: 100%"
+                  :data="item"
+                  border
+                  @select="hanleSelectAll($event, index)"
+                  @select-all="hanleSelectAll($event, index)"
+                >
+                  <el-table-column type="selection" width="55" align="center">
+                  </el-table-column>
+                  <el-table-column
+                    label="货品名称"
+                    width="300"
+                    align="center"
+                    prop="materialName"
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    prop="specification"
+                    label="规格型号"
+                    align="center"
+                  >
+                  </el-table-column>
+                </el-table>
+              </el-row>
+            </el-row>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-form label-width="120px" :inline="false" size="small">
+            <el-row>
+              <el-form-item label="配置比例设置"> </el-form-item>
+            </el-row>
+            <el-col :xs="24" :sm="8" :lg="8">
+              <el-form-item label="限定机型">
+                <el-input size="small" v-model="limit"></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col
+              :xs="24"
+              :sm="8"
+              :lg="8"
+              v-for="(len, index) in conditionBox.length - 1"
+            >
+              <el-form-item :label="'配提' + (index + 1) + '比例'">
+                <el-input
+                  size="small"
+                  v-model="popArr['line_' + index]"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </el-row>
+        <el-divider></el-divider>
+      </el-row>
+    </el-main>
+    <el-main v-else>
+      <el-row>
+        <el-row :gutter="50">
+          <el-col
+            :xs="24"
+            :sm="24"
+            :lg="24"
+            class="mgb"
+            v-for="(item, index) in conditionBoxs"
+            :key="index"
+          >
+            <el-row>
+              <el-row>
+                <el-table style="width: 100%" :data="item" border>
+                  <el-table-column
+                    type="selection"
+                    width="55"
+                    align="center"
+                    v-if="!id"
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    type="index"
+                    label="序号"
+                    width="55"
+                    align="center"
+                    v-else
+                  >
+                  </el-table-column>
+                  <el-table-column
+                    label="货品名称"
+                    width="300"
+                    align="center"
+                    prop="materialName"
+                  >
+                    <template slot-scope="scope">{{
+                      scope.row.materialName
+                    }}</template>
+                  </el-table-column>
+                  <el-table-column
+                    prop="specification"
+                    label="规格型号"
+                    align="center"
+                  >
+                  </el-table-column>
+                </el-table>
+              </el-row>
+            </el-row>
+          </el-col>
+        </el-row>
+        <el-row v-if="conditionBoxs.length">
+          <el-form label-width="120px" :inline="false" size="small">
+            <el-row>
+              <el-form-item label="配置比例设置"> </el-form-item>
+            </el-row>
+            <el-col :xs="24" :sm="8" :lg="8">
+              <el-form-item label="限定机型">
+                <el-input
+                  size="small"
+                  v-model="limit"
+                  :readonly="!id ? false : true"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col
+              :xs="24"
+              :sm="8"
+              :lg="8"
+              v-for="(len, index) in conditionBoxs.length - 1"
+            >
+              <el-form-item :label="'配提' + (index + 1) + '比例'">
+                <el-input
+                  size="small"
+                  :readonly="!id ? false : true"
+                  v-model="popArr['line_' + index]"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-form>
+          <el-col class="text_rihgt" v-if="false">
+            <el-button type="primary" size="small" @click=""
+              >添加限定条件</el-button
+            ></el-col
+          >
+        </el-row>
+        <el-divider></el-divider>
+      </el-row>
+    </el-main>
+    <el-footer height="100px" v-if="id">
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="12" :offset="0">
+          <el-button type="primary" size="small" @click="handleSubmit"
+            >保存</el-button
+          >
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="12" :offset="0" class="tr">
+          <el-button type="primary" size="small" @click="hanleAddModel"
+            >添加</el-button
+          >
+          <el-button type="primary" size="small" @click="handleresale"
+            >重置</el-button
+          >
+        </el-col>
+      </el-row>
+    </el-footer>
+    <el-dialog :visible.sync="VisibleModle" width="70%" center>
+      <div>
+        <el-container>
+          <el-header height="">
+            <el-form label-width="0" :inline="false" size="small">
+              <el-col :xs="24" :sm="8" :lg="8" :offset="0">
+                <el-form-item label="">
+                  <el-input
+                    v-model="saleTypeCode"
+                    placeholder="类型编号"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </el-header>
+          <el-main height="">
+            <el-row>
+              <el-row :gutter="50">
+                <el-col :xs="10" :ms="10" :lg="10">
+                  <el-row>
+                    <el-row> </el-row>
+                    <el-row>
+                      <el-row class="title"> 可选产品列表 </el-row>
+                      <el-table
+                        style="width: 100%"
+                        :data="conditList"
+                        border
+                        height="400"
+                        @select-all="handleSelectionAllChange"
+                        @selection-change="handleSelectionChange"
+                      >
+                        <el-table-column
+                          type="selection"
+                          width="55"
+                          :selectable="selectable"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          label="产品编码"
+                          prop="materialNumber"
+                          width="120"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="materialName"
+                          label="产品名称"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="specification"
+                          label="产品型号"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="price"
+                          label="产品价格"
+                          align="center"
+                        >
+                        </el-table-column>
+                      </el-table>
+                      <el-row class="mg">
+                        <div>
+                          <el-pagination
+                            @size-change="handleSizeChange"
+                            @current-change="handleCurrentChange"
+                            :current-page="currentPage"
+                            :page-sizes="[10, 20, 30, 50]"
+                            :page-size="10"
+                            layout="total, sizes, prev, pager, next, jumper"
+                            :total="listTotal"
+                          >
+                          </el-pagination>
+                        </div>
+                      </el-row>
+                    </el-row>
+                  </el-row>
+                </el-col>
+                <el-col :xs="4" :ms="4" :lg="4" class="middle">
+                  <el-row :gutter="20" justify="center" align="middle">
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleAllAdd"
+                        :disabled="type == 2"
+                        >全部添加</el-button
+                      >
+                    </el-row>
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleAdd"
+                        :disabled="type == 2"
+                        >增加</el-button
+                      >
+                    </el-row>
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleDelete"
+                        :disabled="type == 1"
+                        >删除</el-button
+                      ></el-row
+                    >
+                    <el-row class="btn"
+                      ><el-button
+                        :disabled="type == 1"
+                        type="primary"
+                        size="small  "
+                        @click="handleAllDelete"
+                        >全部删除</el-button
+                      ></el-row
+                    >
+                  </el-row>
+                </el-col>
+                <el-col :xs="10" :ms="10" :lg="10">
+                  <el-row>
+                    <el-row> </el-row>
+                    <el-row>
+                      <el-row class="title"> 已选产品列表 </el-row>
+                      <el-table
+                        style="width: 100%"
+                        :data="conditList2"
+                        @select-all="handleSelectionAllChange2"
+                        @selection-change="handleSelectionChange2"
+                        border
+                        height="400"
+                      >
+                        <el-table-column
+                          type="selection"
+                          width="55"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          label="产品编码"
+                          prop="materialNumber"
+                          width="120"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="materialName"
+                          label="产品名称"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="specification"
+                          label="产品型号"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          prop="price"
+                          label="产品价格"
+                          align="center"
+                        >
+                        </el-table-column>
+                      </el-table>
+                      <el-row class="mg">
+                        <!-- <Pagination /> -->
+                      </el-row>
+                    </el-row>
+                  </el-row>
+                </el-col>
+              </el-row>
+            </el-row>
+          </el-main>
+        </el-container>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="VisibleModle = false">取 消</el-button>
+        <el-button type="primary" @click="handleDiaSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
+  </el-container>
+</template>
+
+<script>
+import {
+  getId,
+  addPoliyCondition,
+  getConditionMaterialList,
+  getMaterialList,
+  getConditionMaterialDetail,
+} from "@/api/policy_list";
+import TabelTransfer from "./TabelTransfer.vue";
+
+import { mapState } from "vuex";
+import AddModel from "./AddModel";
+import Minxin from "@/mixin";
+
+export default {
+  mixins: [Minxin],
+  props: {
+    id: {
+      type: String,
+      default: "",
+    },
+    policyId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      base: {
+        id: null,
+        policyConditionMaterials: [
+          {
+            id: null,
+            materialId: "",
+            materialName: "",
+            materialNumber: "",
+            policyConditionId: "",
+            policyId: "",
+            policyMaterialId: "",
+            popType: 0,
+            specification: "",
+            walletType: "",
+          },
+        ],
+        policyId: "",
+        policyName: "",
+        pop: "",
+      },
+      limit: "",
+      VisibleModle: false,
+      conditionBox: [[], []],
+      conditionBoxs: [],
+      multipleSelection: [],
+      searchForm: {
+        code: "",
+      },
+      pop: "",
+      conditList: [],
+      leftData: [],
+      rightData: [],
+      conditList2: [],
+      type: "",
+      saleTypeCode: "",
+      arrIndex: 0,
+      popArr: {},
+      fang: false,
+      newConditionBox: [],
+      currentPage: 1,
+    };
+  },
+  created() {
+    this.getCommonApi();
+  },
+  computed: mapState({
+    comCode: (state) => state.sales.code,
+  }),
+  methods: {
+    getList() {},
+    handleBack() {
+      console.log(this.id, this.policyId);
+      this.$parent.isEdit = 1;
+    },
+    /**
+     * 根据条件禁用行复选框
+     * 函数返回值为false则禁用选择(反之亦然)
+     * @param {Object} row - 行数据
+     * @param {String} index - 索引值
+     * @return Boolean
+     */
+    selectable: function (row, index) {
+      // row.disabled == undefined 才能被选中
+      if (row.disabled == undefined) {
+        return true;
+      }
+      // 函数必须有返回值且是布尔值
+      // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
+      // 如果没有返回值则默认返回false(全部无法选中)
+    },
+    async getCommonApi() {
+      if (this.id) {
+        const res = await getConditionMaterialDetail({ id: this.id });
+        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];
+            continue;
+          }
+          this.$set(this.popArr, `line_${i - 1}`, pop[i]);
+        }
+        this.conditionBox = [];
+        for (let k = 0; k < pop.length; k++) {
+          const { data } = await getConditionMaterialList({
+            pageNum: 1,
+            pageSize: -1,
+            policyConditionId: res.data.id,
+            popType: k + 1,
+          });
+
+          this.conditionBox.push(data.records);
+        }
+      }
+    },
+    toggleSelection(rows) {
+      if (rows) {
+        rows.forEach((row) => {
+          this.$refs.multipleTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.multipleTable.clearSelection();
+      }
+    },
+    hanleAddModel() {
+      this.conditionBox.push([]);
+    },
+    handleSubmit() {
+      var tableData = [];
+
+      this.newConditionBox.push(JSON.parse(JSON.stringify(this.conditionBox)));
+      for (let i = 0; i < this.conditionBox.length; i++) {
+        for (let j = 0; j < this.conditionBox[i].length; j++) {
+          this.conditionBox[i][j].popType = i + 1;
+          this.conditionBox[i][j].policyId = this.policyId;
+
+          //  this.conditionBox[i][j].policyMaterialId =this.conditionBox[i][j].materialId
+        }
+        tableData = [...tableData, ...this.conditionBox[i]];
+      }
+
+      if (!tableData.length) {
+        this.$errorMsg("请选择机型");
+        return;
+      }
+      var pop = [this.limit];
+      for (const key in this.popArr) {
+        pop.push(this.popArr[key]);
+      }
+      console.log(pop.join(":"));
+      const params = {
+        id: this.id,
+        policyConditionMaterials: tableData,
+        policyId: this.policyId,
+        policyName: "",
+        pop: pop.join(":"),
+      };
+      addPoliyCondition(params).then((res) => {
+        this.$successMsg("添加成功");
+        this.conditionBox = [[], []];
+        this.conditionBoxs = [];
+        this.limit = "";
+        this.pop = "";
+        this.popArr = {};
+        this.$parent.isCondition = 0;
+        this.$parent.isEdit = 1;
+        // Object.assign(this.$data, this.$options.data());
+        // this.$emit("handleSubmitCon", this.policyId);
+      });
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 筛选全部数据
+    hanleSelectAll(selection, index) {
+      this.arrIndex = index;
+      this.ids = selection.map((k) => {
+        return k.id;
+      });
+      console.log(this.ids);
+    },
+    handleDeleteRow(index) {
+      if (this.arrIndex == index && this.ids.length) {
+        var arr = [];
+        for (var i = 0; i < this.conditionBox[index].length; i++) {
+          if (this.ids.indexOf(this.conditionBox[index][i].id) == -1) {
+            arr.push(this.conditionBox[index][i]);
+          }
+        }
+        this.conditionBox[index] = [];
+        this.$set(this.conditionBox, index, arr);
+      }
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getMaterialLists(this.arrIndex);
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getMaterialLists(this.arrIndex);
+    },
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      this.currentPage = val;
+      this.getMaterialLists(this.arrIndex);
+    },
+    getMaterialLists(index) {
+      this.arrIndex = index;
+      getMaterialList({
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        saleTypeCode: this.saleTypeCode,
+        policyId: this.policyId,
+      }).then((res) => {
+        let datas = [];
+        for (let j = 0; j < this.conditionBox.length; j++) {
+          datas = [...datas, ...this.conditionBox[j]];
+        }
+        /**
+         * @value newConditionBox 首页保存的所有选中者,即条件1
+         * @value res.data.records,this.conditList 每次点击添加获取的最新数据
+         * @value disabled 添加条件都进行比较上一个条件或者所有条件当中的限定机型和配提机型,
+         * 如:上一个或者所有条件中已经存在disabled
+         */
+        if (this.newConditionBox.length) {
+          this.conditList = res.data.records;
+          for (let j = 0; j < this.newConditionBox.length; j++) {
+            for (let o = 0; o < this.newConditionBox[j].length; o++) {
+              if (o == index) {
+                console.log(this.newConditionBox[j][o], "dier");
+                for (let i = 0; i < res.data.records.length; i++) {
+                  for (let k = 0; k < this.newConditionBox[j][o].length; k++) {
+                    if (
+                      this.newConditionBox[j][o][k].id == res.data.records[i].id
+                    ) {
+                      res.data.records[i].disabled = true;
+                    }
+                  }
+                }
+              } else {
+                this.conditList = res.data.records;
+              }
+            }
+          }
+          this.conditList = res.data.records;
+        } else {
+          const newData = datas;
+          if (newData.length) {
+            for (let j = 0; j < res.data.records.length; j++) {
+              for (let i = 0; i < this.conditionBox[index].length; i++) {
+                if (
+                  this.conditionBox[index][i].policyMaterialId ==
+                  res.data.records[j].id
+                ) {
+
+                  res.data.records[j].disabled = true;
+                }
+              }
+            }
+          }
+          this.conditList = res.data.records;
+          this.listTotal = res.data.total;
+        }
+      });
+    },
+    handleSelectionAllChange(e) {
+      this.leftData = e;
+      this.type = 1;
+    },
+    handleSelectionChange(e) {
+      this.leftData = e;
+      this.type = 1;
+    },
+    handleSelectionAllChange2(e) {
+      this.rightData = e;
+      this.type = 2;
+    },
+    handleSelectionChange2(e) {
+      this.rightData = e;
+      this.type = 2;
+    },
+    handleAllAdd() {
+      this.conditList2 = this.leftData;
+      this.leftData = [];
+    },
+    handleAllDelete() {
+      this.conditList2 = [];
+    },
+    handleAdd() {
+      this.conditList2 = this.leftData;
+    },
+    //去掉相同数据
+    resArr(arr1, arr2) {
+      return arr1.filter((v) => arr2.every((val) => val.id != v.id));
+    },
+    handleDelete() {
+      if (this.type == 2) {
+        this.conditList2 = this.resArr(this.conditList2, this.rightData);
+        this.rightData = [];
+      }
+    },
+    handleDiaSubmit() {
+      if (this.conditList2.length) {
+        for (let i = 0; i < this.conditionBox.length; i++) {
+          if (i == this.arrIndex) {
+            this.$set(this.conditionBox, i, [
+              ...this.conditList2,
+              ...this.conditionBox[i],
+            ]);
+          }
+        }
+        this.VisibleModle = false;
+        this.conditList2 = [];
+      } else {
+        this.$errorMsg("请选择内容");
+      }
+    },
+    handleresale() {
+      Object.assign(this.$data, this.$options.data());
+    },
+  },
+  components: {
+    AddModel,
+    TabelTransfer,
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.line {
+  margin: 0 20px;
+}
+.mgb {
+  margin-bottom: 20px;
+}
+.pdt {
+  padding-bottom: 20px;
+}
+.text_rihgt {
+  text-align: right;
+}
+.header {
+  margin-bottom: 40px;
+}
+.el-main {
+  overflow: hidden;
+}
+.btn {
+  margin: 20px 0;
+  text-align: center;
+}
+.query_btn {
+  margin-left: 0;
+}
+.mg {
+  margin: 20px;
+}
+.pdt {
+  margin: 20px 0;
+}
+.el-main {
+  overflow: hidden;
+}
+.middle {
+  height: 430px;
+  display: flex;
+  align-content: center;
+  justify-content: center;
+  align-items: center;
+}
+.title {
+  padding: 10px 0;
+  text-align: center;
+  border-left: 1px solid #ebeef5;
+  border-right: 1px solid #ebeef5;
+  border-top: 1px solid #ebeef5;
+}
+</style>

Разница между файлами не показана из-за своего большого размера
+ 785 - 261
src/views/sales_policy/components/Examine.vue


+ 10 - 11
src/views/sales_policy/policy_list.vue

@@ -133,7 +133,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :ms="6" :lg="6"> </el-col>
-            <el-col :xs="24" :ms="6" :lg="6" class="tr">
+            <el-col :xs="24" :ms="6" :lg="12" class="tr">
               <el-form-item>
                 <el-button type="primary" size="small" @click="submitScreenForm"
                   >查询</el-button
@@ -161,15 +161,16 @@
     </div>
     <div class="mymain-container">
       <el-table :data="dataList" border style="width: 100%">
-        <el-table-column fixed="left" label="操作" width="250" align="center">
+        <el-table-column fixed="left" label="操作" min-width="150" align="center">
           <template slot-scope="scope">
-            <!-- <el-button
+            <el-button
               type="text"
               size="small"
+              v-if=" scope.row.examineStatus == 'SAVE'"
               @click="(isShow = 5), (id = scope.row.id)"
               >编辑</el-button
 
-            > -->
+            >
             <el-button
               type="text"
               size="small"
@@ -217,13 +218,13 @@
             </el-popconfirm>
           </template>
         </el-table-column>
-        <!-- <el-table-column label="状态" width="120" align="center">
+        <el-table-column label="状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.status == '1'">已生效</el-tag>
             <el-tag v-else-if="scope.row.status == '0'">未生效 </el-tag>
           </template>
-        </el-table-column> -->
-        <el-table-column label="状态" width="120" align="center">
+        </el-table-column>
+        <el-table-column label="审核状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.examineStatus == 'SAVE'">保存</el-tag>
             <el-tag v-else-if="scope.row.examineStatus == 'WAIT'"
@@ -247,11 +248,11 @@
           align="center"
         >
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           prop="mainName"
           label="产品品类"
           align="center"
-        ></el-table-column>
+        ></el-table-column> -->
         <el-table-column
           prop="remark"
           label="表头备注"
@@ -301,9 +302,7 @@
     </div>
   </div>
   <AddPolicy v-else-if="isShow == 2" />
-
   <AddCondition v-else-if="isShow == 10" :id="id" :policyId="policyId" />
-
   <Examine v-else />
 </template>
 

+ 15 - 19
src/views/sales_rebate/rebate_list.vue

@@ -190,9 +190,9 @@
               :readonly="true"
             ></el-input>
           </el-form-item>
-          <el-form-item label="产品使用品类" prop="mainName">
+          <!-- <el-form-item label="产品使用品类" prop="mainName">
             <el-input v-model="dialogForm.mainName" :readonly="true"></el-input>
-          </el-form-item>
+          </el-form-item> -->
 
           <el-form-item label="返利折扣比例" prop="rebateRate">
 
@@ -272,11 +272,7 @@ export default {
           lable: "销售类型名称",
           widht: 160,
         },
-        {
-          prop: "mainName",
-          lable: "产品大类",
-          widht: 160,
-        },
+
         {
           prop: "name",
           lable: "返利类型",
@@ -372,8 +368,8 @@ export default {
       this.typeList.find((k) => {
         if (e == k.saleCode) {
           this.dialogForm.saleTypeName = k.saleName;
-          this.dialogForm.mainId = k.mainId;
-          this.dialogForm.mainName = k.mainName;
+          // this.dialogForm.mainId = k.mainId;
+          // this.dialogForm.mainName = k.mainName;
         }
       });
     },
@@ -400,8 +396,8 @@ export default {
       console.log(item);
       this.dialogForm = {
         adminCompanyId: item.adminCompanyId,
-        mainId: item.mainId,
-        mainName: item.mainName,
+        mainId: '',
+        mainName:'',
         name: item.name,
         rebateRate: item.rebateRate,
         rabateSort: item.rabateSort,
@@ -449,7 +445,7 @@ export default {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
           if (this.type) {
-            this.hanleScreen(this.dialogForm.mainId);
+            // this.hanleScreen(this.dialogForm.mainId);
             const params = {
               ...this.dialogForm,
             };
@@ -492,13 +488,13 @@ export default {
       this.dialogVisible = false;
     },
     hanleScreen(code) {
-      this.dictListData.find((k) => {
-        if (k.dictCode == code) {
-          this.dialogForm.mainId = k.dictCode;
-          this.dialogForm.mainName = k.dictValue;
-          return;
-        }
-      });
+      // this.dictListData.find((k) => {
+      //   if (k.dictCode == code) {
+      //     this.dialogForm.mainId = k.dictCode;
+      //     this.dialogForm.mainName = k.dictValue;
+      //     return;
+      //   }
+      // });
     },
   },
   components: {

+ 5 - 11
src/views/sales_rebate/salestype_list.vue

@@ -166,7 +166,7 @@
           <el-form-item label="销售类型名称" prop="saleName">
             <el-input v-model="dialogForm.saleName"></el-input>
           </el-form-item>
-          <el-form-item label="产品大类" prop="mainId">
+          <!-- <el-form-item label="产品大类" prop="mainId">
             <el-select v-model="dialogForm.mainId" @change="handleChange">
               <el-option
                 v-for="(item, index) in productList"
@@ -177,8 +177,8 @@
               </el-option>
             </el-select>
 
-            <!-- <el-input v-model="dialogForm.mainName"></el-input> -->
-          </el-form-item>
+            <el-input v-model="dialogForm.mainName"></el-input> -->
+          <!-- </el-form-item>  -->
           <el-form-item label="状态" prop="status">
             <el-switch
               v-model="dialogForm.status"
@@ -251,11 +251,7 @@ export default {
           widht: 160,
         },
 
-        {
-          prop: "mainName",
-          lable: "产品大类",
-          widht: 160,
-        },
+
         {
           prop: "status",
           lable: "状态",
@@ -303,9 +299,7 @@ export default {
         saleName: [
           { required: true, message: "请输入销售类型名称", trigger: "blur" },
         ],
-        mainName: [
-          { required: true, message: "请输入品类名称", trigger: "blur" },
-        ],
+
       },
       productList: [],
     };

+ 3 - 3
src/views/setting/role.vue

@@ -328,8 +328,8 @@ export default {
 }
 </script>
 
-<style lang="scss">
-  .tree-dialog {
+<style lang="scss" scoped>
+  ::v-deep .tree-dialog {
     .el-dialog__body {
       padding: 20px;
       .el-tree {
@@ -345,7 +345,7 @@ export default {
       }
     }
   }
-  .custom-tree-node {
+  ::v-deep .custom-tree-node {
     flex: 1;
     display: flex;
     align-items: center;

+ 1 - 16
src/views/supply/apply/components/apply_detail.vue

@@ -84,12 +84,6 @@
       <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -124,7 +118,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -163,15 +157,6 @@ export default {
   },
 
   computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
     },

+ 2 - 64
src/views/supply/apply/components/apply_examine.vue

@@ -76,14 +76,6 @@
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.stockIds" placeholder="请选择发货仓库" size="small" multiple filterable @change="changeWarehouse(scope.$index)">
-              <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -129,7 +121,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
         <el-popconfirm
           title="确定关闭吗?"
@@ -145,7 +137,7 @@
 </template>
 
 <script>
-import { getApplyDetail, examineApply, getPositionList, checkStock } from "@/api/supply/apply";
+import { getApplyDetail, examineApply } from "@/api/supply/apply";
 
 export default {
   name: 'ApplyExamine',
@@ -176,22 +168,9 @@ export default {
         status: true,
         remark: '',
       },
-      positionList: [],
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },
@@ -209,41 +188,12 @@ export default {
 
         res.data.orders.forEach((item, index) => {
           item.approvalNumber = item.invoiceNum;
-          if(item.stockIds && item.stockIds.length > 0) {
-            item.stockIds = item.stockIds.map((it, idx) => {
-              return it.id;
-            });
-          }
         });
 
         this.goodsList = res.data.orders;
-        this.getPositionList();
-      })
-    },
-
-    // 获取仓位列表
-    getPositionList() {
-      getPositionList({
-        correspondId: this.detailData.correspondId
-      }).then((res) => {
-        this.positionList = res.data;
       })
     },
 
-    // 修改仓位
-    changeWarehouse(index) {
-      if(this.goodsList[index].stockIds && this.goodsList[index].stockIds.length > 0) {
-        checkStock({
-          materialId: this.goodsList[index].materialId,
-          StockIds: this.goodsList[index].stockIds.join(',')
-        }).then(res => {
-          this.goodsList[index].stockNumber = res.data;
-        })
-      }else {
-        this.goodsList[index].stockNumber = 0;
-      }
-    },
-
     // 检查文件类型
     checkFileType(url) {
       if(!url) return '';
@@ -274,18 +224,6 @@ export default {
     // 提交审批
     clickSubmitForm() {
       for(let i=0; i<this.goodsList.length; i++) {
-        if(this.goodsList[i].stockIds && this.goodsList[i].stockIds.length < 1) {
-          this.$errorMsg('请选择发货仓库');
-          return;
-        }
-        if(this.goodsList[i].stockNumber < 1) {
-          this.$errorMsg('库存不足');
-          return;
-        }
-        if(this.goodsList[i].approvalNumber > this.goodsList[i].stockNumber) {
-          this.$errorMsg('审批数量不可大于库存数');
-          return;
-        }
         if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
           this.$errorMsg('审批数量不可大于申请数量');
           return;

+ 2 - 59
src/views/supply/apply/components/engin_examine.vue

@@ -120,14 +120,6 @@
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.stockIds" placeholder="请选择发货仓库" size="small" multiple filterable @change="changeWarehouse(scope.$index)">
-              <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="销售订单号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
@@ -170,7 +162,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
         <el-button type="warning" @click="clickSubmitForm('FAIL')">审批驳回</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
@@ -183,7 +175,7 @@
 </template>
 
 <script>
-import { getEnginDetail, examineEngin, getPositionList, checkStock } from "@/api/supply/apply";
+import { getEnginDetail, examineEngin } from "@/api/supply/apply";
 
 export default {
   name: 'EnginExamine',
@@ -218,22 +210,9 @@ export default {
       examineForm: {
         remark: '',
       },
-      positionList: [],
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },
@@ -265,42 +244,10 @@ export default {
       getEnginDetail({id: this.listItem.id}).then(res => {
         this.detailData = res.data;
 
-        res.data.orders.forEach((item, index) => {
-          if(item.stockIds && item.stockIds.length > 0) {
-            item.stockIds = item.stockIds.map((it, idx) => {
-              return it.id;
-            });
-          }
-        });
-
         this.goodsList = res.data.orders;
-        this.getPositionList();
       })
     },
 
-    // 获取仓位列表
-    getPositionList() {
-      getPositionList({
-        correspondId: this.detailData.correspondId
-      }).then((res) => {
-        this.positionList = res.data;
-      })
-    },
-
-    // 修改仓位
-    changeWarehouse(index) {
-      if(this.goodsList[index].stockIds && this.goodsList[index].stockIds.length > 0) {
-        checkStock({
-          materialId: this.goodsList[index].materialId,
-          StockIds: this.goodsList[index].stockIds.join(',')
-        }).then(res => {
-          this.goodsList[index].stockNumber = res.data;
-        })
-      }else {
-        this.goodsList[index].stockNumber = 0;
-      }
-    },
-
     // 检查文件类型
     checkFileType(url) {
       if(!url) return '';
@@ -335,10 +282,6 @@ export default {
           this.$errorMsg('请填写审批数量');
           return;
         }
-        if(this.goodsList[i].approvalNumber > this.goodsList[i].stockNumber) {
-          this.$errorMsg('审批数量不可大于库存数');
-          return;
-        }
         if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
           this.$errorMsg('审批数量不可大于申请数量');
           return;

+ 1 - 18
src/views/supply/deliver/components/commerce_detail.vue

@@ -114,11 +114,6 @@
         <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
@@ -142,7 +137,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -195,18 +190,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 0 - 5
src/views/supply/deliver/components/deliver_detail.vue

@@ -114,11 +114,6 @@
         <el-table :data="detailData.shipDocumentOrders" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>

+ 1 - 18
src/views/supply/deliver/components/home_detail.vue

@@ -114,11 +114,6 @@
         <el-table :data="detailData.shipDocumentOrders" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
           <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -143,7 +138,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -200,18 +195,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 39 - 4
src/views/supply/engin/commerce_list.vue

@@ -91,9 +91,16 @@
               </template>
             </el-table-column>
             <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>
+                  <span>{{scope.row.orderDate | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.enginOrderType | typeFilter}}
@@ -101,7 +108,7 @@
             </el-table-column>
             <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="货品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
@@ -156,6 +163,8 @@
         </div>
       </div>
     </div>
+
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
     
     <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -166,11 +175,12 @@
 </template>
 
 <script>
-import { getOrderList, applyCom, withdrawCom, deleteCom } from "@/api/supply/engin";
+import { getOrderList, applyCom, withdrawCom, deleteCom, editCom } from "@/api/supply/engin";
 import CommerceDetail from "@/views/supply/engin/components/commerce_detail";
 import CommerceForm from "@/views/supply/engin/components/commerce_form";
 import CommerceExamine from "@/views/supply/engin/components/commerce_examine";
 import CommerceReturn from "@/views/supply/engin/components/commerce_return";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
 let that
 export default {
@@ -179,6 +189,7 @@ export default {
     CommerceForm,
     CommerceExamine,
     CommerceReturn,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -226,6 +237,12 @@ export default {
       isShowForm: false,
       isShowExamine: false,
       isShowReturn: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -394,6 +411,24 @@ export default {
       this.multipleSelection = val;
     },
 
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.parentId;
+      this.dateForm.date = item.orderDate.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
+
+    // 提交 修改订单日期
+    submitDateForm() {
+      editCom({
+        enginOrderId: this.editId,
+        orderDate: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
 
   }
 }

+ 4 - 3
src/views/supply/engin/components/commerce_form.vue

@@ -17,10 +17,11 @@
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -361,7 +362,7 @@ export default {
         fileNum: '',
       },
       mainFormRules: {
-        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
         jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
         jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
         enginNum: [{ required: true, message: '请输入工程登录编号', trigger: 'blur' }],
@@ -678,7 +679,7 @@ export default {
 
           let params = {
             enginOrderId: this.mainForm.orderNum,
-            orderDate: this.mainForm.orderDate,
+            // orderDate: this.mainForm.orderDate,
             mainId: this.mainForm.type || '',
             refEnginRecordNo: this.mainForm.enginNum || '',
             refFactoryNo: this.mainForm.factoryNum || '',

+ 5 - 4
src/views/supply/engin/components/engin_form.vue

@@ -6,7 +6,7 @@
       <div class="title">工程信息单</div>
     </div>
 
-    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px" size="small" label-position="left">
+    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px" size="small" label-position="right">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程信息单" prop="orderNum">
@@ -17,10 +17,11 @@
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -239,7 +240,7 @@ export default {
         contractDate: '',
       },
       mainFormRules: {
-        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
         jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
         enginName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
         jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
@@ -415,7 +416,7 @@ export default {
           }
 
           let params = {
-            orderDate: this.mainForm.orderDate + ' 00:00:00',
+            // orderDate: this.mainForm.orderDate + ' 00:00:00',
             mainId: this.mainForm.mainId,
             projectName: this.mainForm.enginName,
             orderType: this.mainForm.orderType,

+ 4 - 3
src/views/supply/engin/components/home_form.vue

@@ -17,10 +17,11 @@
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -369,7 +370,7 @@ export default {
         loginUserId: ''
       },
       mainFormRules: {
-        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
         jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
         jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
         loginNum: [{ required: true, message: '请输入工程登录编号', trigger: 'blur' }],
@@ -712,7 +713,7 @@ export default {
           let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
           let params = {
             enginOrderId: this.mainForm.orderNum,
-            orderDate: this.mainForm.orderDate,
+            // orderDate: this.mainForm.orderDate,
             mainId: this.mainForm.type || '',
             loginUserId: this.mainForm.loginUserId,
             refEnginRecordNo: this.mainForm.loginNum || '',

+ 39 - 3
src/views/supply/engin/engin_list.vue

@@ -89,7 +89,14 @@
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
             <el-table-column align="center" label="工程信息单" prop="enginInfoNo" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>
+                  <span>{{scope.row.orderDate | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -142,6 +149,8 @@
         </div>
       </div>
     </div>
+    
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
 
     <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -151,10 +160,11 @@
 </template>
 
 <script>
-import { getEnginList, applyEngin, withdrawEngin, deleteEngin } from "@/api/supply/engin";
+import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editEngin } from "@/api/supply/engin";
 import EnginDetail from "@/views/supply/engin/components/engin_detail";
 import EnginForm from "@/views/supply/engin/components/engin_form";
 import EnginExamine from "@/views/supply/engin/components/engin_examine";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
 let that
 export default {
@@ -162,6 +172,7 @@ export default {
     EnginDetail,
     EnginForm,
     EnginExamine,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -200,6 +211,12 @@ export default {
       isShowDetail: false,
       isShowForm: false,
       isShowExamine: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -329,7 +346,26 @@ export default {
         this.$successMsg();
         this.getList();
       })
-    }
+    },
+
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.enginInfoId;
+      this.dateForm.date = item.orderDate.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
+
+    // 提交 修改订单日期
+    submitDateForm() {
+      editEngin({
+        enginInfoId: this.editId,
+        orderDate: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
   }
 }
 </script>

+ 39 - 4
src/views/supply/engin/home_list.vue

@@ -91,8 +91,15 @@
               </template>
             </el-table-column>
             <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>
+                  <span>{{scope.row.orderDate | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
@@ -101,7 +108,7 @@
             </el-table-column>
             <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="货品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
@@ -156,6 +163,8 @@
         </div>
       </div>
     </div>
+
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
     
     <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <HomeForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -166,11 +175,12 @@
 </template>
 
 <script>
-import { getOrderList, applyHome, withdrawHome, deleteHome } from "@/api/supply/engin";
+import { getOrderList, applyHome, withdrawHome, deleteHome, editHome } from "@/api/supply/engin";
 import HomeDetail from "@/views/supply/engin/components/home_detail";
 import HomeForm from "@/views/supply/engin/components/home_form";
 import HomeExamine from "@/views/supply/engin/components/home_examine";
 import HomeReturn from "@/views/supply/engin/components/home_return";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
 let that
 export default {
@@ -179,6 +189,7 @@ export default {
     HomeForm,
     HomeExamine,
     HomeReturn,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -226,6 +237,12 @@ export default {
       isShowForm: false,
       isShowExamine: false,
       isShowReturn: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -387,7 +404,25 @@ export default {
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
+    
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.parentId;
+      this.dateForm.date = item.orderDate.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
 
+    // 提交 修改订单日期
+    submitDateForm() {
+      editHome({
+        enginOrderId: this.editId,
+        orderDate: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
 
   }
 }

+ 1 - 1
src/views/supply/implement/implement_list.vue

@@ -83,7 +83,7 @@
             <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单未发货数量" prop="refundableQty" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>

+ 3 - 1
src/views/supply/policy/components/retail_examine.vue

@@ -18,7 +18,7 @@
              <el-date-picker
             v-model="detailData.theTime"
             type="datetime"
-            value-format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
             style="width: 100%"
             placeholder="选择日期"
           >
@@ -298,6 +298,7 @@ export default {
       mainForm: {
         status: true,
         remark: "",
+        theTime:''
       },
     };
   },
@@ -338,6 +339,7 @@ export default {
         id: this.listItem.id,
         examineStatus: this.mainForm.status ? "OK" : "FAIL",
         examineRemark: this.mainForm.remark,
+        theTime:this.detailData.theTime
       })
         .then((res) => {
           this.$successMsg("审批成功");

+ 200 - 114
src/views/supply/policy/components/retail_form2.vue

@@ -12,7 +12,7 @@
     <el-form
       ref="mainForm"
       :model="mainForm"
-      :rules="mainFormRules"
+
       label-width="120px"
       size="small"
       label-position="right"
@@ -53,7 +53,7 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
+        <!-- <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="产品大类" prop="type">
             <el-select
               v-model="mainForm.type"
@@ -68,8 +68,8 @@
               ></el-option>
             </el-select>
           </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="16" :lg="16">
+        </el-col> -->
+        <el-col :xs="24" :sm="8" :lg="8">
           <el-form-item label="备注" prop="remark">
             <el-input
               v-model="mainForm.remark"
@@ -199,7 +199,7 @@
               size="small"
               @change="changeWallet(scope.$index)"
             >
-              <el-option label="全部" value=""></el-option>
+
               <el-option
                 v-for="item in scope.row.rebateWallets"
                 :key="item.customerWalletId"
@@ -253,7 +253,7 @@
               placeholder="选择现金钱包"
               size="small"
             >
-              <el-option label="全部" value=""></el-option>
+
               <el-option
                 v-for="item in scope.row.wallets"
                 :key="item.customerWalletId"
@@ -350,11 +350,11 @@
         </el-table-column>
         <el-table-column align="center" label="操作" width="100" fixed="right">
           <template slot-scope="scope">
-            <el-button
+            <!-- <el-button
               type="text"
               @click="(dialogVisible = true), (cid = scope.row.id)"
               >修改</el-button
-            >
+            > -->
             <el-button type="text" @click="deleteItem(scope.$index)"
               >删除</el-button
             >
@@ -368,7 +368,7 @@
           <el-date-picker
             v-model="mainForm.date"
             type="datetime"
-            value-format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
             style="width: 100%"
             placeholder="选择日期"
           >
@@ -455,7 +455,7 @@
                   placeholder="选择销售类型"
                   style="width: 100%"
                 >
-                  <el-option label="全部" value=""></el-option>
+
                   <el-option
                     v-for="item in ztypeList"
                     :key="item.id"
@@ -476,93 +476,172 @@
             </el-col>
           </el-row>
         </el-form>
-        <el-row :gutter="20" style="margin: 10px 0">
-          {{ cusIndex > 0 ? "选择配提机型" : "选择限定机型" }}
-          {{ "(" + pop + ")" }}
-        </el-row>
-        <el-table
-          v-loading="listLoading"
-          :data="popDataArr[cusIndex]"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          @select-all="handleSelectionChange"
-          @selection-change="handleSelectionChange"
-          stripe
-        >
-          <el-table-column
-            align="center"
-            type="selection"
-            :selectable="selectable"
-            width="55"
+        <template v-if="!dataList.length">
+          <el-row :gutter="20" style="margin: 10px 0">
+            {{ cusIndex > 0 ? "选择配提机型" : "选择限定机型" }}
+            {{ "(" + pop + ")" }}
+          </el-row>
+          <el-table
+            v-loading="listLoading"
+            :data="popDataArr[cusIndex]"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            @select-all="handleSelectionChange"
+            @selection-change="handleSelectionChange"
+            stripe
           >
-          </el-table-column>
-          <template v-for="col in columns">
             <el-table-column
-              v-if="col.num"
               align="center"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
+              type="selection"
+              :selectable="selectable"
+              width="55"
             >
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.qty" size="small"></el-input>
-              </template>
             </el-table-column>
-            <el-table-column
-              v-else-if="col.jie"
-              align="center"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
+            <template v-for="col in columns">
+              <el-table-column
+                v-if="col.num"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-input v-model="scope.row.qty" size="small"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else-if="col.jie"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.qty * scope.row.price || 0 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+            </template>
+          </el-table>
+          <div style="margin: 10px 0">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
             >
-              <template slot-scope="scope">
-                {{ scope.row.qty * scope.row.price || 0 }}
-              </template>
-            </el-table-column>
-            <el-table-column
-              v-else
+            </el-pagination>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" v-if="cusIndex > 0" @click="handleShang"
+              >上一步</el-button
+            >
+            <el-button
+              type="primary"
+              @click="handleCondition"
+              v-if="popArr.length != cusIndex + 1"
+              >下一步</el-button
+            >
+            <el-button
+              type="primary"
+              @click="hanlePopData"
+              v-if="popArr.length == cusIndex + 1"
+              >完成</el-button
+            >
+          </span>
+        </template>
+        <template v-else>
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+              @select-all="handleSelectionChange"
+            @selection-change="handleSelectionChange"
+            stripe
+          >
+              <el-table-column
               align="center"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
+              type="selection"
+              :selectable="selectable"
+              width="55"
             >
             </el-table-column>
-          </template>
-        </el-table>
-        <div style="margin: 10px 0">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-          >
-          </el-pagination>
-        </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button type="primary" v-if="cusIndex > 0" @click="handleShang"
-            >上一步</el-button
-          >
-          <el-button
-            type="primary"
-            @click="handleCondition"
-            v-if="popArr.length != cusIndex + 1"
-            >下一步</el-button
-          >
-          <el-button
-            type="primary"
-            @click="hanlePopData"
-            v-if="popArr.length == cusIndex + 1"
-            >完成</el-button
-          >
-        </span>
+            <template v-for="col in columns">
+              <el-table-column
+                v-if="col.num"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-input v-model="scope.row.qty" size="small"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else-if="col.jie"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.qty * scope.row.price || 0 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+            </template>
+          </el-table>
+          <div style="margin: 10px 0">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
+            >
+            </el-pagination>
+          </div>
+            <span slot="footer" class="dialog-footer">
+
+            <el-button
+              type="primary"
+              @click="hanlePopData"
+
+              >完成</el-button
+            >
+          </span>
+        </template>
       </template>
     </el-dialog>
   </div>
@@ -584,6 +663,7 @@ import {
   getConditionList,
   getConditionDetail,
   getpolicyTypeList,
+  getMaterialTypeList ,
   getPolicyConditionList,
 } from "@/api/supply/policy";
 import { getDictList } from "@/api/common";
@@ -625,9 +705,9 @@ export default {
         policyRemark: "",
         policyId: "",
       },
-      mainFormRules: {
-        type: [{ required: true, message: "请选择品类", trigger: "change" }],
-      },
+      // mainFormRules: {
+      //   type: [{ required: true, message: "请选择品类", trigger: "change" }],
+      // },
       goodsList: [],
       warehouseList: [],
       warehouseValue: "",
@@ -774,20 +854,21 @@ export default {
       });
     },
     hendleEdit(val, index) {
-      let params = {
-        id: this.cid,
-        theTime: this.mainForm.date,
-        mainId: this.mainForm.type,
-        mainName: this.mainForm.mainName,
-        remark: this.mainForm.remark,
-        type: 2,
-        retailOrderItemList: this.goodsList,
-        policyId: this.policyId,
-      };
-      editData(params).then((res) => {
-        this.$successMsg("编辑成功");
-        this.getDetail();
-      });
+      this.dialogVisible = false
+      // let params = {
+      //   id: this.cid,
+      //   theTime: this.mainForm.date,
+      //   mainId: this.mainForm.type,
+      //   mainName: this.mainForm.mainName,
+      //   remark: this.mainForm.remark,
+      //   type: 2,
+      //   retailOrderItemList: this.goodsList,
+      //   policyId: this.policyId,
+      // };
+      // editData(params).then((res) => {
+      //   this.$successMsg("编辑成功");
+      //   this.getDetail();
+      // });
     },
     //获取条件相对应的比列
     handleFactor(e) {
@@ -806,7 +887,7 @@ export default {
       if (this.screenForm.factorId) {
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
       } else {
-        this.$errorMsg("必须要条件");
+        this.getMaterialTypeList();
       }
     },
     // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
@@ -982,7 +1063,14 @@ export default {
         pageSize: 10,
         policyId: this.screenForm.policyId,
         saleTypeCode: this.screenForm.saleTypeCode,
-      }).then((res) => {});
+      }).then((res) => {
+          for (let i = 0; i < res.data.records.length; i++) {
+          res.data.records[i].qty = 1;
+        }
+        this.dataList = res.data.records;
+        this.total = res.data.total;
+        console.log(this.dataList, "kkkk");
+      });
     },
 
     handleShow() {
@@ -996,7 +1084,6 @@ export default {
         type: "COMMONLY",
       }).then((res) => {
         this.xjWalletList = res.data;
-        console.log(res.data, "xxxxx");
       });
 
       getWalletList({
@@ -1004,7 +1091,6 @@ export default {
         type: "REBATE",
       }).then((res) => {
         this.flWalletList = res.data;
-        console.log(this.flWalletList, "xxccc");
       });
     },
 
@@ -1223,14 +1309,14 @@ export default {
     clickSubmitForm() {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
-          let mainName =
-            this.typeList[
-              findElem(this.typeList, "dictCode", this.mainForm.type)
-            ].dictValue;
+          // let mainName =
+          //   this.typeList[
+          //     findElem(this.typeList, "dictCode", this.mainForm.type)
+          //   ].dictValue;
           let params = {
             theTime: this.mainForm.date,
             mainId: this.mainForm.type,
-            mainName,
+            mainName:'',
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,

+ 34 - 6
src/views/supply/policy/policy_list.vue

@@ -66,6 +66,14 @@
               <el-form-item label="订单日期" prop="date">
                 <el-date-picker
                   v-model="screenForm.date"
+                  class="dateStyle"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择订单日期"
+                >
+                </el-date-picker>
+                <!-- <el-date-picker
+                  v-model="screenForm.date"
                   type="datetimerange"
                   range-separator="至"
                   style="width: 100%"
@@ -73,7 +81,7 @@
                   start-placeholder="开始日期"
                   end-placeholder="结束日期"
                 >
-                </el-date-picker>
+                </el-date-picker> -->
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -351,19 +359,28 @@
                   <el-button slot="reference" type="text">提审</el-button>
                 </el-popconfirm>
                 <el-button
-                  v-if="scope.row.examineStatus == 'WAIT'&&$checkBtnRole('examine', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus == 'WAIT' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
                   type="text"
                   @click="toExamine(scope.row)"
                   >审核</el-button
                 >
                 <el-button
                   type="text"
-                  v-if="scope.row.examineStatus === 'SAVE'&&$checkBtnRole('edit', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus === 'SAVE' &&
+                    $checkBtnRole('edit', $route.meta.roles)
+                  "
                   @click="toForm(scope.row)"
                   >编辑</el-button
                 >
                 <el-popconfirm
-                  v-if="scope.row.examineStatus == 'WAIT'&&$checkBtnRole('apply', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus == 'WAIT' &&
+                    $checkBtnRole('apply', $route.meta.roles)
+                  "
                   style="margin-left: 10px"
                   title="确定撤回?"
                   @onConfirm="handleCancel(scope.row.id)"
@@ -379,10 +396,21 @@
                 <el-button
                   type="text"
                   @click="toReturn(scope.row)"
-                  v-if="scope.row.examineStatus === 'OK'&&$checkBtnRole('examine', $route.meta.roles)"
+                  v-if="
+                    scope.row.examineStatus === 'OK' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
                   >退订</el-button
                 >
-   <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime&&$checkBtnRole('examine', $route.meta.roles)" >
+                <el-popconfirm
+                  style="margin-left: 10px"
+                  title="确定关闭吗?"
+                  @onConfirm="handleClose(scope.row.id)"
+                  v-if="
+                    scope.row.examineStatus === 'SAVE' &&
+                    $checkBtnRole('examine', $route.meta.roles)
+                  "
+                >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>

+ 127 - 23
src/views/supply/reserve/components/reserve_form.vue

@@ -10,30 +10,31 @@
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="6">
           <el-form-item label="单据编号" prop="orderNum">
-            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6">
           <el-form-item label="制单人" prop="createMan">
-            <el-input v-model="mainForm.createMan" placeholder="请输入制单人" readonly></el-input>
+            <el-input v-model="mainForm.createMan" placeholder="请输入制单人" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
           <el-form-item label="制单日期" prop="createDate">
             <el-date-picker
               v-model="mainForm.createDate"
-              readonly
+              disabled
               type="datetime"
               value-format="yyyy-MM-dd HH:mm:ss"
               style="width: 100%;"
@@ -50,8 +51,8 @@
     </el-form>
 
     <div style="margin-top: 20px">
-      <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
-      <el-button type="danger" size="small" icon="el-icon-minus" @click="deleteGoods" :disabled="tableSelection.length < 1">批量删除</el-button>
+      <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog" v-if="!listItem">添加引用</el-button>
+      <el-button type="danger" size="small" icon="el-icon-minus" @click="deleteGoods" :disabled="tableSelection.length < 1" v-if="!listItem">批量删除</el-button>
     </div>
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" @selection-change="tableSelectionChange">
@@ -62,10 +63,56 @@
             {{scope.row.orderTime | dateToDayFilter}}
           </template>
         </el-table-column>
-        <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div v-if="scope.row.orderId || listItem">{{scope.row.customerId}}</div>
+            <el-select 
+              v-else
+              v-model="scope.row.customerId"
+              placeholder="选择经销商"
+              size="small"
+              filterable
+              remote
+              clearable
+              :remote-method="checkDealerList"
+              @change="changeDealer(scope.$index)">
+              <el-option
+                v-for="item in dealerList"
+                :key="item.id"
+                :label="item.id"
+                :value="item.id">
+                <span>{{ item.id }}</span>
+                <span style="color: #8492a6; font-size: 13px; margin-left: 6px">{{ item.name }}</span>
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div v-if="scope.row.orderId || listItem">{{scope.row.materialCode}}</div>
+            <el-select 
+              v-else
+              v-model="scope.row.materialCode"
+              placeholder="选择产品"
+              size="small"
+              filterable
+              remote
+              clearable
+              :remote-method="checkMaterialList"
+              @change="changeMaterial(scope.$index)">
+              <el-option
+                v-for="item in materialList"
+                :key="item.number"
+                :label="item.number"
+                :value="item.number">
+                <span>{{ item.number }}</span>
+                <span style="color: #8492a6; font-size: 13px; margin-left: 6px">{{ item.name }}</span>
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
@@ -90,10 +137,11 @@
           </template>
         </el-table-column>
       </el-table>
+      <div class="add" v-if="!listItem"><el-button type="text" icon="el-icon-plus" @click="addGoods">添加行</el-button></div>
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -210,7 +258,7 @@
 </template>
 
 <script>
-import { getDetail, getGoodsList, addData, editData } from "@/api/supply/reserve";
+import { getDetail, getGoodsList, addData, editData, checkDealerList, checkMaterialList } from "@/api/supply/reserve";
 import { getDictList } from '@/api/common'
 
 let that
@@ -264,19 +312,10 @@ export default {
       
       dialogGoodsList: [],
       dialogSelection: [],
-    }
-  },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
+      dealerList: [],
+      materialList: [],
+    }
   },
 
   beforeCreate() {
@@ -350,6 +389,7 @@ export default {
       }).then(res => {
         res.data.records.forEach(item => {
           item.status = 1;
+          item.reservedStatus = 1;
         });
         let oldGoodsList = this.goodsList;
         let newGoodsList = res.data.records;
@@ -452,12 +492,68 @@ export default {
       }
     },
 
+    // 添加产品
+    addGoods() {
+      this.goodsList.push({
+        reservedStatus: 2,
+        status: 1
+      })
+    },
+
+    // 查询经销商列表
+    checkDealerList(query) {
+      checkDealerList({
+        number: query,
+      }).then(res => {
+        this.dealerList = res.data || [];
+      })
+    },
+
+    // 更改经销商
+    changeDealer(index) {
+      if(this.goodsList[index].customerId) {
+        let obj = this.dealerList.find(o => o.id == this.goodsList[index].customerId);
+        this.goodsList[index].customerName = obj.name;
+        this.goodsList[index].customerNumber = obj.number;
+      }else {
+        this.goodsList[index].customerName = '';
+        this.goodsList[index].customerNumber = '';
+      }
+    },
+
+    // 查询产品
+    checkMaterialList(query) {
+      checkMaterialList({
+        number: query,
+      }).then(res => {
+        this.materialList = res.data || [];
+      })
+    },
+
+    // 更改产品
+    changeMaterial(index) {
+      if(this.goodsList[index].materialCode) {
+        let obj = this.materialList.find(o => o.number == this.goodsList[index].materialCode);
+        this.goodsList[index].materialName = obj.name;
+        this.goodsList[index].materialId = obj.id;
+        this.goodsList[index].materialOldNumber = obj.oldNumber;
+        this.goodsList[index].specification = obj.specification;
+        this.goodsList[index].unit = obj.baseUnitId;
+      }else {
+        this.goodsList[index].materialName = '';
+        this.goodsList[index].materialId = '';
+        this.goodsList[index].materialOldNumber = '';
+        this.goodsList[index].specification = '';
+        this.goodsList[index].unit = '';
+      }
+    },
+
     // 提交
     clickSubmitForm() {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
           let params = {
-            orderTime: this.mainForm.orderDate + ' 00:00:00',
+            // orderTime: this.mainForm.orderDate + ' 00:00:00',
             remark: this.mainForm.remark,
             reservedOrderItems: this.goodsList,
           }
@@ -501,4 +597,12 @@ export default {
       padding-left: 10px;
     }
   }
+  .add {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border: 1px solid #EBEEF5;
+    border-top: none;
+    height: 50px;
+  }
 </style>

+ 2 - 2
src/views/supply/reserve/reserve_list.vue

@@ -75,7 +75,7 @@
             <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'reserve/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
@@ -93,7 +93,7 @@
                 {{scope.row.orderTime | dateToDayFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column>
+            <!-- <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column> -->
             <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>

+ 1 - 1
src/views/supply/retail/components/retail_detail.vue

@@ -21,7 +21,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
-          <div class="value">{{detailData.theTime}}</div>
+          <div class="value">{{detailData.theTime | dateToDayFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>

+ 10 - 9
src/views/supply/retail/components/retail_form.vue

@@ -10,17 +10,18 @@
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="订单号" prop="orderNum">
-            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
           <el-form-item label="单据日期" prop="date">
             <el-date-picker
               v-model="mainForm.date"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -33,12 +34,12 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="经销商编码" prop="jxsNum">
-            <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" readonly></el-input>
+            <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="16">
           <el-form-item label="经销商名称" prop="jxsName">
-            <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" readonly></el-input>
+            <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
@@ -291,9 +292,9 @@ export default {
         remark: '',
       },
       mainFormRules: {
-        date: [
-          { required: true, message: '请选择单据日期', trigger: 'change' }
-        ],
+        // date: [
+        //   { required: true, message: '请选择单据日期', trigger: 'change' }
+        // ],
         type: [
           { required: true, message: '请选择品类', trigger: 'change' }
         ],
@@ -364,7 +365,7 @@ export default {
       getDetail({id: this.listItem.id}).then(res => {
         let data = res.data;
         this.mainForm.orderNum = data.id;
-        this.mainForm.date = data.theTime;
+        this.mainForm.date = data.theTime.slice(0, 10);
         this.mainForm.type = data.mainId;
         this.mainForm.jxsNum = data.customerId;
         this.mainForm.jxsName = data.customerName;
@@ -624,7 +625,7 @@ export default {
 
           let mainName = this.typeList[findElem(this.typeList, 'dictCode', this.mainForm.type)].dictValue;
           let params = {
-            theTime: this.mainForm.date + ' 00:00:00',
+            // theTime: this.mainForm.date + ' 00:00:00',
             mainId: this.mainForm.type,
             mainName,
             remark: this.mainForm.remark,

+ 383 - 94
src/views/supply/retail/retail_list.vue

@@ -1,36 +1,65 @@
 <template>
   <div class="app-container">
-    <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
+    <div
+      v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn"
+    >
       <!-- 筛选条件 -->
       <div class="screen-container">
-        <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
+        <el-form
+          ref="screenForm"
+          :model="screenForm"
+          label-width="70px"
+          size="small"
+          label-position="left"
+        >
           <el-row :gutter="20">
             <el-col :xs="24" :sm="24" :lg="24">
               <el-form-item prop="status" label-width="0">
-                <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
+                <el-radio-group
+                  v-model="screenForm.status"
+                  size="medium"
+                  @change="getList()"
+                >
                   <el-radio-button label="">全部</el-radio-button>
-                  <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+                  <el-radio-button
+                    v-for="(item, index) in statusList"
+                    :key="index"
+                    :label="item.value"
+                    >{{ item.label }}</el-radio-button
+                  >
                 </el-radio-group>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="订单号" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
+                <el-input
+                  v-model="screenForm.orderNum"
+                  placeholder="请输入订单号"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="货品名称" prop="goodsName">
-                <el-input v-model="screenForm.goodsName" placeholder="请输入货品名称"></el-input>
+                <el-input
+                  v-model="screenForm.goodsName"
+                  placeholder="请输入货品名称"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="规格型号" prop="model">
-                <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+                <el-input
+                  v-model="screenForm.model"
+                  placeholder="请输入规格型号"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="经销商" prop="jxsName">
-                <el-input v-model="screenForm.jxsName" placeholder="请输入经销商"></el-input>
+                <el-input
+                  v-model="screenForm.jxsName"
+                  placeholder="请输入经销商"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -39,28 +68,39 @@
                   v-model="screenForm.date"
                   type="datetimerange"
                   range-separator="至"
-                  style="width: 100%;"
+                  style="width: 100%"
                   value-format="yyyy-MM-dd HH:mm:ss"
                   start-placeholder="开始日期"
-                  end-placeholder="结束日期">
+                  end-placeholder="结束日期"
+                >
                 </el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="制表人" prop="zbMan">
-                <el-input v-model="screenForm.zbMan" placeholder="请输入制表人"></el-input>
+                <el-input
+                  v-model="screenForm.zbMan"
+                  placeholder="请输入制表人"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="审核人" prop="shMan">
-                <el-input v-model="screenForm.shMan" placeholder="请输入审核人"></el-input>
+                <el-input
+                  v-model="screenForm.shMan"
+                  placeholder="请输入审核人"
+                ></el-input>
               </el-form-item>
             </el-col>
-            
+
             <el-col :xs="24" :sm="12" :lg="6" class="tr">
               <el-form-item label="">
-                <el-button size="small" @click="resetScreenForm">清空</el-button>
-                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+                <el-button size="small" @click="resetScreenForm"
+                  >清空</el-button
+                >
+                <el-button size="small" type="primary" @click="submitScreenForm"
+                  >搜索</el-button
+                >
               </el-form-item>
             </el-col>
           </el-row>
@@ -70,72 +110,274 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              @click="toForm()"
+              v-if="$checkBtnRole('add', $route.meta.roles)"
+              >新增</el-button
+            >
           </div>
           <div class="fr">
             <ExportButton :exUrl="'retail/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
-          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+          >
             <!-- <el-table-column align="center" label="提货进度" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-progress :text-inside="true" :stroke-width="26" :percentage="((scope.row.hasSendQty * 100) / (scope.row.totalQty * 100)) || 0"></el-progress>
               </template>
             </el-table-column> -->
-            <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
+            <el-table-column
+              align="center"
+              label="审核状态"
+              prop="examineStatus"
+              min-width="100"
+              show-overflow-tooltip
+            >
               <template slot-scope="scope">
-                {{scope.row.examineStatus | statusFilter}}
+                {{ scope.row.examineStatus | statusFilter }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="开票状态" prop="isInvoicing" min-width="100" show-overflow-tooltip>
+            <el-table-column
+              align="center"
+              label="开票状态"
+              prop="isInvoicing"
+              min-width="100"
+              show-overflow-tooltip
+            >
               <template slot-scope="scope">
-                {{scope.row.isInvoicing ? '已开票':'未开票'}}
+                {{ scope.row.isInvoicing ? "已开票" : "未开票" }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="订单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="theTime" min-width="100" show-overflow-tooltip>
+            <el-table-column
+              align="center"
+              label="订单号"
+              prop="id"
+              min-width="200"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="订单日期"
+              prop="theTime"
+              min-width="120"
+              show-overflow-tooltip
+            >
               <template slot-scope="scope">
-                {{scope.row.theTime | dateToDayFilter}}
+                <div>
+                  <span>{{ scope.row.theTime | dateToDayFilter }}</span>
+                  <el-button
+                    type="text"
+                    icon="el-icon-edit"
+                    style="padding: 0; margin-left: 6px"
+                    @click="editDate(scope.row)"
+                  ></el-button>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="货品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
+            <el-table-column
+              align="center"
+              label="销售类型"
+              prop="saleTypeName"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="货品名称"
+              prop="materialName"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="规格型号"
+              prop="specification"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="计量单位"
+              prop="unit"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="是否直调"
+              prop="isDirectTransfer"
+              min-width="100"
+              show-overflow-tooltip
+            >
               <template slot-scope="scope">
-                {{scope.row.isDirectTransfer ? '是':'否'}}
+                {{ scope.row.isDirectTransfer ? "是" : "否" }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="120" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip>
+            <el-table-column
+              align="center"
+              label="总数量"
+              prop="qty"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="直调数量"
+              prop="directTransferQty"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="出库数量"
+              prop="hasSendQty"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="可退数量"
+              prop="refundableQty"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="单价"
+              prop="price"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="金额"
+              prop="payAmount"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="返利类型"
+              prop="customerWalletName2"
+              min-width="120"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="返利金额"
+              prop="rebateAmount"
+              min-width="100"
+              show-overflow-tooltip
+            >
               <template slot-scope="scope">
-                <div>{{scope.row.rebateAmount}}</div>
-                <div>(实际:{{scope.row.payRebateAmount}})</div>
+                <div>{{ scope.row.rebateAmount }}</div>
+                <div>(实际:{{ scope.row.payRebateAmount }})</div>
               </template>
             </el-table-column>
-            <el-table-column align="center" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="examineName" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="操作" width="220" fixed="right">
+            <el-table-column
+              align="center"
+              label="格力折扣"
+              prop="totalDiscAmount"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="制表人"
+              prop="createName"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="制表日期"
+              prop="createTime"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="审核人"
+              prop="examineName"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="审核日期"
+              prop="examineTime"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="操作"
+              width="180"
+              fixed="right"
+            >
               <template slot-scope="scope">
-                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
-                <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'">退订</el-button>
-                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
+                <el-button
+                  type="text"
+                  @click="toForm(scope.row)"
+                  v-if="
+                    $checkBtnRole('edit', $route.meta.roles) &&
+                    scope.row.examineStatus === 'SAVE'
+                  "
+                  >编辑</el-button
+                >
+                <el-button
+                  type="text"
+                  @click="toExamine(scope.row)"
+                  v-if="
+                    $checkBtnRole('examine', $route.meta.roles) &&
+                    scope.row.examineStatus === 'WAIT'
+                  "
+                  >审批</el-button
+                >
+                <el-button
+                  type="text"
+                  @click="toReturn(scope.row)"
+                  v-if="
+                    $checkBtnRole('examine', $route.meta.roles) &&
+                    scope.row.examineStatus === 'OK'
+                  "
+                  >退订</el-button
+                >
+                <el-button type="text" @click="toDetail(scope.row)"
+                  >详情</el-button
+                >
+                <el-popconfirm
+                  style="margin-left: 10px"
+                  title="确定申请吗?"
+                  @onConfirm="handleSubmit(scope.row.id)"
+                  v-if="
+                    $checkBtnRole('apply', $route.meta.roles) &&
+                    scope.row.examineStatus === 'SAVE'
+                  "
+                >
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="$checkBtnRole('examine', $route.meta.roles) && !scope.row.closeTime" >
+                <el-popconfirm
+                  style="margin-left: 10px"
+                  title="确定关闭吗?"
+                  @onConfirm="handleClose(scope.row.id)"
+                  v-if="
+                    $checkBtnRole('examine', $route.meta.roles) &&
+                    !scope.row.closeTime
+                  "
+                >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>
@@ -152,40 +394,63 @@
             :page-sizes="[10, 20, 30, 50]"
             :page-size="10"
             layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal">
+            :total="listTotal"
+          >
           </el-pagination>
         </div>
       </div>
     </div>
-    
-    <RetailDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
-    <RetailForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
-    <RetailExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
-    <RetailReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
 
+    <EditDateDialog
+      :isShow.sync="isShowEditDateDialog"
+      :dateForm.sync="dateForm"
+    />
+
+    <RetailDetail
+      :listItem="queryItem"
+      v-if="isShowDetail"
+      @backListFormDetail="backList"
+    />
+    <RetailForm
+      :listItem="queryItem"
+      v-if="isShowForm"
+      @backListFormDetail="backList"
+    />
+    <RetailExamine
+      :listItem="queryItem"
+      v-if="isShowExamine"
+      @backListFormDetail="backList"
+    />
+    <RetailReturn
+      :listItem="queryItem"
+      v-if="isShowReturn"
+      @backListFormDetail="backList"
+    />
   </div>
 </template>
 
 <script>
-import { getList, closeData, submitData } from "@/api/supply/retail";
+import { getList, closeData, submitData, editData } from "@/api/supply/retail";
 import RetailDetail from "@/views/supply/retail/components/retail_detail";
 import RetailForm from "@/views/supply/retail/components/retail_form";
 import RetailExamine from "@/views/supply/retail/components/retail_examine";
 import RetailReturn from "@/views/supply/retail/components/retail_return";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
-let that
+let that;
 export default {
   components: {
     RetailDetail,
     RetailForm,
     RetailExamine,
     RetailReturn,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
-      let obj = that.statusList.find(o => o.value == val);
-      return obj ? obj.label : ''
-    }
+      let obj = that.statusList.find((o) => o.value == val);
+      return obj ? obj.label : "";
+    },
   },
   data() {
     return {
@@ -194,21 +459,22 @@ export default {
       listTotal: 0, // 列表总数
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
-      screenForm: { // 筛选表单数据
-        orderNum: '',
-        goodsName: '',
-        model: '',
-        jxsName: '',
-        date: '',
-        zbMan: '',
-        shMan: '',
-        status: '',
+      screenForm: {
+        // 筛选表单数据
+        orderNum: "",
+        goodsName: "",
+        model: "",
+        jxsName: "",
+        date: "",
+        zbMan: "",
+        shMan: "",
+        status: "",
       },
       statusList: [
-        { label: '已保存', value: 'SAVE' },
-        { label: '待审核', value: 'WAIT' },
-        { label: '审核通过', value: 'OK' },
-        { label: '审核驳回', value: 'FAIL' },
+        { label: "已保存", value: "SAVE" },
+        { label: "待审核", value: "WAIT" },
+        { label: "审核通过", value: "OK" },
+        { label: "审核驳回", value: "FAIL" },
       ],
 
       queryItem: {},
@@ -216,7 +482,13 @@ export default {
       isShowForm: false,
       isShowExamine: false,
       isShowReturn: false,
-    }
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: "",
+      },
+    };
   },
 
   computed: {
@@ -227,12 +499,12 @@ export default {
         materialName: this.screenForm.goodsName,
         specification: this.screenForm.model,
         customer: this.screenForm.jxsName,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        startTime: this.screenForm.date ? this.screenForm.date[0] : "",
+        endTime: this.screenForm.date ? this.screenForm.date[1] : "",
         createBy: this.screenForm.zbMan,
         examineBy: this.screenForm.shMan,
         type: 1, // 1:普通零售单,2:政策零售单
-      }
+      };
     },
   },
 
@@ -257,8 +529,8 @@ export default {
         materialName: this.screenForm.goodsName,
         specification: this.screenForm.model,
         customer: this.screenForm.jxsName,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        startTime: this.screenForm.date ? this.screenForm.date[0] : "",
+        endTime: this.screenForm.date ? this.screenForm.date[1] : "",
         createBy: this.screenForm.zbMan,
         examineBy: this.screenForm.shMan,
         type: 1, // 1:普通零售单,2:政策零售单
@@ -267,7 +539,7 @@ export default {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;
-      })
+      });
     },
 
     // 提交筛选表单
@@ -316,8 +588,8 @@ export default {
 
     // 进入退订
     toReturn(item) {
-      if(item.refundableQty < 1) {
-        return this.$errorMsg('可退数量为0');
+      if (item.refundableQty < 1) {
+        return this.$errorMsg("可退数量为0");
       }
       this.queryItem = item;
       this.isShowReturn = true;
@@ -333,23 +605,40 @@ export default {
 
     // 关闭
     handleClose(id) {
-      closeData({id}).then(res => {
+      closeData({ id }).then((res) => {
         this.$successMsg();
         this.getList();
-      })
+      });
     },
 
     // 申请
     handleSubmit(id) {
-      submitData({id}).then(res => {
+      submitData({ id }).then((res) => {
         this.$successMsg();
         this.getList();
-      })
+      });
+    },
+
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.id;
+      this.dateForm.date = item.theTime.slice(0, 10);
+      this.isShowEditDateDialog = true;
     },
-  }
-}
-</script>
 
-<style lang="scss" scoped>
+    // 提交 修改订单日期
+    submitDateForm() {
+      editData({
+        id: this.editId,
+        theTime: this.dateForm.date + " 00:00:00",
+      }).then((res) => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg("修改成功");
+      });
+    },
+  },
+};
+</script>
 
-</style>
+<style lang="scss" scoped></style>

Некоторые файлы не были показаны из-за большого количества измененных файлов