Browse Source

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

FengChaoYu 3 năm trước cách đây
mục cha
commit
b97c692c90
34 tập tin đã thay đổi với 2605 bổ sung474 xóa
  1. 13 0
      src/api/basic_data/warehouse.js
  2. 9 1
      src/api/dashboard.js
  3. 11 2
      src/api/supply/pickup.js
  4. 12 0
      src/api/supply/policy.js
  5. 2 1
      src/store/getters.js
  6. 136 109
      src/store/modules/user.js
  7. 1 1
      src/views/basic_data/logistics/logistics_list.vue
  8. 2 0
      src/views/basic_data/material/machine_list.vue
  9. 2 1
      src/views/basic_data/material/modify_list.vue
  10. 2 0
      src/views/basic_data/material/relation_list.vue
  11. 16 3
      src/views/basic_data/warehouse/components/warehouse_list-detail.vue
  12. 2 0
      src/views/basic_data/warehouse/warehouse_cost.vue
  13. 2 1
      src/views/basic_data/warehouse/warehouse_site.vue
  14. 251 10
      src/views/dashboard/index.vue
  15. 23 1
      src/views/finance/components/receivable_list-add.vue
  16. 46 7
      src/views/finance/rebate_list.vue
  17. 10 2
      src/views/finance/wallet.vue
  18. 119 84
      src/views/login/index.vue
  19. 63 30
      src/views/sales_policy/components/AddCondition.vue
  20. 1 1
      src/views/sales_policy/components/Examine.vue
  21. 4 1
      src/views/sales_policy/policy_list.vue
  22. 6 5
      src/views/sales_rebate/rebate_list.vue
  23. 26 3
      src/views/supply/pickup/check.vue
  24. 56 27
      src/views/supply/pickup/components/pickup_form.vue
  25. 19 9
      src/views/supply/pickup/pickup_list.vue
  26. 7 3
      src/views/supply/pickup/sum_list.vue
  27. 472 146
      src/views/supply/policy/components/retail_detail.vue
  28. 0 2
      src/views/supply/policy/components/retail_form.vue
  29. 1258 0
      src/views/supply/policy/components/retail_form2.vue
  30. 12 4
      src/views/supply/policy/policy_list.vue
  31. 3 3
      src/views/supply/retail/components/retail_detail.vue
  32. 2 2
      src/views/supply/retail/components/retail_form.vue
  33. 6 5
      src/views/supply/sales/components/sales_detail.vue
  34. 11 10
      src/views/supply/sales/sales_list.vue

+ 13 - 0
src/api/basic_data/warehouse.js

@@ -133,3 +133,16 @@ export function addReserve(params) {
     data:params
   })
 }
+
+
+
+
+
+
+export function setStock(params) {
+  return request({
+    url: '/stock/update',
+    method: 'get',
+    params
+  })
+}

+ 9 - 1
src/api/dashboard.js

@@ -1,2 +1,10 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 
+// 获取消息列表
+export function getNoticeList(params) {
+  return request({
+    url: "/notice/list",
+    method: "get",
+    params,
+  });
+}

+ 11 - 2
src/api/supply/pickup.js

@@ -12,7 +12,7 @@ export function getPickupList(params) {
 // 获取详情
 export function getDetail(params) {
   return request({
-    url: '/retreat/detail',
+    url: '/pick/detail',
     method: 'get',
     params
   })
@@ -63,7 +63,7 @@ export function getCompanyList(params) {
   })
 }
 
-// 提交提货预约
+// 新增提货预约
 export function addPickupBook(params) {
   return request({
     url: '/pick/add',
@@ -72,6 +72,15 @@ export function addPickupBook(params) {
   })
 }
 
+// 编辑提货预约
+export function editPickupBook(params) {
+  return request({
+    url: '/pick/update',
+    method: 'post',
+    data: params
+  })
+}
+
 // 获取短信验证码
 export function getCode(params) {
   return request({

+ 12 - 0
src/api/supply/policy.js

@@ -192,3 +192,15 @@ export function getConditionDetail(params) {
     params
   })
 }
+
+
+// 政策条件
+
+export function getPolicyConditionList(params) {
+  return request({
+    url: '/policy/condition/list',
+    method: 'get',
+    params
+  })
+}
+

+ 2 - 1
src/store/getters.js

@@ -9,6 +9,7 @@ const getters = {
   name: state => state.user.name,
   menus: state => state.user.menus,
   customerId: state => state.user.customerId,
-  customerName: state => state.user.customerName
+  customerName: state => state.user.customerName,
+  showMessages: state => state.user.showMessages
 }
 export default getters

+ 136 - 109
src/store/modules/user.js

@@ -1,82 +1,105 @@
-import { login, logout, getInfo, getRouter } from '@/api/user'
-import { getToken, setToken, removeToken, getUserid, setUserid, removeUserid } from '@/utils/auth'
-import { resetRouter } from '@/router'
+import { login, logout, getInfo, getRouter } from "@/api/user";
+import {
+  getToken,
+  setToken,
+  removeToken,
+  getUserid,
+  setUserid,
+  removeUserid,
+} from "@/utils/auth";
+import { resetRouter } from "@/router";
 
 const getDefaultState = () => {
   return {
     token: getToken(), // token
     userid: getUserid(), // 用户id
-    name: '', // 用户名称
-    phone: '', // 用户手机
+    name: "", // 用户名称
+    phone: "", // 用户手机
     menus: "", // 菜单
-    customerId:'',//经销商ID
-    customerName:''//经销商名称
-  }
-}
+    customerId: "", //经销商ID
+    customerName: "", //经销商名称
+    showMessages: null, //
+  };
+};
 
