howie 3 سال پیش
والد
کامیت
6d80f94411
46فایلهای تغییر یافته به همراه3222 افزوده شده و 669 حذف شده
  1. 8 0
      src/api/basic_data/material.js
  2. 9 0
      src/api/common.js
  3. 10 0
      src/api/finance/blance_sum.js
  4. 41 0
      src/api/finance/rebate_form.js
  5. 9 0
      src/api/finance/rebate_list.js
  6. 17 0
      src/api/finance/tax_rate.js
  7. 2 2
      src/api/stock.js
  8. 55 0
      src/api/supply/direct.js
  9. 1 1
      src/api/supply/implement.js
  10. 38 2
      src/api/supply/reserve.js
  11. 9 0
      src/api/supply/retail.js
  12. 0 3
      src/views/basic_data/dealer/dealer_deposit.vue
  13. 35 17
      src/views/basic_data/dealer/dealer_stock.vue
  14. 19 13
      src/views/basic_data/material/classify_list.vue
  15. 15 15
      src/views/basic_data/material/components/modify_list-apply.vue
  16. 9 2
      src/views/basic_data/material/material_list.vue
  17. 28 7
      src/views/basic_data/wallet/wallet_list.vue
  18. 40 26
      src/views/finance/balance_sum.vue
  19. 18 6
      src/views/finance/change_apply.vue
  20. 3 3
      src/views/finance/components/receivable_list-add.vue
  21. 5 5
      src/views/finance/credit_list.vue
  22. 5 5
      src/views/finance/finance_sum.vue
  23. 291 29
      src/views/finance/rebate_form.vue
  24. 120 48
      src/views/finance/rebate_list.vue
  25. 62 13
      src/views/finance/standbook_list.vue
  26. 184 61
      src/views/finance/tax_rate.vue
  27. 190 129
      src/views/merchant/create_account.vue
  28. 0 1
      src/views/sales_policy/components/AddCondition.vue
  29. 3 2
      src/views/sales_policy/components/Distributor.vue
  30. 9 1
      src/views/setting/account.vue
  31. 1 0
      src/views/setting/department.vue
  32. 2 1
      src/views/setting/menu.vue
  33. 1 10
      src/views/setting/role.vue
  34. 88 27
      src/views/stock/stock_list.vue
  35. 5 0
      src/views/supply/direct.vue
  36. 270 0
      src/views/supply/direct/components/direct_detail.vue
  37. 283 0
      src/views/supply/direct/components/direct_examine.vue
  38. 386 0
      src/views/supply/direct/components/direct_form.vue
  39. 345 0
      src/views/supply/direct/direct_list.vue
  40. 87 40
      src/views/supply/implement/implement_list.vue
  41. 39 71
      src/views/supply/reserve/components/reserve_detail.vue
  42. 381 63
      src/views/supply/reserve/components/reserve_form.vue
  43. 74 54
      src/views/supply/reserve/reserve_list.vue
  44. 19 6
      src/views/supply/retail/components/retail_detail.vue
  45. 2 2
      src/views/supply/retail/components/retail_form.vue
  46. 4 4
      src/views/supply/retail/retail_list.vue

+ 8 - 0
src/api/basic_data/material.js

@@ -297,6 +297,14 @@ export function getProductCategoryDelSub(params) {
     params
   })
 }
+//删除产品品类
+export function getProductCategoryDel(params) {
+  return request({
+    url:'/product-category/del',
+    method: 'post',
+    params
+  })
+}
 
 
 // 业务员

+ 9 - 0
src/api/common.js

@@ -34,4 +34,13 @@ export function getFileUrl(params) {
     method: 'get',
     params
   })
+}
+
+// 获取产品小类列表
+export function getSmallList(params) {
+  return request({
+    url: '/product-category/sub-list',
+    method: 'get',
+    params
+  })
 }

+ 10 - 0
src/api/finance/blance_sum.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 财务汇总-字段简单,直接看返回结果接
+export function getFinanceTotalCustomer(params) {
+    return request({
+      url: '/finance/totalCustomer',
+      method: 'get',
+      params
+    })
+  }

+ 41 - 0
src/api/finance/rebate_form.js

@@ -0,0 +1,41 @@
+import request from '@/utils/request'
+// 经销商列表
+export function getCustomerList(params) {
+    return request({
+      url: '/customer/list',
+      method: 'get',
+      params
+    })
+  }
+// 经销商钱包列表
+export function getWalletCustomerList(params) {
+    return request({
+      url: '/wallet/customer/list',
+      method: 'get',
+      params
+    })
+  }
+// 新增
+export function getRebateOrderAdd(data) {
+    return request({
+      url: '/rebate/order/add',
+      method: 'post',
+      data
+    })
+  }
+// 提审
+export function getRebateOrderApply(data) {
+    return request({
+      url: '/rebate/order/apply',
+      method: 'post',
+      data
+    })
+  }
+// 列表
+export function getRebateOrderList(params) {
+    return request({
+      url: '/rebate/order/list',
+      method: 'get',
+      params
+    })
+  }

+ 9 - 0
src/api/finance/rebate_list.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+// 列表
+export function getRebateOrderList(params) {
+    return request({
+      url: '/rebate/order/list',
+      method: 'get',
+      params
+    })
+  }

+ 17 - 0
src/api/finance/tax_rate.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+// 获取税率配置
+export function getCommonTaxGet() {
+    return request({
+      url: '/common/tax/get',
+      method: 'post',
+      
+    })
+  }
+// 税率配置
+export function getCommonTaxConfig(data) {
+    return request({
+      url: '/common/tax/config',
+      method: 'post',
+      data
+    })
+  }

+ 2 - 2
src/api/stock.js

@@ -12,7 +12,7 @@ export function getStockList(params) {
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
-    url: '/stock/list',
+    url: '/stock/listStock',
     method: 'get',
     params
   })
@@ -34,4 +34,4 @@ export function getReservedList(params) {
     method: 'get',
     params
   })
-}
+}

+ 55 - 0
src/api/supply/direct.js

@@ -0,0 +1,55 @@
+import request from '@/utils/request'
+
+// 获取列表
+export function getList(params) {
+  return request({
+    url: '/requisition/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取详情
+export function getDetail(params) {
+  return request({
+    url: '/requisition/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 审批
+export function examineData(params) {
+  return request({
+    url: '/requisition/approval',
+    method: 'post',
+    params
+  })
+}
+
+// 删除
+export function deleteData(params) {
+  return request({
+    url: '/requisition/delete',
+    method: 'post',
+    params
+  })
+}
+
+// 编辑
+export function editData(params) {
+  return request({
+    url: '/requisition/updateRequisition',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取仓库列表
+export function getWarehouseList(params) {
+  return request({
+    url: '/stock/listStock',
+    method: 'get',
+    params
+  })
+}

+ 1 - 1
src/api/supply/implement.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取列表
 export function getList(params) {
   return request({
-    url: '/transfer/list',
+    url: '/retail/exec/list',
     method: 'get',
     params
   })

+ 38 - 2
src/api/supply/reserve.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取列表
 export function getList(params) {
   return request({
-    url: '/ship/list',
+    url: '/reserve/list',
     method: 'get',
     params
   })
@@ -12,8 +12,44 @@ export function getList(params) {
 // 获取详情
 export function getDetail(params) {
   return request({
-    url: '/ship/detail',
+    url: '/reserve/detail',
     method: 'get',
     params
   })
+}
+
+// 关闭
+export function closeData(params) {
+  return request({
+    url: '/reserve/close',
+    method: 'post',
+    params
+  })
+}
+
+// 获取产品列表
+export function getGoodsList(params) {
+  return request({
+    url: '/reserve/listOrder',
+    method: 'get',
+    params
+  })
+}
+
+// 新增
+export function addData(params) {
+  return request({
+    url: '/reserve/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑
+export function editData(params) {
+  return request({
+    url: '/reserve/updateReserved',
+    method: 'post',
+    data: params
+  })
 }

+ 9 - 0
src/api/supply/retail.js

@@ -125,3 +125,12 @@ export function adjustDeliver(params) {
     data: params
   })
 }
+
+// 直调完成
+export function finishData(params) {
+  return request({
+    url: '/retail/transfer/over',
+    method: 'post',
+    params
+  })
+}

+ 0 - 3
src/views/basic_data/dealer/dealer_deposit.vue

@@ -47,9 +47,6 @@
       <div class="fl">
         <el-button type="primary" size="small" @click="addFn">新增</el-button>
       </div>
-      <div class="fr">
-        <el-button type="primary" size="small">打印</el-button>
-      </div>
     </div>
 
     <div class="mymain-container">

+ 35 - 17
src/views/basic_data/dealer/dealer_stock.vue

@@ -45,9 +45,6 @@
           >
         </el-popconfirm>
       </div>
-      <div class="fr">
-        <el-button type="primary" size="small">打印</el-button>
-      </div>
     </div>
 
     <div class="mymain-container">
@@ -181,8 +178,9 @@
         label-width="100px"
         label-position="right"
       >
-        <el-form-item label="经销商名称" prop="customerId">
+        <el-form-item label="经销商编码" prop="">
           <el-select
+            filterable
             class="selectStyle"
             v-model="addForm.customerId"
             placeholder="请选择"
@@ -190,17 +188,24 @@
             <el-option
               v-for="item in dealerList"
               :key="item.id"
-              :label="item.name"
+              :label="item.number"
               :value="item.id"
             >
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="经销商名称" prop="">
+          <el-input disabled v-model="addForm.customerName"></el-input>
+          <!-- <template slot-scope="scope">
+            {{ scope.row }}
+          </template> -->
+        </el-form-item>
         <el-form-item label="产品大类" prop="mainId">
           <el-select
             class="selectStyle"
             v-model="addForm.mainId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in categoryList"
@@ -216,6 +221,7 @@
             class="selectStyle"
             v-model="addForm.oneParentId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in oneList"
@@ -228,6 +234,7 @@
         </el-form-item>
         <el-form-item label="二级区域" prop="twoParentId">
           <el-select
+            filterable
             class="selectStyle"
             v-model="addForm.twoParentId"
             placeholder="请选择"
@@ -246,6 +253,7 @@
             class="selectStyle"
             v-model="addForm.threeParentId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in threeList"
@@ -261,6 +269,7 @@
             class="selectStyle"
             v-model="addForm.serviceId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="(item, i) in userList"
@@ -301,6 +310,8 @@ export default {
       dialogForm: false,
       addForm: {
         customerId: "",
+        customerName: "",
+        customerNumber: "",
         oneParentId: "",
         twoParentId: "",
         threeParentId: "",
@@ -353,10 +364,18 @@ export default {
     this.getDealerDataList({ pageNum: -1, pageSize: 10 });
     this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
     this.getCategoryList();
-    this.getAdminWebsit(1);
+    this.getAdminWebsit(0);
   },
   computed: {},
   watch: {
+    "addForm.customerId": async function (newValue) {
+      if (newValue) {
+        const res = this.dealerList.filter((i) => i.id == newValue);
+
+        this.addForm.customerName = res[0].name;
+        this.addForm.customerNumber = res[0].number;
+      }
+    },
     "addForm.oneParentId": async function (newValue) {
       if (newValue) {
         let res = await getAdminWebsitByparent({ parentId: newValue });
@@ -373,7 +392,7 @@ export default {
       if (newValue) {
         let res = await getAdminUserList({
           pageNum: 1,
-          pageSize: 10,
+          pageSize: -1,
           isCustomer: 0,
           adminWebsitId: newValue,
         });
@@ -391,9 +410,9 @@ export default {
       console.log(res);
       this.addForm.customerId = res.data.customerId;
       this.addForm.mainId = res.data.mainId;
-      this.addForm.oneParentId = res.data.adminWebsitId2;
-      this.addForm.twoParentId = res.data.adminWebsitId3;
-      this.addForm.threeParentId = res.data.adminCompanyId;
+      this.addForm.oneParentId = res.data.adminWebsitId1;
+      this.addForm.twoParentId = res.data.adminWebsitId2;
+      this.addForm.threeParentId = res.data.adminWebsitId3;
       this.addForm.serviceId = res.data.serviceId;
 
       this.dialogForm = true;
@@ -437,14 +456,11 @@ export default {
     },
     addFn() {
       this.title = "经销商业务关系管理";
+
       this.dialogForm = true;
     },
     async addDataListFn() {
       await this.$refs.addForm.validate();
-      console.log(this.addForm);
-      let data = this.dealerList.filter((v) => {
-        return v.id === this.addForm.customerId;
-      });
 
       let data2 = this.categoryList.filter((v) => {
         return v.productCategoryId == this.addForm.mainId;
@@ -455,8 +471,8 @@ export default {
 
       let value = {
         customerId: this.addForm.customerId,
-        customerName: data[0].name,
-        customerNumber: data[0].number,
+        customerName: this.addForm.cusotmerName,
+        customerNumber: this.addForm.customerNumber,
         mainId: this.addForm.mainId,
         mainName: data2[0].productCategoryName,
         serviceId: this.addForm.serviceId,
@@ -472,6 +488,7 @@ export default {
         this.$message.success("添加成功");
       }
       this.addForm.customerId = "";
+      this.addForm.customerName = "";
       this.addForm.mainId = "";
       this.addForm.oneParentId = "";
       this.addForm.twoParentId = "";
@@ -487,6 +504,7 @@ export default {
     async cancelFn() {
       await this.$refs.addForm.clearValidate();
       this.addForm.customerId = "";
+      this.addForm.customerName = "";
       this.addForm.mainId = "";
       this.addForm.oneParentId = "";
       this.addForm.twoParentId = "";
@@ -530,7 +548,7 @@ export default {
     //获取列表数据
     async getList(data) {
       const res = await getDealerStockList(data);
-      console.log(res);
+
       this.dataList = res.data.records;
       this.listTotal = res.data.total;
     },

+ 19 - 13
src/views/basic_data/material/classify_list.vue

@@ -11,12 +11,8 @@
           >新建分组</el-button
         >
         <div class="list">
-          <div
-            class="item"
-            :class="activeGroup === '' ? 'active' : ''"
-            @click="changeGroup('')"
-          >
-            <div class="title">所有分组</div>
+          <div class="item">
+            <strong class="title">所有分组</strong>
           </div>
           <div
             class="item"
@@ -34,9 +30,9 @@
                 <el-dropdown-item :command="['edit', v]"
                   >修改名称</el-dropdown-item
                 >
-                <!-- <el-dropdown-item :command="['del', v]"
+                <el-dropdown-item :command="['del', v]"
                   >删除分组</el-dropdown-item
-                > -->
+                >
               </el-dropdown-menu>
             </el-dropdown>
           </div>
@@ -181,7 +177,15 @@
             autocomplete="off"
             v-model="addGroupForm.productCategoryNumber"
             placeholder="请输入"
+            v-if="addGroupFormType == 'add' "
           ></el-input>
+            <el-input v-else
+              autocomplete="off"
+              v-model="addGroupForm.productCategoryNumber"
+              placeholder="请输入"
+              v-else disabled='disabled'
+            ></el-input>
+
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -208,6 +212,7 @@ import {
   getProductCategoryAdd,
   getProductCategoryEdit,
   getProductCategoryDelSub,
+  getProductCategoryDel,
 } from "@/api/basic_data/material";
 export default {
   data() {
@@ -330,10 +335,11 @@ export default {
           type: "warning",
         })
           .then(() => {
-            // deleteGroup({ groupId: item.marketingGroupId }).then((res) => {
-            //   this.$successMsg("删除成功");
-            //   this.getGroupList();
-            // });
+            console.log(v, 111);
+            getProductCategoryDel({ ids: v.productCategoryId }).then((res) => {
+              this.getDataList();
+              this.$successMsg("删除成功");
+            });
           })
           .catch(() => {});
       }
@@ -476,4 +482,4 @@ export default {
     }
   }
 }
-</style>
+</style>

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

@@ -47,21 +47,21 @@
               ></el-input>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="销售类型">
-              <el-select
-                placeholder="请选择销售类型"
-                filterable
-                v-model="saleTypeId"
-              >
-                <el-option
-                  v-for="item in typeList"
-                  :label="item.saleName"
-                  :value="item.id"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
+<!--          <el-col :xs="24" :sm="12" :lg="6">-->
+<!--            <el-form-item label="销售类型">-->
+<!--              <el-select-->
+<!--                placeholder="请选择销售类型"-->
+<!--                filterable-->
+<!--                v-model="saleTypeId"-->
+<!--              >-->
+<!--                <el-option-->
+<!--                  v-for="item in typeList"-->
+<!--                  :label="item.saleName"-->
+<!--                  :value="item.id"-->
+<!--                ></el-option>-->
+<!--              </el-select>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="文件编码">
               <el-input placeholder="请输入" v-model="base.remark"></el-input>

+ 9 - 2
src/views/basic_data/material/material_list.vue

@@ -92,13 +92,20 @@
               label="是否维护商城资料"
               prop="maintainData"
               min-width="100"
-            ></el-table-column>
+            >
+
+            </el-table-column>
             <el-table-column
               align="center"
               label="是否维护内外机档案"
               prop="maintainFiles"
               min-width="100"
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                <el-tag type="success" v-if="scope.row.isSheath==true">是</el-tag>
+                <el-tag type="danger" v-else>否</el-tag>
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="基本单位"

+ 28 - 7
src/views/basic_data/wallet/wallet_list.vue

@@ -20,16 +20,26 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="产品大类" prop="mainId">
-              <el-input
+              <el-select
+                class="selectStyle"
+                filterable
                 v-model="searchForm.mainId"
-                placeholder="请输入"
-              ></el-input>
+                placeholder="名称"
+              >
+                <el-option
+                  v-for="item in categoryList"
+                  :key="item.productCategoryNumber"
+                  :label="item.productCategoryName"
+                  :value="item.productCategoryNumber"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
 
-          <el-col :xs="24" :sm="12" :lg="12" class="tr">
+          <el-col :xs="24" :sm="24" :lg="12" class="tr">
             <el-form-item label="">
-              <el-button size="small">清空</el-button>
+              <el-button size="small" @click="clearFn">清空</el-button>
               <el-button size="small" type="primary" @click="searchFn"
                 >搜索</el-button
               >
@@ -116,7 +126,11 @@
           <el-input disabled v-model="addForm.number"></el-input>
         </el-form-item>
         <el-form-item label="对应产品大类" prop="customerId">
-          <el-select v-model="addForm.mainId" placeholder="名称">
+          <el-select
+            class="selectStyle"
+            v-model="addForm.mainId"
+            placeholder="名称"
+          >
             <el-option
               v-for="item in categoryList"
               :key="item.productCategoryNumber"
@@ -213,6 +227,10 @@ export default {
       // this.addForm.mainId = "";
       this.dialogForm = false;
     },
+    //清空
+    async clearFn() {
+      await this.$refs.searchForm.resetFields();
+    },
     //搜索
     searchFn() {
       this.getDataList({ ...this.searchForm });
@@ -247,5 +265,8 @@ export default {
 };
 </script>
 
-<style>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
 </style>

+ 40 - 26
src/views/finance/balance_sum.vue

@@ -12,18 +12,26 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="经销商名称" prop="">
-              <el-input placeholder="请输入经销商名称"></el-input>
+              <el-input
+                v-model="searchForm.customerName"
+                placeholder="请输入经销商名称"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="经销商编码" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-model="searchForm.customerNumber"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24">
             <el-form-item label="" class="fr">
               <el-button size="small">清空</el-button>
-              <el-button size="small" type="primary">搜索</el-button>
+              <el-button size="small" type="primary" @click="searchFn"
+                >搜索</el-button
+              >
             </el-form-item>
           </el-col>
         </el-row>
@@ -54,35 +62,28 @@
           <el-table-column
             align="center"
             label="经销商编码"
-            prop=""
+            prop="customerNumber"
             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=""
+            prop="customerName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="总金额"
-            prop=""
+            prop="total"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="更新时间"
-            prop=""
+            prop="theTime"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -94,16 +95,12 @@
             show-overflow-tooltip
           >
             <template slot-scope=""> </template>
-            <el-button type="text" class="textColor" slot="reference">
-              余额
-            </el-button>
-            <el-button type="text" class="textColor" slot="reference">
-              明细
-            </el-button>
+            <el-button type="text" class="textColor"> 余额 </el-button>
+            <el-button type="text" class="textColor"> 明细 </el-button>
           </el-table-column>
         </el-table>
       </div>
-      <!-- 分页 -->
+      <!-- 分页
       <div class="fr">
         <el-pagination
           :current-page="currentPage"
@@ -113,24 +110,41 @@
           :total="listTotal"
         >
         </el-pagination>
-      </div>
+      </div> -->
     </div>
   </div>
 </template>
 
 <script>
+import { getFinanceTotalCustomer } from "@/api/finance/blance_sum";
 export default {
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
+      // currentPage: 1, // 当前页码
+      // pageSize: 10, // 每页数量
+      // listTotal: 0, // 列表总数
       dataList: [], // 列表数据
-      searchForm: {}, //搜索表单
+      searchForm: {
+        customerName: "",
+        customerNumber: "",
+      }, //搜索表单
       listLoading: false, // 列表加载loading
     };
   },
+  created() {
+    this.getDataList();
+  },
   methods: {
+    //搜索
+    searchFn() {
+      this.getDataList(this.searchForm);
+    },
+    //获取列表数据
+    async getDataList(data) {
+      const res = await getFinanceTotalCustomer(data);
+      console.log(res);
+      this.dataList = res.data;
+    },
     //余额
     walletFn() {
       this.$router.push("/finance/wallet");

+ 18 - 6
src/views/finance/change_apply.vue

@@ -105,10 +105,10 @@
                 filterable
                 v-model="scope.row.name"
                 placeholder="请选择"
-                @focus="typeFn(scope.row)"
+                @click.native="changeCustomerFn(scope.row, scope.$index)"
               >
                 <el-option
-                  v-for="item in typeList"
+                  v-for="item in scope.row.typeList"
                   :key="item.id"
                   :label="item.name"
                   :value="item.id"
@@ -206,15 +206,27 @@ export default {
         v.bz = "";
       });
     },
-    //返利类型数据
-    async typeFn(row) {
+
+    // //返利类型数据
+    async changeCustomerFn(v, index) {
+      console.log(v, index, 123456789);
+      v.name = "";
       let res = await getWalletCustomerList({
-        customerId: row.customerId,
+        customerId: v.customerId,
         type: "REBATE",
       });
-      this.typeList = res.data;
+      this.$set(this.dataList[index], "typeList", res.data);
     },
 
+    // async typeFn(row) {
+    //   console.log(row);
+    //   let res = await getWalletCustomerList({
+    //     customerId: row.customerId,
+    //     type: "REBATE",
+    //   });
+    //   this.typeList = res.data;
+    // },
+
     //查询同个集团的经销商数据
     async getCustomerData() {
       const res = await getCustomerGroupList();

+ 3 - 3
src/views/finance/components/receivable_list-add.vue

@@ -319,7 +319,7 @@ export default {
         console.log(res);
         v.customerName = res[0].name;
         v.customerNumber = res[0].number;
-        let res2 = this.walletList.filter((j) => j.mainId == v.walletId);
+        let res2 = v.walletList.filter((j) => j.mainId == v.walletId);
         v.customerWalletId = res2[0].customerWalletId;
       });
       console.log(this.dataList);
@@ -335,14 +335,14 @@ export default {
     },
     //选择经销商名称事件
     async changeCustomerFn(v, index) {
-      console.log(v);
+      console.log(v, 322311);
       const res = await getFinanceCustomerList({
         customerId: v,
         type: "COMMONLY",
       });
       this.$set(this.dataList[index], "walletList", res.data);
       console.log(this.dataList, "kkk");
-      this.walletList = res.data;
+      // this.walletList = res.data;
     },
     //获取经销商数据
     async getCustomerList() {

+ 5 - 5
src/views/finance/credit_list.vue

@@ -138,7 +138,7 @@
             </el-table-column>
           </el-table>
         </div>
-        <!-- 分页 -->
+        <!-- 分页
         <div class="fr">
           <el-pagination
             @size-change="handleSizeChange"
@@ -150,7 +150,7 @@
             :total="listTotal"
           >
           </el-pagination>
-        </div>
+        </div> -->
       </div>
     </div>
     <CreditListDetail :recordsListId="recordsListId" v-else />
@@ -216,9 +216,9 @@ export default {
   },
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
+      // currentPage: 1, // 当前页码
+      // pageSize: 10, // 每页数量
+      // listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
         customerNumber: "",

+ 5 - 5
src/views/finance/finance_sum.vue

@@ -96,7 +96,7 @@
           ></el-table-column>
         </el-table>
       </div>
-      <!-- 分页 -->
+      <!-- 分页
       <div class="fr">
         <el-pagination
           :current-page="currentPage"
@@ -106,7 +106,7 @@
           :total="listTotal"
         >
         </el-pagination>
-      </div>
+      </div> -->
     </div>
   </div>
 </template>
@@ -119,9 +119,9 @@ import {
 export default {
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
+      // currentPage: 1, // 当前页码
+      // pageSize: 10, // 每页数量
+      // listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
         mainId: "",

+ 291 - 29
src/views/finance/rebate_form.vue

@@ -14,27 +14,49 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利单号" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input disabled placeholder=""></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利日期" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-date-picker
+                class="selectStyle"
+                v-model="searchForm.theTime"
+                type="datetime"
+                placeholder="选择日期时间"
+                default-time="23:59:59"
+                value-format="yyyy-MM-dd HH:mm:ss"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="备注" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单人" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-model="searchForm.createBy"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单日期" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-date-picker
+                class="selectStyle"
+                v-model="searchForm.createTime"
+                type="datetime"
+                placeholder="选择日期时间"
+                default-time="23:59:59"
+                value-format="yyyy-MM-dd HH:mm:ss"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
         </el-row>
@@ -68,65 +90,305 @@
           <el-table-column
             align="center"
             label="经销商编码"
-            prop=""
+            prop="customerNumber"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input disabled v-model="scope.row.customerNumber"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="经销商名称"
-            prop=""
+            prop="customerName"
+            min-width="200"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-select
+                @change="changeCustomerFn($event, scope.$index, scope.row)"
+                v-model="scope.row.customerId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in customerData"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利类型"
+            prop="customerWalletId"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select
+                v-model="scope.row.customerWalletId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in scope.row.walletList"
+                  :key="item.walletRebateId"
+                  :label="item.name"
+                  :value="item.walletRebateId"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="经销商简称"
-            prop=""
+            label="返利总金额"
+            prop="amount"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model.number="scope.row.amount"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="返利类型"
-            prop=""
+            label="暂扣返利"
+            prop="withholdAmount"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model.number="scope.row.withholdAmount"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="返利总金额"
-            prop=""
+            label="政策文件流水号"
+            prop="policyFileNo"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyFileNo"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="暂扣返利"
-            prop=""
+            label="政策文号"
+            prop="policyDocNo"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyDocNo"></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
-            label="备注"
-            prop=""
+            label="政策年份"
+            prop="policyYear"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyYear"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策月份"
+            prop="policyMonth"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyMonth"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策归属部门"
+            prop="policyOrg"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyOrg"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户区域"
+            prop="customerArea"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.customerArea"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户属性"
+            prop="customerAttr"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.customerAttr"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="建立实际归属客户"
+            prop="rewardActualCustomers"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.rewardActualCustomers"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注1"
+            prop="remark1"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark1"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注2"
+            prop="remark2"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark2"></el-input>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
     </div>
     <br />
-    <el-button type="primary" size="small">保存</el-button>
-    <el-button type="primary" size="small">提交审批</el-button>
-    <el-button type="primary" size="small">重置</el-button>
+
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fl">
+        <el-button type="primary" size="small" @click="addFn">保存</el-button>
+        <el-button type="primary" size="small" @click="submitFn"
+          >提交审批</el-button
+        >
+        <el-button type="primary" size="small">重置</el-button>
+      </div>
+      <div class="fr">
+        <el-button type="primary" size="small" @click="addRowFn"
+          >添加行</el-button
+        >
+        <el-button type="primary" size="small">删除行</el-button>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
-export default {};
+import {
+  getCustomerList,
+  getWalletCustomerList,
+  getRebateOrderAdd,
+  getRebateOrderApply,
+  getRebateOrderList,
+} from "@/api/finance/rebate_form";
+export default {
+  data() {
+    return {
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      customerData: [],
+      searchForm: {
+        theTime: "",
+        createTime: "",
+        remark: "",
+        createBy: "",
+      },
+    };
+  },
+  created() {
+    this.getCustomerData();
+  },
+  methods: {
+    //提交审批
+    async submitFn() {
+      let res = await getRebateOrderList({ pageSize: -1, pageNum: 1 });
+      console.log(res);
+      let index = res.data.records.length - 1;
+      let arr = res.data.records;
+      await getRebateOrderApply({ id: arr[index].id });
+      this.$message.success("提交审批成功");
+    },
+    //新增
+    async addFn() {
+      console.log(this.searchForm);
+      this.dataList.forEach((v) => {
+        delete v.walletList;
+      });
+      console.log(this.dataList);
+      await getRebateOrderAdd({ ...this.searchForm, items: this.dataList });
+      this.$message.success("保存成功");
+    },
+    //选择经销商名称事件
+    async changeCustomerFn(v, index, value) {
+      value.customerWalletId = "";
+      console.log(v, 322311);
+      const res = await getWalletCustomerList({
+        customerId: v,
+        type: "REBATE",
+      });
+      const res2 = this.customerData.filter((i) => i.id == v);
+
+      this.$set(this.dataList[index], "customerNumber", res2[0].number);
+      this.$set(this.dataList[index], "customerName", res2[0].name);
+      this.$set(this.dataList[index], "walletList", res.data);
+    },
+    //获取经销商数据
+    async getCustomerData() {
+      const res = await getCustomerList({ pageSize: -1, pageNum: 1 });
+      this.customerData = res.data.records;
+    },
+    //添加行
+    addRowFn() {
+      this.dataList.push({
+        customerNumber: "",
+        customerName: "",
+        customerWalletId: "",
+        amount: null,
+        withholdAmount: null,
+        policyFileNo: "",
+        policyDocNo: "",
+        policyYear: "",
+        policyMonth: "",
+        policyOrg: "",
+        customerArea: "",
+        customerAttr: "",
+        rewardActualCustomers: "",
+        remark1: "",
+        remark2: "",
+      });
+    },
+  },
+};
 </script>
 
-<style>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
 </style>

+ 120 - 48
src/views/finance/rebate_list.vue

@@ -79,185 +79,244 @@
           >
             <el-table-column
               align="center"
-              label="返利单号"
+              label="状态"
               prop=""
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
-              label="返利日期"
-              prop=""
+              label="返利单号"
+              prop="rebateOrderId"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
-              label="经销商编码"
-              prop=""
+              label="返利日期"
+              prop="theTime"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
-              label="经销商名称"
-              prop=""
+              label="经销商编码"
+              prop="customerNumber"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
-              label="主表备注"
-              prop=""
+              label="经销商名称"
+              prop="customerName"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
-              label="总金额"
-              prop=""
+              label="返利类型"
+              prop="walletName"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
-              label="返利类型"
+              label="总返利金额"
               prop=""
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{ Math.abs(scope.row.amount) + scope.row.withholdAmount }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="返利金额"
-              prop=""
+              prop="amount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="暂扣返利"
-              prop=""
+              prop="withholdAmount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="折让金额"
-              prop=""
+              prop="allowanceAmount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="折让编号"
-              prop=""
+              prop="allowanceCode"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="折让账号"
-              prop=""
+              prop="allowanceAccount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="已办理折让金额"
-              prop=""
+              prop="handledAllowanceAmount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="折让对应收款单号"
-              prop=""
+              prop="allowanceOrderNo"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="政策文件流水号"
+              prop="policyFileNo"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="政策文号"
+              prop="policyDocNo"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="政策年份"
+              prop="policyYear"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="政策月份"
+              prop="policyMonth"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="政策归属部门"
+              prop="policyOrg"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="客户区域"
+              prop="customerArea"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="客户属性"
+              prop="customerAttr"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="奖励实际归属客户"
+              prop="rewardActualCustomers"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="备注1"
+              prop="remark1"
+              min-width="160"
+              show-overflow-tooltip
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              label="备注2"
+              prop="remark2"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="制单人"
-              prop=""
+              prop="createBy"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="制单时间"
-              prop=""
+              prop="createTime"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="审核人"
-              prop=""
+              prop="examineBy"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="审核时间"
-              prop=""
+              prop="examineTime"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="确认人"
-              prop=""
+              prop="customerName"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="确认时间"
-              prop=""
+              prop="customerConfirmTime"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="复核人"
-              prop=""
+              prop="secondExamineBy"
               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=""
+              prop="secondExamineTime"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="操作"
-              min-width="160"
+              min-width="260"
               show-overflow-tooltip
               fixed="right"
             >
               <template slot-scope="">
-                <el-button type="text" class="textColor" slot="reference"
-                  >申请</el-button
-                >
-                <el-button type="text" class="textColor" slot="reference"
-                  >审核</el-button
-                >
-                <el-button type="text" class="textColor" slot="reference"
-                  >复核</el-button
-                >
-                <el-button type="text" class="textColor" slot="reference"
-                  >详情</el-button
-                >
+                <el-button type="text" class="textColor">申请</el-button>
+                <el-button type="text" class="textColor">审核</el-button>
+                <el-button type="text" class="textColor">复核</el-button>
+                <el-button type="text" class="textColor">详情</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -284,6 +343,7 @@
 </template>
 
 <script>
+import { getRebateOrderList } from "@/api/finance/rebate_list";
 import RebateListApply from "./components/rebate_list-apply.vue";
 import RebateListExamine from "./components/rebate_list-examine.vue";
 import RebateListReview from "./components/rebate_list-review.vue";
@@ -306,7 +366,19 @@ export default {
       showPage: 1,
     };
   },
+  created() {
+    this.getDataList({
+      pageSize: this.pageSize,
+      pageNum: this.currentPage,
+    });
+  },
   methods: {
+    //获取列表数据
+    async getDataList(data) {
+      const res = await getRebateOrderList(data);
+      this.dataList = res.data.records;
+      this.listTotal = res.data.total;
+    },
     //复核
     reviewFn() {
       this.showPage = 4;

+ 62 - 13
src/views/finance/standbook_list.vue

@@ -2,15 +2,15 @@
   <div class="app-container">
     <span>台账</span>
     <el-divider></el-divider>
-    <el-radio-group v-model="mainId" size="">
+    <!-- <el-radio-group v-model="mainId" size="">
       <el-radio-button
-        v-for="v in dictList"
-        :key="v.sysDictId"
+        v-for="(v, i) in dictList"
+        :key="i"
         :label="v.dictCode"
         >{{ v.dictValue }}</el-radio-button
       >
     </el-radio-group>
-    <br /><br />
+    <br /><br /> -->
     <el-radio-group v-model="bill" @change="checkFn" size="">
       <el-radio-button label="COMMONLY">贷款台账</el-radio-button>
       <el-radio-button label="REBATE">返利台账</el-radio-button>
@@ -34,8 +34,8 @@
                 placeholder="请选择"
               >
                 <el-option
-                  v-for="v in selectList"
-                  :key="v.walletRebateId"
+                  v-for="(v, i) in selectList"
+                  :key="i"
                   :label="v.name"
                   :value="v.walletRebateId"
                 >
@@ -152,7 +152,15 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                {{ scope.row.flag == 1 ? scope.row.amount : "-" }}
+                {{
+                  scope.row.flag == 1
+                    ? scope.row.amountType == "IN"
+                      ? scope.row.amount
+                      : scope.row.amountType == "OUT"
+                      ? -scope.row.amount
+                      : ""
+                    : "-"
+                }}
               </template>
             </el-table-column>
             <el-table-column
@@ -163,7 +171,15 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                {{ scope.row.flag == 2 ? scope.row.amount : "-" }}
+                {{
+                  scope.row.flag == 2
+                    ? scope.row.amountType == "IN"
+                      ? scope.row.amount
+                      : scope.row.amountType == "OUT"
+                      ? -scope.row.amount
+                      : ""
+                    : "-"
+                }}
               </template>
             </el-table-column>
             <el-table-column
@@ -174,7 +190,15 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                {{ scope.row.flag == 3 ? scope.row.amount : "-" }}
+                {{
+                  scope.row.flag == 3
+                    ? scope.row.amountType == "IN"
+                      ? scope.row.amount
+                      : scope.row.amountType == "OUT"
+                      ? -scope.row.amount
+                      : ""
+                    : "-"
+                }}
               </template>
             </el-table-column>
             <el-table-column
@@ -185,7 +209,15 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                {{ scope.row.flag == 4 ? scope.row.amount : "-" }}
+                {{
+                  scope.row.flag == 4
+                    ? scope.row.amountType == "IN"
+                      ? scope.row.amount
+                      : scope.row.amountType == "OUT"
+                      ? -scope.row.amount
+                      : ""
+                    : "-"
+                }}
               </template>
             </el-table-column>
             <el-table-column
@@ -196,7 +228,15 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                {{ scope.row.flag == 5 ? scope.row.amount : "-" }}
+                {{
+                  scope.row.flag == 5
+                    ? scope.row.amountType == "IN"
+                      ? scope.row.amount
+                      : scope.row.amountType == "OUT"
+                      ? -scope.row.amount
+                      : ""
+                    : "-"
+                }}
               </template>
             </el-table-column>
             <el-table-column
@@ -207,7 +247,15 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                {{ scope.row.flag == 6 ? scope.row.amount : "-" }}
+                {{
+                  scope.row.flag == 6
+                    ? scope.row.amountType == "IN"
+                      ? scope.row.amount
+                      : scope.row.amountType == "OUT"
+                      ? -scope.row.amount
+                      : ""
+                    : "-"
+                }}
               </template>
             </el-table-column>
             <el-table-column
@@ -389,7 +437,7 @@ export default {
         walletRebateId: "",
       }, //搜索表单
       listLoading: false, // 列表加载loading
-      mainId: "",
+      mainId: null,
       bill: "COMMONLY",
     };
   },
@@ -430,6 +478,7 @@ export default {
     },
     //查询
     searchFn() {
+      console.log(this.mainId);
       // console.log(this.searchForm);
       // const res = this.selectList.filter(
       //   (v) => v.walletRebateId == this.searchForm.walletRebateId

+ 184 - 61
src/views/finance/tax_rate.vue

@@ -1,79 +1,202 @@
 <template>
   <div class="app-container">
-    <div class="setting_title">税率设置</div>
-    <el-divider></el-divider>
-    <div class="">
-      <el-form label-position="left" label-width="100px">
-        <el-row>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="仓存费税率" prop="">
-              <el-input placeholder="请输入">
-                <i class="el-input__icon" slot="suffix">% </i>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :xs="24" :sm="24" :lg="6">
-            <el-form-item label="工程价差税率" prop="">
-              <el-input placeholder="请输入">
-                <i class="el-input__icon" slot="suffix">% </i>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :xs="24" :sm="24" :lg="6">
-            <el-form-item label="运输费税率" prop="">
-              <el-input placeholder="请输入">
-                <i class="el-input__icon" slot="suffix">% </i>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :xs="24" :sm="24" :lg="6">
-            <el-form-item label="安装费税率" prop="">
-              <el-input placeholder="请输入">
-                <i class="el-input__icon" slot="suffix">% </i>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :xs="24" :sm="24" :lg="6">
-            <el-form-item label="库存商品税率" prop="">
-              <el-input placeholder="请输入">
-                <i class="el-input__icon" slot="suffix">% </i>
-              </el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
+    <div>
+      <div class="setting_title">税率设置</div>
+      <el-divider></el-divider>
 
-        <el-row>
-          <el-col :xs="24" :sm="24" :lg="24">
-            <el-form-item label="" class="">
-              <el-button size="small">修改</el-button>
-              <el-button size="small" type="primary">确定</el-button>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+      <el-card shadow="never" class="my-card">
+        <el-form
+          class="my-form"
+          ref="mainForm"
+          :model="mainForm"
+          label-width="120px"
+          label-position="right"
+        >
+          <el-form-item label="仓存费税率" prop="nickName">
+            <el-input
+              v-model="mainForm.storageFeeTax"
+              autocomplete="off"
+              placeholder="请输入"
+              ><i class="el-input__icon" slot="suffix">% </i></el-input
+            >
+          </el-form-item>
+          <el-form-item label="工程价差税率" prop="nickName">
+            <el-input
+              v-model="mainForm.enginPriceDifTax"
+              autocomplete="off"
+              placeholder="请输入"
+              ><i class="el-input__icon" slot="suffix">% </i></el-input
+            >
+          </el-form-item>
+          <el-form-item label="运输费税率" prop="nickName">
+            <el-input
+              v-model="mainForm.transportTax"
+              autocomplete="off"
+              placeholder="请输入"
+              ><i class="el-input__icon" slot="suffix">% </i></el-input
+            >
+          </el-form-item>
+          <el-form-item label="安装费税率" prop="nickName">
+            <el-input
+              v-model="mainForm.installTax"
+              autocomplete="off"
+              placeholder="请输入"
+              ><i class="el-input__icon" slot="suffix">% </i></el-input
+            >
+          </el-form-item>
+          <el-form-item label="库存商品税率" prop="nickName">
+            <el-input
+              v-model="mainForm.stockTax"
+              autocomplete="off"
+              placeholder="请输入"
+              ><i class="el-input__icon" slot="suffix">% </i></el-input
+            >
+          </el-form-item>
+        </el-form>
+        <!-- <el-form label-position="left" label-width="100px">
+          <el-row>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="仓存费税率" prop="">
+                <el-input placeholder="请输入">
+                  <i class="el-input__icon" slot="suffix">% </i>
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :xs="24" :sm="24" :lg="6">
+              <el-form-item label="工程价差税率" prop="">
+                <el-input placeholder="请输入">
+                  <i class="el-input__icon" slot="suffix">% </i>
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :xs="24" :sm="24" :lg="6">
+              <el-form-item label="运输费税率" prop="">
+                <el-input placeholder="请输入">
+                  <i class="el-input__icon" slot="suffix">% </i>
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :xs="24" :sm="24" :lg="6">
+              <el-form-item label="安装费税率" prop="">
+                <el-input placeholder="请输入">
+                  <i class="el-input__icon" slot="suffix">% </i>
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :xs="24" :sm="24" :lg="6">
+              <el-form-item label="库存商品税率" prop="">
+                <el-input placeholder="请输入">
+                  <i class="el-input__icon" slot="suffix">% </i>
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row>
+            <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item label="" class="">
+                <el-button size="small">修改</el-button>
+                <el-button size="small" type="primary">确定</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form> -->
+      </el-card>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer">
+        <el-button type="primary" @click="editFn">修改</el-button>
+        <el-button type="primary">确定</el-button>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
+import { getCommonTaxGet, getCommonTaxConfig } from "@/api/finance/tax_rate";
 export default {
   data() {
     return {
-      userInfo: {
-        nickName: "",
+      mainForm: {
+        storageFeeTax: "",
+        enginPriceDifTax: "",
+        transportTax: "",
+        installTax: "",
+        stockTax: "",
       },
     };
   },
+  created() {
+    this.getData();
+  },
+  methods: {
+    //修改
+    async editFn() {
+      await getCommonTaxConfig(this.mainForm);
+    },
+    //获取税率数据
+    async getData() {
+      const res = await getCommonTaxGet();
+      console.log(res);
+      this.mainForm = {
+        storageFeeTax: res.data.storageFeeTax,
+        enginPriceDifTax: res.data.enginPriceDifTax,
+        transportTax: res.data.transportTax,
+        installTax: res.data.installTax,
+        stockTax: res.data.stockTax,
+      };
+    },
+  },
 };
 </script>
 
-<style>
+<style lang="scss" scoped>
+.setting_title {
+  padding-left: 0;
+}
+.tips {
+  font-size: 14px;
+}
+.my-card {
+  margin-top: 20px;
+  .box {
+    background: rgb(235, 240, 249);
+    padding: 10px;
+    font-size: 14px;
+    margin: 20px 0;
+    line-height: 18px;
+    ::v-deep .el-link {
+      vertical-align: unset;
+    }
+  }
+}
+.my-form {
+  width: 450px;
+  margin: 0 auto;
+}
+.show-pwd {
+  position: absolute;
+  right: 15px;
+  top: 0;
+  font-size: 16px;
+  cursor: pointer;
+  user-select: none;
+}
+.question {
+  position: absolute;
+  right: -30px;
+  top: 0;
+  font-size: 20px;
+  cursor: pointer;
+  user-select: none;
+}
 </style>

+ 190 - 129
src/views/merchant/create_account.vue

@@ -3,47 +3,96 @@
     <div v-show="step == 1">
       <div class="setting_title">开通账号</div>
       <el-divider></el-divider>
-      <div class="tips">说明:开通商户账号是指开通商城后台管理系统的总登录账号。</div>
+      <div class="tips">
+        说明:开通商户账号是指开通商城后台管理系统的总登录账号。
+      </div>
 
       <el-card shadow="never" class="my-card">
-        <el-form class="my-form" ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="120px" label-position="right">
+        <el-form
+          class="my-form"
+          ref="mainForm"
+          :model="mainForm"
+          :rules="mainFormRules"
+          label-width="120px"
+          label-position="right"
+        >
           <el-form-item label="商户账号" prop="account">
-            <el-input v-model="mainForm.account" autocomplete="off" placeholder="请输入商户账号"></el-input>
+            <el-input
+              v-model="mainForm.account"
+              autocomplete="off"
+              placeholder="请输入商户账号"
+            ></el-input>
             <el-popover
               class="question"
               placement="right-start"
               title="账号设置"
               width="260"
               trigger="hover"
-              content="账号设置需按数字、字母组合设置至少12位账号">
+              content="账号设置需按数字、字母组合设置至少12位账号"
+            >
               <svg-icon icon-class="question" slot="reference" />
             </el-popover>
           </el-form-item>
           <el-form-item label="账户昵称" prop="nickName">
-            <el-input v-model="mainForm.nickName" autocomplete="off" placeholder="请输入账户昵称"></el-input>
+            <el-input
+              v-model="mainForm.nickName"
+              autocomplete="off"
+              placeholder="请输入账户昵称"
+            ></el-input>
           </el-form-item>
           <el-form-item label="负责人" prop="chargePerson">
-            <el-input v-model="mainForm.chargePerson" autocomplete="off" placeholder="请输入负责人"></el-input>
+            <el-input
+              v-model="mainForm.chargePerson"
+              autocomplete="off"
+              placeholder="请输入负责人"
+            ></el-input>
           </el-form-item>
           <el-form-item label="联系电话" prop="phone">
-            <el-input v-model="mainForm.phone" autocomplete="off" placeholder="请输入联系电话"></el-input>
+            <el-input
+              v-model="mainForm.phone"
+              autocomplete="off"
+              placeholder="请输入联系电话"
+            ></el-input>
           </el-form-item>
           <el-form-item label="金蝶主体账号" prop="kingdeeId">
-            <el-input v-model="mainForm.kingdeeId" autocomplete="off" placeholder="请输入金蝶主体账号"></el-input>
+            <el-input
+              v-model="mainForm.kingdeeId"
+              autocomplete="off"
+              placeholder="请输入金蝶主体账号"
+            ></el-input>
           </el-form-item>
           <el-form-item label="金蝶主体名称" prop="kingdeeName">
-            <el-input v-model="mainForm.kingdeeName" autocomplete="off" placeholder="请输入金蝶主体名称"></el-input>
+            <el-input
+              v-model="mainForm.kingdeeName"
+              autocomplete="off"
+              placeholder="请输入金蝶主体名称"
+            ></el-input>
           </el-form-item>
           <el-form-item label="电子邮箱" prop="email">
-            <el-input v-model="mainForm.email" autocomplete="off" placeholder="请输入电子邮箱"></el-input>
+            <el-input
+              v-model="mainForm.email"
+              autocomplete="off"
+              placeholder="请输入电子邮箱"
+            ></el-input>
           </el-form-item>
           <el-form-item label="地址" prop="address">
-            <el-input v-model="mainForm.address" placeholder="请输入地址"></el-input>
+            <el-input
+              v-model="mainForm.address"
+              placeholder="请输入地址"
+            ></el-input>
           </el-form-item>
           <el-form-item label="登录密码" prop="newPassword">
-            <el-input v-model="mainForm.newPassword" ref="password1" auto-complete="new-password" placeholder="请输入登录密码" :type="passwordType1"></el-input>
+            <el-input
+              v-model="mainForm.newPassword"
+              ref="password1"
+              auto-complete="new-password"
+              placeholder="请输入登录密码"
+              :type="passwordType1"
+            ></el-input>
             <span class="show-pwd" @click="showPwd(1)">
-              <svg-icon :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'" />
+              <svg-icon
+                :icon-class="passwordType1 === 'password' ? 'eye' : 'eye-open'"
+              />
             </span>
             <el-popover
               class="question"
@@ -51,14 +100,23 @@
               title="密码设置"
               width="260"
               trigger="hover"
-              content="密码设置需按数字、字母组合设置至少12位密码">
+              content="密码设置需按数字、字母组合设置至少12位密码"
+            >
               <svg-icon icon-class="question" slot="reference" />
             </el-popover>
           </el-form-item>
           <el-form-item label="确认密码" prop="confirmPassword">
-            <el-input v-model="mainForm.confirmPassword" ref="password2" auto-complete="confirm-password" placeholder="请再次输入密码" :type="passwordType2"></el-input>
+            <el-input
+              v-model="mainForm.confirmPassword"
+              ref="password2"
+              auto-complete="confirm-password"
+              placeholder="请再次输入密码"
+              :type="passwordType2"
+            ></el-input>
             <span class="show-pwd" @click="showPwd(2)">
-              <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
+              <svg-icon
+                :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'"
+              />
             </span>
             <el-popover
               class="question"
@@ -66,7 +124,8 @@
               title="密码设置"
               width="260"
               trigger="hover"
-              content="确认密码需要和登录密码保持一致">
+              content="确认密码需要和登录密码保持一致"
+            >
               <svg-icon icon-class="question" slot="reference" />
             </el-popover>
           </el-form-item>
@@ -76,121 +135,121 @@
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
+        <el-button
+          type="primary"
+          @click="clickSubmitForm"
+          :loading="formLoading"
+          >{{ formLoading ? "提交中 ..." : "提 交" }}</el-button
+        >
         <el-popconfirm
           title="确定关闭吗?"
           @onConfirm="goBack"
-          style="margin-left: 10px;"
+          style="margin-left: 10px"
         >
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
       </div>
     </div>
-    
   </div>
 </template>
 
 <script>
-import { getToken } from '@/utils/auth'
+import { getToken } from "@/utils/auth";
 import { addAccount } from "@/api/merchant";
 
 export default {
   data() {
     var validateAccount = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请输入商户账号'));
+      if (value === "") {
+        callback(new Error("请输入商户账号"));
       } else if (value.length < 12) {
-        callback(new Error('账号长度至少12位'));
+        callback(new Error("账号长度至少12位"));
       } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
-        callback(new Error('账号必须包含数字和字母'));
+        callback(new Error("账号必须包含数字和字母"));
       } else {
         callback();
       }
     };
     var validatePass3 = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请输入登录密码'));
+      if (value === "") {
+        callback(new Error("请输入登录密码"));
       } else if (value.length < 12) {
-        callback(new Error('密码长度至少12位'));
+        callback(new Error("密码长度至少12位"));
       } else if (/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(value) == false) {
-        callback(new Error('密码必须包含数字和字母'));
+        callback(new Error("密码必须包含数字和字母"));
       } else {
-        if (this.mainForm.confirmPassword !== '') {
-          this.$refs.mainForm.validateField('confirmPassword');
+        if (this.mainForm.confirmPassword !== "") {
+          this.$refs.mainForm.validateField("confirmPassword");
         }
         callback();
       }
     };
     var validatePass4 = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('请再次输入密码'));
+      if (value === "") {
+        callback(new Error("请再次输入密码"));
       } else if (value !== this.mainForm.newPassword) {
-        callback(new Error('两次输入密码不一致'));
+        callback(new Error("两次输入密码不一致"));
       } else {
         callback();
       }
     };
     return {
       baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: {'x-token': getToken()},
+      myHeaders: { "x-token": getToken() },
       step: 1,
       mainForm: {
-        account: '', // 账号
-        nickName: '', // 用户名
-        appName: '', // 小程序名称
-        chargePerson: '', // 负责人
-        phone: '', // 联系电话
-        kingdeeId: '',
-        kingdeeName: '',
-        email: '', // 电子邮箱
-        address: '', // 地址
-        newPassword: '', // 登录密码
-        confirmPassword: '', // 确认密码
+        account: "", // 账号
+        nickName: "", // 用户名
+        appName: "", // 小程序名称
+        chargePerson: "", // 负责人
+        phone: "", // 联系电话
+        kingdeeId: "",
+        kingdeeName: "",
+        email: "", // 电子邮箱
+        address: "", // 地址
+        newPassword: "", // 登录密码
+        confirmPassword: "", // 确认密码
       },
       mainFormRules: {
         account: [
-          { required: true, validator: validateAccount, trigger: 'blur' }
+          { required: true, validator: validateAccount, trigger: "blur" },
         ],
         nickName: [
-          { required: true, message: '请输入用户名', trigger: 'blur' }
-        ],
-        appName: [
-          { required: true, message: '请输入用户名', trigger: 'blur' }
+          { required: true, message: "请输入用户名", trigger: "blur" },
         ],
+        appName: [{ required: true, message: "请输入用户名", trigger: "blur" }],
         chargePerson: [
-          { required: true, message: '请输入负责人', trigger: 'blur' }
-        ],
-        phone: [
-          { required: true, message: '请输入联系电话', trigger: 'blur' }
+          { required: true, message: "请输入负责人", trigger: "blur" },
         ],
+        phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
         kingdeeId: [
-          { required: true, message: '请输入金蝶主体账号', trigger: 'blur' }
+          { required: true, message: "请输入金蝶主体账号", trigger: "blur" },
         ],
         kingdeeName: [
-          { required: true, message: '请输入金蝶主体密码', trigger: 'blur' }
+          { required: true, message: "请输入金蝶主体密码", trigger: "blur" },
         ],
         newPassword: [
-          { required: true, validator: validatePass3, trigger: 'blur' }
+          { required: true, validator: validatePass3, trigger: "blur" },
         ],
         confirmPassword: [
-          { required: true, validator: validatePass4, trigger: 'blur' }
+          { required: true, validator: validatePass4, trigger: "blur" },
         ],
       },
-      passwordType1: 'password',
-      passwordType2: 'password',
+      passwordType1: "password",
+      passwordType2: "password",
 
       formLoading: false,
-    }
+    };
   },
   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,
+      };
     },
   },
   methods: {
@@ -200,25 +259,25 @@ export default {
 
     // 显示隐藏密码
     showPwd(num) {
-      if(num == 1) {
-        if (this.passwordType1 === 'password') {
-          this.passwordType1 = ''
+      if (num == 1) {
+        if (this.passwordType1 === "password") {
+          this.passwordType1 = "";
         } else {
-          this.passwordType1 = 'password'
+          this.passwordType1 = "password";
         }
         this.$nextTick(() => {
-          this.$refs.password1.focus()
-        })
+          this.$refs.password1.focus();
+        });
       }
-      if(num == 2) {
-        if (this.passwordType2 === 'password') {
-          this.passwordType2 = ''
+      if (num == 2) {
+        if (this.passwordType2 === "password") {
+          this.passwordType2 = "";
         } else {
-          this.passwordType2 = 'password'
+          this.passwordType2 = "password";
         }
         this.$nextTick(() => {
-          this.$refs.password2.focus()
-        })
+          this.$refs.password2.focus();
+        });
       }
     },
 
@@ -228,7 +287,7 @@ export default {
         if (valid) {
           this.submitForm();
         }
-      })
+      });
     },
 
     // 提交表单
@@ -247,61 +306,63 @@ export default {
           address: this.mainForm.address,
           password: this.mainForm.confirmPassword,
         },
-      }
-      addAccount(params).then(res => {
-        this.$successMsg('开通成功');
-        setTimeout(() => {
-          this.$router.push({
-            path: '/merchant/merchant_list',
-            query: {}
-          })
-        }, 1500)
-      }).finally(res => {
-        this.formLoading = false;
-      })
-    }
-  }
-}
+      };
+      addAccount(params)
+        .then((res) => {
+          this.$successMsg("开通成功");
+          setTimeout(() => {
+            this.$router.push({
+              path: "/merchant/merchant_list",
+              query: {},
+            });
+          }, 1500);
+        })
+        .finally((res) => {
+          this.formLoading = false;
+        });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .setting_title {
-    padding-left: 0;
-  }
-  .tips {
+.setting_title {
+  padding-left: 0;
+}
+.tips {
+  font-size: 14px;
+}
+.my-card {
+  margin-top: 20px;
+  .box {
+    background: rgb(235, 240, 249);
+    padding: 10px;
     font-size: 14px;
-  }
-  .my-card {
-    margin-top: 20px;
-    .box {
-      background: rgb(235, 240, 249);
-      padding: 10px;
-      font-size: 14px;
-      margin: 20px 0;
-      line-height: 18px;
-      ::v-deep .el-link {
-        vertical-align: unset;
-      }
+    margin: 20px 0;
+    line-height: 18px;
+    ::v-deep .el-link {
+      vertical-align: unset;
     }
   }
-  .my-form {
-    width: 450px;
-    margin: 0 auto;
-  }
-  .show-pwd {
-    position: absolute;
-    right: 15px;
-    top: 0;
-    font-size: 16px;
-    cursor: pointer;
-    user-select: none;
-  }
-  .question {
-    position: absolute;
-    right: -30px;
-    top: 0;
-    font-size: 20px;
-    cursor: pointer;
-    user-select: none;
-  }
+}
+.my-form {
+  width: 450px;
+  margin: 0 auto;
+}
+.show-pwd {
+  position: absolute;
+  right: 15px;
+  top: 0;
+  font-size: 16px;
+  cursor: pointer;
+  user-select: none;
+}
+.question {
+  position: absolute;
+  right: -30px;
+  top: 0;
+  font-size: 20px;
+  cursor: pointer;
+  user-select: none;
+}
 </style>

+ 0 - 1
src/views/sales_policy/components/AddCondition.vue

@@ -147,7 +147,6 @@
               v-for="(len, index) in conditionBoxs.length - 1"
             >
               <el-form-item :label="'配提' + (index + 1) + '比例'">
-
                 <el-input
                   size="small"
                   :readonly="!id?false:true"

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

@@ -142,13 +142,13 @@
         >
         </el-table-column>
         <el-table-column
-          v-if="!$store.getters.customerId"
           fixed="right"
           label="操作"
           align="center"
           width="200"
         >
-          <template slot-scope="scope">
+          <!--  v-if="!$store.getters.customerId"-->
+          <template slot-scope="scope" >
             <el-button
               type="text"
               size="small"
@@ -164,6 +164,7 @@
             >
             <!-- <el-button type="text" size="small">删除</el-button> -->
           </template>
+
         </el-table-column>
       </el-table>
       <!-- 分页 -->

+ 9 - 1
src/views/setting/account.vue

@@ -163,6 +163,11 @@
             <el-radio :label="true">是</el-radio>
           </el-radio-group>
         </el-form-item>
+        <el-form-item label="所属集团" prop="company" v-show="roleObj.type === 0 && roleObj.name === '经销商' && !AccountForm.isGroup">
+          <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%;">
+            <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="密码" prop="newPassword">
           <el-input v-model="AccountForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入密码" :type="passwordType1"></el-input>
           <span class="show-pwd" @click="showPwd(1)">
@@ -279,6 +284,7 @@ export default {
         dealer: '', //经销商
         role: '', // 角色组
         isGroup: false,
+        company: '',
         newPassword: '', // 新密码
         confirmPassword: '', // 确认密码
       },
@@ -429,7 +435,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         adminWebsitId: this.selectDepartment ? this.selectDepartment.adminWebsitId : '',
-        keyword: this.screenForm.name
+        userName: this.screenForm.name
       };
 
       getAccountList(params).then(res => {
@@ -514,6 +520,7 @@ export default {
           this.AccountForm.merchant = res.data.companyWechatId;
           this.AccountForm.dealer = res.data.customerId;
           this.AccountForm.isGroup = res.data.isGroupCompany;
+          this.AccountForm.company = res.data.parentCustomerId;
           this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
         })
       }
@@ -542,6 +549,7 @@ export default {
             if(this.roleObj.name === '经销商') {
               params.customerId = this.AccountForm.dealer;
               params.isGroupCompany = this.AccountForm.isGroup;
+              params.parentCustomerId = this.AccountForm.company;
             }
           }else {
             params.adminCompanyId = this.AccountForm.merchant;

+ 1 - 0
src/views/setting/department.vue

@@ -134,6 +134,7 @@ export default {
     getList() {
       getDepartmentList().then(res => {
         this.dataList = res.data;
+        this.listTotal = res.data.length;
       })
     },
 

+ 2 - 1
src/views/setting/menu.vue

@@ -518,7 +518,8 @@ export default {
     getList() {
       this.listLoading = true;
       getMenuList({
-        adminUserId: this.userid
+        adminUserId: this.userid,
+        flag: 'menu',
       }).then(res => {
         this.dataList = res.data;
       })

+ 1 - 10
src/views/setting/role.vue

@@ -54,9 +54,6 @@
         <el-form-item label="角色名" prop="name">
           <el-input v-model="addForm.name" autocomplete="off" placeholder="请输入角色名"></el-input>
         </el-form-item>
-        <el-form-item label="上传文件" prop="fileUrl">
-          <fileUpload :fileList="fileList" />
-        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="cancelAddForm">取 消</el-button>
@@ -69,7 +66,7 @@
       <el-tree
         :data="menuRoleList"
         show-checkbox
-        :check-strictly="true"
+        :check-strictly="false"
         :default-expand-all="true"
         node-key="moduleId"
         ref="tree"
@@ -88,12 +85,8 @@
 <script>
 import { mapGetters } from 'vuex'
 import { getRoleList, addRole, editRole, getRoleDetail, deleteRole, getMenuList, getMenuRoleIds, setMenuRole } from '@/api/setting'
-import fileUpload from '@/components/Common/file-upload.vue'
 
 export default {
-  components: {
-    fileUpload
-  },
   data() {
     return {
       imageURL: this.$imageUrl,
@@ -122,8 +115,6 @@ export default {
         children: 'children',
         label: 'moduleName'
       },
-
-      fileList: [],
     }
   },
   computed: {

+ 88 - 27
src/views/stock/stock_list.vue

@@ -6,37 +6,54 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="仓库" prop="warehouse">
-              <el-select v-model="screenForm.warehouse" placeholder="请选择仓库">
-                <el-option label="全部" value=""></el-option>
-                <el-option :label="item.name" :value="item.name" v-for="(item, index) in warehouseList" :key="index"></el-option>
+              <el-select v-model="screenForm.warehouse" placeholder="请选择仓库" @change="changeWarehouse" clearable>
+                <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-form-item label="产品名称" prop="name">
-              <el-input v-model="screenForm.name" placeholder="请输入产品名称"></el-input>
+            <el-form-item label="仓位" prop="position">
+              <el-select v-model="screenForm.position" placeholder="请选择仓位" clearable>
+                <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="产品编码" prop="code">
-              <el-input v-model="screenForm.code" placeholder="请输入产品编码"></el-input>
+            <el-form-item label="物料代码" prop="goodsCode">
+              <el-input v-model="screenForm.goodsCode" placeholder="请输入物料代码"></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="规格型号" prop="model">
-              <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+            <el-form-item label="产品名称" prop="goodsName">
+              <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="品类" prop="type">
-              <el-select v-model="screenForm.type" placeholder="全部">
-                <el-option label="全部" value=""></el-option>
+            <el-form-item label="产品大类" prop="type">
+              <el-select v-model="screenForm.type" placeholder="请选择产品大类" @change="changeType" clearable>
                 <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="12" :lg="18" class="tr">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="产品类别" prop="smallType">
+              <el-select v-model="screenForm.smallType" placeholder="请选择产品类别" clearable>
+                <el-option v-for="item in smallList" :key="item.kingDeeCategoryId" :label="item.kingDeeCategoryName" :value="item.kingDeeCategoryId"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="产品编码" prop="goodsNum">
+              <el-input v-model="screenForm.goodsNum" placeholder="请输入产品编码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="规格型号" prop="model">
+              <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :xs="24" :sm="24" :lg="24" class="tr">
             <el-form-item label="">
               <el-button size="small" @click="resetScreenForm">清空</el-button>
               <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -54,14 +71,18 @@
       </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="categoryName" min-width="160" 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="categoryName" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编码" prop="materialNumber" 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="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="总库存数量" prop="stockQty" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="可用库数" prop="stockAdequate" min-width="120" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="经销商预留库存" prop="reservedNum" min-width="140" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="经销商暂扣库存" prop="temporaryNum" min-width="140" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="开单未提数量" prop="num" min-width="140" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
     </div>
@@ -84,7 +105,7 @@
 
 <script>
 import { getStockList, getWarehouseList } from "@/api/stock";
-import { getDictList } from '@/api/common'
+import { getDictList, getSmallList } from '@/api/common'
 
 export default {
   data() {
@@ -96,24 +117,32 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         warehouse: '',
-        name: '',
-        code: '',
+        position: '',
+        goodsName: '',
+        goodsNum: '',
+        goodsCode: '',
         model: '',
         type: '',
+        smallType: '',
       },
       warehouseList: [],
+      positionList: [],
       typeList: [],
+      smallList: [],
     }
   },
 
   computed: {
     exParams() {
       return {
-        name: this.screenForm.warehouse,
-        materialName: this.screenForm.name,
-        materialNumber: this.screenForm.code,
+        correspondId: this.screenForm.warehouse,
+        stockId: this.screenForm.position,
+        materialName: this.screenForm.goodsName,
+        materialNumber: this.screenForm.goodsNum,
+        materialOldNumber: this.screenForm.goodsCode,
         specification: this.screenForm.model,
-        categoryName: this.screenForm.type,
+        mainNumber: this.screenForm.type,
+        categoryId: this.screenForm.smallType,
       }
     },
   },
@@ -144,12 +173,41 @@ export default {
       })
     },
 
+    // 获取产品大类列表
     getDictList() {
       getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
         this.typeList = res.data;
       })
     },
 
+    // 获取产品小类列表
+    getSmallList() {
+      getSmallList({id: this.screenForm.type}).then(res => {
+        this.smallList = res.data;
+      })
+    },
+
+    // 更改大类
+    changeType() {
+      this.screenForm.smallType = '';
+      if(this.screenForm.type) {
+        this.getSmallList();
+      }else {
+        this.smallList = [];
+      }
+    },
+
+    // 更改仓库
+    changeWarehouse() {
+      this.screenForm.position = '';
+      if(this.screenForm.warehouse) {
+        let obj = this.warehouseList.find(o => o.id == this.screenForm.warehouse);
+        this.positionList = obj.kingDeeStocks;
+      }else {
+        this.positionList = [];
+      }
+    },
+
     // 查询列表
     getList() {
       this.listLoading = true;
@@ -157,11 +215,14 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        name: this.screenForm.warehouse,
-        materialName: this.screenForm.name,
-        materialNumber: this.screenForm.code,
+        correspondId: this.screenForm.warehouse,
+        stockId: this.screenForm.position,
+        materialName: this.screenForm.goodsName,
+        materialNumber: this.screenForm.goodsNum,
+        materialOldNumber: this.screenForm.goodsCode,
         specification: this.screenForm.model,
-        categoryName: this.screenForm.type,
+        mainNumber: this.screenForm.type,
+        categoryId: this.screenForm.smallType,
       };
       getStockList(params).then((res) => {
         this.dataList = res.data.records;

+ 5 - 0
src/views/supply/direct.vue

@@ -0,0 +1,5 @@
+<template>
+  <div>
+    <router-view />
+  </div>
+</template>

+ 270 - 0
src/views/supply/direct/components/direct_detail.vue

@@ -0,0 +1,270 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="详情"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">基本信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">直接调拨单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请日期</div>
+          <div class="value">{{detailData.orderTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerNumber}}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售订单号</div>
+          <div class="value">{{detailData.orderNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售单类型</div>
+          <div class="value">{{detailData.orderType | orderTypeFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调拨类型</div>
+          <div class="value">{{detailData.type | typeFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调出库存组织</div>
+          <div class="value">{{detailData.requsitionOut}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调入库存组织</div>
+          <div class="value">{{detailData.requsitionIn}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调拨方向</div>
+          <div class="value">{{detailData.direction}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{detailData.createBy}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核人</div>
+          <div class="value">{{detailData.approvalName}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核日期</div>
+          <div class="value">{{detailData.approvalTime}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">最后更新人</div>
+          <div class="value">{{detailData.updateBy}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">最后更新日期</div>
+          <div class="value">{{detailData.updateTime}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">关闭人</div>
+          <div class="value">{{detailData.closeName}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">关闭日期</div>
+          <div class="value">{{detailData.closeTime}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value">{{detailData.approvalRemark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="detailData.results" 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="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <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="调出仓库" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.correspondName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出仓位" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.stockName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入仓库" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.inCorrespondName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入仓位" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.inStockName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出库存状态" min-width="110" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.stockStatusType}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入库存状态" min-width="110" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.inStockStatusType}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出库主" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.requsitionOut}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入库主" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.requsitionIn}}</template>
+        </el-table-column>
+
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
+
+    <div v-if="isExamine">
+      <div class="main-title">
+        <div class="title">审批记录</div>
+      </div>
+      <div class="diy-table-1">
+        <el-row :gutter="0">
+          <el-col :span="12" class="item">
+            <div class="label">审批人</div>
+            <div class="value">{{detailData.approvalName}}</div>
+          </el-col>
+          <el-col :span="12" class="item">
+            <div class="label">审批结果</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">审批说明</div>
+            <div class="value">{{detailData.approvalRemark}}</div>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button @click="goBack">关 闭</el-button>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getDetail } from "@/api/supply/direct";
+
+export default {
+  name: 'DirectDetail',
+  componentName: 'DirectDetail',
+  props: ['listItem'],
+  filters: {
+    statusFilter(val) {
+      const MAP = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = MAP.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    orderTypeFilter(val) {
+      const MAP = [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售单', value: 'RETAIL' },
+        { label: '销售政策单', value: 'RETAIL_POLICY' },
+      ];
+      let obj = MAP.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    typeFilter(val) {
+      const MAP = {
+        1: '组织内调拨',
+      }
+      return MAP[val];
+    }
+  },
+  data() {
+    return {
+      detailData: {},
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+    isExamine() {
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
+
+  }
+}
+</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;
+    }
+  }
+</style>

+ 283 - 0
src/views/supply/direct/components/direct_examine.vue

@@ -0,0 +1,283 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="审批"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">基本信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">直接调拨单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请日期</div>
+          <div class="value">{{detailData.orderTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerNumber}}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售订单号</div>
+          <div class="value">{{detailData.orderNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售单类型</div>
+          <div class="value">{{detailData.orderType | orderTypeFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调拨类型</div>
+          <div class="value">{{detailData.type | typeFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调出库存组织</div>
+          <div class="value">{{detailData.requsitionOut}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调入库存组织</div>
+          <div class="value">{{detailData.requsitionIn}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">调拨方向</div>
+          <div class="value">{{detailData.direction}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="detailData.results" 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="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <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="调出仓库" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.correspondName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出仓位" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.stockName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入仓库" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.inCorrespondName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入仓位" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.inStockName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出库存状态" min-width="110" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.stockStatusType}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入库存状态" min-width="110" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.inStockStatusType}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出库主" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.requsitionOut}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入库主" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{detailData.requsitionIn}}</template>
+        </el-table-column>
+
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
+
+    <div class="main-title">
+      <div class="title">审批信息</div>
+    </div>
+    <div class="diy-table-1">
+      <el-row :gutter="0">
+        <el-col :span="12" class="item">
+          <div class="label">审批人</div>
+          <div class="value">{{userName}}</div>
+        </el-col>
+        <el-col :span="12" class="item">
+          <div class="label">审批日期</div>
+          <div class="value">{{getDate()}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
+        </el-col>
+      </el-row>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
+        <el-button type="warning" @click="clickSubmitForm('FAIL')">审批驳回</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getDetail, examineData } from "@/api/supply/direct";
+
+export default {
+  name: 'DirectExamine',
+  componentName: 'DirectExamine',
+  props: ['listItem'],
+  filters: {
+    statusFilter(val) {
+      const MAP = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = MAP.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    orderTypeFilter(val) {
+      const MAP = [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售单', value: 'RETAIL' },
+        { label: '销售政策单', value: 'RETAIL_POLICY' },
+      ];
+      let obj = MAP.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    typeFilter(val) {
+      const MAP = {
+        1: '组织内调拨',
+      }
+      return MAP[val];
+    }
+  },
+  data() {
+    return {
+      detailData: {},
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+
+      formLoading: false,
+      examineForm: {
+        remark: '',
+      },
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
+    
+    // 提交审批
+    clickSubmitForm(val) {
+      this.$confirm('此操作将审批订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let params = {
+          id: this.detailData.id,
+          examineStatus: val,
+          approvalRemark: this.examineForm.remark
+        };
+        examineData(params).then(res => {
+          this.$successMsg();
+          this.goBack();
+          this.$parent.getList();
+        })
+      }).catch(() => {});
+    },
+
+  }
+}
+</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;
+    }
+  }
+
+  ::v-deep input::-webkit-outer-spin-button,
+  ::v-deep input::-webkit-inner-spin-button {
+    -webkit-appearance: none;
+  }
+  ::v-deep input[type='number'] {
+    -moz-appearance: textfield;
+  }
+</style>

+ 386 - 0
src/views/supply/direct/components/direct_form.vue

@@ -0,0 +1,386 @@
+<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="100px" size="small" label-position="right">
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="单据编号" prop="id">
+            <el-input v-model="mainForm.id" placeholder="系统自动生成" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
+          <el-form-item label="申请日期" prop="orderTime">
+            <el-date-picker
+              v-model="mainForm.orderTime"
+              type="datetime"
+              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="examineStatus">
+            <el-select v-model="mainForm.examineStatus" style="width: 100%;" disabled>
+              <el-option
+                v-for="(item, index) in statusList" 
+                :key="index"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="经销商编码" prop="customerNumber">
+            <el-input v-model="mainForm.customerNumber" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="16">
+          <el-form-item label="经销商名称" prop="customerName">
+            <el-input v-model="mainForm.customerName" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="销售单号" prop="orderNo">
+            <el-input v-model="mainForm.orderNo" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="销售单类型" prop="orderType">
+            <el-select v-model="mainForm.orderType" style="width: 100%;" disabled>
+              <el-option
+                v-for="(item, index) in orderTypeList" 
+                :key="index"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </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" style="width: 100%;" disabled>
+              <el-option
+                v-for="(item, index) in typeList" 
+                :key="index"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="调出库存组织" prop="requsitionOut">
+            <el-input v-model="mainForm.requsitionOut" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="调入库存组织" prop="requsitionIn">
+            <el-input v-model="mainForm.requsitionIn" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="调拨方向" prop="direction">
+            <el-input v-model="mainForm.direction" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="制单人" prop="createBy">
+            <el-input v-model="mainForm.createBy" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="制单日期" prop="createTime">
+            <el-date-picker
+              v-model="mainForm.createTime"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              style="width: 100%;"
+              disabled
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :xs="12" :sm="6" :lg="6">
+          <el-form-item label="调出仓库" prop="correspondId">
+            <el-select v-model="mainForm.correspondId" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
+              <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6" :lg="6">
+          <el-form-item label="调出仓位" prop="stockId">
+            <el-select v-model="mainForm.stockId" placeholder="请调出仓位" style="width: 100%" filterable>
+              <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6" :lg="6">
+          <el-form-item label="调入仓库" prop="inCorrespondId">
+            <el-select v-model="mainForm.inCorrespondId" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
+              <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="12" :sm="6" :lg="6">
+          <el-form-item label="调入仓位" prop="inStockId">
+            <el-select v-model="mainForm.inStockId" placeholder="请调入仓位" style="width: 100%" filterable>
+              <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24">
+          <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>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="mainForm.results" 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="materialOldNumber" 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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="调出仓库" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{ mainForm.correspondName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出仓位" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{ mainForm.stockName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入仓库" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{ mainForm.inCorrespondName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入仓位" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{ mainForm.inStockName}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出库存状态" min-width="110" show-overflow-tooltip>
+          <template slot-scope="">{{ mainForm.stockStatusType}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入库存状态" min-width="110" show-overflow-tooltip>
+          <template slot-scope="">{{ mainForm.inStockStatusType}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
+          <template slot-scope="">{{mainForm.requsitionOut}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
+          <template slot-="scope">{{mainForm.requsitionIn}}</template>
+        </el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getDetail, editData, getWarehouseList } from "@/api/supply/direct";
+
+export default {
+  name: 'DirectForm',
+  componentName: 'DirectForm',
+  props: ['listItem'],
+  data() {
+    return {
+      statusList: [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ],
+      orderTypeList: [
+        { label: '商用工程订单', value: 'TRADE' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '零售单', value: 'RETAIL' },
+        { label: '销售政策单', value: 'RETAIL_POLICY' },
+      ],
+      typeList: [
+        { label: '组织内调拨', value: 1 },
+      ],
+      mainForm: {},
+      mainFormRules: {
+        orderTime: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
+        correspondId: [{ required: true, message: '请选择调出仓库', trigger: 'change' }],
+        stockId: [{ required: true, message: '请选择调出仓位', trigger: 'change' }],
+        inCorrespondId: [{ required: true, message: '请选择调入仓库', trigger: 'change' }],
+        inStockId: [{ required: true, message: '请选择调入仓位', trigger: 'change' }],
+      },
+      goodsList: [],
+
+      warehouseList1: [],
+      warehouseList2: [],
+      positionList1: [],
+      positionList2: [],
+      
+    }
+  },
+
+  watch: {
+    'mainForm.correspondId': {
+      handler(newValue, oldValue) {
+        if (newValue) {
+          let obj = this.warehouseList1.find(o => o.id == newValue);
+          this.mainForm.correspondName = obj.name;
+          this.positionList1 = obj.kingDeeStocks;
+        }
+      },
+      immediate: true,
+    },
+    'mainForm.inCorrespondId': {
+      handler(newValue, oldValue) {
+        if (newValue) {
+          let obj = this.warehouseList2.find(o => o.id == newValue);
+          this.mainForm.inCorrespondName = obj.name;
+          this.positionList2 = obj.kingDeeStocks;
+        }
+      },
+      immediate: true,
+    },
+    'mainForm.stockId': {
+      handler(newValue, oldValue) {
+        if (newValue) {
+          let obj = this.positionList1.find(o => o.id == newValue);
+          this.mainForm.stockName = obj.name;
+          this.mainForm.stockStatusType = obj.defStockStatusName;
+        }
+      },
+      immediate: true,
+    },
+    'mainForm.inStockId': {
+      handler(newValue, oldValue) {
+        if (newValue) {
+          let obj = this.positionList2.find(o => o.id == newValue);
+          this.mainForm.inStockName = obj.name;
+          this.mainForm.inStockStatusType = obj.defStockStatusName;
+        }
+      },
+      immediate: true,
+    },
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  async created() {
+    await this.getWarehouseList();
+    if(this.listItem) {
+      this.getDetail();
+    }
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.mainForm = res.data;
+      })
+    },
+
+    // 获取仓库列表
+    async getWarehouseList() {
+      const result = new Promise((resolve, reject) => {
+        getWarehouseList({
+          pageNum: 1,
+          pageSize: -1
+        }).then((res) => {
+          this.warehouseList1 = res.data.records;
+          this.warehouseList2 = res.data.records;
+          resolve(res.data.records);
+        })
+      })
+      return result;
+    },
+
+    // 更改调出仓库
+    changeWarehouse1() {
+      this.mainForm.stockId = '';
+    },
+
+    // 更改调入仓库
+    changeWarehouse2() {
+      this.mainForm.inStockId = '';
+    },
+
+    // 保存
+    clickSubmitForm(status) {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          let { id, orderTime, correspondId, correspondName, stockId, stockName, inCorrespondId, inCorrespondName, inStockId, inStockName, remark }  = this.mainForm;
+          let params = { id, orderTime, correspondId, correspondName, stockId, stockName, inCorrespondId, inCorrespondName, inStockId, inStockName, remark };
+          params.examineStatus = status;
+          editData(params).then(res => {
+            this.$successMsg('编辑成功');
+            this.goBack();
+            this.$parent.getList();
+          })
+        }
+      })
+    },
+  }
+}
+</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;
+    }
+  }
+</style>

+ 345 - 0
src/views/supply/direct/direct_list.vue

@@ -0,0 +1,345 @@
+<template>
+  <div class="app-container">
+    <div v-show="!isShowDetail && !isShowExamine && !isShowForm">
+      <!-- 筛选条件 -->
+      <div class="screen-container">
+        <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item prop="status" label-width="0">
+                <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
+                  <el-radio-button label="">全部</el-radio-button>
+                  <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="直接调拨单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入直接调拨单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="仓库" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商编码" prop="jxsNum">
+                <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商名称" prop="jxsName">
+                <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货申请日期" prop="date">
+                <el-date-picker
+                  v-model="screenForm.date"
+                  type="datetimerange"
+                  range-separator="至"
+                  style="width: 100%;"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="产品名称" prop="chName">
+                <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="规格型号" prop="model">
+                <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+              </el-form-item>
+            </el-col>
+            
+            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+              <el-form-item label="">
+                <el-button size="small" @click="resetScreenForm">清空</el-button>
+                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+
+      <div class="mymain-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()">批量删除</el-button>
+          </div>
+          <div class="fr">
+            <ExportButton :exUrl="'admin/user/mch/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 @selection-change="handleSelectionChange">
+            <el-table-column align="center" type="selection" width="55"></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="examineStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.examineStatus | statusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="单据日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerNumber" 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="direction" 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="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调出仓位" prop="stockName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调入仓库" prop="inCorrespondName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调入仓位" prop="inStockName" 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="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="180" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审单</el-button>
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
+                  <el-button slot="reference" type="text">删除</el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <div class="pagination clearfix">
+        <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>
+    </div>
+    
+    <DirectDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <DirectExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
+    <DirectForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
+
+  </div>
+</template>
+
+<script>
+import { getList, submitApply, deleteData } from "@/api/supply/direct";
+import DirectDetail from "@/views/supply/direct/components/direct_detail";
+import DirectExamine from "@/views/supply/direct/components/direct_examine";
+import DirectForm from "@/views/supply/direct/components/direct_form";
+
+let that
+export default {
+  components: {
+    DirectDetail,
+    DirectExamine,
+    DirectForm
+  },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: null, // 列表数据
+      listLoading: false, // 列表加载loading
+      screenForm: { // 筛选表单数据
+        orderNum: '',
+        warehouse: '',
+        jxsNum: '',
+        jxsName: '',
+        date: '',
+        chName: '',
+        model: '',
+        status: '',
+      },
+      statusList: [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ],
+
+      queryItem: {},
+      isShowDetail: false,
+      isShowExamine: false,
+      isShowForm: false,
+
+      multipleSelection: [],
+    }
+  },
+
+  computed: {
+    exParams() {
+      return {
+        id: this.screenForm.orderNum,
+        correspondId: this.screenForm.warehouse,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        productName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        examineStatus: this.screenForm.status,
+      }
+    },
+  },
+
+  beforeCreate() {
+    that = this;
+  },
+
+  created() {
+    this.getList();
+  },
+
+  methods: {
+    // 查询按钮权限
+    checkBtnRole(value) {
+      // let btnRole = this.$route.meta.roles;
+      // if(!btnRole) {return true}
+      // let index = btnRole.indexOf(value);
+      // return index >= 0;
+      return true
+    },
+
+    // 查询列表
+    getList() {
+      this.listLoading = true;
+
+      let params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        id: this.screenForm.orderNum,
+        correspondId: this.screenForm.warehouse,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        productName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        examineStatus: this.screenForm.status,
+      };
+      getList(params).then((res) => {
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
+        this.listLoading = false;
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+
+    // 进入表单
+    toForm(item) {
+      this.queryItem = item;
+      this.isShowForm = true;
+    },
+
+    // 进入审批
+    toExamine(item) {
+      this.queryItem = item;
+      this.isShowExamine = true;
+    },
+
+    // 进入详情
+    toDetail(item) {
+      this.queryItem = item;
+      this.isShowDetail = true;
+    },
+
+    backList() {
+      this.queryItem = {};
+      this.isShowDetail = false;
+      this.isShowExamine = false;
+      this.isShowForm = false;
+    },
+
+    // 删除
+    handleDelete(id) {
+      deleteData({ids: id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+     // 批量删除
+    batchDelete() {
+      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let ids = this.multipleSelection.map(item => {
+          return item.id;
+        });
+        deleteData({ids: ids.join(',')}).then(res => {
+          this.$successMsg();
+          this.getList();
+        })
+      }).catch(() => {});
+    },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 申请/撤回
+    handleSubmit(id, examineStatus) {
+      submitApply({id, examineStatus}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 87 - 40
src/views/supply/implement/implement_list.vue

@@ -3,26 +3,33 @@
     <div>
       <!-- 筛选条件 -->
       <div class="screen-container">
-        <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
+        <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
           <el-row :gutter="20">
+            <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item prop="status" label-width="0">
+                <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
+                  <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="厂产品代码" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入厂产品代码"></el-input>
+              <el-form-item label="物料代码" prop="goodsCode">
+                <el-input v-model="screenForm.goodsCode" placeholder="请输入物料代码"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="销售订单" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入销售订单"></el-input>
+              <el-form-item label="销售订单" prop="saleNum">
+                <el-input v-model="screenForm.saleNum" placeholder="请输入销售订单"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入经销商"></el-input>
+              <el-form-item label="经销商" prop="dealer">
+                <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="存货名称" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入存货名称"></el-input>
+              <el-form-item label="产品名称" prop="goodsName">
+                <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -39,17 +46,22 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="业务员" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入业务员"></el-input>
+              <el-form-item label="业务员" prop="saleMan">
+                <el-input v-model="screenForm.saleMan" placeholder="请输入业务员"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="项目名称" prop="enginName">
+                <el-input v-model="screenForm.enginName" placeholder="请输入项目名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="项目名称" prop="wlName">
-                <el-input v-model="screenForm.wlName" placeholder="请输入项目名称"></el-input>
+              <el-form-item label="工程登录编号" prop="loginNum">
+                <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录编号"></el-input>
               </el-form-item>
             </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="24" :lg="24" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -63,26 +75,26 @@
         <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="序号" type="index" width="50"></el-table-column>
-            <el-table-column align="center" label="厂产品代码" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="下单日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="受订日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售订单" prop="aaa" min-width="120" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商编码" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商名称" prop="aaa" min-width="240" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售类型" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="存货名称" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="存货编码" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单未发货数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="总数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="退货数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单金额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单返利金额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="发货金额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="发货数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="直调数量" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="退货金额" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="业务员" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="厂产品代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="下单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="受订日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售订单" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerNumber" 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="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单未发货数量" prop="refundableQty" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="退货数量" prop="retiredQty" 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="110" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货金额" prop="hasSendAmount" 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="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="退货金额" prop="retiredAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
           </el-table>
         </div>
       </div>
@@ -107,7 +119,14 @@
 <script>
 import { getList } from "@/api/supply/implement";
 
+let that
 export default {
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       currentPage: 1, // 当前页码
@@ -116,24 +135,46 @@ export default {
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
-        orderNum: '',
-        wlName: '',
+        status: '2',
+        goodsCode: '',
+        saleNum: '',
+        dealer: '',
+        goodsName: '',
         date: '',
+        saleMan: '',
+        enginName: '',
+        loginNum: '',
       },
+      statusList: [
+        { label: '政策零售订单', value: '2' },
+        { label: '零售订单', value: '1' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '商用工程订单', value: 'TRADE' },
+      ],
     }
   },
 
   computed: {
     exParams() {
       return {
-        billNo: this.screenForm.orderNum,
-        materialName: this.screenForm.wlName,
+        type: this.screenForm.status,
+        materialOldNumber: this.screenForm.goodsCode,
+        id: this.screenForm.saleNum,
+        customerName: this.screenForm.dealer,
+        materialName: this.screenForm.goodsName,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        serviceName: this.screenForm.saleMan,
+        projectName: this.screenForm.enginName,
+        enginRecordNo: this.screenForm.orderNum,
       }
     },
   },
 
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
     this.getList();
   },
@@ -155,10 +196,16 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        billNo: this.screenForm.orderNum,
-        materialName: this.screenForm.wlName,
+        type: this.screenForm.status,
+        materialOldNumber: this.screenForm.goodsCode,
+        id: this.screenForm.saleNum,
+        customerName: this.screenForm.dealer,
+        materialName: this.screenForm.goodsName,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        serviceName: this.screenForm.saleMan,
+        projectName: this.screenForm.enginName,
+        enginRecordNo: this.screenForm.orderNum,
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;

+ 39 - 71
src/views/supply/reserve/components/reserve_detail.vue

@@ -9,104 +9,63 @@
 
       <div class="diy-table-1">
         <el-row>
-          <el-col :span="24" class="item">
-            <div class="label">关联单据:</div>
-            <div class="value">{{detailData.billNo}}</div>
-          </el-col>
           <el-col :span="6" class="item">
             <div class="label">单据编号:</div>
-            <div class="value">{{detailData.billNo}}</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">单据日期:</div>
-            <div class="value">{{detailData.fdate}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">货品名称:</div>
-            <div class="value">{{detailData.srcStockId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">类型:</div>
-            <div class="value">{{detailData.destStockId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">货品编码:</div>
-            <div class="value">{{detailData.approveDate}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">规格型号:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">计量单位:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">状态:</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.orderTime}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">制单人:</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.createBy}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">制单日期:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">修改人:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">修改日期:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">审核人:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">审核日期:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">关闭人:</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">关闭日期:</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.createTime}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">备注:</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.remark}}</div>
           </el-col>
         </el-row>
       </div>
 
       <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table :data="detailData.reservedOrderItems" 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="materialNumber" 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="model" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="主计量单位" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单价" prop="consignPrice" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="金额" prop="consignAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="orderId" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="经销商编码" prop="customerId" 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="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="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="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="预留数量" prop="reservedNum" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单数量" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="修改人" prop="updateBy" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="修改时间" prop="updateTime" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="关闭人" prop="closureBy" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="关闭时间" prop="closureTime" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.status | statusFilter}}
+            </template>
+          </el-table-column>
         </el-table>
       </div>
       
     </div>
     
-    <!-- <div class="page-footer">
+    <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+        <el-button @click="goBack">关 闭</el-button>
       </div>
-    </div> -->
+    </div>
 
   </div>
 </template>
@@ -122,6 +81,15 @@ export default {
   directives: {
     print
   },
+  filters: {
+    statusFilter(val) {
+      const MAP = {
+        0: '已关闭',
+        1: '执行中',
+      }
+      return MAP[val];
+    }
+  },
   data() {
     return {
       printObj: {

+ 381 - 63
src/views/supply/reserve/components/reserve_form.vue

@@ -9,24 +9,14 @@
     <el-form ref="mainForm" :model="mainForm" label-width="70px" size="small" label-position="left">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="关联单据" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入关联单据"></el-input>
-          </el-form-item>
-        </el-col>
-        <!-- <el-col :xs="24" :sm="12" :lg="6">
-          <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">
-          <el-form-item label="单据编号" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入单据编号"></el-input>
+          <el-form-item label="单据编号" prop="orderNum">
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
-          <el-form-item label="单据日期" prop="date">
+          <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
-              v-model="mainForm.date"
+              v-model="mainForm.orderDate"
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
@@ -35,91 +25,241 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="货品名称" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入货品名称"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="类型" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入类型"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="货品编码" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入货品编码"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="规格型号" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入规格型号"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="计量单位" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入计量单位"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="备注" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="6">
-          <el-form-item label="制单人" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入制单人"></el-input>
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" placeholder="请输入制单人" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
-          <el-form-item label="制单日期" prop="date">
+          <el-form-item label="制单日期" prop="createDate">
             <el-date-picker
-              v-model="mainForm.date"
-              type="date"
-              value-format="yyyy-MM-dd"
+              v-model="mainForm.createDate"
+              readonly
+              type="datetime"
+              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="24" :lg="24">
+          <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 style="margin-top: 20px">
+      <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
+      <el-button type="danger" size="small" icon="el-icon-minus" @click="deleteGoods" :disabled="tableSelection.length < 1">批量删除</el-button>
+    </div>
     <div class="table" style="margin-top: 20px">
-      <el-table :data="detailData.kingDeeTransferItems" 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="materialNumber" 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="model" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="开单数量" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="备注" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" @selection-change="tableSelectionChange">
+        <el-table-column align="center" type="selection" width="55"></el-table-column>
+        <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.orderDate | dateToDayFilter}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialNumber" 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="100" 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="reservedNum" 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="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.status ? '执行中':'已关闭'}}
+          </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)" v-if="!listItem">删除</el-button>
+
+            <el-button type="text" @click="changeItem(scope.$index, 0)" v-if="listItem && scope.row.status === 1">关闭</el-button>
+            <el-button type="text" @click="changeItem(scope.$index, 1)" v-if="listItem && scope.row.status === 0">开启</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-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 title="添加引用" :visible.sync="isShowDialog" width="80%">
+      <el-form ref="screenForm" :model="screenForm" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="jxsNum">
+              <el-input v-model="screenForm.jxsNum" placeholder="经销商编码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="jxsName">
+              <el-input v-model="screenForm.jxsName" placeholder="经销商名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="type">
+              <el-select v-model="screenForm.type" placeholder="产品大类" style="width: 100%">
+                <el-option v-for="item in typeList" :key="item.dictValue" :label="item.dictValue" :value="item.dictValue"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="goodsNum">
+              <el-input v-model="screenForm.goodsNum" placeholder="产品编码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="goodsCode">
+              <el-input v-model="screenForm.goodsCode" placeholder="物料代码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="goodsName">
+              <el-input v-model="screenForm.goodsName" placeholder="产品名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="model">
+              <el-input v-model="screenForm.model" placeholder="规格型号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="orderType">
+              <el-select v-model="screenForm.orderType" placeholder="订单类型" style="width: 100%">
+                <el-option v-for="item in orderTypeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="4">
+            <el-form-item prop="saleNum">
+              <el-input v-model="screenForm.saleNum" placeholder="销售订单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="18" :lg="12" class="tr">
+            <el-form-item label="">
+              <el-button size="small" @click="resetScreenForm">清空</el-button>
+              <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="table">
+        <el-table :data="dialogGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="dialogSelectionChange">
+          <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
+          <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.orderDate | dateToDayFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="订单类型" prop="orderType" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.orderType | orderTypeFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售类型" prop="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="materialOldNumber" 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>
+        <div class="pagination clearfix" style="margin-top: 10px">
+          <div class="fr">
+            <el-pagination
+              @current-change="handleTableCurrentChange"
+              :current-page="currentPage"
+              :page-size="10"
+              background
+              layout="prev, pager, next"
+              :total="listTotal">
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+      
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDialog">取 消</el-button>
+        <el-button type="primary" @click="submitAddGoods">确 定</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { getDetail } from "@/api/supply/reserve";
+import { getDetail, getGoodsList, addData, editData } from "@/api/supply/reserve";
+import { getDictList } from '@/api/common'
 
+let that
 export default {
   name: 'ReserveForm',
   componentName: 'ReserveForm',
   props: ['listItem'],
+  filters: {
+    orderTypeFilter(val) {
+      let obj = that.orderTypeList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
-      detailData: {},
       mainForm: {
+        orderNum: '',
+        orderDate: '',
+        createMan: '',
+        createDate: '',
+        remark: '',
+      },
+      goodsList: [],
+      tableSelection: [],
 
+      typeList: [],
+      orderTypeList: [
+        { label: '商用单', value: 'TRADE' },
+        { label: '家用单', value: 'HOME' },
+        { label: '零售单', value: 'RETAIL' },
+        { label: '销售政策单', value: 'RETAIL_POLICY' },
+        { label: '置换家用单', value: 'PERMU_HOME' },
+        { label: '置换商用单', value: 'PERMU_TRADE' },
+        { label: '置换零售单', value: 'PERMU_RETAIL' },
+        { label: '置换销售政策单', value: 'PERMU_RETAIL_POLICY' },
+      ],
+      isShowDialog: false,
+      screenForm: {
+        jxsNum: '',
+        jxsName: '',
+        type: '',
+        goodsNum: '',
+        goodsCode: '',
+        goodsName: '',
+        model: '',
+        orderType: '',
+        saleNum: '',
       },
+      currentPage: 1,
+      listTotal: 0,
+      
+      dialogGoodsList: [],
+      dialogSelection: [],
     }
   },
 
@@ -135,11 +275,42 @@ export default {
     },
   },
 
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
-    this.getDetail();
+    if(this.listItem) {
+      this.getDetail();
+    }else {
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+      this.mainForm.createDate = this.getDate();
+    }
   },
 
   methods: {
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
+    getDictList() {
+      getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
+        this.typeList = res.data;
+      })
+    },
+
     // 返回列表
     goBack() {
       this.$emit('backListFormDetail');
@@ -148,12 +319,159 @@ export default {
     // 获取详情
     getDetail() {
       getDetail({id: this.listItem.id}).then(res => {
-        this.detailData = res.data;
+        let data = res.data;
+        this.mainForm.orderNum = data.id;
+        this.mainForm.orderDate = data.orderTime;
+        this.mainForm.createMan = data.createBy;
+        this.mainForm.createDate = data.createTime;
+        this.mainForm.remark = data.remark;
+        this.goodsList = data.reservedOrderItems;
       })
     },
 
-    clickSubmitForm() {
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.currentPage,
+        pageSize: 10,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        mainName: this.screenForm.type,
+        materialCode: this.screenForm.goodsNum,
+        materialOldNumber: this.screenForm.goodsCode,
+        materialName: this.screenForm.goodsName,
+        specification: this.screenForm.model,
+        orderType: this.screenForm.orderType,
+        orderId: this.screenForm.saleNum,
+      }).then(res => {
+        res.data.records.forEach(item => {
+          item.status = 1;
+        });
+        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.orderId === oldItem.orderId){
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+        this.dialogGoodsList = newGoodsList;
+        this.listTotal = res.data.total;
+      })
+    },
 
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 点击 选择商品
+    openDialog() {
+      this.isShowDialog = true;
+      this.getDictList();
+      this.getGoodsList();
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.dialogGoodsList = [];
+      this.getGoodsList();
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      if(this.dialogSelection.length > 0) {
+        return this.$errorMsg('已选择产品不可切换');
+      }
+      this.currentPage = val;
+      this.getGoodsList();
+    },
+
+    // 关闭 弹窗
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
+    // 列表选择
+    dialogSelectionChange(val) {
+      this.dialogSelection = val;
+    },
+
+    // 确定 添加产品
+    submitAddGoods() {
+      this.goodsList = this.goodsList.concat(this.dialogSelection);
+      this.isShowDialog = false;
+      this.dialogGoodsList = [];
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+    },
+
+    // 修改状态
+    changeItem(index, status) {
+      this.goodsList[index].status = status;
+    },
+
+    tableSelectionChange(val) {
+      this.tableSelection = val;
+    },
+
+    // 批量删除
+    deleteGoods() {
+      let goodsList = this.goodsList;
+      let tableSelection = this.tableSelection;
+      for(let i = 0; i < goodsList.length; i++) {
+        for(let j = 0; j < tableSelection.length; j++) {
+          if(tableSelection[j].orderId == goodsList[i].orderId){
+            this.goodsList.splice(i, 1);
+          }
+        }
+      }
+    },
+
+    // 提交
+    clickSubmitForm() {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          let params = {
+            orderTime: this.mainForm.orderDate + ' 00:00:00',
+            remark: this.mainForm.remark,
+            reservedOrderItems: this.goodsList,
+          }
+          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();
+            })
+          }
+        }
+      })
     },
   }
 }

+ 74 - 54
src/views/supply/reserve/reserve_list.vue

@@ -5,26 +5,14 @@
       <div class="screen-container">
         <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
           <el-row :gutter="20">
-            <el-col :xs="24" :sm="24" :lg="24">
-              <el-form-item prop="orderNum" label-width="0">
-                <el-radio-group v-model="screenForm.status" size="medium">
-                  <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-button label="3">审核通过</el-radio-button>
-                  <el-radio-button label="3">审核驳回</el-radio-button>
-                  <el-radio-button label="3">已取消</el-radio-button>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="货品名称" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入货品名称"></el-input>
+              <el-form-item label="产品名称" prop="goodsName">
+                <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="货品编码" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入货品编码"></el-input>
+              <el-form-item label="产品编码" prop="goodsNum">
+                <el-input v-model="screenForm.goodsNum" placeholder="请输入产品编码"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -38,7 +26,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="单据日期" prop="date">
+              <el-form-item label="预留日期" prop="date">
                 <el-date-picker
                   v-model="screenForm.date"
                   type="datetimerange"
@@ -51,17 +39,27 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="制表人" prop="chName">
-                <el-input v-model="screenForm.chName" placeholder="请输入制表人"></el-input>
+              <el-form-item label="制表人" prop="createMan">
+                <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="修改人" prop="updateMan">
+                <el-input v-model="screenForm.updateMan" placeholder="请输入修改人"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="审核人" prop="model">
-                <el-input v-model="screenForm.model" placeholder="请输入审核人"></el-input>
+              <el-form-item label="预留单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入预留单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="销售订单号" prop="saleNum">
+                <el-input v-model="screenForm.saleNum" placeholder="请输入销售订单号"></el-input>
               </el-form-item>
             </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="12" :lg="18" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -82,35 +80,38 @@
         </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="shipOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据日期" prop="shipTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="关联单据" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="品类" prop="projectNumber" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="货品编号" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="货品名称" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.status | statusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="预留单号" prop="id" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="预留日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售订单号" prop="orderId" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <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="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="预留数量" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="开单数量" prop="number" 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="reservedNum" 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="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerId" 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="productName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制表人" prop="createBy" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制表日期" prop="createTime" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="修改人" prop="createBy" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="修改日期" prop="createTime" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="关闭人" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="关闭日期" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核状态" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="修改人" prop="updateBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="修改日期" prop="updateTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="关闭人" prop="closureBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="关闭日期" prop="closureTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="160" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm v-if="scope.row.status" style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
-                  <el-button slot="reference" type="text">删除</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.itemId)" >
+                  <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>
             </el-table-column>
@@ -139,7 +140,7 @@
 </template>
 
 <script>
-import { getList } from "@/api/supply/reserve";
+import { getList, closeData } from "@/api/supply/reserve";
 import ReserveDetail from "@/views/supply/reserve/components/reserve_detail";
 import ReserveForm from "@/views/supply/reserve/components/reserve_form";
 
@@ -148,6 +149,15 @@ export default {
     ReserveDetail,
     ReserveForm,
   },
+  filters: {
+    statusFilter(val) {
+      const MAP = {
+        0: '已关闭',
+        1: '执行中',
+      }
+      return MAP[val];
+    }
+  },
   data() {
     return {
       currentPage: 1, // 当前页码
@@ -156,13 +166,16 @@ export default {
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
+        goodsName: '',
+        goodsNum: '',
         orderNum: '',
         jxsName: '',
-        chName: '',
-        model: '',
-        date: '',
         jxsNum: '',
-        status: '',
+        date: '',
+        createMan: '',
+        updateMan: '',
+        orderNum: '',
+        saleNum: '',
       },
 
       queryItem: {},
@@ -207,14 +220,16 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        retreatOrderNo: this.screenForm.orderNum,
+        materialName: this.screenForm.goodsName,
+        materialCode: this.screenForm.goodsNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
-        productName: this.screenForm.chName,
-        specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 2, // 1:发货单,2:工程发货单
+        createBy: this.screenForm.createMan,
+        updateBy: this.screenForm.updateMan,
+        id: this.screenForm.orderNum,
+        orderId: this.screenForm.saleNum,
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;
@@ -267,8 +282,13 @@ export default {
       this.isShowForm = false;
     },
 
-    handleDelete(id) {
 
+    // 关闭
+    handleClose(id) {
+      closeData({itemId: id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
     }
   }
 }

+ 19 - 6
src/views/supply/retail/components/retail_detail.vue

@@ -6,7 +6,7 @@
       <div class="title">提货进度</div>
     </div>
     <div class="progress-container">
-      <el-progress :text-inside="true" :stroke-width="26" :percentage="progress || 0"></el-progress>
+      <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 100) : 0"></el-progress>
     </div>
 
     <div class="main-title">
@@ -119,6 +119,7 @@
     <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 @click="goBack">关 闭</el-button>
       </div>
     </div>
@@ -186,7 +187,7 @@
 </template>
 
 <script>
-import { getDetail, getWarehouseList, adjustDeliver } from "@/api/supply/retail";
+import { getDetail, getWarehouseList, adjustDeliver, finishData } from "@/api/supply/retail";
 
 export default {
   name: 'RetailDetail',
@@ -245,10 +246,6 @@ export default {
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
-    progress() {
-      if(this.detailData.totalQty == 0) return 0;
-      return (this.detailData.hasSendQty * 100) / (this.detailData.totalQty * 100);
-    }
   },
 
   created() {
@@ -329,6 +326,22 @@ export default {
       })
     },
 
+    // 直调完成
+    handleFinish() {
+      this.$confirm('此操作将直调完成, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        finishData({
+          id: this.listItem.id
+        }).then(res => {
+          this.$successMsg();
+          this.getDetail();
+        })
+      }).catch(() => {});
+    },
+
   }
 }
 </script>

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

@@ -124,11 +124,11 @@
             <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100">
+        <!-- <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> -->
         <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>

+ 4 - 4
src/views/supply/retail/retail_list.vue

@@ -78,11 +78,11 @@
         </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="120" show-overflow-tooltip>
+            <!-- <el-table-column align="center" label="提货进度" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-progress :text-inside="true" :stroke-width="26" :percentage="((scope.row.hasSendQty * 100) / (scope.row.totalQty * 100)) || 0"></el-progress>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.examineStatus | statusFilter}}
@@ -113,7 +113,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="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="rebateRate" min-width="110" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 <div>{{scope.row.rebateAmount}}</div>
@@ -129,7 +129,7 @@
               <template slot-scope="scope">
                 <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
-                <el-button type="text" @click="toReturn(scope.row)">退订</el-button>
+                <el-button type="text" @click="toReturn(scope.row)" v-if="scope.row.examineStatus === 'OK'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定提审吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="scope.row.examineStatus === 'SAVE'" >
                   <el-button slot="reference" type="text">提审</el-button>