-const state = getDefaultState()
+const state = getDefaultState();
 
 const mutations = {
   RESET_STATE: (state) => {
-    Object.assign(state, getDefaultState())
+    Object.assign(state, getDefaultState());
   },
   SET_USERID: (state, userid) => {
-    state.userid = userid
+    state.userid = userid;
   },
   SET_TOKEN: (state, token) => {
-    state.token = token
+    state.token = token;
   },
   SET_NAME: (state, name) => {
-    state.name = name
+    state.name = name;
   },
   SET_PHONE: (state, phone) => {
-    state.phone = phone
+    state.phone = phone;
   },
   SET_MENUS: (state, menus) => {
-    state.menus = menus
+    state.menus = menus;
   },
   SET_CUSTOMERID: (state, customerId) => {
-    state.customerId = customerId
+    state.customerId = customerId;
   },
   SET_CUSTOMERNAME: (state, customerName) => {
-    state.customerName = customerName
-  }
-}
+    state.customerName = customerName;
+  },
+  showMessage: (state, value) => {
+    if (value == "yes") {
+      state.showMessages = true;
+    } else {
+      state.showMessages = false;
+    }
+  },
+};
 
 const actions = {
   // user login
   login({ commit }, userInfo) {
-    const { username, password, code, codeValue } = userInfo
+    const { username, password, code, codeValue } = userInfo;
     return new Promise((resolve, reject) => {
-      login({ userName: username.trim(), password: password, code: code, codeValue: codeValue }).then(response => {
-        const { data } = response
-        commit('SET_TOKEN', data.token)
-        commit('SET_USERID', data.adminUserId)
-        setToken(data.token)
-        setUserid(data.adminUserId)
-        resolve()
-      }).catch(error => {
-        reject(error)
+      login({
+        userName: username.trim(),
+        password: password,
+        code: code,
+        codeValue: codeValue,
       })
-    })
+        .then((response) => {
+          const { data } = response;
+          commit("SET_TOKEN", data.token);
+          commit("SET_USERID", data.adminUserId);
+          setToken(data.token);
+          setUserid(data.adminUserId);
+          resolve();
+        })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
 
   // get user info
   getInfo({ commit, state }) {
     return new Promise((resolve, reject) => {
       console.log(state);
-      getInfo(state.userid).then(response => {
-        const { data } = response
-        console.log(1111111,data);
+      getInfo(state.userid)
+        .then((response) => {
+          const { data } = response;
+          console.log(1111111, data);
 
-        if (!data) {
-          return reject('Verification failed, please Login again.')
-        }
-        console.log(data);
-        const { nickName, userName ,customerId,customerName} = data
-        
-        // 模拟请求数据
-        // const menus = [
+          if (!data) {
+            return reject("Verification failed, please Login again.");
+          }
+          console.log(data);
+          const { nickName, userName, customerId, customerName } = data;
+
+          // 模拟请求数据
+          // const menus = [
           // {
           //   'path': '/example',
           //   'component': 'Layout',
@@ -98,90 +121,94 @@ const actions = {
           //     }
           //   ]
           // },
-        // ]
-        // menus.push({ path: '*', redirect: '/404', hidden: true })
-        commit('SET_CUSTOMERID',customerId)
-        commit('SET_CUSTOMERNAME',customerName)
-        commit('SET_NAME', nickName)
-        commit('SET_PHONE', userName)
-        // commit("SET_MENUS", menus) // 触发vuex SET_MENUS 保存路由表到vuex
+          // ]
+          // menus.push({ path: '*', redirect: '/404', hidden: true })
+          commit("SET_CUSTOMERID", customerId);
+          commit("SET_CUSTOMERNAME", customerName);
+          commit("SET_NAME", nickName);
+          commit("SET_PHONE", userName);
+          // commit("SET_MENUS", menus) // 触发vuex SET_MENUS 保存路由表到vuex
 
-        localStorage.setItem("supply_user", JSON.stringify(data));
+          localStorage.setItem("supply_user", JSON.stringify(data));
 
-        resolve(data)
-      }).catch(error => {
-        reject(error)
-      })
-    })
+          resolve(data);
+        })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
 
   getRouter({ commit, state }) {
     return new Promise((resolve, reject) => {
-      getRouter({adminUserId: state.userid}).then(response => {
-        const menus = response.data;
-        // 模拟请求数据
-        // const menus = [
-        //   {
-        //     'path': '/example',
-        //     'component': 'Layout',
-        //     'redirect': '/example/table',
-        //     'name': 'Example',
-        //     'meta': { 'title': 'Example', 'icon': 'el-icon-s-help' },
-        //     'children': [
-        //       {
-        //         'path': 'table',
-        //         'name': 'Table',
-        //         'component': 'table/index',
-        //         'meta': { 'title': 'Table', 'icon': 'table' }
-        //       },
-        //       {
-        //         'path': 'tree',
-        //         'name': 'Tree',
-        //         'component': 'tree/index',
-        //         'meta': { 'title': 'Tree', 'icon': 'tree' }
-        //       }
-        //     ]
-        //   },
-        // ]
-        // menus.push({ path: '*', redirect: '/404', hidden: true })
-        commit("SET_MENUS", menus)
-        resolve()
-      }).catch(error => {
-        reject(error)
-      })
-    })
+      getRouter({ adminUserId: state.userid })
+        .then((response) => {
+          const menus = response.data;
+          // 模拟请求数据
+          // const menus = [
+          //   {
+          //     'path': '/example',
+          //     'component': 'Layout',
+          //     'redirect': '/example/table',
+          //     'name': 'Example',
+          //     'meta': { 'title': 'Example', 'icon': 'el-icon-s-help' },
+          //     'children': [
+          //       {
+          //         'path': 'table',
+          //         'name': 'Table',
+          //         'component': 'table/index',
+          //         'meta': { 'title': 'Table', 'icon': 'table' }
+          //       },
+          //       {
+          //         'path': 'tree',
+          //         'name': 'Tree',
+          //         'component': 'tree/index',
+          //         'meta': { 'title': 'Tree', 'icon': 'tree' }
+          //       }
+          //     ]
+          //   },
+          // ]
+          // menus.push({ path: '*', redirect: '/404', hidden: true })
+          commit("SET_MENUS", menus);
+          resolve();
+        })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
 
   // user logout
   logout({ commit, state }) {
     return new Promise((resolve, reject) => {
-      logout(state.token).then(() => {
-        removeToken() // must remove  token  first
-        removeUserid()
-        resetRouter()
-        commit('RESET_STATE')
-        resolve()
-      }).catch(error => {
-        reject(error)
-      })
-    })
+      logout(state.token)
+        .then(() => {
+          removeToken(); // must remove  token  first
+          removeUserid();
+          resetRouter();
+          commit("RESET_STATE");
+          resolve();
+        })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
 
   // remove token
   resetToken({ commit }) {
-    return new Promise(resolve => {
-      removeToken() // must remove  token  first
-      removeUserid()
-      commit('RESET_STATE')
-      resolve()
-    })
-  }
-}
+    return new Promise((resolve) => {
+      removeToken(); // must remove  token  first
+      removeUserid();
+      commit("RESET_STATE");
+      resolve();
+    });
+  },
+};
 
 export default {
   namespaced: true,
   state,
   mutations,
-  actions
-}
-
+  actions,
+};

+ 1 - 1
src/views/basic_data/logistics/logistics_list.vue

@@ -40,7 +40,7 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small" @click="hanleAdd"
+        <el-button type="primary" icon="el-icon-plus" size="small" @click="hanleAdd"
           >新增</el-button
         >
         <el-popconfirm

+ 2 - 0
src/views/basic_data/material/machine_list.vue

@@ -61,6 +61,7 @@
         <el-button
           type="primary"
           size="small"
+             icon="el-icon-plus"
           @click="(showDialogForm = true), (type = 1)"
           >新增</el-button
         >
@@ -76,6 +77,7 @@
           <el-button
             slot="reference"
             type="primary"
+               icon="el-icon-delete"
             size="small"
             class="textColor el-popover-left"
             >删除</el-button

+ 2 - 1
src/views/basic_data/material/modify_list.vue

@@ -61,7 +61,7 @@
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button type="primary" size="small" @click="addFn">新增</el-button>
+          <el-button type="primary"   icon="el-icon-plus" size="small" @click="addFn">新增</el-button>
           <!-- <el-button type="primary" size="small">编辑</el-button> -->
           <el-popconfirm
             confirm-button-text="好的"
@@ -74,6 +74,7 @@
             <el-button
               type="primary"
               size="small"
+                icon="el-icon-delete"
               slot="reference"
               class="el-popover-left"
               >删除</el-button

+ 2 - 0
src/views/basic_data/material/relation_list.vue

@@ -117,6 +117,7 @@
       <div class="fl">
         <el-button
           type="primary"
+             icon="el-icon-plus"
           size="small"
           @click="(showDialogForm = true), (type = 1), hanleMachine()"
           >新增</el-button
@@ -133,6 +134,7 @@
           <el-button
             type="primary"
             size="small"
+               icon="el-icon-delete"
             slot="reference"
             class="el-popover-left"
             >删除</el-button

+ 16 - 3
src/views/basic_data/warehouse/components/warehouse_list-detail.vue

@@ -258,7 +258,7 @@
                        <el-col :span="12"
                       >
                     <el-form-item label="允许客户查询" size="small">
-                        <el-checkbox :readonly="isReadonly" v-model="detail.allowMinusQty" :label="true">{{''}}</el-checkbox>
+                        <el-checkbox :readonly="isReadonly" v-model="detail.inquire" :true-label="1" :false-label="0">{{''}}</el-checkbox>
                     </el-form-item>
 
                      </el-col>
@@ -300,7 +300,7 @@
                          <el-col :span="12"
                       >
                            <el-form-item label="虚拟仓" size="small">
-                        <el-checkbox :readonly="isReadonly" v-model="detail.stockType" :label="1" :value="1">{{''}}</el-checkbox>
+                        <el-checkbox :readonly="isReadonly" v-model="detail.stockType" :true-label="1" :false-label="0">{{''}}</el-checkbox>
                     </el-form-item>
 
                       </el-col>
@@ -352,13 +352,16 @@
             </el-col>
           </el-row>
         </div>
+        <el-button type="primary"  @click="setStock">保存</el-button>
+
       </el-card>
     </el-form>
   </div>
 </template>
 
 <script>
-import { type } from "os";
+
+import { setStock } from "@/api/basic_data/warehouse";
 
 export default {
   props: {
@@ -412,6 +415,16 @@ export default {
       console.log(this.$parent);
       this.$parent.isShow = true;
     },
+    setStock(){
+      setStock({
+        inquire:this.detail.inquire,
+        stockType:this.detail.stockType,
+        id:this.detail.id
+      }).then((res) => {
+        this.$successMsg('保存成功')
+         this.$parent.isShow = true;
+      })
+    }
   },
 };
 </script>

+ 2 - 0
src/views/basic_data/warehouse/warehouse_cost.vue

@@ -36,6 +36,7 @@
         <el-button
           type="primary"
           size="small"
+          icon="el-icon-plus"
           @click="(showDialog = true), (type = 1)"
           >新增</el-button
         >
@@ -51,6 +52,7 @@
           <el-button
             type="primary"
             size="small"
+            icon="el-icon-delete"
             slot="reference"
             class="el-popover-left"
             >批量删除</el-button

+ 2 - 1
src/views/basic_data/warehouse/warehouse_site.vue

@@ -41,7 +41,7 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small" @click="newData(), (type = 1)"
+        <el-button type="primary" icon="el-icon-plus" size="small" @click="newData(), (type = 1)"
           >新增</el-button
         >
   <el-popconfirm
@@ -55,6 +55,7 @@
                 <el-button
                   slot="reference"
                     type="primary"
+                        icon="el-icon-delete"
                    size="small"
                   class="textColor el-popover-left"
                   >批量删除</el-button

+ 251 - 10
src/views/dashboard/index.vue

@@ -1,30 +1,271 @@
 <template>
   <div class="dashboard-container">
-
     <el-row :gutter="10" class="top-container">
       <el-col :xs="24" :sm="12" :lg="12">
         <div class="today-content">欢迎登入供应链管理系统</div>
       </el-col>
     </el-row>
+
+    <!-- 弹窗 -->
+    <el-dialog
+      title="消息"
+      :visible.sync="showMessages"
+      width="50%"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <el-radio-group v-model="type" @change="checkFn" size="">
+        <el-radio-button label="1">系统通知</el-radio-button>
+        <el-radio-button label="2">文件下发</el-radio-button>
+        <el-radio-button label="3">返利确认单</el-radio-button>
+      </el-radio-group>
+      <br />
+      <br />
+      <!-- 系统通知 -->
+      <div v-show="type == '1'">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
+          <el-table-column
+            align="center"
+            type="index"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="标题"
+            prop="title"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="来源"
+            prop="source"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="时间"
+            prop="issueTime"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label=""
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="">
+              <el-button type="text" class="textColor">查看</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!-- 文件下发 -->
+      <div v-show="type == '2'">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
+          <el-table-column
+            align="center"
+            type="index"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="标题"
+            prop="title"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="来源"
+            prop="source"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="时间"
+            prop="issueTime"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label=""
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="">
+              <el-button type="text" class="textColor">下载</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!-- 返利确认单 -->
+      <div v-show="type == '3'">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
+          <el-table-column
+            align="center"
+            type="index"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商名称"
+            prop=""
+            min-width="160"
+            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="customerName"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label=""
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="">
+              <el-button type="text" class="textColor">复核</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <br />
+      <br />
+      <!-- 分页 -->
+      <div class="fr">
+        <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>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="closeFn">关闭</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import { getInfo, getOrder, getGoodsRank  } from '@/api/dashboard'
-import { dateFormat } from '@/utils/util'
+import { getNoticeList } from "@/api/dashboard";
+import { mapGetters } from "vuex";
+import { getInfo, getOrder, getGoodsRank } from "@/api/dashboard";
+import { dateFormat } from "@/utils/util";
 
 export default {
-  name: 'Dashboard',
+  name: "Dashboard",
+  created() {
+    this.getDataList({
+      pageSize: this.pageSize,
+      pageNum: this.currentPage,
+      type: this.type,
+    });
+  },
+  computed: {
+    ...mapGetters(["showMessages"]),
+  },
   data() {
     return {
-
-    }
-  }
-}
+      type: "1",
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: [],
+      listLoading: false, // 列表加载loading
+    };
+  },
+  methods: {
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        type: this.type,
+      });
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        type: this.type,
+      });
+    },
+    //获取列表数据
+    async getDataList(data) {
+      const res = await getNoticeList(data);
+      console.log(res);
+      this.dataList = res.data.records;
+      this.listTotal = res.data.total;
+    },
+    //选择
+    checkFn(v) {
+      this.type = v;
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        type: this.type,
+      });
+    },
+    //关闭
+    closeFn() {
+      this.$store.commit("user/showMessage", "no");
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
-
 .dashboard {
   &-container {
     background: #f5f5f5;

+ 23 - 1
src/views/finance/components/receivable_list-add.vue

@@ -325,6 +325,25 @@ export default {
 
     //新增
     async addFn() {
+      let aaa = this.dataList.map((v) => {
+        if (v.afterTaxAmount == "") {
+          this.$message.error("请输入不含税金额");
+          return 1;
+        }
+        if (v.tax == "") {
+          this.$message.error("请输入税额");
+          return 1;
+        }
+        if (v.totalAmount == "") {
+          this.$message.error("请输入总金额");
+          return 1;
+        }
+      });
+
+      let bbb = aaa.indexOf(1);
+      if (bbb != -1) {
+        return;
+      }
       this.dataList.forEach((v) => {
         let res = this.customerList.filter((i) => i.id == v.customerId);
         console.log(res);
@@ -334,7 +353,7 @@ export default {
         v.customerWalletId = res2[0].customerWalletId;
         v.walletId = res2[0].walletRebateId;
       });
-      console.log(this.dataList);
+
       await getFinanceOtherReceAdd({
         items: this.dataList,
         ...this.searchForm,
@@ -387,4 +406,7 @@ export default {
 .selectStyle {
   width: 100%;
 }
+.mar {
+  margin-top: 20px;
+}
 </style>

+ 46 - 7
src/views/finance/rebate_list.vue

@@ -90,6 +90,7 @@
               prop="examineStatus"
               min-width="160"
               show-overflow-tooltip
+              v-if="!isCustomer"
             >
               <template slot-scope="scope">
                 <el-tag v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
@@ -128,6 +129,15 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="isCustomer"
+              align="center"
+              label="标题备注"
+              prop="policyDocNo"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="经销商编码"
               prop="customerNumber"
@@ -135,6 +145,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="经销商名称"
               prop="customerName"
@@ -151,21 +162,22 @@
             <el-table-column
               align="center"
               label="总返利金额"
-              prop=""
+              prop="amount"
               min-width="160"
               show-overflow-tooltip
             >
-              <template slot-scope="scope">
-                {{ Math.abs(scope.row.amount) + scope.row.withholdAmount }}
-              </template>
             </el-table-column>
             <el-table-column
               align="center"
               label="返利金额"
-              prop="amount"
+              prop=""
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{ scope.row.withholdAmount != 0 ? 0 : 0 }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="暂扣返利"
@@ -181,6 +193,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="折让编号"
               prop="allowanceCode"
@@ -188,6 +201,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="折让账号"
               prop="allowanceAccount"
@@ -195,6 +209,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="已办理折让金额"
               prop="handledAllowanceAmount"
@@ -202,6 +217,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="折让对应收款单号"
               prop="allowanceOrderNo"
@@ -209,6 +225,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="政策文件流水号"
               prop="policyFileNo"
@@ -216,6 +233,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="政策文号"
               prop="policyDocNo"
@@ -223,6 +241,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="政策年份"
               prop="policyYear"
@@ -230,6 +249,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="政策月份"
               prop="policyMonth"
@@ -237,6 +257,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="政策归属部门"
               prop="policyOrg"
@@ -245,12 +266,14 @@
             ></el-table-column>
             <el-table-column
               align="center"
+              v-if="!isCustomer"
               label="客户区域"
               prop="customerArea"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="客户属性"
               prop="customerAttr"
@@ -259,12 +282,14 @@
             ></el-table-column>
             <el-table-column
               align="center"
+              v-if="!isCustomer"
               label="奖励实际归属客户"
               prop="rewardActualCustomers"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="备注1"
               prop="remark1"
@@ -272,6 +297,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="备注2"
               prop="remark2"
@@ -279,6 +305,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="制单人"
               prop="createBy"
@@ -286,6 +313,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="制单时间"
               prop="createTime"
@@ -293,6 +321,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="审核人"
               prop="examineBy"
@@ -300,6 +329,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="审核时间"
               prop="examineTime"
@@ -307,6 +337,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="确认人"
               prop="customerName"
@@ -314,6 +345,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="确认时间"
               prop="customerConfirmTime"
@@ -321,6 +353,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="复核人"
               prop="secondExamineBy"
@@ -328,6 +361,7 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              v-if="!isCustomer"
               align="center"
               label="复核时间"
               prop="secondExamineTime"
@@ -345,6 +379,7 @@
                 <el-button
                   type="text"
                   class="textColor"
+                  v-if="!isCustomer"
                   @click="editFn(scope.row.rebateOrderId)"
                   >编辑</el-button
                 >
@@ -396,7 +431,11 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  v-if="isCustomer && scope.row.examineStatus == 'OK_ONE'"
+                  v-if="
+                    isCustomer &&
+                    scope.row.examineStatus == 'OK_ONE' &&
+                    scope.row.withholdAmount == 0
+                  "
                   @click="confirmFn(scope.row.rebateOrderId)"
                   >确认</el-button
                 >

+ 10 - 2
src/views/finance/wallet.vue

@@ -1,5 +1,9 @@
-<template >
+<template>
   <div class="app-container">
+    <div class="sty" v-show="this.$route.query.id">
+      <el-page-header @back="goBack"> </el-page-header>
+    </div>
+
     <el-row>
       <el-col :xs="24" :sm="12" :lg="12">
         <div class="styl">现金钱包</div>
@@ -226,6 +230,10 @@ export default {
     ...mapGetters(["customerId"]),
   },
   methods: {
+    //返回
+    goBack() {
+      this.$router.push("/finance/balance_sum");
+    },
     //取消
     async cancelFn() {
       this.dialogForm = false;
@@ -281,4 +289,4 @@ export default {
 .styl {
   padding-top: 14px;
 }
-</style>
+</style>

+ 119 - 84
src/views/login/index.vue

@@ -1,21 +1,26 @@
 <template>
   <div class="login-container">
-    <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
-
+    <el-form
+      ref="loginForm"
+      :model="loginForm"
+      :rules="loginRules"
+      class="login-form"
+      auto-complete="on"
+      label-position="left"
+    >
       <!-- <div class="title-container">
         <img src="@/assets/login/title.png" alt="">
       </div> -->
       <div class="image-container">
-        <img src="@/assets/login/image.png" alt="">
+        <img src="@/assets/login/image.png" alt="" />
       </div>
       <div class="right-container">
         <div class="empty-height" />
         <div class="form-container">
-
           <div class="title">供应链管理系统</div>
-<!--      <div class="logo">-->
-<!--        <img src="@/assets/login/logo.png" alt="">-->
-<!--      </div>-->
+          <!--      <div class="logo">-->
+          <!--        <img src="@/assets/login/logo.png" alt="">-->
+          <!--      </div>-->
 
           <el-form-item prop="username">
             <span class="svg-container">
@@ -48,7 +53,9 @@
               @keyup.enter.native="handleLogin"
             />
             <span class="show-pwd" @click="showPwd">
-              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
+              <svg-icon
+                :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
+              />
             </span>
           </el-form-item>
 
@@ -66,13 +73,20 @@
               auto-complete="off"
               @keyup.enter.native="handleLogin"
             />
-            <div class="code" @click="getCode"><img :src="'data:image/jpeg;base64,' + codeImage" alt=""></div>
+            <div class="code" @click="getCode">
+              <img :src="'data:image/jpeg;base64,' + codeImage" alt="" />
+            </div>
           </el-form-item>
 
           <el-checkbox v-model="isRemenberPw">记住密码</el-checkbox>
 
           <div class="button-container">
-            <el-button :loading="loading" type="primary" @click.native.prevent="handleLogin">登录</el-button>
+            <el-button
+              :loading="loading"
+              type="primary"
+              @click.native.prevent="handleLogin"
+              >登录</el-button
+            >
           </div>
         </div>
       </div>
@@ -81,69 +95,75 @@
 </template>
 
 <script>
-import { validUsername } from '@/utils/validate'
-import Cookies from 'js-cookie'
-import { getCode } from '@/api/user'
+import { validUsername } from "@/utils/validate";
+import Cookies from "js-cookie";
+import { getCode } from "@/api/user";
 
 export default {
-  name: 'Login',
+  name: "Login",
   data() {
     const validateUsername = (rule, value, callback) => {
       if (value.length <= 0) {
-        callback(new Error('请输入用户名'))
+        callback(new Error("请输入用户名"));
       } else {
-        callback()
+        callback();
       }
-    }
+    };
     const validatePassword = (rule, value, callback) => {
       if (value.length <= 0) {
-        callback(new Error('请输入密码'))
+        callback(new Error("请输入密码"));
       } else {
-        callback()
+        callback();
       }
-    }
+    };
     const validateCode = (rule, value, callback) => {
       if (value.length <= 0) {
-        callback(new Error('请输入验证码'))
+        callback(new Error("请输入验证码"));
       } else {
-        callback()
+        callback();
       }
-    }
+    };
     return {
       loginForm: {
-        username: '',
-        password: '',
-        code: '',
-        codeValue: ''
+        username: "",
+        password: "",
+        code: "",
+        codeValue: "",
       },
       loginRules: {
-        username: [{ required: true, trigger: 'change', validator: validateUsername }],
-        password: [{ required: true, trigger: 'change', validator: validatePassword }],
-        codeValue: [{ required: true, trigger: 'change', validator: validateCode }],
+        username: [
+          { required: true, trigger: "change", validator: validateUsername },
+        ],
+        password: [
+          { required: true, trigger: "change", validator: validatePassword },
+        ],
+        codeValue: [
+          { required: true, trigger: "change", validator: validateCode },
+        ],
       },
       loading: false,
-      passwordType: 'password',
+      passwordType: "password",
       redirect: undefined,
       isRemenberPw: false,
-      codeImage: '',
-    }
+      codeImage: "",
+    };
   },
   watch: {
     $route: {
-      handler: function(route) {
-        this.redirect = route.query && route.query.redirect
+      handler: function (route) {
+        this.redirect = route.query && route.query.redirect;
       },
-      immediate: true
-    }
+      immediate: true,
+    },
   },
   created() {
     // 获取缓存信息
-    if(localStorage.getItem("supply_login")) {
+    if (localStorage.getItem("supply_login")) {
       let storageData = JSON.parse(localStorage.getItem("supply_login"));
       this.loginForm.username = storageData.username;
       this.isRemenberPw = storageData.isRemenberPw;
     }
-    if(this.isRemenberPw) {
+    if (this.isRemenberPw) {
       this.getCookie();
     }
 
@@ -152,57 +172,63 @@ export default {
   methods: {
     // 获取验证码
     getCode() {
-      getCode().then(res => {
+      getCode().then((res) => {
         console.log(res);
         this.loginForm.code = res.data.code;
         this.codeImage = res.data.pic;
-      })
+      });
     },
 
     // 显示隐藏密码
     showPwd() {
-      if (this.passwordType === 'password') {
-        this.passwordType = ''
+      if (this.passwordType === "password") {
+        this.passwordType = "";
       } else {
-        this.passwordType = 'password'
+        this.passwordType = "password";
       }
       this.$nextTick(() => {
-        this.$refs.password.focus()
-      })
+        this.$refs.password.focus();
+      });
     },
 
     // 登录
     handleLogin() {
       console.log(this.loginForm);
-      this.$refs.loginForm.validate(valid => {
+      this.$refs.loginForm.validate((valid) => {
         if (valid) {
-          this.loading = true
-          this.$store.dispatch('user/login', this.loginForm).then(() => {
-            console.log(this.redirect);
-            this.$router.push({ path: this.redirect || '/' })
-            this.saveUnAndPw();
-            this.loading = false
-          }).catch(() => {
-            this.getCode();
-            this.loginForm.codeValue = '';
-            this.loading = false
-          })
+          this.loading = true;
+          this.$store
+            .dispatch("user/login", this.loginForm)
+            .then(() => {
+              console.log(this.redirect);
+
+              this.$router.push({ path: this.redirect || "/" });
+              this.$store.commit("user/showMessage", "yes");
+              this.saveUnAndPw();
+
+              this.loading = false;
+            })
+            .catch(() => {
+              this.getCode();
+              this.loginForm.codeValue = "";
+              this.loading = false;
+            });
         } else {
-          console.log('error submit!!')
-          return false
+          console.log("error submit!!");
+          return false;
         }
-      })
+      });
     },
 
     // 处理账号密码的储存
     saveUnAndPw() {
       let storageData = {
         username: this.loginForm.username,
-        isRemenberPw: this.isRemenberPw
-      }
+        isRemenberPw: this.isRemenberPw,
+      };
       localStorage.setItem("supply_login", JSON.stringify(storageData));
 
-      if(this.isRemenberPw) {
+      if (this.isRemenberPw) {
         this.setCookie(this.loginForm.username, this.loginForm.password, 7);
       }
     },
@@ -212,20 +238,30 @@ export default {
       var exdate = new Date(); //获取时间
       exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays); //保存的天数
       //字符串拼接cookie
-      window.document.cookie = "supply_username" + "=" + c_name + ";path=/;expires=" + exdate.toGMTString();
-      window.document.cookie = "supply_password" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
+      window.document.cookie =
+        "supply_username" +
+        "=" +
+        c_name +
+        ";path=/;expires=" +
+        exdate.toGMTString();
+      window.document.cookie =
+        "supply_password" +
+        "=" +
+        c_pwd +
+        ";path=/;expires=" +
+        exdate.toGMTString();
     },
 
     //读取cookie
-    getCookie: function() {
+    getCookie: function () {
       if (document.cookie.length > 0) {
-        var arr = document.cookie.split('; '); //这里显示的格式需要切割一下自己可输出看下
+        var arr = document.cookie.split("; "); //这里显示的格式需要切割一下自己可输出看下
         for (var i = 0; i < arr.length; i++) {
-          var arr2 = arr[i].split('='); //再次切割
+          var arr2 = arr[i].split("="); //再次切割
           //判断查找相对应的值
-          if (arr2[0] == 'supply_username') {
+          if (arr2[0] == "supply_username") {
             this.loginForm.username = arr2[1]; //保存到保存数据的地方
-          } else if (arr2[0] == 'supply_password') {
+          } else if (arr2[0] == "supply_password") {
             this.loginForm.password = arr2[1];
           }
         }
@@ -233,20 +269,19 @@ export default {
     },
 
     //清除cookie
-    clearCookie: function() {
+    clearCookie: function () {
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
-    }
-
-  }
-}
+    },
+  },
+};
 </script>
 
 <style lang="scss">
 /* 修复input 背景不协调 和光标变色 */
 /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
 
-$bg:#283443;
-$light_gray:#fff;
+$bg: #283443;
+$light_gray: #fff;
 $cursor: #fff;
 $back: #333;
 
@@ -258,7 +293,7 @@ $back: #333;
 
 /* reset element-ui css */
 .login-container {
-  background: url('~@/assets/login/background.png') center center;
+  background: url("~@/assets/login/background.png") center center;
   background-size: cover;
   .el-input {
     display: inline-block;
@@ -302,9 +337,9 @@ $back: #333;
 </style>
 
 <style lang="scss" scoped>
-$bg:#2d3a4b;
-$dark_gray:#889aa4;
-$light_gray:#eee;
+$bg: #2d3a4b;
+$dark_gray: #889aa4;
+$light_gray: #eee;
 
 .login-container {
   min-height: 100%;
@@ -365,7 +400,7 @@ $light_gray:#eee;
 
   .svg-container {
     padding: 6px 5px 6px 5px;
-    color: #33AEF7;
+    color: #33aef7;
     vertical-align: middle;
     width: 30px;
     display: inline-block;
@@ -409,7 +444,7 @@ $light_gray:#eee;
       height: 45px;
       border-radius: 45px;
       background: #33aef7;
-      box-shadow: 2px 3px 8px 0px rgba(5,155,245,0.75);
+      box-shadow: 2px 3px 8px 0px rgba(5, 155, 245, 0.75);
     }
   }
 }

+ 63 - 30
src/views/sales_policy/components/AddCondition.vue

@@ -236,6 +236,7 @@
                         <el-table-column
                           type="selection"
                           width="55"
+                          :selectable="selectable"
                           align="center"
                         >
                         </el-table-column>
@@ -452,6 +453,8 @@ export default {
       arrIndex: 0,
       popArr: {},
       fang: false,
+      newConditionBox: [],
+      currentPage: 1,
     };
   },
   created() {
@@ -470,11 +473,26 @@ export default {
         this.$parent.isCondition = 0;
       }
     },
+    /**
+     * 根据条件禁用行复选框
+     * 函数返回值为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(全部无法选中)
+    },
     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) {
@@ -541,15 +559,23 @@ export default {
       };
       addPoliyCondition(params).then((res) => {
         this.$successMsg("添加成功");
+
+        this.newConditionBox = this.conditList;
+        this.conditionBox = [[], []];
+        this.conditionBoxs = [];
+        this.limit = "";
+        this.pop = "";
+        this.popArr = {};
         this.$parent.isCondition = 0;
         this.$parent.isFlag = 1;
-        Object.assign(this.$data,this.$options.data())
+        // Object.assign(this.$data, this.$options.data());
         this.$emit("handleSubmitCon", this.comCode);
       });
     },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
+
     // 筛选全部数据
     hanleSelectAll(selection, index) {
       this.arrIndex = index;
@@ -569,39 +595,48 @@ export default {
         }
       }
     },
+    // 更改每页数量
+    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;
-      if (!this.fang) {
-        getMaterialList({
-          pageNum: this.currentPage,
-          pageSize: this.pageSize,
-          saleTypeCode: this.saleTypeCode,
-          policyId: this.comCode,
-        }).then((res) => {
-          this.conditList = res.data.records;
-          this.listTotal = res.data.total;
-          this.fang = true;
-        });
-      } else {
-        console.log('fang');
-
+      getMaterialList({
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        saleTypeCode: this.saleTypeCode,
+        policyId: this.comCode,
+      }).then((res) => {
         let datas = [];
-
-      for (let j = 0; j < this.conditionBox.length; j++) {
-            datas = [...datas, ...this.conditionBox[j]];
+        for (let j = 0; j < this.conditionBox.length; j++) {
+          datas = [...datas, ...this.conditionBox[j]];
         }
-        for (let i = 0; i < this.conditList.length; i++) {
-           if (datas.length) {
-              for (let k = 0; k < datas.length; k++) {
-                if (datas[k].id == this.conditList[i].id) {
-                  this.conditList.splice(i,1)
-
-                }
+        const newData = datas.length ? datas : this.newConditionBox;
+        console.log(newData, "newData");
+        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.listTotal = this.conditList.length;
-      }
+        this.conditList = res.data.records;
+        this.listTotal = res.data.total;
+      });
     },
     handleSelectionAllChange(e) {
       this.leftData = e;
@@ -643,13 +678,11 @@ export default {
     handleDiaSubmit() {
       if (this.conditList2.length) {
         for (let i = 0; i < this.conditionBox.length; i++) {
-          console.log(this.conditionBox[i]);
           if (i == this.arrIndex) {
             this.$set(this.conditionBox, i, [
               ...this.conditList2,
               ...this.conditionBox[i],
             ]);
-            console.log(this.conditionBox);
           }
         }
         this.VisibleModle = false;

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

@@ -365,7 +365,7 @@ export default {
         examineRemark: this.remark,
       }).then((res) => {
         this.$successMsg("已提交审核");
-        this.isShow = 1;
+        this.$parent.isShow = 1;
         this.$parent.getList()
       });
     },

+ 4 - 1
src/views/sales_policy/policy_list.vue

@@ -153,7 +153,9 @@
     </div>
     <div class="btn-group">
       <el-row type="flex">
-        <el-button type="primary" class="btn" size="small" @click="hanlenewInfo"
+        <el-button  size="small"
+              type="primary"
+              icon="el-icon-plus"   @click="hanlenewInfo"
           >新增</el-button
         >
       </el-row>
@@ -414,6 +416,7 @@ listLoading:false,
       console.log(params,123);
       getList(params).then((res) => {
         this.dataList = res.data.records;
+        console.log(this.dataList);
         this.listTotal = res.data.total;
         this.listLoading = false
 

+ 6 - 5
src/views/sales_rebate/rebate_list.vue

@@ -167,25 +167,25 @@
             ></el-input>
           </el-form-item>
 
-          <el-form-item label="销售类型编码" prop="saleTypeCode">
+          <el-form-item label="销售类型名称" prop="saleTypeName">
             <el-select
               v-model="dialogForm.saleTypeCode"
               :disabled="type == 3"
               @change="handleChange"
-              placeholder="请选择类型编码"
+              placeholder="请选择销售类型编码"
             >
               <el-option
                 v-for="item in typeList"
                 :key="item.sysDictId"
-                :label="item.dictValue"
+                :label="item.saleName"
                 :value="item.saleCode"
               >
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="销售类型名称" prop="saleTypeName">
+          <el-form-item label="销售类型编码" prop="saleTypeCode">
             <el-input
-              v-model="dialogForm.saleTypeName"
+              v-model="dialogForm.saleTypeCode"
               :readonly="true"
             ></el-input>
           </el-form-item>
@@ -441,6 +441,7 @@ export default {
     hanelclose() {
       this.type = "";
       this.hanleReset();
+       this.$refs.dialogForm.resetFields();
     },
     handelInfo() {
       console.log(this.$refs.dialogForm);

+ 26 - 3
src/views/supply/pickup/check.vue

@@ -65,7 +65,32 @@
               {{ scope.row.printNum ? '已打单':'未打单' }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="提货方式" prop="pickType" min-width="160" show-overflow-tooltip>
+          <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.pickTime | dateToDayFilter }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
+            </template>
+          </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="invoiceOrderId" min-width="180" 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="mainName" min-width="120" 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>
+          <el-table-column align="center" label="数量" prop="qty" 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="payRebateAmount" min-width="120" show-overflow-tooltip></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="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
             </template>
@@ -75,8 +100,6 @@
               {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="提货单号" prop="pickOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
     </div>

+ 56 - 27
src/views/supply/pickup/components/pickup_form.vue

@@ -7,19 +7,19 @@
     <div>
       <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="80px" size="small" label-position="left">
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="选择仓库" prop="warehouse">
-              <el-select v-model="mainForm.warehouse" placeholder="请选择仓库">
+              <el-select v-model="mainForm.warehouse" placeholder="请选择仓库" style="width: 100%">
                 <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-button size="small" type="primary" @click="getDeliverList">确定</el-button>
           </el-col>
         </el-row>
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
+          <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
             <el-form-item label="预约日期" prop="date">
               <el-date-picker
                 v-model="mainForm.date"
@@ -40,28 +40,28 @@
           </el-col>
         </el-row>
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="提货方式" prop="pickupWay">
               <el-radio-group v-model="mainForm.pickupWay">
                 <el-radio :label="item.dictCode" v-for="(item, index) in pickupWayList" :key="index">{{item.dictValue}}</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="提货人" prop="pickupMan">
               <el-select v-model="mainForm.pickupMan" placeholder="全部" style="width: 100%">
                 <el-option :label="item.takerName" :value="item.id" v-for="(item, index) in pickupManList" :key="index"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6" v-if="mainForm.pickupWay == '1'">
+          <el-col :xs="24" :sm="12" :lg="8" v-if="mainForm.pickupWay == '1'">
             <el-form-item label="提货车辆" prop="pickupCar">
               <el-select v-model="mainForm.pickupCar" placeholder="全部" style="width: 100%">
                 <el-option :label="item.carBrand" :value="item.id" v-for="(item, index) in pickupCarList" :key="index"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6" v-if="mainForm.pickupWay == '2'">
+          <el-col :xs="24" :sm="12" :lg="8" v-if="mainForm.pickupWay == '2'">
             <el-form-item label="物流公司" prop="company">
               <el-select v-model="mainForm.company" placeholder="全部" style="width: 100%">
                 <el-option :label="item.logisticsCompany" :value="item.logisticsNumber" v-for="(item, index) in companyList" :key="index"></el-option>
@@ -83,13 +83,13 @@
       <div class="table">
         <el-table v-loading="listLoading" :data="deliverList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
           <el-table-column align="center" type="selection" width="55"></el-table-column>
-          <el-table-column align="center" label="发货申请单" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货申请单" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.orderTime | dateToDayFilter }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></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="enginOrderNo" 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="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
@@ -114,9 +114,8 @@
 </template>
 
 <script>
-import { getWarehouseList, getDeliverList, getPickupManList, getPickupCarList, getCompanyList, addPickupBook } from "@/api/supply/pickup";
+import { getWarehouseList, getDeliverList, getPickupManList, getPickupCarList, getCompanyList, addPickupBook, editPickupBook, getDetail } from "@/api/supply/pickup";
 import { getDictList } from "@/api/common";
-import { findElem } from "@/utils/util";
 
 export default {
   name: 'PickupForm',
@@ -178,6 +177,9 @@ export default {
     this.getPickupManList();
     this.getPickupCarList();
     this.getCompanyList();
+    if(this.listItem) {
+      this.getDetail();
+    }
   },
 
   methods: {
@@ -195,6 +197,23 @@ export default {
       this.$emit('backListFormDetail');
     },
 
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        let data = res.data;
+        this.mainForm.warehouse = data.correspondId;
+        this.mainForm.date = data.pickTime.slice(0, 10);
+        this.mainForm.timeSlot = Number(data.pickStatus);
+        this.mainForm.pickupWay = String(data.pickType);
+        this.mainForm.pickupMan = data.takerId;
+        this.mainForm.pickupCar = data.takerCarId;
+        this.mainForm.company = data.pickLogistics;
+        this.mainForm.remark = data.remark;
+
+        this.deliverList = data.invoicePickBeans;
+      })
+    },
+
     // 获取仓库列表
     getWarehouseList() {
       getWarehouseList({
@@ -264,20 +283,19 @@ export default {
           if(this.tableSelection.length < 1) {
             return this.$errorMsg('请选择发货申请单');
           }
-
           this.formLoading = true;
-          let takerName = '';
-          if(this.mainForm.pickupMan) {
-            let index = findElem(this.pickupManList, 'id', this.mainForm.pickupMan);
-            takerName = this.pickupManList[index].takerName;
-          }
+
+          let takerName = this.pickupManList.find(o => o.id == this.mainForm.pickupMan).takerName;
+          let correspondName = this.warehouseList.find(o => o.id == this.mainForm.warehouse).name;
+
           let orderList = [];
           this.tableSelection.forEach(item => {
             orderList.push(item.invoiceOrderId);
           });
           let params = {
-            stockName: this.mainForm.warehouse,
-            pickTime: this.mainForm.date,
+            correspondId: this.mainForm.warehouse,
+            correspondName,
+            pickTime: this.mainForm.date + ' 00:00:00',
             pickStatus: Number(this.mainForm.timeSlot),
             pickType: Number(this.mainForm.pickupWay),
             takerId: this.mainForm.pickupMan,
@@ -291,13 +309,24 @@ export default {
           if(this.mainForm.pickupWay == '2') {
             params.pickLogistics = this.mainForm.company;
           }
-          addPickupBook(params).then(res => {
-            this.$successMsg('提交成功');
-            this.goBack();
-            this.$parent.getList();
-          }).finally(res => {
-            this.formLoading = false;
-          })
+          if(this.listItem) {
+            params.id = this.listItem.id;
+            editPickupBook(params).then(res => {
+              this.$successMsg('提交成功');
+              this.goBack();
+              this.$parent.getList();
+            }).finally(res => {
+              this.formLoading = false;
+            })
+          }else {
+            addPickupBook(params).then(res => {
+              this.$successMsg('提交成功');
+              this.goBack();
+              this.$parent.getList();
+            }).finally(res => {
+              this.formLoading = false;
+            })
+          }
         }
       })
     },

+ 19 - 9
src/views/supply/pickup/pickup_list.vue

@@ -50,12 +50,12 @@
             <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
           </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'pick/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-column align="center" label="状态" min-width="160" show-overflow-tooltip>
+            <el-table-column align="center" label="状态" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.printNum ? '已打单':'未打单' }}
               </template>
@@ -63,7 +63,11 @@
             <el-table-column align="center" label="打单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="发货申请单号" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.pickTime | dateToDayFilter }}
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
@@ -75,18 +79,24 @@
                 {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
+            <el-table-column align="center" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{ scope.row.orderTime | dateToDayFilter }}
+                {{ scope.row.theTime | dateToDayFilter }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></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="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品名称" prop="productName" 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="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="number" min-width="100" show-overflow-tooltip></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="remark" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="100" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </div>

+ 7 - 3
src/views/supply/pickup/sum_list.vue

@@ -51,7 +51,7 @@
     <div class="mymain-container">
       <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="状态" min-width="160" show-overflow-tooltip>
+          <el-table-column align="center" label="状态" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.printNum ? '已打单':'未打单' }}
             </template>
@@ -59,7 +59,11 @@
           <el-table-column align="center" label="打单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="发货申请单号" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.pickTime | dateToDayFilter }}
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
@@ -76,7 +80,7 @@
               {{ scope.row.orderTime | dateToDayFilter }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></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="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>

+ 472 - 146
src/views/supply/policy/components/retail_detail.vue

@@ -5,7 +5,11 @@
       <div class="title">提货进度</div>
     </div>
     <div class="progress-container">
-      <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 1000 / 10) : 0"></el-progress>
+      <el-progress
+        :text-inside="true"
+        :stroke-width="26"
+        :percentage="detailData.thjd ? (detailData.thjd * 1000) / 10 : 0"
+      ></el-progress>
     </div>
 
     <div class="main-title">
@@ -16,47 +20,47 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">订单号</div>
-          <div class="value">{{detailData.id}}</div>
+          <div class="value">{{ detailData.id }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
-          <div class="value">{{detailData.theTime}}</div>
+          <div class="value">{{ detailData.theTime }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
         </el-col>
         <el-col :span="16" class="item">
           <div class="label">备注</div>
-          <div class="value">{{detailData.remark}}</div>
+          <div class="value">{{ detailData.remark }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">业务员</div>
-          <div class="value">{{detailData.serviceName}}</div>
+          <div class="value">{{ detailData.serviceName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">制单人</div>
-          <div class="value">{{detailData.createName}}</div>
+          <div class="value">{{ detailData.createName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">制单日期</div>
-          <div class="value">{{detailData.createTime}}</div>
+          <div class="value">{{ detailData.createTime }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">审核人</div>
-          <div class="value">{{detailData.examineName}}</div>
+          <div class="value">{{ detailData.examineName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">审核日期</div>
-          <div class="value">{{detailData.examineTime}}</div>
+          <div class="value">{{ detailData.examineTime }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">关闭人</div>
-          <div class="value">{{detailData.closeName}}</div>
+          <div class="value">{{ detailData.closeName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">关闭日期</div>
-          <div class="value">{{detailData.closeTime}}</div>
+          <div class="value">{{ detailData.closeTime }}</div>
         </el-col>
       </el-row>
     </div>
@@ -66,43 +70,177 @@
     </div>
 
     <div class="table" style="margin-top: 20px">
-      <el-table :data="detailData.retailOrderItemList" 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="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>
-        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-<el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip>
-                <template slot-scope="scope">
-
-                  <el-tag type="success" size="small"  v-if="scope.row.customerWalletName2">
-                      {{scope.row.customerWalletName2}}
-                  </el-tag>
-
-                </template>
-               </el-table-column>        <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="现金钱包" prop="customerWalletName" 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="isDirectTransfer" min-width="100" show-overflow-tooltip>
+      <el-table
+        :data="detailData.retailOrderItemList"
+        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="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>
+        <el-table-column
+          align="center"
+          label="单价"
+          prop="price"
+          min-width="100"
+          show-overflow-tooltip
+        ></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="totalAmount"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="返利类型"
+          prop="customerWalletName2"
+          min-width="200"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            <el-tag
+              type="success"
+              size="small"
+              v-if="scope.row.customerWalletName2"
+            >
+              {{ scope.row.customerWalletName2 }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="返利金额"
+          prop="payRebateAmount"
+          min-width="100"
+          show-overflow-tooltip
+        ></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="customerWalletName"
+          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="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="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="税率" prop="tax" 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="oldQty"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="备注"
+          prop="remark"
+          min-width="160"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="税率"
+          prop="tax"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
       </el-table>
     </div>
-  <div class="page-footer">
+    <div class="page-footer">
       <div class="footer" :class="classObj">
-        <!-- <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button> -->
-        <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'">直调完成</el-button>
+        <el-button
+          type="primary"
+          @click="openDeliverDialog"
+          :disabled="detailData.examineStatus !== 'OK'"
+          >直调发货</el-button
+        >
+        <el-button
+          type="primary"
+          @click="handleFinish"
+          :disabled="detailData.examineStatus !== 'OK'"
+          >直调完成</el-button
+        >
         <!-- <el-button @click="goBack">关 闭</el-button> -->
       </div>
     </div>
@@ -114,20 +252,22 @@
         <el-row :gutter="0">
           <el-col :span="12" class="item">
             <div class="label">审批人</div>
-            <div class="value">{{detailData.examineName}}</div>
+            <div class="value">{{ detailData.examineName }}</div>
           </el-col>
           <el-col :span="12" class="item">
             <div class="label">审批结果</div>
-            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+            <div class="value">
+              {{ detailData.examineStatus | statusFilter }}
+            </div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">审批说明</div>
-            <div class="value">{{detailData.examineRemark}}</div>
+            <div class="value">{{ detailData.examineRemark }}</div>
           </el-col>
         </el-row>
       </div>
     </div>
-<!--
+    <!--
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
@@ -136,33 +276,59 @@
     </div> -->
 
     <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
-      <el-form ref="deliverForm" :model="deliverForm" label-width="70px" size="small" label-position="left">
+      <el-form
+        ref="deliverForm"
+        :model="deliverForm"
+        :rules="deliverFormRules"
+        label-width="80px"
+        size="small"
+        label-position="left"
+      >
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="8" :lg="8">
-            <el-form-item label="工程订单" prop="orderNum">
-              <el-input v-model="deliverForm.orderNum" placeholder="请输入工程订单"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="8" :lg="8" style="height: 51px;">
+          <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">
             <el-form-item label="发货日期" prop="date">
               <el-date-picker
                 v-model="deliverForm.date"
                 type="date"
                 value-format="yyyy-MM-dd"
-                style="width: 100%;"
-                placeholder="选择日期">
+                style="width: 100%"
+                placeholder="选择日期"
+              >
               </el-date-picker>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="8" :lg="8">
+          <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="发货仓库" prop="warehouse">
-              <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库">
+              <el-select
+                v-model="deliverForm.warehouse"
+                placeholder="请选择发货仓库"
+                style="width: 100%"
+                filterable
+                @change="changeWarehouse"
+              >
                 <el-option
                   v-for="item in warehouseList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="8" :sm="8" :lg="8">
+            <el-form-item label="选择仓位" prop="position">
+              <el-select
+                v-model="deliverForm.position"
+                placeholder="请选择仓位"
+                style="width: 100%"
+                filterable
+              >
+                <el-option
+                  v-for="item in positionList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
               </el-select>
             </el-form-item>
           </el-col>
@@ -170,30 +336,120 @@
       </el-form>
 
       <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.retailOrderItemList" 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="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>
-          <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="返利类型" prop="walletRebateName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></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="qty" min-width="100" show-overflow-tooltip></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="isDirectTransfer" min-width="100" show-overflow-tooltip>
+        <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="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>
+          <el-table-column
+            align="center"
+            label="订单数量"
+            prop="qty"
+            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="adjustNum"
+            min-width="100"
+            show-overflow-tooltip
+          >
             <template slot-scope="scope">
-              {{scope.row.isDirectTransfer ? '是':'否'}}
+              <el-input
+                v-model="scope.row.adjustNum"
+                size="small"
+                type="number"
+              ></el-input>
             </template>
           </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="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></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="price"
+            min-width="100"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="金额"
+            prop="totalAmount"
+            min-width="100"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="返利"
+            prop="rebateAmount"
+            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="remark"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -201,28 +457,31 @@
         <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
       </span>
     </el-dialog>
-
   </div>
 </template>
 
 <script>
 import { getDetail } from "@/api/supply/policy";
-
+import {
+  getWarehouseList,
+  adjustDeliver,
+  finishData,
+} from "@/api/supply/retail";
 export default {
-  name: 'RetailDetail',
-  componentName: 'RetailDetail',
-  props: ['listItem'],
+  name: "RetailDetail",
+  componentName: "RetailDetail",
+  props: ["listItem"],
   filters: {
     statusFilter(val) {
       const 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" },
       ];
-      let obj = statusList.find(o => o.value == val);
-      return obj ? obj.label : ''
-    }
+      let obj = statusList.find((o) => o.value == val);
+      return obj ? obj.label : "";
+    },
   },
   data() {
     return {
@@ -230,30 +489,48 @@ export default {
 
       isShowDeliverDialog: false,
       deliverForm: {
-        orderNum: '',
-        date: '',
+        date: "",
+        warehouse: "",
+        position: "",
+      },
+      deliverFormRules: {
+        date: [
+          { required: true, message: "请选择发货日期", trigger: "change" },
+        ],
+        warehouse: [
+          { required: true, message: "请选择发货仓库", trigger: "change" },
+        ],
+        position: [
+          { required: true, message: "请选择仓位", trigger: "change" },
+        ],
       },
       warehouseList: [],
-    }
+      positionList: [],
+
+      goodsList: [],
+    };
   },
 
   computed: {
     sidebar() {
-      return this.$store.state.app.sidebar
+      return this.$store.state.app.sidebar;
     },
     classObj() {
       return {
         hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
+        openSidebar: this.sidebar.opened,
+      };
     },
     isExamine() {
-      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
+      return (
+        this.detailData.examineStatus === "OK" ||
+        this.detailData.examineStatus === "FAIL"
+      );
     },
     progress() {
-      if(this.detailData.totalQty == 0) return 0;
+      if (this.detailData.totalQty == 0) return 0;
       return (this.detailData.takeQty * 100) / (this.detailData.totalQty * 100);
-    }
+    },
   },
 
   created() {
@@ -263,72 +540,121 @@ export default {
   methods: {
     // 返回列表
     goBack() {
-      this.$emit('backListFormDetail');
+      this.$emit("backListFormDetail");
     },
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getDetail({ id: this.listItem.id }).then((res) => {
         this.detailData = res.data;
-      })
+      });
     },
- // 直调完成
+    // 直调完成
     handleFinish() {
-      this.$confirm('此操作将直调完成, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        finishData({
-          id: this.listItem.id
-        }).then(res => {
-          this.$successMsg();
-          this.getDetail();
+      this.$confirm("此操作将直调完成, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          finishData({
+            id: this.listItem.id,
+          }).then((res) => {
+            this.$successMsg();
+            this.getDetail();
+          });
         })
-      }).catch(() => {});
+        .catch(() => {});
+    },
+
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then((res) => {
+        this.warehouseList = res.data.records;
+      });
     },
+    // 更改仓库
+    changeWarehouse() {
+      this.deliverForm.position = "";
+      let obj = this.warehouseList.find(
+        (o) => o.id == this.deliverForm.warehouse
+      );
+      this.positionList = obj.kingDeeStocks;
+    },
+
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;
+      this.goodsList = this.detailData.retailOrderItemList;
+      this.getWarehouseList();
     },
 
     // 关闭 直调发货
     closeDeliverDialog() {
       this.isShowDeliverDialog = false;
     },
-
     // 提交 直调发货
     submitDeliverForm() {
-
+      this.$refs.deliverForm.validate((valid) => {
+        if (valid) {
+          for (let i = 0; i < this.goodsList.length; i++) {
+            if (!this.goodsList[i].adjustNum) {
+              this.$errorMsg("请输入直调数量");
+              return;
+            }
+          }
+          let goodsList = this.goodsList.map((item) => {
+            return {
+              itemId: item.id,
+              qty: item.adjustNum,
+            };
+          });
+          let params = {
+            orderNo: this.listItem.id,
+            orderDate: this.deliverForm.date + " 00:00:00",
+            correspondId: this.deliverForm.warehouse,
+            stockId: this.deliverForm.position,
+            directItems: goodsList,
+          };
+          adjustDeliver(params).then((res) => {
+            this.$successMsg();
+            this.isShowDeliverDialog = false;
+            this.getDetail();
+          });
+        }
+      });
     },
-
-  }
-}
+  },
+};
 </script>
 
 <style scoped lang="scss">
-  .detail-container {
-    width: 100%;
-    height: 100%;
-  }
-  .main-title {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    margin-top: 20px;
-    height: 60px;
-    border-bottom: 1px solid #DCDFE6;
-    margin-bottom: 20px;
-    .title {
-      font-size: 16px;
-      font-weight: 600;
-      padding-left: 10px;
-    }
+.detail-container {
+  width: 100%;
+  height: 100%;
+  margin-bottom: 50px;
+}
+.main-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 20px;
+  height: 60px;
+  border-bottom: 1px solid #dcdfe6;
+  margin-bottom: 20px;
+  .title {
+    font-size: 16px;
+    font-weight: 600;
+    padding-left: 10px;
   }
-  .progress-container {
-    display: flex;
-    .el-progress {
-      width: 500px;
-    }
+}
+.progress-container {
+  display: flex;
+  .el-progress {
+    width: 500px;
   }
+}
 </style>

+ 0 - 2
src/views/supply/policy/components/retail_form.vue

@@ -876,8 +876,6 @@ export default {
            })[0][val]
 
         }
-
-
       };
     },
       pickerOptions({ $props }) {

+ 1258 - 0
src/views/supply/policy/components/retail_form2.vue

@@ -0,0 +1,1258 @@
+<template>
+  <div class="detail-container">
+    <el-page-header
+      @back="goBack"
+      :content="listItem ? '编辑' : '新增'"
+    ></el-page-header>
+
+    <div class="main-title">
+      <div class="title">订单信息</div>
+    </div>
+
+    <el-form
+      ref="mainForm"
+      :model="mainForm"
+      :rules="mainFormRules"
+      label-width="120px"
+      size="small"
+      label-position="right"
+    >
+      <el-row :gutter="20">
+        <el-col
+          :xs="24"
+          :sm="12"
+          :lg="8"
+          v-if="!listItem"
+          @click.native="handleShow"
+        >
+          <el-form-item label="销售政策编号" prop="policyCode">
+            <el-input
+              v-model="policyId"
+              placeholder="销售政策编号"
+              readonly
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8" v-else>
+          <el-form-item label="销售政策编号" prop="policyCode">
+            <el-input
+              v-model="mainForm.policyCode"
+              placeholder="销售政策编号"
+            ></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"
+              type="datetime"
+              :picker-options="pickerOptions"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              style="width: 100%"
+              placeholder="选择日期"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="产品大类" prop="type">
+            <el-select
+              v-model="mainForm.type"
+              placeholder="选择产品大类"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in typeList"
+                :key="item.dictCode"
+                :label="item.dictValue"
+                :value="item.dictCode"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="16" :lg="16">
+          <el-form-item label="备注" prop="remark">
+            <el-input
+              v-model="mainForm.remark"
+              placeholder="请输入备注"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+      <div v-if="!listItem">
+        <el-select
+          v-model="warehouseValue"
+          placeholder="请选择发货仓库"
+          size="small"
+          style="margin-right: 10px"
+        >
+          <el-option
+            :label="item.name"
+            :value="item.id"
+            v-for="(item, index) in warehouseList"
+            :key="index"
+          ></el-option>
+        </el-select>
+        <el-button
+          type="primary"
+          size="small"
+          icon="el-icon-search"
+          @click="checkStock"
+          >检查库存</el-button
+        >
+        <el-divider direction="vertical"></el-divider>
+      </div>
+    </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"
+      >
+        <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="materialNumber"
+          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="price"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="总数量"
+          prop="qty"
+          min-width="100"
+          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
+          align="center"
+          label="订单金额"
+          min-width="100"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{ scope.row.price * scope.row.qty }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="返利钱包"
+          prop="customerWalletId2"
+          min-width="160"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            <el-select
+              v-model="scope.row.customerWalletId2"
+              placeholder="选择返利钱包"
+              size="small"
+              @change="changeWallet(scope.$index)"
+            >
+              <el-option label="全部" value=""></el-option>
+              <el-option
+                v-for="item in scope.row.rebateWallets"
+                :key="item.customerWalletId"
+                :label="item.name"
+                :value="item.customerWalletId"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="返利金额"
+          min-width="100"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{
+              (scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
+                100 || 0
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="格力折扣"
+          min-width="100"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{ scope.row.qty * scope.row.discAmount }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="现金钱包"
+          prop="customerWalletId"
+          min-width="160"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            <el-select
+              v-model="scope.row.customerWalletId"
+              placeholder="选择现金钱包"
+              size="small"
+            >
+              <el-option label="全部" value=""></el-option>
+              <el-option
+                v-for="item in scope.row.wallets"
+                :key="item.customerWalletId"
+                :label="item.name"
+                :value="item.customerWalletId"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="实付金额"
+          prop="qty"
+          min-width="100"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            {{
+              (scope.row.price * scope.row.qty * 100 -
+                ((scope.row.price *
+                  scope.row.qty *
+                  (scope.row.rebateRate * 100)) /
+                  100) *
+                  100 -
+                ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) /
+                100 || 0
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="是否直调"
+          prop="isDirectTransfer"
+          min-width="100"
+        >
+          <template slot-scope="scope">
+            <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column
+          align="center"
+          label="直调数量"
+          prop="directTransferQty"
+          min-width="100"
+        >
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.directTransferQty"
+              size="small"
+            ></el-input>
+          </template>
+        </el-table-column> -->
+        <el-table-column
+          align="center"
+          label="备注"
+          prop="remark"
+          min-width="160"
+        >
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="税率"
+          prop="tax"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          align="center"
+          label="总仓库"
+          prop="status1"
+          min-width="100"
+          show-overflow-tooltip
+          v-if="!listItem"
+        >
+          <template slot-scope="scope">
+            <div>{{ scope.row.status1 | status1Filter }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          align="center"
+          label="仓库状态"
+          prop="status2"
+          min-width="100"
+          show-overflow-tooltip
+          v-if="!listItem"
+        >
+          <template slot-scope="scope">
+            <div>{{ status2Filter(scope.row) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" @click="deleteItem(scope.$index)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
+        <el-popconfirm
+          title="确定关闭吗?"
+          @onConfirm="goBack"
+          style="margin-left: 10px"
+        >
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+    <el-dialog
+      :visible.sync="isShowDialog"
+      @close="handleClose"
+      width="80%"
+      :close-on-click-modal="false"
+      title="引用销售政策"
+    >
+      <template>
+        <el-form
+          :model="screenForm"
+          ref="screenForm"
+          label-width="120px"
+          size="small"
+        >
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="6" :lg="6">
+              <el-form-item label="销售政策">
+                <el-select
+                  v-model="screenForm.policyId"
+                  placeholder="选择销售政策"
+                  @change="handlePolicy"
+                  filterable
+                  :disabled="goodsList.length ? true : false"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in policyList"
+                    :key="index"
+                    :label="item.title"
+                    :value="item.code"
+                  ></el-option>
+                </el-select> </el-form-item
+            ></el-col>
+            <el-col :xs="24" :sm="6" :lg="6">
+              <el-form-item label="条件">
+                <el-select
+                  v-model="screenForm.factorId"
+                  filterable
+                  @change="handleFactor"
+                  placeholder="选择条件"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="(item, index) in factor"
+                    :key="item.id"
+                    :label="'条件' + (index + 1)"
+                    :value="item.id"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="6" :lg="6">
+              <el-form-item label="销售类型">
+                <el-select
+                  v-model="screenForm.saleTypeCode"
+                  filterable
+                  placeholder="选择销售类型"
+                  style="width: 100%"
+                >
+                  <el-option label="全部" value=""></el-option>
+                  <el-option
+                    v-for="item in ztypeList"
+                    :key="item.id"
+                    :label="item.saleName"
+                    :value="item.saleCode"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :xs="24" :sm="6" :lg="6" class="tr">
+              <el-button
+                type="primary"
+                size="small"
+                @click="handlePolicyTypeList"
+                >查询</el-button
+              >
+            </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
+          @selection-change="handleSelectionChange"
+          stripe
+        >
+          <el-table-column
+            align="center"
+            type="selection"
+            :selectable="selectable"
+            width="55"
+          >
+          </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
+            >
+              <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" 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>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getDetail,
+  addData,
+  editData,
+  getSalesTypeList,
+  getGoodsList,
+  getWalletList,
+  getWarehouseList,
+  policyList,
+  checkStock,
+  typeList,
+  getpolicyList,
+  getConditionList,
+  getConditionDetail,
+  getpolicyTypeList,
+  getPolicyConditionList,
+} from "@/api/supply/policy";
+import { getDictList } from "@/api/common";
+import { findElem } from "@/utils/util";
+
+export default {
+  name: "RetailForm",
+  componentName: "RetailForm",
+  props: ["listItem"],
+  filters: {
+    status1Filter(val) {
+      if (val === "" || val === null || val === undefined) return "未检查";
+      else if (val === 0) return "无货";
+      else if (val > 0 && val <= 30) return val;
+      else if (val > 30 && val <= 1000) return "有货";
+      else if (val > 1000) return "充足";
+    },
+  },
+  data() {
+    return {
+      tableData: [],
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      cusIndex: 0,
+      total: 0,
+      radio: "",
+      pop: "",
+      factor: [],
+      popArr: [],
+      mainForm: {
+        id: "",
+        date: "",
+        type: "",
+        ztype: "",
+        remark: "",
+        policyCode: "",
+        policyRemark: "",
+        policyId: "",
+      },
+      mainFormRules: {
+        date: [
+          { required: true, message: "请选择单据日期", trigger: "change" },
+        ],
+        type: [{ required: true, message: "请选择品类", trigger: "change" }],
+      },
+      goodsList: [],
+      warehouseList: [],
+      warehouseValue: "",
+      isShowDialog: false,
+      screenForm: {
+        policyId: "",
+        saleTypeCode: "",
+        factorId: "",
+      },
+      currentPage: 1,
+      listTotal: 0,
+      salesTypeList: [],
+      typeList: [],
+      ztypeList: [],
+      leftGoodsList: [],
+      rightGoodsList: [],
+      leftSelection: [],
+      rightSelection: [],
+      policyList: [],
+      xjWalletList: [],
+      flWalletList: [],
+      dataList: [],
+      columns: [
+        {
+          prop: "saleTypeName",
+          lable: "销售类型",
+          widht: 160,
+        },
+        {
+          prop: "materialName",
+          lable: "货品名称",
+          widht: 160,
+        },
+        {
+          prop: "specification",
+          lable: "规格型号",
+          widht: 160,
+        },
+
+        {
+          prop: "qty",
+          lable: "数量",
+          widht: 160,
+          num: true,
+        },
+        {
+          prop: "price",
+          lable: "单价",
+          widht: 160,
+        },
+        {
+          prop: "zong",
+          lable: "金额",
+          jie: true,
+        },
+      ],
+      listLoading: false,
+      popDataArr: [],
+      radioObj: {},
+      step: 0,
+      policyId: "",
+      policyConditionId: "",
+      multipleSelection: [],
+      multipleData: [],
+    };
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar;
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened,
+      };
+    },
+    comxjWalletList() {
+      return (c) => {
+        console.log(c, "现金钱包");
+        const walle = [];
+        const ovalVall = c == undefined || !c.length ? [] : c;
+        for (let i = 0; i < this.xjWalletList.length; i++) {
+          for (let j = 0; j < ovalVall.length; j++) {
+            if (this.xjWalletList[i].walletRebateId == ovalVall[j].walletId) {
+              walle.push(this.xjWalletList[i]);
+            }
+          }
+        }
+        return walle;
+      };
+    },
+    comText() {
+      return (val) => {
+        if (this.cusIndex - 1 == 0) {
+          const params = this.radio.split("&");
+          return this.dataList.filter((k) => {
+            return k.id == params[0];
+          })[0][val];
+        } else {
+          const params =
+            this.radioObj["radio" + (this.cusIndex - 1)].split("&");
+          return this.popDataArr[this.cusIndex - 2].filter((k) => {
+            return k.id == params[0];
+          })[0][val];
+        }
+      };
+    },
+    pickerOptions({ $props }) {
+      return {
+        disabledDate: (time) => {
+          return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000;
+        },
+      };
+    },
+  },
+
+  created() {
+    this.getDictList();
+    this.getWalletList();
+    this.getWarehouseList();
+    this.getTypeList();
+    if (this.listItem) {
+      this.getDetail();
+    }
+  },
+  beforeUpdate() {},
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit("backListFormDetail");
+    },
+    // 选择销售政策获取政策条件列表
+    handlePolicy(e) {
+      this.factor = [];
+      this.popDataArr = []
+      this.total = 0
+      this.screenForm.factorId = "";
+      // 选择销售政策PolidcyId改变获取条件列表
+      getPolicyConditionList({ policyId: e }).then((res) => {
+        this.factor = res.data;
+      });
+    },
+    //获取条件相对应的比列
+    handleFactor(e) {
+      const data = this.factor.filter((k) => {
+        return k.id == e;
+      })[0];
+      console.log(data, "kkkk");
+      this.pop = data.pop;
+      this.popArr = data.pop.split(":");
+
+      this.screenForm.policyId = data.policyId;
+      this.policyConditionId = data.id;
+    },
+    //引用销售政策搜索
+    handlePolicyTypeList() {
+      if (this.screenForm.factorId) {
+        this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+      } else {
+        this.$errorMsg("必须要条件");
+      }
+    },
+    // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
+    getConditionList(policyConditionId, popType) {
+      getConditionList({
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        policyConditionId,
+        popType,
+      }).then((res) => {
+        const datas = res.data.records;
+        this.total = res.data.total;
+        console.log(this.goodsList.length, 223424);
+        if (this.goodsList.length) {
+          for (let p = 0; p < this.goodsList.length; p++) {
+            for (let q = 0; q < datas.length; q++) {
+              if (this.goodsList[p].id == datas[q].id) {
+                datas[q].disabled = true;
+              }
+            }
+          }
+        }
+        for (let i = 0; i < res.data.records.length; i++) {
+          res.data.records[i].qty = 1;
+        }
+        if (this.popDataArr.length) {
+          this.popDataArr.splice(this.cusIndex, 1);
+        }
+        if (this.cusIndex == 0) {
+          this.popDataArr = [];
+        }
+
+        this.popDataArr = [...this.popDataArr, datas];
+      });
+    },
+    // 下一步获取某个政策条件比例数据
+    handleCondition() {
+      if (this.multipleSelection.length) {
+        this.cusIndex += 1;
+        this.multipleData.push(this.multipleSelection);
+        console.log(this.multipleData, "push", this.cusIndex);
+        this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+      } else {
+        this.$errorMsg("请选择");
+      }
+    },
+    /**
+     * 根据条件禁用行复选框
+     * 函数返回值为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(全部无法选中)
+    },
+
+    // 上一步
+    handleShang() {
+      this.cusIndex -= 1;
+      this.multipleData.splice(this.cusIndex, 1);
+    },
+    // 条件数据多选
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      console.log(this.multipleSelection);
+    },
+    hanlePopData() {
+      this.multipleData.push(this.multipleSelection);
+      if (this.multipleData.length) {
+        let arrData = [];
+        console.log(this.multipleData, "datga");
+        for (let i = 0; i < this.multipleData.length; i++) {
+          arrData = [...arrData, ...this.multipleData[i]];
+        }
+          if (this.goodsList.length) {
+            this.goodsList = [...this.goodsList,...arrData];
+          }else{
+            this.goodsList = arrData
+          }
+
+         console.log(this.goodsList,'jjjj');
+        this.goodsList.forEach((item) => {
+          this.$set(item, "status1", "");
+          this.$set(item, "status2", "");
+        });
+        this.cusIndex = 0;
+        this.total = 0;
+        this.popDataArr = [];
+        this.multipleData=[]
+        this.policyId = this.screenForm.policyId;
+        this.isShowDialog = false;
+      } else {
+        this.$errorMsg("请选择");
+      }
+    },
+    // 获取详情
+    getDetail() {
+      getDetail({ id: this.listItem.id }).then((res) => {
+        let data = res.data;
+        this.mainForm.date = data.theTime;
+        this.mainForm.type = data.mainId;
+        this.mainForm.remark = data.remark;
+        data.retailOrderItemList.forEach((item) => {
+          item.status1 = "";
+          item.status2 = "";
+        });
+        this.goodsList = data.retailOrderItemList;
+      });
+    },
+    // 获取销售政策
+    getPolicyList() {
+      policyList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then((res) => {
+        this.screenForm.policyId = res.data.records[0].code;
+        this.handlePolicy(this.screenForm.policyId);
+        this.policyList = res.data.records;
+        console.log(this.policyList, "policyList");
+      });
+    },
+    // 获取销售类型
+    getTypeList() {
+      const params = {
+        pageNum: 1,
+        pageSize: -1,
+        saleCode: "",
+        saleName: "",
+        status: "",
+      };
+      typeList(params).then((res) => {
+        this.ztypeList = res.data.records;
+        console.log(this.ztypeList, "type1111");
+      });
+    },
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then((res) => {
+        this.warehouseList = res.data.records;
+      });
+    },
+    // 获取限定机型
+    getpolicyTypeList() {
+      getpolicyTypeList({
+        pageNum: 1,
+        pageSize: 10,
+        policyId: this.screenForm.policyId,
+        saleTypeCode: this.screenForm.saleTypeCode,
+      }).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");
+      });
+    },
+    // 获取政策列表
+    getMaterialTypeList() {
+      getMaterialTypeList({
+        pageNum: 1,
+        pageSize: 10,
+        policyId: this.screenForm.policyId,
+        saleTypeCode: this.screenForm.saleTypeCode,
+      }).then((res) => {});
+    },
+
+    handleShow() {
+      this.isShowDialog = true;
+      this.getPolicyList();
+    },
+    // 获取钱包列表
+    getWalletList() {
+      getWalletList({
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        type: "COMMONLY",
+      }).then((res) => {
+        this.xjWalletList = res.data;
+        console.log(res.data, "xxxxx");
+      });
+
+      getWalletList({
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        type: "REBATE",
+      }).then((res) => {
+        this.flWalletList = res.data;
+        console.log(this.flWalletList, "xxccc");
+      });
+    },
+
+    // 获取销售类型列表
+    getSalesTypeList() {
+      getSalesTypeList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then((res) => {
+        this.salesTypeList = res.data.records;
+      });
+    },
+
+    getDictList() {
+      getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
+        this.typeList = res.data;
+      });
+    },
+
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.currentPage,
+        pageSize: 10,
+        mainId: this.screenForm.type,
+        saleId: this.screenForm.salesType,
+        materialCode: this.screenForm.proNum,
+        materialName: this.screenForm.proName,
+        specification: this.screenForm.proModel,
+        price1: this.screenForm.price1,
+        price2: this.screenForm.price2,
+      }).then((res) => {
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = res.data.records;
+        for (let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i];
+          for (let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j];
+            if (newItem.materialId === oldItem.materialId) {
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+        res.data.records.forEach((item) => {
+          item.materialName = item.name;
+          item.materialCode = item.number;
+          item.saleTypeName = item.saleName;
+          item.unit = item.baseUnit;
+          item.price = item.batchPrice;
+          item.tax = item.taxRate;
+          item.isDirectTransfer = false;
+          item.directTransferQty = "";
+          item.status1 = "";
+          item.status2 = "";
+          item.rebateAmount = "";
+          item.rebateRate = "";
+          item.productPriceId = item.id;
+        });
+        this.leftGoodsList = res.data.records;
+        this.listTotal = res.data.total;
+      });
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false; // 禁用
+      } else {
+        return true; // 不禁用
+      }
+    },
+
+    // 点击 选择商品
+    openDialog() {
+      this.getSalesTypeList();
+      this.getGoodsList();
+      this.isShowDialog = true;
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+
+
+    // 关闭 弹窗
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
+    // 删除
+    deleteGoods() {
+      let rightGoodsList = this.rightGoodsList;
+      let rightSelection = this.rightSelection;
+      for (let i = 0; i < rightGoodsList.length; i++) {
+        for (let j = 0; j < rightSelection.length; j++) {
+          if (rightSelection[j].materialId == rightGoodsList[i].materialId) {
+            this.rightGoodsList.splice(i, 1);
+          }
+        }
+      }
+    },
+
+    // 确定 添加产品
+    submitAddGoods() {
+      if (this.radio) {
+        const params = this.radio.split("&");
+        this.screenForm.policyId = params[1];
+        this.mainForm.policyId = params[1];
+        this.cusIndex += 1;
+        getpolicyList({
+          materialId: params[2],
+          policyId: params[1],
+        }).then((res) => {
+          this.pop = res.data.pop;
+          this.popArr = res.data.pop.split(":");
+          this.popArr.splice(0, 1);
+          for (let i = 0; i < this.popArr.length; i++) {
+            this.$set(this.radioObj, "radio" + (i + 1), "");
+          }
+          this.step = this.cusIndex + 1;
+
+          this.getConditionList(params[3], this.step);
+        });
+      } else {
+        this.$errorMsg("请选择");
+      }
+    },
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+
+      this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+    },
+ // 更改列表当前页
+    handleTableCurrentChange(val) {
+      this.currentPage = val;
+      this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+    },
+    handleClose() {
+      this.cusIndex = 0;
+      this.radio = "";
+      this.dataList = [];
+      this.popDataArr = [];
+      this.screenForm.policyId = "";
+      this.screenForm.saleTypeCode = "";
+    },
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+      console.log(this.multipleData);
+      // this.popDataArr.splice(index,1)
+    },
+    // 修改返利钱包
+    changeWallet(index) {
+      if (this.goodsList[index].customerWalletId2) {
+        let obj = this.flWalletList.find(
+          (o) => o.customerWalletId == this.goodsList[index].customerWalletId2
+        );
+        this.goodsList[index].rebateRate = obj.rebateRate;
+      } else {
+        this.goodsList[index].rebateRate = "";
+      }
+    },
+
+    // 检查库存
+    checkStock() {
+      if (!this.warehouseValue) {
+        return this.$errorMsg("请选择仓库");
+      }
+      if (!this.goodsList) {
+        return this.$errorMsg("请添加货品");
+      }
+      let ids = [];
+      this.goodsList.forEach((item) => {
+        ids.push(item.materialId);
+      });
+      checkStock({
+        correspondId: this.warehouseValue,
+        materialId: ids.join(","),
+      }).then((res) => {
+        if (res.data) {
+          this.goodsList.forEach((item, index) => {
+            item.status1 = res.data[index].allStockNum;
+            item.status2 = res.data[index].stockNum;
+            console.log(item.status1, item.status2);
+          });
+        }
+      });
+    },
+    status2Filter(item) {
+      if (
+        item.status2 === "" ||
+        item.status2 === null ||
+        item.status2 === undefined
+      )
+        return "未检查";
+      else if (item.status2 >= item.qty) return "可用";
+      else return "短缺";
+    },
+    // 保存
+    clickSubmitForm() {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          let mainName =
+            this.typeList[
+              findElem(this.typeList, "dictCode", this.mainForm.type)
+            ].dictValue;
+          let params = {
+            theTime: this.mainForm.date + " 00:00:00",
+            mainId: this.mainForm.type,
+            mainName,
+            remark: this.mainForm.remark,
+            type: 2, // 1:普通零售单,2:政策零售单
+            retailOrderItemList: this.goodsList,
+            policyId: this.policyId,
+          };
+          if (this.listItem) {
+            params.id = this.listItem.id;
+            editData(params).then((res) => {
+              this.$successMsg("编辑成功");
+              this.goBack();
+              this.$parent.getList();
+            });
+          } else {
+            addData(params).then((res) => {
+              this.$successMsg("添加成功");
+              this.goBack();
+              this.$parent.getList();
+            });
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.fr {
+  margin: 10px;
+  overflow: hidden;
+}
+.detail-container {
+  width: 100%;
+  height: 100%;
+}
+.main-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 20px;
+  height: 60px;
+  border-bottom: 1px solid #dcdfe6;
+  margin-bottom: 20px;
+  .title {
+    font-size: 16px;
+    font-weight: 600;
+    padding-left: 10px;
+  }
+}
+.tables {
+  display: flex;
+  margin-top: 10px;
+  .table {
+    width: 45%;
+  }
+  .buttons {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    padding: 0 10px;
+    button {
+      margin: 0;
+      margin-top: 10px;
+    }
+  }
+}
+.ellipsis {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+</style>

+ 12 - 4
src/views/supply/policy/policy_list.vue

@@ -238,7 +238,7 @@
             <el-table-column
               align="center"
               label="金额"
-              prop="totalAmount"
+              prop="payAmount"
               min-width="100"
               show-overflow-tooltip
             ></el-table-column>
@@ -262,8 +262,15 @@
 
             <el-table-column
               align="center"
-              label="返利"
-              prop="rebateAmount"
+              label="返利金额"
+              prop="payRebateAmount"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="格力折扣"
+              prop="totalDiscAmount"
               min-width="100"
               show-overflow-tooltip
             ></el-table-column>
@@ -427,7 +434,7 @@ import {
   submitCancel,
 } from "@/api/supply/policy";
 import RetailDetail from "./components/retail_detail";
-import RetailForm from "./components/retail_form";
+import RetailForm from "./components/retail_form2";
 import RetailExamine from "./components/retail_examine";
 import RetailReturn from "./components/retail_return";
 
@@ -525,6 +532,7 @@ export default {
         startTime: this.screenForm.date ? this.screenForm.date[0] : "",
         endTime: this.screenForm.date ? this.screenForm.date[1] : "",
         createBy: this.screenForm.zbMan,
+        status: true,
         examineBy: this.screenForm.shMan,
         type: 2, // 1:普通零售单,2:政策零售单
       };

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

@@ -167,7 +167,7 @@
         <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="直调数量" prop="adjustNum" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.adjustNum" size="small" type="number"></el-input>
+            <el-input v-model="scope.row.adjustNum" size="small" type="number" :disabled="!scope.row.isDirectTransfer"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
@@ -299,7 +299,7 @@ export default {
       this.$refs.deliverForm.validate((valid) => {
         if (valid) {
           for(let i=0; i<this.goodsList.length; i++) {
-            if(!this.goodsList[i].adjustNum) {
+            if(!this.goodsList[i].adjustNum && this.goodsList[i].isDirectTransfer) {
               this.$errorMsg('请输入直调数量');
               return;
             }
@@ -307,7 +307,7 @@ export default {
           let goodsList = this.goodsList.map((item) => {
             return {
               itemId: item.id,
-              qty: item.adjustNum,
+              qty: item.adjustNum || 0,
             }
           });
           let params = {

+ 2 - 2
src/views/supply/retail/components/retail_form.vue

@@ -411,7 +411,7 @@ export default {
           let oldItem = oldGoodsList[i]
           for(let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
-            if(newItem.materialId === oldItem.materialId){
+            if(newItem.id === oldItem.id){
               newGoodsList[j].selected = true;
               break;
             }
@@ -499,7 +499,7 @@ export default {
       for(let i=0; i<allArr.length; i++){  // 循环allArr数组对象的内容
         let flag = true;  // 建立标记,判断数据是否重复,true为不重复
         for(let j=0; j<newArr.length; j++){  // 循环新数组的内容
-          if(allArr[i].materialId == newArr[j].materialId){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
+          if(allArr[i].id == newArr[j].id){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
             flag = false;
           }
         }

+ 6 - 5
src/views/supply/sales/components/sales_detail.vue

@@ -10,7 +10,7 @@
         <el-row :gutter="0">
           <el-col :span="8" class="item">
             <div class="label">出库单号</div>
-            <div class="value">{{detailData.retailOrderId}}</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据日期</div>
@@ -18,7 +18,7 @@
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-          <div class="value">{{detailData.status | statusFilter}}</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">仓库</div>
@@ -99,9 +99,10 @@ export default {
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '待审核', value: 1 },
-        { label: '审核通过', value: 2 },
-        { label: '审核驳回', value: 3 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
       ];
       let obj = statusList.find(o => o.value == val);
       return obj ? obj.label : ''

+ 11 - 10
src/views/supply/sales/sales_list.vue

@@ -68,14 +68,14 @@
             <!-- <el-button size="small" type="warning" icon="el-icon-close">退单</el-button> -->
           </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'sale/order/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-column align="center" label="状态" prop="status" 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.status | statusFilter}}
+                {{scope.row.examineStatus | statusFilter}}
               </template>
             </el-table-column>
             <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
@@ -83,7 +83,7 @@
                 {{scope.row.billStatus | billStatusFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="出库单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></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="orderNo" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -91,9 +91,9 @@
             <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="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="备注" prop="remark" min-width="200" 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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="120" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
@@ -165,9 +165,10 @@ export default {
         status: '',
       },
       statusList: [
-        { label: '待审核', value: 1 },
-        { label: '审核通过', value: 2 },
-        { label: '审核驳回', value: 3 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
       ],
 
       queryItem: {},