Pārlūkot izejas kodu

Merge branch 'feature/Feature-sales' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-sales

howie 3 gadi atpakaļ
vecāks
revīzija
1e39b68944

+ 8 - 0
src/api/finance/change_apply.js

@@ -24,3 +24,11 @@ export function getTransferAdd(params) {
       params
     })
   }
+//查询同个集团的经销商
+export function getCustomerGroupList() {
+    return request({
+      url: '/customer/group/list',
+      method: 'get',
+      
+    })
+  }

+ 10 - 1
src/api/finance/credit_list.js

@@ -41,7 +41,7 @@ export function getCreditExport(params) {
     })
   }
 // 信用额度记录
-export function getCredit(params) {
+export function getCreditRecordList(params) {
     return request({
       url: '/credit/record/list',
       method: 'get',
@@ -49,3 +49,12 @@ export function getCredit(params) {
     })
   }
 
+// 经销商钱包列表
+export function getWalletCustomerList(params) {
+    return request({
+      url: '/wallet/customer/list',
+      method: 'get',
+      params
+    })
+  }
+

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

@@ -24,4 +24,45 @@ export function getFinanceCustomerList(params) {
       params
     })
   }
+// 其他应收单-列表
+export function getFinanceOtherReceList(params) {
+    return request({
+      url: '/finance/other/rece/list',
+      method: 'get',
+      params
+    })
+  }
+
+// 其他应收单-提审
+export function getFinanceOtherReceApply(params) {
+    return request({
+      url: '/finance/other/rece/apply',
+      method: 'post',
+      params
+    })
+  }
+// 其他应收单-详情
+export function getFinanceOtherReceDetail(params) {
+    return request({
+      url: '/finance/other/rece/detail',
+      method: 'get',
+      params
+    })
+  }
+// 其他应收单-审核
+export function getFinanceOtherReceExamine(params) {
+    return request({
+      url: '/finance/other/rece/examine',
+      method: 'post',
+      params
+    })
+  }
+// 其他应收单-删除
+export function getFinanceOtherReceDelete(params) {
+    return request({
+      url: '/finance/other/rece/delete',
+      method: 'post',
+      params
+    })
+  }
 

+ 121 - 2
src/api/supply/engin.js

@@ -126,6 +126,20 @@ export function getOrderDetail(params) {
   })
 }
 
+// 工程订单 - 直调完结
+export function overOrder(params) {
+  return request({
+    url: '/engin-order/end-direct-transfer',
+    method: 'post',
+    params
+  })
+}
+
+
+
+
+
+
 // 家用工程订单 - 获取工程登录列表
 export function getHomeLoginList(params) {
   return request({
@@ -162,6 +176,53 @@ export function editHome(params) {
   })
 }
 
+// 家用工程订单 - 提交审核
+export function submitHome(params) {
+  return request({
+    url: '/engin-order/home-submit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 家用工程订单 - 申请
+export function applyHome(params) {
+  return request({
+    url: '/engin-order/home-submit-on-list',
+    method: 'post',
+    params
+  })
+}
+
+// 家用工程订单 - 撤回
+export function withdrawHome(params) {
+  return request({
+    url: '/engin-order/home-revoke',
+    method: 'post',
+    params
+  })
+}
+
+// 家用工程订单 - 删除
+export function deleteHome(params) {
+  return request({
+    url: '/engin-order/home-del',
+    method: 'post',
+    params
+  })
+}
+
+// 家用工程订单 - 关闭订单
+export function closeHome(params) {
+  return request({
+    url: '/engin-order/home-close',
+    method: 'post',
+    params
+  })
+}
+
+
+
 
 
 // 商用工程订单 - 获取工程登录列表
@@ -185,7 +246,7 @@ export function getComLoginDetail(params) {
 // 商用工程订单 - 新增
 export function addCom(params) {
   return request({
-    url: '/engin-order/home-add',
+    url: '/engin-order/trade-add',
     method: 'post',
     data: params
   })
@@ -194,12 +255,61 @@ export function addCom(params) {
 // 商用工程订单 - 编辑
 export function editCom(params) {
   return request({
-    url: '/engin-order/home-edit',
+    url: '/engin-order/trade-edit',
     method: 'post',
     data: params
   })
 }
 
+// 商用工程订单 - 提交审核
+export function submitCom(params) {
+  return request({
+    url: '/engin-order/trade-submit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 商用工程订单 - 申请
+export function applyCom(params) {
+  return request({
+    url: '/engin-order/trade-submit-on-list',
+    method: 'post',
+    params
+  })
+}
+
+// 商用工程订单 - 撤回
+export function withdrawCom(params) {
+  return request({
+    url: '/engin-order/trade-revoke',
+    method: 'post',
+    params
+  })
+}
+
+// 商用工程订单 - 删除
+export function deleteCom(params) {
+  return request({
+    url: '/engin-order/trade-del',
+    method: 'post',
+    params
+  })
+}
+
+// 商用工程订单 - 关闭订单
+export function closeCom(params) {
+  return request({
+    url: '/engin-order/trade-close',
+    method: 'post',
+    params
+  })
+}
+
+
+
+
+
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
@@ -216,4 +326,13 @@ export function checkStock(params) {
     method: 'get',
     params
   })
+}
+
+// 获取钱包列表
+export function getWalletList(params) {
+  return request({
+    url: '/wallet/customer/list',
+    method: 'get',
+    params
+  })
 }

+ 20 - 3
src/api/supply/sales.js

@@ -1,11 +1,28 @@
 import request from '@/utils/request'
 
-
-// 销售政策
+// 获取列表
 export function getList(params) {
   return request({
-    url: '/policy/list',
+    url: '/sale/order/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取详情
+export function getDetail(params) {
+  return request({
+    url: '/sale/order/detail',
     method: 'get',
     params
   })
 }
+
+// 审批
+export function examineData(params) {
+  return request({
+    url: '/sale/order/approval',
+    method: 'post',
+    data: params
+  })
+}

+ 3 - 3
src/views/basic_data/dealer/dealer_stock.vue

@@ -385,7 +385,7 @@ export default {
     //编辑
 
     async editFn(id) {
-      this.title = "编辑";
+      this.title = "经销商业务关系管理 ";
       this.rowID = id;
       let res = await getCustomerPtDetail({ id });
       console.log(res);
@@ -436,7 +436,7 @@ export default {
       this.$message.success("删除成功");
     },
     addFn() {
-      this.title = "新增";
+      this.title = "经销商业务关系管理";
       this.dialogForm = true;
     },
     async addDataListFn() {
@@ -463,7 +463,7 @@ export default {
         serviceName: data3[0].nickName,
       };
 
-      if (this.title == "编辑") {
+      if (this.title == "经销商业务关系管理 ") {
         await getCustomerPtUpdate({ ...value, id: this.rowID });
 
         this.$message.success("编辑成功");

+ 1 - 1
src/views/basic_data/taker/taker_list.vue

@@ -14,7 +14,7 @@
             <el-form-item label="经销商名称" prop="customerName">
               <el-input
                 v-model="searchForm.customerName"
-                placeholder="请输入提货人姓名"
+                placeholder="请输入经销商名称"
               ></el-input>
             </el-form-item>
           </el-col>

+ 61 - 1
src/views/finance/change_apply.vue

@@ -72,11 +72,51 @@
           ></el-table-column>
           <el-table-column
             align="center"
+            label="经销商名称"
+            prop="customerName"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-select
+                filterable
+                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="name"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              <el-select
+                filterable
+                v-model="scope.row.name"
+                placeholder="请选择"
+                @focus="typeFn(scope.row)"
+              >
+                <el-option
+                  v-for="item in typeList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="返利金额"
@@ -122,7 +162,9 @@ import {
   getWalletCustomerList,
   getTransferAdd,
   getTransferSubmit,
+  getCustomerGroupList,
 } from "@/api/finance/change_apply";
+
 export default {
   data() {
     return {
@@ -132,6 +174,8 @@ export default {
         customerId: "",
         customerName: "",
       },
+      customerData: [], //经销商数据
+      typeList: [], //返利类型数据
     };
   },
   computed: {
@@ -139,6 +183,7 @@ export default {
   },
   created() {
     this.getUserInfoFn();
+    this.getCustomerData();
   },
   methods: {
     func(arr, target) {
@@ -161,6 +206,21 @@ export default {
         v.bz = "";
       });
     },
+    //返利类型数据
+    async typeFn(row) {
+      let res = await getWalletCustomerList({
+        customerId: row.customerId,
+        type: "REBATE",
+      });
+      this.typeList = res.data;
+    },
+
+    //查询同个集团的经销商数据
+    async getCustomerData() {
+      const res = await getCustomerGroupList();
+      console.log(res, 123214);
+      this.customerData = res.data;
+    },
 
     //保存
     async preservationFn() {

+ 10 - 12
src/views/finance/components/credit_list-detail.vue

@@ -163,12 +163,12 @@
 </template>
 
 <script>
-import { getCredit } from "@/api/finance/credit_list";
+import { getCreditRecordList } from "@/api/finance/credit_list";
 import { downloadFiles } from "@/utils/util";
 export default {
   props: {
-    recordsList: {
-      type: Object,
+    recordsListId: {
+      type: String,
       required: true,
     },
   },
@@ -187,10 +187,9 @@ export default {
   },
   created() {
     this.getDataList({
-      customerWalletCreditId: this.recordsList.id,
-
-      pageNum: this.currentPage,
+      customerWalletId: this.recordsListId,
       pageSize: this.pageSize,
+      pageNum: this.currentPage,
     });
   },
   methods: {
@@ -208,7 +207,7 @@ export default {
     //导出
     exportList() {
       let screenData = {
-        customerWalletCreditId: this.recordsList.id,
+        customerWalletCreditId: this.recordsListId,
         startTime: this.searchForm.startTime,
         endTime: this.searchForm.endTime,
       };
@@ -222,16 +221,15 @@ export default {
     searchFn() {
       console.log(this.searchForm);
       this.getDataList({
-        ...this.searchForm,
-        customerWalletCreditId: this.recordsList.id,
-        pageNum: this.currentPage,
+        customerWalletId: this.recordsListId,
         pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        ...this.searchForm,
       });
     },
     //获取信用额度变更记录数据
     async getDataList(data) {
-      const res = await getCredit(data);
-      console.log(res);
+      const res = await getCreditRecordList(data);
       this.dataList = res.data.records;
       this.listTotal = res.data.total;
     },

+ 87 - 53
src/views/finance/components/receivable_list-add.vue

@@ -18,17 +18,17 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据类型" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </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.billType" disabled></el-input>
             </el-form-item>
           </el-col>
+
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据来源" prop="">
-              <el-select v-model="searchForm.source" placeholder="请选择">
+              <el-select
+                class="selectStyle"
+                v-model="searchForm.source"
+                placeholder="请选择"
+              >
                 <el-option value="工程押金"> </el-option>
                 <el-option value="保证金"> </el-option>
                 <el-option value="工程价差"> </el-option>
@@ -38,11 +38,12 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="业务日期" prop="">
               <el-date-picker
+                class="selectStyle"
                 v-model="searchForm.theTime"
-                type="date"
-                placeholder="选择日期"
-                format="yyyy 年 MM 月 dd 日"
-                value-format="yyyy-MM-dd"
+                type="datetime"
+                placeholder="选择日期时间"
+                default-time="23:59:59"
+                value-format="yyyy-MM-dd HH:mm:ss"
               >
               </el-date-picker>
             </el-form-item>
@@ -50,42 +51,35 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="到期日" prop="">
               <el-date-picker
+                class="selectStyle"
                 v-model="searchForm.endTime"
-                type="date"
-                placeholder="选择日期"
-                format="yyyy 年 MM 月 dd 日"
-                value-format="yyyy-MM-dd"
+                type="datetime"
+                placeholder="选择日期时间"
+                default-time="23:59:59"
+                value-format="yyyy-MM-dd HH:mm:ss"
               >
               </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="总金额" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="制单人" prop="">
               <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
-                v-model="searchForm.createTime"
-                placeholder="请输入"
+                disabled
+                v-model="searchForm.totalAmount"
+                placeholder=""
               ></el-input>
             </el-form-item>
           </el-col>
+
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据状态" prop="">
-              <el-input
+              <el-select
+                class="selectStyle"
                 v-model="searchForm.examineStatus"
-                placeholder="请输入"
-              ></el-input>
+                placeholder="请选择"
+              >
+                <el-option value="SAVE" label="暂存"> </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
@@ -112,14 +106,13 @@
           fit
           highlight-current-row
           stripe
+          :row-class-name="rouClassNameFn"
+          @row-click="onRowClick"
         >
-          <el-table-column
-            label="序号"
-            align="center"
-            width="100"
-            type="index"
-            show-overflow-tooltip
-          >
+          <el-table-column align="center" label="序号">
+            <template slot-scope="scope">
+              {{ scope.$index + 1 }}
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -130,13 +123,13 @@
           >
             <template slot-scope="scope">
               <el-select
-                @change="changeCustomerFn"
+                @change="changeCustomerFn($event, scope.$index)"
                 v-model="scope.row.customerId"
                 placeholder="请选择"
               >
                 <el-option
-                  v-for="item in customerList"
-                  :key="item.id"
+                  v-for="(item, i) in customerList"
+                  :key="i"
                   :label="item.name"
                   :value="item.id"
                 >
@@ -187,10 +180,10 @@
             <template slot-scope="scope">
               <el-select v-model="scope.row.walletId" placeholder="请选择">
                 <el-option
-                  v-for="item in walletList"
-                  :key="item.walletRebateId"
+                  v-for="item in scope.row.walletList"
+                  :key="item.mainId"
                   :label="item.name"
-                  :value="item.walletRebateId"
+                  :value="item.mainId"
                 >
                 </el-option>
               </el-select>
@@ -243,12 +236,12 @@
           <el-table-column
             align="center"
             label="备注"
-            prop="tax"
+            prop="remark"
             min-width="160"
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.tax"></el-input>
+              <el-input v-model="scope.row.remark"></el-input>
             </template>
           </el-table-column>
         </el-table>
@@ -260,13 +253,15 @@
         <el-button type="primary" size="small" @click="addFn"
           >提交审核</el-button
         >
-        <el-button type="primary" size="small">重置</el-button>
+        <el-button type="primary" size="small" @click="resetFn">重置</el-button>
       </div>
       <div class="fr">
         <el-button type="primary" size="small" @click="addRowFn"
           >添加行</el-button
         >
-        <el-button type="primary" size="small">删除行</el-button>
+        <el-button type="primary" size="small" @click="delRowFn"
+          >删除行</el-button
+        >
       </div>
     </div>
   </div>
@@ -277,6 +272,8 @@ import {
   getCustomerList,
   getFinanceCustomerList,
   getFinanceOtherReceAdd,
+  getFinanceOtherReceApply,
+  getFinanceOtherReceList,
 } from "@/api/finance/receivable_list";
 export default {
   data() {
@@ -284,33 +281,67 @@ export default {
       searchForm: {
         source: "",
         theTime: "",
+        billType: "其他应收单",
+        examineStatus: "",
       },
       dataList: [],
       customerList: [], //经销商数据
       listLoading: false, // 列表加载loading
       walletList: [], //现金钱包数据
+      delIndex: null,
     };
   },
   created() {
     this.getCustomerList();
   },
   methods: {
+    //重置
+    resetFn() {
+      this.dataList = [];
+      this.searchForm = {};
+    },
+    rouClassNameFn({ row, rowIndex }) {
+      //把每一行的索引放进row
+      row.index = rowIndex;
+    },
+    onRowClick(row, event, column) {
+      this.delIndex = row.index;
+    },
+    //删除行
+    delRowFn() {
+      this.dataList.splice(this.delIndex, 1);
+    },
+
     //新增
     async addFn() {
+      this.dataList.forEach((v) => {
+        let res = this.customerList.filter((i) => i.id == v.customerId);
+        console.log(res);
+        v.customerName = res[0].name;
+        v.customerNumber = res[0].number;
+        let res2 = this.walletList.filter((j) => j.mainId == v.walletId);
+        v.customerWalletId = res2[0].customerWalletId;
+      });
       console.log(this.dataList);
-      console.log(this.searchForm);
       await getFinanceOtherReceAdd({
         items: this.dataList,
         ...this.searchForm,
       });
+      const res = await getFinanceOtherReceList({ pageSize: 1, pageNum: 1 });
+      await getFinanceOtherReceApply({ id: res.data.records[0].id });
+      this.$message.success("提审成功");
+      this.$emit("updateList");
+      this.resetFn();
     },
     //选择经销商名称事件
-    async changeCustomerFn(v) {
+    async changeCustomerFn(v, index) {
       console.log(v);
       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;
     },
     //获取经销商数据
@@ -339,5 +370,8 @@ export default {
 };
 </script>
 
-<style>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
 </style>

+ 164 - 85
src/views/finance/components/receivable_list-approval.vue

@@ -18,107 +18,92 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据类型" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="往来单位类型" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="结算组织" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据来源" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                disabled
+                v-model="searchForm.billType"
+                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
+                disabled
+                v-model="searchForm.code"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="往来单位" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="收款组织" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="备注" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="单据来源" prop="">
+              <el-input
+                disabled
+                v-model="searchForm.source"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="业务日期" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="币别" prop="">
-              <el-input 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
+                disabled
+                v-model="searchForm.theTime"
+                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
+                disabled
+                v-model="searchForm.endTime"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="总金额" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="部门" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                disabled
+                v-model="searchForm.totalAmount"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据状态" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="申请部门" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="组" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="制单人" prop="">
+              <el-input
+                disabled
+                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-input
+                disabled
+                v-model="searchForm.createTime"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="制单人" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="钱包" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="单据状态" prop="">
+              <el-input
+                disabled
+                v-model="searchForm.examineStatus"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="业务员" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="备注" prop="">
+              <el-input
+                disabled
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -141,26 +126,48 @@
           <el-table-column
             label="序号"
             align="center"
-            min-width="100"
+            type="index"
+            width="100"
+            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=""
+            prop="projectCode"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="项目费用名称"
-            prop=""
+            prop="projectName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="*费用承担部门"
+            prop="departmentId"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="现金钱包"
             prop=""
             min-width="160"
             show-overflow-tooltip
@@ -168,35 +175,35 @@
           <el-table-column
             align="center"
             label="*发票类型"
-            prop=""
+            prop="invoiceType"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="不含税金额"
-            prop=""
+            prop="afterTaxAmount"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="税额"
-            prop=""
+            prop="tax"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="总金额"
-            prop=""
+            prop="totalAmount"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="备注"
-            prop=""
+            prop="remark"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -210,21 +217,24 @@
       <el-row :gutter="0">
         <el-col :span="12" class="item">
           <div class="label">审批人</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{ this.name }}</div>
         </el-col>
         <el-col :span="12" class="item">
           <div class="label">审批结果</div>
           <div class="value">
-            <el-radio-group>
-              <el-radio :label="true">通过</el-radio>
-              <el-radio :label="false">驳回</el-radio>
-            </el-radio-group>
+            <div class="value">
+              <el-radio v-model="examineStatus" label="OK">通过</el-radio>
+              <el-radio v-model="examineStatus" label="FALL">驳回</el-radio>
+            </div>
           </div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">审批说明</div>
           <div class="value">
-            <el-input placeholder="请输入内容"></el-input>
+            <el-input
+              v-model="examineRemark"
+              placeholder="请输入内容"
+            ></el-input>
           </div>
         </el-col>
       </el-row>
@@ -233,16 +243,85 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small">提交审批</el-button>
-        <el-button type="primary" size="small">重置</el-button>
+        <el-button type="primary" size="small" @click="btnOK"
+          >提交审批</el-button
+        >
+        <el-button type="primary" size="small" @click="resetFn">重置</el-button>
       </div>
     </div>
   </div>
 </template>
 
 <script>
+import {
+  getFinanceOtherReceDetail,
+  getFinanceOtherReceExamine,
+} from "@/api/finance/receivable_list";
+import { mapGetters } from "vuex";
 export default {
+  props: {
+    approvalId: {
+      type: String,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      examineRemark: "",
+      examineStatus: "",
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      searchForm: {
+        billType: "",
+        code: "",
+        source: "",
+        theTime: "",
+        endTime: "",
+        totalAmount: "",
+        create: "",
+        createTime: "",
+        examineStatus: "",
+        remark: "",
+      },
+    };
+  },
+  computed: { ...mapGetters(["name"]) },
+  created() {
+    this.getDataList();
+  },
   methods: {
+    //重置
+    resetFn() {
+      this.examineRemark = "";
+      this.examineStatus = "";
+    },
+    //审核
+    async btnOK() {
+      await getFinanceOtherReceExamine({
+        id: this.approvalId,
+        examineRemark: this.examineRemark,
+        examineStatus: this.examineStatus,
+      });
+      this.$emit("updateList");
+      this.$message.success("审核成功");
+    },
+    async getDataList() {
+      const res = await getFinanceOtherReceDetail({ id: this.approvalId });
+      console.log(res);
+      this.searchForm = {
+        billType: res.data.billType,
+        code: res.data.code,
+        source: res.data.source,
+        theTime: res.data.theTime,
+        endTime: res.data.endTime,
+        totalAmount: res.data.totalAmount,
+        create: res.data.create,
+        createTime: res.data.createTime,
+        examineStatus: res.data.examineStatus,
+        remark: res.data.remark,
+      };
+      this.dataList = res.data.items;
+    },
     goBack() {
       this.$parent.showPage = 1;
     },

+ 128 - 90
src/views/finance/components/receivable_list-detail.vue

@@ -18,107 +18,74 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据类型" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="往来单位类型" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="结算组织" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据来源" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                disabled
+                v-model="searchForm.billType"
+                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
+                disabled
+                v-model="searchForm.code"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="往来单位" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="收款组织" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="单据来源" prop="">
+              <el-input
+                disabled
+                v-model="searchForm.source"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="备注" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="单据状态" prop="">
+              <el-input
+                disabled
+                v-model="searchForm.examineStatus"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="业务日期" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="币别" prop="">
-              <el-input 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
+                disabled
+                v-model="searchForm.theTime"
+                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
+                disabled
+                v-model="searchForm.endTime"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="总金额" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="部门" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="单据状态" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="申请部门" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="组" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="制单日期" prop="">
-              <el-input 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
+                disabled
+                v-model="searchForm.totalAmount"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="钱包" prop="">
-              <el-input placeholder="请输入"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="业务员" prop="">
-              <el-input placeholder="请输入"></el-input>
+            <el-form-item label="备注" prop="">
+              <el-input
+                disabled
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -141,26 +108,48 @@
           <el-table-column
             label="序号"
             align="center"
-            min-width="100"
+            type="index"
+            width="100"
+            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=""
+            prop="projectCode"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="项目费用名称"
-            prop=""
+            prop="projectName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="*费用承担部门"
+            prop="departmentId"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="现金钱包"
             prop=""
             min-width="160"
             show-overflow-tooltip
@@ -168,35 +157,35 @@
           <el-table-column
             align="center"
             label="*发票类型"
-            prop=""
+            prop="invoiceType"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="不含税金额"
-            prop=""
+            prop="afterTaxAmount"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="税额"
-            prop=""
+            prop="tax"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="总金额"
-            prop=""
+            prop="totalAmount"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="备注"
-            prop=""
+            prop="remark"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -210,25 +199,25 @@
       <el-row :gutter="0">
         <el-col :span="8" class="item">
           <div class="label">审批人</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{ this.examineBy }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">审批结果</div>
           <div class="value">
-            <el-radio-group>
-              <el-radio :label="true">通过</el-radio>
-              <el-radio :label="false">驳回</el-radio>
+            <el-radio-group v-model="examineStatus">
+              <el-radio disabled label="OK">通过</el-radio>
+              <el-radio disabled label="FAIL">驳回</el-radio>
             </el-radio-group>
           </div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">审批时间</div>
-          <div class="value">2022-09-12012:23</div>
+          <div class="value">{{ this.examineTime }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">审批说明</div>
           <div class="value">
-            <el-input placeholder="请输入内容"></el-input>
+            {{ this.examineRemark }}
           </div>
         </el-col>
       </el-row>
@@ -238,8 +227,57 @@
 </template>
 
 <script>
+import { getFinanceOtherReceDetail } from "@/api/finance/receivable_list";
 export default {
+  props: {
+    approvalId: {
+      type: String,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      examineBy: "", //审核人
+      examineTime: "", //审核时间
+      examineStatus: null, //审核状态
+      examineRemark: "", //审核备注
+      searchForm: {
+        billType: "",
+        code: "",
+        source: "",
+        theTime: "",
+        endTime: "",
+        totalAmount: "",
+        examineStatus: "",
+        remark: "",
+      },
+    };
+  },
+  created() {
+    this.getDataList();
+  },
   methods: {
+    async getDataList() {
+      const res = await getFinanceOtherReceDetail({ id: this.approvalId });
+      console.log(res);
+      this.examineBy = res.data.examineBy;
+      this.examineTime = res.data.examineTime;
+      this.examineStatus = res.data.examineStatus;
+      this.examineRemark = res.data.examineRemark;
+      this.searchForm = {
+        billType: res.data.billType,
+        code: res.data.code,
+        source: res.data.source,
+        theTime: res.data.theTime,
+        endTime: res.data.endTime,
+        totalAmount: res.data.totalAmount,
+        examineStatus: res.data.examineStatus == "OK" ? "已通过" : "驳回",
+        remark: res.data.remark,
+      };
+      this.dataList = res.data.items;
+    },
     goBack() {
       this.$parent.showPage = 1;
     },

+ 24 - 134
src/views/finance/credit_list.vue

@@ -57,11 +57,6 @@
       </div>
       <!-- 按钮 -->
       <div class="btn-group clearfix">
-        <div class="fl">
-          <el-button type="primary" size="small" @click="showAddFn"
-            >新建</el-button
-          >
-        </div>
         <div class="fr">
           <el-button type="primary" size="small" @click="exportList"
             >导出</el-button
@@ -108,11 +103,15 @@
               prop="amount"
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{ scope.row.usedCreditAmount + scope.row.freeCreditAmount }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="关联钱包"
-              prop="customerWalletName"
+              prop="name"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
@@ -132,7 +131,7 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  @click="recordFn(scope.row)"
+                  @click="recordFn(scope.row.customerWalletId)"
                   >记录</el-button
                 >
               </template>
@@ -154,10 +153,10 @@
         </div>
       </div>
     </div>
-    <CreditListDetail :recordsList="recordsList" v-else />
+    <CreditListDetail :recordsListId="recordsListId" v-else />
     <!-- 新增弹窗 -->
     <el-dialog
-      title="新增"
+      title="经销商信用额度管理"
       :visible.sync="dialogForm"
       width="30%"
       :show-close="false"
@@ -169,44 +168,10 @@
         :model="addForm"
         label-width="120px"
       >
-        <el-form-item label="经销商名称" prop="customerId" label-width="120px">
-          <el-select
-            v-model="addForm.customerId"
-            class="selectStyle"
-            placeholder="请选择"
-            filterable
-            @change="customerChangeFn"
-          >
-            <el-option
-              v-for="v in customerList"
-              :key="v.id"
-              :label="v.name"
-              :value="v.id"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-
         <el-form-item label="信用变更额度" prop="amount">
           <el-input v-model.number="addForm.amount"></el-input>
         </el-form-item>
 
-        <el-form-item label="关联钱包" prop="customerWalletId">
-          <el-select
-            v-model="addForm.customerWalletId"
-            class="selectStyle"
-            placeholder="请选择"
-            filterable
-          >
-            <el-option
-              v-for="v in customerWalletList"
-              :key="v.customerWalletId"
-              :label="v.mainName"
-              :value="v.customerWalletId"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
         <el-form-item label="开始时间" prop="startTime">
           <el-date-picker
             class="selectStyle"
@@ -239,12 +204,9 @@
 </template>
 
 <script>
-import { getWalletCustomerList } from "@/api/finance/change_apply";
-import { getDealerList } from "@/api/basic_data/dealer";
 import {
-  getCreditListAdd,
-  getCreditList,
   getCreditListEdit,
+  getWalletCustomerList,
 } from "@/api/finance/credit_list";
 import CreditListDetail from "./components/credit_list-detail";
 import { downloadFiles } from "@/utils/util";
@@ -271,13 +233,10 @@ export default {
         startTime: "",
         endTime: "",
         amount: null,
-        customerId: "",
-        customerWalletId: "",
       },
-      customerList: [], //经销商列表数据
-      customerWalletList: [], //经销商钱包列表
-      recordsList: {}, //记录数据
-      customerWalletCreditId: null, //设置额度ID
+      data: null,
+      recordsListId: {}, //记录
+
       rules: {
         startTime: [
           { required: true, message: "请选择开始时间", trigger: "blur" },
@@ -303,34 +262,15 @@ export default {
     };
   },
   created() {
-    this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
-    this.getDealerData({ pageSize: -1, pageNum: 1 });
+    this.getDataList({ type: "COMMONLY" });
   },
   methods: {
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.getDataList({ pageNum: 1, pageSize: this.pageSize });
-    },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val;
-      this.getDataList({ pageNum: val, pageSize: 10 });
-    },
     //设置额度
     editFn(value) {
-      this.customerWalletCreditId = value.id;
-
-      this.addForm = {
-        startTime: "",
-        endTime: "",
-        amount: value.amount,
+      this.data = {
         customerId: value.customerId,
         customerWalletId: value.customerWalletId,
       };
-      this.getWalletData({ type: "COMMONLY", customerId: value.customerId });
-
       this.dialogForm = true;
     },
     //导出
@@ -348,13 +288,7 @@ export default {
       this.$refs.searchForm.resetFields();
     },
     //搜索
-    searchFn() {
-      this.getDataList({
-        ...this.searchForm,
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-      });
-    },
+    searchFn() {},
     // 更改每页数量
     handleSizeChange(val) {
       this.pageSize = val;
@@ -368,72 +302,28 @@ export default {
     },
     //列表数据
     async getDataList(data) {
-      const res = await getCreditList(data);
-      console.log(res);
-      this.dataList = res.data.records;
-      this.listTotal = res.data.total;
-    },
-    //下拉框数据
-    customerChangeFn(value) {
-      this.getWalletData({ type: "COMMONLY", customerId: value });
-    },
-    //获取经销商钱包列表
-    async getWalletData(data) {
       const res = await getWalletCustomerList(data);
-
-      this.customerWalletList = res.data;
+      console.log(res);
+      this.dataList = res.data;
     },
-    //获取经销商列表
-    async getDealerData(data) {
-      const res = await getDealerList(data);
 
-      this.customerList = res.data.records;
-    },
-    //新建
-    showAddFn() {
-      this.dialogForm = true;
-    },
     //确定
     async addDataFn() {
       await this.$refs.addForm.validate();
-
-      if (this.customerWalletCreditId) {
-        await getCreditListEdit({
-          ...this.addForm,
-          customerWalletCreditId: this.customerWalletCreditId,
-        });
-        this.$message.success("设置成功");
-      } else {
-        await getCreditListAdd({ ...this.addForm });
-        this.$message.success("新增成功");
-      }
-      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
-      this.addForm = {
-        startTime: "",
-        endTime: "",
-        amount: null,
-        customerId: "",
-        customerWalletId: "",
-      };
-      this.customerWalletCreditId = null;
+      await getCreditListEdit({ ...this.addForm, ...this.data });
+      this.getDataList({ type: "COMMONLY" });
+      this.$message.success("设置成功");
       this.dialogForm = false;
     },
     //取消
     async cancelFn() {
-      // this.addForm = {
-      //   startTime: "",
-      //   endTime: "",
-      //   amount: null,
-      //   customerId: "",
-      //   customerWalletId: "",
-      // };
       await this.$refs.addForm.resetFields();
-      this.customerWalletCreditId = null;
       this.dialogForm = false;
     },
     //记录
-    recordFn(v) {
-      this.recordsList = v;
+    recordFn(id) {
+      console.log(id);
+      this.recordsListId = id;
       this.showRecord = false;
     },
   },

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

@@ -75,6 +75,20 @@
           ></el-table-column>
           <el-table-column
             align="center"
+            label="可用信用额度"
+            prop="freezeCreditAmount"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="已用信用额度"
+            prop="usedCreditAmount"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
             label="更新时间"
             prop="theTime"
             min-width="160"

+ 157 - 45
src/views/finance/receivable_list.vue

@@ -2,10 +2,10 @@
   <div class="app-container">
     <div v-if="showPage == 1">
       <el-radio-group v-model="examine" size="">
-        <el-radio-button label="全部"></el-radio-button>
-        <el-radio-button label="待审核"></el-radio-button>
-        <el-radio-button label="审核通过"></el-radio-button>
-        <el-radio-button label="审核驳回"></el-radio-button>
+        <el-radio-button label="">全部</el-radio-button>
+        <el-radio-button label="WAIT">待审核</el-radio-button>
+        <el-radio-button label="OK">审核通过</el-radio-button>
+        <el-radio-button label="FAIL">审核驳回</el-radio-button>
       </el-radio-group>
       <br /><br />
       <!-- 筛选条件 -->
@@ -19,37 +19,65 @@
         >
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程押金" prop="">
-                <el-select class="selectStyle" placeholder="请选择">
-                  <el-option> </el-option>
+              <el-form-item label="单据来源" prop="source">
+                <el-select
+                  v-model="searchForm.source"
+                  class="selectStyle"
+                  placeholder="请选择"
+                >
+                  <el-option value="工程押金"> </el-option>
+                  <el-option value="保证金"> </el-option>
+                  <el-option value="工程价差"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="单据编号" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="单据编号" prop="code">
+                <el-input
+                  v-model="searchForm.code"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="往来单位" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="往来单位" prop="userName">
+                <el-input
+                  v-model="searchForm.userName"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="申请部门" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="业务开始时间" prop="startTime">
+                <el-date-picker
+                  class="dateStyle"
+                  v-model="searchForm.startTime"
+                  placeholder="选择日期"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="业务日期" prop="">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="业务结束时间" prop="endTime">
+                <el-date-picker
+                  class="dateStyle"
+                  v-model="searchForm.endTime"
+                  placeholder="选择日期"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
 
             <el-col :xs="24" :sm="24" :lg="18">
               <el-form-item label="" class="fr">
-                <el-button size="small">清空</el-button>
-                <el-button size="small" type="primary">搜索</el-button>
+                <el-button size="small" @click="clearFn">清空</el-button>
+                <el-button size="small" type="primary" @click="searchFn"
+                  >搜索</el-button
+                >
               </el-form-item>
             </el-col>
           </el-row>
@@ -59,13 +87,12 @@
       <div class="btn-group clearfix">
         <div class="fl">
           <el-button type="primary" size="small" @click="addFn">新建</el-button>
-          <el-button type="primary" size="small">删除</el-button>
-          <el-button type="primary" size="small" @click="approvalFn"
-            >审批</el-button
-          >
-          <el-button type="primary" size="small" @click="detailFn"
-            >详情</el-button
-          >
+
+          <el-popconfirm @onConfirm="deleFn" title="这是一段内容确定删除吗?">
+            <el-button slot="reference" type="primary" size="small"
+              >批量删除</el-button
+            >
+          </el-popconfirm>
         </div>
         <div class="fr">
           <el-button type="primary" size="small">导出</el-button>
@@ -82,72 +109,87 @@
             fit
             highlight-current-row
             stripe
+            @selection-change="selectionChangeFn"
           >
             <el-table-column align="center" type="selection" width="100">
             </el-table-column>
             <el-table-column
               align="center"
               label="单据类型"
-              prop=""
+              prop="billType"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="单据来源"
-              prop=""
+              prop="source"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="单据编码"
-              prop=""
+              prop="code"
               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>
             <el-table-column
               align="center"
               label="往来单位类型"
-              prop=""
+              prop="userType"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="往来单位"
-              prop=""
+              prop="userName"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="币别"
-              prop=""
+              prop="amountType"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="总金额"
-              prop=""
+              prop="totalAmount"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
               align="center"
               label="单据状态"
-              prop=""
+              prop="examineStatus"
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                <el-tag v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
+                <el-tag v-show="scope.row.examineStatus == 'WAIT'"
+                  >待审核</el-tag
+                >
+                <el-tag v-show="scope.row.examineStatus == 'OK'">通过</el-tag>
+                <el-tag v-show="scope.row.examineStatus == 'FAIL'"
+                  >不通过</el-tag
+                >
+                <el-tag v-show="scope.row.examineStatus == 'CLOSE'"
+                  >已关闭</el-tag
+                >
+              </template>
+            </el-table-column>
 
             <el-table-column
               align="center"
@@ -156,11 +198,21 @@
               show-overflow-tooltip
               fixed="right"
             >
-              <template slot-scope="">
-                <el-button type="text" class="textColor" slot="reference"
+              <template slot-scope="scope">
+                <el-button
+                  v-if="
+                    scope.row.examineStatus == 'WAIT' ||
+                    scope.row.examineStatus == 'FAIL'
+                  "
+                  type="text"
+                  class="textColor"
+                  @click="approvalFn(scope.row.id)"
                   >审批</el-button
                 >
-                <el-button type="text" class="textColor" slot="reference"
+                <el-button
+                  type="text"
+                  class="textColor"
+                  @click="detailFn(scope.row.id)"
                   >详情</el-button
                 >
               </template>
@@ -180,14 +232,21 @@
         </div>
       </div>
     </div>
-    <ReceivableListAdd v-else-if="showPage == 2" />
-    <ReceivableListApproval v-else-if="showPage == 3" />
-    <ReceivableListDetail v-else-if="showPage == 4" />
+    <ReceivableListAdd @updateList="updateList" v-else-if="showPage == 2" />
+    <ReceivableListApproval
+      :approvalId="approvalId"
+      @updateList="updateList"
+      v-else-if="showPage == 3"
+    />
+    <ReceivableListDetail :approvalId="approvalId" v-else-if="showPage == 4" />
   </div>
 </template>
 
 <script>
-import { getFinanceOtherReceAdd } from "@/api/finance/receivable_list";
+import {
+  getFinanceOtherReceList,
+  getFinanceOtherReceDelete,
+} from "@/api/finance/receivable_list";
 import ReceivableListAdd from "./components/receivable_list-add";
 import ReceivableListApproval from "./components/receivable_list-approval";
 import ReceivableListDetail from "./components/receivable_list-detail";
@@ -203,19 +262,69 @@ export default {
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       dataList: [], // 列表数据
-      searchForm: {}, //搜索表单
+      searchForm: {
+        source: "",
+        code: "",
+        userName: "",
+      }, //搜索表单
       listLoading: false, // 列表加载loading
-      examine: "全部",
+      examine: "",
       showPage: 1,
+      approvalId: null,
+      deleList: null,
     };
   },
+  created() {
+    this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+  },
   methods: {
+    //清除
+    async clearFn() {
+      await this.$refs.searchForm.resetFields();
+      this.examine = "";
+    },
+    //搜索
+    searchFn() {
+      this.getDataList({
+        ...this.searchForm,
+        examineStatus: this.examine,
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+      });
+    },
+    //删除
+    async deleFn() {
+      let res = this.deleList.toString();
+      console.log(res);
+      await getFinanceOtherReceDelete({ ids: res });
+      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+      this.$message.success("删除成功");
+    },
+    selectionChangeFn(value) {
+      console.log(value);
+      const res = value.map((v) => v.id);
+      console.log(res);
+      this.deleList = res;
+    },
+    //新建后更新列表
+    updateList() {
+      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+    },
+    //获取来列表数据
+    async getDataList(data) {
+      const res = await getFinanceOtherReceList(data);
+      console.log(res);
+      this.dataList = res.data.records;
+      this.listTotal = res.data.total;
+    },
     //详情
-    detailFn() {
+    detailFn(id) {
+      this.approvalId = id;
       this.showPage = 4;
     },
     //审批
-    approvalFn() {
+    approvalFn(id) {
+      this.approvalId = id;
       this.showPage = 3;
     },
     //新建
@@ -229,4 +338,7 @@ export default {
 .selectStyle {
   width: 100%;
 }
+.dateStyle {
+  width: 100%;
+}
 </style>

+ 17 - 0
src/views/finance/wallet.vue

@@ -48,6 +48,20 @@
           ></el-table-column>
           <el-table-column
             align="center"
+            label="可用信用额度"
+            prop="freeCreditAmount"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="已用信用额度"
+            prop="usedCreditAmount"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
             label="更新时间"
             prop="updateTime"
             min-width="160"
@@ -84,6 +98,7 @@
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
+
           <el-table-column
             align="center"
             label="更新时间"
@@ -120,6 +135,8 @@ export default {
     //一键生成
     async generateFn() {
       await getfinanceInit({ customerId: this.customerId });
+      this.getDataWallet();
+      this.getDataRebate();
       this.$message.success("已生成");
     },
     //

+ 140 - 79
src/views/supply/engin/components/home_detail.vue

@@ -10,92 +10,120 @@
       <div class="diy-table-1">
         <el-row>
           <el-col :span="8" class="item">
-            <div class="label">订单号</div>
-            <div class="value">{{detailData.billNo}}</div>
+            <div class="label">工程订单号</div>
+            <div class="value">{{detailData.enginOrderId}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">订单日期</div>
-            <div class="value">{{detailData.fdate}}</div>
+            <div class="value">{{detailData.orderDate}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-            <div class="value">{{detailData.srcStockId}}</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">工程登录单号</div>
-            <div class="value">{{detailData.destStockId}}</div>
+            <div class="label">经销商编码</div>
+            <div class="value">{{detailData.customerId}}</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.approveDate}}</div>
+            <div class="label">工程信息编号</div>
+            <div class="value">{{detailData.refEnginRecordNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">单据类型</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">工程项目名称</div>
+            <div class="value">{{detailData.refProjectName}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">经销商编码</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">工程登录类型</div>
+            <div class="value">{{detailData.refPromiseStatus}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">厂工程编码</div>
+            <div class="value">{{detailData.refFactoryNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">使用单位</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.refUseUnit}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">安装地址</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">销售类型</div>
+            <div class="value">{{detailData.saleTypeName}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">工程编号</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">联系人</div>
+            <div class="value">{{detailData.aaa}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">厂工厂编码</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">固定电话</div>
+            <div class="value">{{detailData.aaa}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">工程登录类型</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">移动电话</div>
+            <div class="value">{{detailData.aaa}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">文件编号</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">不扣押金</div>
+            <div class="value">{{detailData.takeDeposit ? '是':'否'}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">制单人</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">文件编码</div>
+            <div class="value">{{detailData.fileNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">制单日期</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="label">业务员</div>
+            <div class="value">{{detailData.serviceName}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">格力回复</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.note1}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">格力内部备注</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.note2}}</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.createName}}</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.approverId}}</div>
+            <div class="value">{{detailData.confirmName}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">审核日期</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.confirmTime}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">最后更新人</div>
+            <div class="value">{{detailData.updateName}}</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.approverId}}</div>
+            <div class="value">{{detailData.closeName}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">关闭日期</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.closeTime}}</div>
           </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">备注</div>
-            <div class="value">{{detailData.approverId}}</div>
+          <el-col :span="24" class="item" v-if="isExamine">
+            <div class="label">审批说明</div>
+            <div class="value">{{detailData.examineNote}}</div>
           </el-col>
         </el-row>
       </div>
@@ -105,55 +133,44 @@
       </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.items" 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="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="是否使用返利" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="返利使用比例" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="是否直调" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="直调数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="已发货数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单价" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="返利" prop="qty" min-width="100" 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="saleTypeName" 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="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="baseUnitId" 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="enginNum" 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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.isDirectTransfer ? '是' : '否' }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
-
-      <div class="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">2022123233435342</div>
-          </el-col>
-          <el-col :span="12" class="item">
-            <div class="label">审批结果</div>
-            <div class="value">2022123233435342</div>
-          </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">审批说明</div>
-            <div class="value">2022123233435342</div>
-          </el-col>
-        </el-row>
-      </div>
       
     </div>
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button  type="primary" @click="openDeliverDialog">直调发货</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+        <el-button type="danger" @click="closeData">关闭订单</el-button>
+        <el-button type="primary" @click="openDeliverDialog">提前开票</el-button>
+        <el-button type="primary" @click="overData">直调完结</el-button>
+        <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-button @click="goBack">返回</el-button>
       </div>
     </div>
 
@@ -226,7 +243,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getDetail } from "@/api/supply/engin";
+import { getOrderDetail, closeHome, overOrder } from "@/api/supply/engin";
 
 export default {
   name: 'HomeDetail',
@@ -235,6 +252,19 @@ export default {
   directives: {
     print
   },
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       printObj: {
@@ -261,6 +291,9 @@ export default {
         openSidebar: this.sidebar.opened
       }
     },
+    isExamine() {
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
+    },
   },
 
   created() {
@@ -275,11 +308,39 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getOrderDetail({id: this.listItem.parentId}).then(res => {
         this.detailData = res.data;
       })
     },
 
+    // 关闭订单
+    closeData() {
+      this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        closeHome({id: this.listItem.parentId}).then(res => {
+          this.$successMsg();
+          this.getDetail();
+        })
+      }).catch(() => {});
+    },
+
+    // 直调完结
+    overData() {
+      this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        overOrder({id: this.listItem.parentId}).then(res => {
+          this.$successMsg();
+          this.getDetail();
+        })
+      }).catch(() => {});
+    },
+
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;

+ 215 - 41
src/views/supply/engin/components/home_form.vue

@@ -51,12 +51,12 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程项目名称" prop="enginName">
-            <el-input v-model="mainForm.enginName" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.enginName" placeholder="请输入工程项目名称"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程登录类型" prop="loginType">
-            <el-input v-model="mainForm.loginType" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.loginType" placeholder="请输入工程登录类型"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
@@ -66,34 +66,34 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="使用单位" prop="company">
-            <el-input v-model="mainForm.company" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.company" placeholder="请输入使用单位"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="销售类型" prop="saleType">
-            <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable>
+            <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable @change="changeSaleType">
               <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="联系人" prop="contactMan">
-            <el-input v-model="mainForm.contactMan" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.contactMan" placeholder="请输入联系人"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="固定电话" prop="tel">
-            <el-input v-model="mainForm.tel" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.tel" placeholder="请输入固定电话"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="移动电话" prop="phone">
-            <el-input v-model="mainForm.phone" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.phone" placeholder="请输入移动电话"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
           <el-form-item label="安装地址" prop="address">
-            <el-input v-model="mainForm.address" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.address" placeholder="请输入安装地址"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
@@ -149,27 +149,77 @@
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-        <el-table-column align="center" label="引用记录" prop="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="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="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="单价" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="工程登录数量" prop="qty" min-width="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="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利类型" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="使用返利金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="格力折扣" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="现金钱包" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="是否直调" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="直调数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="已发货数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="备注" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="税率" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialNumber" 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="baseUnitId" 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="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.qty" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.price * scope.row.qty}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="返利钱包" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利钱包" size="small" clearable @change="changeFlWallet(scope.$index)">
+              <el-option
+                v-for="item in flWalletList"
+                :key="item.customerWalletId"
+                :label="item.name"
+                :value="item.customerWalletId">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="格力折扣" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.qty * scope.row.discAmount}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
+              <el-option
+                v-for="item in xjWalletList"
+                :key="item.customerWalletId"
+                :label="item.name"
+                :value="item.customerWalletId">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
+          <template slot-scope="scope">
+            <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.directTransferQty" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             <div>{{ scope.row.status1 | status1Filter }}</div>
@@ -190,8 +240,8 @@
     
     <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-button type="primary" @click="clickSubmitForm(1)">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm(2)">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -267,7 +317,7 @@
 </template>
 
 <script>
-import { getOrderDetail, getHomeLoginList, getWarehouseList, addHome, editHome, checkStock } from "@/api/supply/engin";
+import { getOrderDetail, getHomeLoginList, getWarehouseList, addHome, editHome, submitHome, checkStock, getWalletList } from "@/api/supply/engin";
 import { getDictList, getTypeList } from '@/api/common'
 
 export default {
@@ -285,7 +335,7 @@ export default {
   },
   data() {
     return {
-      detailData: {},
+      editId: '',
       mainForm: {
         orderNum: '',
         orderDate: '',
@@ -317,9 +367,10 @@ export default {
         enginName: [{ required: true, message: '请输入工程项目名称', trigger: 'blur' }],
         loginType: [{ required: true, message: '请输入工程登录类型', trigger: 'blur' }],
         company: [{ required: true, message: '请输入使用单位', trigger: 'blur' }],
-        contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
-        tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
-        phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
+        saleType: [{ required: true, message: '请选择销售类型', trigger: 'change' }],
+        // contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
+        // tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
+        // phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
         address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
       },
       salesTypeList: [],
@@ -340,6 +391,9 @@ export default {
 
       warehouseList: [],
       warehouseValue: '',
+
+      xjWalletList: [],
+      flWalletList: [],
     }
   },
 
@@ -357,10 +411,12 @@ export default {
 
   created() {
     this.getDictList();
+    this.getWalletList();
     this.getSalesTypeList();
     this.getWarehouseList();
 
     if(this.listItem) {
+      this.editId = this.listItem.parentId;
       this.getDetail();
     }else {
       this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
@@ -392,6 +448,22 @@ export default {
       return currentdate;
     },
 
+    // 获取钱包列表
+    getWalletList() {
+      getWalletList({
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        type: 'COMMONLY'
+      }).then(res => {
+        this.xjWalletList = res.data;
+      })
+      getWalletList({
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        type: 'REBATE'
+      }).then(res => {
+        this.flWalletList = res.data;
+      })
+    },
+
     // 获取产品大类列表
     getDictList() {
       getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
@@ -421,8 +493,35 @@ export default {
 
     // 获取详情
     getDetail() {
-      getOrderDetail({id: this.listItem.id}).then(res => {
-        this.detailData = res.data;
+      getOrderDetail({id: this.editId}).then(res => {
+        let data = res.data;
+        this.mainForm.orderNum = data.enginOrderId;
+        this.mainForm.orderDate = data.orderDate;
+        this.mainForm.type = data.refProductCategory;
+        this.mainForm.jxsNum = data.customerId;
+        this.mainForm.jxsName = data.customerName;
+        this.mainForm.loginNum = data.refEnginRecordNo;
+        this.mainForm.enginName = data.refProjectName;
+        this.mainForm.loginType = data.refPromiseStatus;
+        this.mainForm.factoryNum = data.refFactoryNo;
+        this.mainForm.company = data.refUseUnit;
+        this.mainForm.saleType = data.saleTypeId;
+        this.mainForm.contactMan = data.aaa;
+        this.mainForm.tel = data.aaa;
+        this.mainForm.phone = data.aaa;
+        this.mainForm.address = data.refInstallAddress;
+        this.mainForm.greeRemark = data.note2;
+        this.mainForm.greeReply = data.note1;
+        this.mainForm.remark = data.remark;
+        this.mainForm.createMan = data.createName;
+        this.mainForm.createDate = data.createTime;
+        this.mainForm.fileNum = data.fileNo;
+
+        data.items.forEach(item => {
+          item.status1 = '';
+          item.status2 = '';
+        })
+        this.goodsList = data.items;
       })
     },
 
@@ -471,6 +570,18 @@ export default {
     chooseItem(id) {
       addHome({refEnginRecordNo: id}).then(res => {
         this.isShowDialog = false;
+        this.editId = res.data;
+        this.getDetail();
+      })
+    },
+
+    // 选择销售类型
+    changeSaleType() {
+      let obj = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
+      this.goodsList.forEach(item => {
+        item.saleTypeId = obj.id;
+        item.saleTypeCode= obj.saleCode;
+        item.saleTypeName = obj.saleName;
       })
     },
 
@@ -479,6 +590,28 @@ export default {
       this.goodsList.splice(index, 1);
     },
 
+    // 修改返利钱包
+    changeFlWallet(index) {
+      if(this.goodsList[index].customerWalletId2) {
+        let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
+        this.goodsList[index].rebateRate = obj.rebateRate;
+        this.goodsList[index].customerWalletName2 = obj.name;
+      }else {
+        this.goodsList[index].rebateRate = '';
+        this.goodsList[index].customerWalletName2 = '';
+      }
+    },
+
+    // 修改现金钱包
+    changeXjWallet(index) {
+      if(this.goodsList[index].customerWalletId) {
+        let obj = this.xjWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
+        this.goodsList[index].customerWalletName = obj.name;
+      }else {
+        this.goodsList[index].customerWalletName = '';
+      }
+    },
+
     // 检查库存
     checkStock() {
       if(!this.warehouseValue) {
@@ -510,9 +643,50 @@ export default {
       else return '短缺';
     },
 
-
-    clickSubmitForm() {
-
+    // 保存 / 提交审核
+    clickSubmitForm(type) {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
+          let params = {
+            enginOrderId: this.mainForm.orderNum,
+            orderDate: this.mainForm.orderDate,
+            refProductCategory: this.mainForm.type || '',
+            // customerId: this.mainForm.jxsNum,
+            // customerName: this.mainForm.jxsName,
+            refEnginRecordNo: this.mainForm.loginNum || '',
+            refProjectName: this.mainForm.enginName || '',
+            refPromiseStatus: this.mainForm.loginType || '',
+            refFactoryNo: this.mainForm.factoryNum || '',
+            refUseUnit: this.mainForm.company || '',
+            saleTypeId: this.mainForm.saleType,
+            saleTypeCode: saleTypeItem.saleCode,
+            saleTypeName: saleTypeItem.saleName,
+            // aaa: this.mainForm.contactMan,
+            // aaa: this.mainForm.tel,
+            // aaa: this.mainForm.phone,
+            refInstallAddress: this.mainForm.address || '',
+            note2: this.mainForm.greeRemark || '',
+            note1: this.mainForm.greeReply || '',
+            remark: this.mainForm.remark || '',
+            fileNo: this.mainForm.fileNum || '',
+            items: this.goodsList,
+          }
+          if(type === 1) {
+            editHome(params).then(res => {
+              this.$successMsg('编辑成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }else if(type === 2) {
+            submitHome(params).then(res => {
+              this.$successMsg('提交审核成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }
+        }
+      })
     },
   }
 }

+ 70 - 17
src/views/supply/engin/home_list.vue

@@ -76,19 +76,21 @@
         <div class="btn-group clearfix">
           <div class="fl">
             <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+            <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>
+          <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="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="enginOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
@@ -100,29 +102,35 @@
             <el-table-column align="center" label="销售类型" prop="saleTypeId" 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="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="isDirectTransfer" min-width="160" show-overflow-tooltip>
+            <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.isDirectTransfer ? '是':'否'}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单价" prop="enginPrice" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="金额" prop="enginTotality" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单价" prop="enginPrice" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="金额" prop="enginTotality" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="使用返利金额" prop="rebateAmount" 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="createName" min-width="100" 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="confirmName" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="操作" width="160" fixed="right">
+            <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="180" fixed="right">
               <template slot-scope="scope">
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.parentId)" v-if="scope.row.examineStatus === 'SAVE'" >
+                  <el-button slot="reference" type="text">申请</el-button>
+                </el-popconfirm>
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'" >
+                  <el-button slot="reference" type="text">撤回</el-button>
+                </el-popconfirm>
                 <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-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" >
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -152,7 +160,7 @@
 </template>
 
 <script>
-import { getOrderList } from "@/api/supply/engin";
+import { getOrderList, applyHome, withdrawHome, deleteHome } from "@/api/supply/engin";
 import HomeDetail from "@/views/supply/engin/components/home_detail";
 import HomeForm from "@/views/supply/engin/components/home_form";
 
@@ -200,6 +208,8 @@ export default {
         { label: '已关闭', value: 'CLOSE' },
       ],
 
+      multipleSelection: [],
+
       queryItem: {},
       isShowDetail: false,
       isShowForm: false,
@@ -310,9 +320,52 @@ export default {
       this.isShowForm = false;
     },
 
+    // 申请
+    handleSubmit(id) {
+      applyHome({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 撤回
+    handleWithdraw(id) {
+      withdrawHome({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 删除
     handleDelete(id) {
+      deleteHome({ids: id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 批量删除
+    batchDelete() {
+      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let ids = this.multipleSelection.map(item => {
+          return item.parentId;
+        });
+        deleteHome({ids: ids.join(',')}).then(res => {
+          this.$successMsg();
+          this.getList();
+        })
+      }).catch(() => {});
+    },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
 
-    }
   }
 }
 </script>

+ 7 - 1
src/views/supply/retail/retail_list.vue

@@ -99,7 +99,13 @@
             <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="返利使用比例" prop="rebateRate" min-width="110" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="返利" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>{{scope.row.rebateAmount}}</div>
+                <div>(实际:{{scope.row.payRebateAmount}})</div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核人" prop="examineName" min-width="100" show-overflow-tooltip></el-table-column>

+ 43 - 47
src/views/supply/sales/components/sales_detail.vue

@@ -5,37 +5,36 @@
     <div id="printMe">
       <div class="main-title">
         <div class="title">出库单信息</div>
-        <el-button size="small" type="primary" icon="el-icon-printer" v-print="printObj">打印单据</el-button>
       </div>
       <div class="diy-table-1">
         <el-row :gutter="0">
           <el-col :span="8" class="item">
             <div class="label">出库单号</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.retailOrderId}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据日期</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.orderTime}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-            <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.status | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">仓库</div>
-            <div class="value">万豪仓</div>
+            <div class="value">{{detailData.correspondName}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">发货单号</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.orderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">经销商</div>
-            <div class="value">广州格匠机电有限公司</div>
+            <div class="value">{{detailData.customerName}}</div>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24" class="item">
             <div class="label">备注</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.remark}}</div>
           </el-col>
         </el-row>
       </div>
@@ -43,36 +42,17 @@
       <div class="main-title">
         <div class="title">货品信息</div>
       </div>
-      <div class="diy-table-2">
-        <div class="head">
-          <el-row :gutter="20">
-            <el-col :span="2">序号</el-col>
-            <el-col :span="4">产品编号</el-col>
-            <el-col :span="8">产品名称</el-col>
-            <el-col :span="2">规格型号</el-col>
-            <el-col :span="2">内机编码</el-col>
-            <el-col :span="2">外机编码</el-col>
-            <el-col :span="2">单位</el-col>
-            <el-col :span="2">数量</el-col>
-          </el-row>
-        </div>
-        <div class="body">
-          <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
-            <el-col :span="2">{{ index + 1 }}</el-col>
-            <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
-            <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
-            <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
-            <el-col :span="2">{{ item.price || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-          </el-row>
-        </div>
-        <div class="foot">
-          <el-row :gutter="20">
-            <el-col :span="24">合计</el-col>
-          </el-row>
-        </div>
+      <div class="table">
+        <el-table :data="detailData.saleOrderData" 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="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="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
       </div>
 
       <div class="main-title">
@@ -82,19 +62,19 @@
         <el-row :gutter="0">
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批人</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.approvalName}}</div>
           </el-col>
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批结果</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.status | statusFilter}}</div>
           </el-col>
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批时间</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.approvalTime}}</div>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24" class="item">
             <div class="label">审批说明</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.approvalRemark}}</div>
           </el-col>
         </el-row>
       </div>
@@ -107,7 +87,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getList } from "@/api/supply/sales";
+import { getDetail } from "@/api/supply/sales";
 
 export default {
   name: 'SalesDetail',
@@ -116,19 +96,28 @@ export default {
   directives: {
     print
   },
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '待审核', value: 1 },
+        { label: '审核通过', value: 2 },
+        { label: '审核驳回', value: 3 },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       printObj: {
         id: 'printMe'
       },
-      goodsList: [{
-        goodsId: 1,
-      }]
+      detailData: {},
     }
   },
 
   created() {
-
+    this.getDetail();
   },
 
   methods: {
@@ -136,6 +125,13 @@ export default {
     goBack() {
       this.$emit('backListFormDetail');
     },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
   }
 }
 </script>

+ 43 - 44
src/views/supply/sales/components/sales_examine.vue

@@ -9,31 +9,31 @@
       <el-row :gutter="0">
         <el-col :span="8" class="item">
           <div class="label">出库单号</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.retailOrderId}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据日期</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.orderTime}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">2022123233435342</div>
+        <div class="value">{{detailData.status | statusFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">仓库</div>
-          <div class="value">万豪仓</div>
+          <div class="value">{{detailData.correspondName}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">发货单号</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.orderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商</div>
-          <div class="value">广州格匠机电有限公司</div>
+          <div class="value">{{detailData.customerName}}</div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">备注</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.remark}}</div>
         </el-col>
       </el-row>
     </div>
@@ -41,36 +41,17 @@
     <div class="main-title">
       <div class="title">货品信息</div>
     </div>
-    <div class="diy-table-2">
-      <div class="head">
-        <el-row :gutter="20">
-          <el-col :span="2">序号</el-col>
-          <el-col :span="4">产品编号</el-col>
-          <el-col :span="8">产品名称</el-col>
-          <el-col :span="2">规格型号</el-col>
-          <el-col :span="2">内机编码</el-col>
-          <el-col :span="2">外机编码</el-col>
-          <el-col :span="2">单位</el-col>
-          <el-col :span="2">数量</el-col>
-        </el-row>
-      </div>
-      <div class="body">
-        <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
-          <el-col :span="2">{{ index + 1 }}</el-col>
-          <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
-          <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
-          <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
-          <el-col :span="2">{{ item.price || 0 }}</el-col>
-          <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
-          <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-          <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-        </el-row>
-      </div>
-      <div class="foot">
-        <el-row :gutter="20">
-          <el-col :span="24">合计</el-col>
-        </el-row>
-      </div>
+    <div class="table">
+      <el-table :data="detailData.saleOrderData" 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="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="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+      </el-table>
     </div>
 
     <div class="main-title">
@@ -80,7 +61,7 @@
       <el-row :gutter="0">
         <el-col :span="12" class="item">
           <div class="label">审批人</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{userName}}</div>
         </el-col>
         <el-col :span="12" class="item">
           <div class="label">审批结果</div>
@@ -117,7 +98,7 @@
 </template>
 
 <script>
-import { getList } from "@/api/supply/sales";
+import { getDetail, examineData } from "@/api/supply/sales";
 
 export default {
   name: 'SalesDetail',
@@ -125,9 +106,8 @@ export default {
   props: ['listItem'],
   data() {
     return {
-      goodsList: [{
-        goodsId: 1,
-      }],
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+      detailData: {},
       formLoading: false,
       examineForm: {
         status: true,
@@ -149,7 +129,7 @@ export default {
   },
 
   created() {
-
+    this.getDetail();
   },
 
   methods: {
@@ -158,8 +138,27 @@ export default {
       this.$emit('backListFormExamine');
     },
 
-    clickSubmitForm() {
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
 
+    // 提交审批
+    clickSubmitForm() {
+      this.formLoading = true;
+      examineData({
+        id: this.listItem.id,
+        status: this.examineForm.status ? 2 : 3,
+        approvalRemark: this.examineForm.remark,
+      }).then(res => {
+        this.$successMsg('审批成功');
+        this.goBack();
+        this.$parent.getList();
+      }).finally(res => {
+        this.formLoading = false;
+      })
     },
   }
 }

+ 82 - 56
src/views/supply/sales/sales_list.vue

@@ -7,11 +7,9 @@
           <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="4">审核驳回</el-radio-button>
+                <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>
@@ -26,6 +24,11 @@
               </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="chName">
                 <el-input v-model="screenForm.chName" placeholder="请输入存货名称"></el-input>
               </el-form-item>
@@ -48,21 +51,8 @@
                 </el-date-picker>
               </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="status">
-                <el-select v-model="screenForm.status" placeholder="全部">
-                  <el-option label="全部" value=""></el-option>
-                  <el-option :label="item.label" :value="item.value" v-for="(item, index) in select_status" :key="index"></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="12" :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>
@@ -75,7 +65,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="warning" icon="el-icon-close">退单</el-button>
+            <!-- <el-button size="small" type="warning" icon="el-icon-close">退单</el-button> -->
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -83,21 +73,31 @@
         </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="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="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="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="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="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="billStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.billStatus | billStatusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="出库单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货单号" prop="orderNo" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+            <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="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="120" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toDetail('detail', scope.row)">详情</el-button>
-                <el-button type="text" @click="toDetail('examine', scope.row)">审批</el-button>
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
+                <el-button type="text" @click="toExamine(scope.row)">审批</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -125,16 +125,29 @@
 </template>
 
 <script>
-import { COMMON_SELECT } from '@/utils/select_data'
 import { getList } from "@/api/supply/sales";
 import SalesDetail from "@/views/supply/sales/components/sales_detail";
 import SalesExamine from "@/views/supply/sales/components/sales_examine";
 
+let that
 export default {
   components: {
     SalesDetail,
     SalesExamine,
   },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    billStatusFilter(val) {
+      const MAP = {
+        1: '已开票',
+        0: '未开票',
+      }
+      return MAP[val];
+    }
+  },
   data() {
     return {
       currentPage: 1, // 当前页码
@@ -145,38 +158,41 @@ export default {
       screenForm: { // 筛选表单数据
         orderNum: '',
         jxsName: '',
+        jxsNum: '',
         chName: '',
         model: '',
         date: '',
-        jxsNum: '',
         status: '',
       },
-      select_status: [ // 筛选字段 - 状态
-        { label: '正常', value: true },
-        { label: '冻结', value: false }
+      statusList: [
+        { label: '待审核', value: 1 },
+        { label: '审核通过', value: 2 },
+        { label: '审核驳回', value: 3 },
       ],
 
-      jumpType: '',
       queryItem: {},
+      isShowDetail: false,
+      isShowExamine: false,
     }
   },
 
   computed: {
     exParams() {
       return {
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
         status: this.screenForm.status,
+        orderNo: this.screenForm.orderNum,
+        customerName: this.screenForm.jxsName,
+        customerNumber: this.screenForm.jxsNum,
+        materialName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
     },
-    isShowDetail() {
-      return this.queryItem.hasOwnProperty('adminUserId') && this.jumpType == 'detail';
-    },
-    isShowExamine() {
-      return this.queryItem.hasOwnProperty('adminUserId') && this.jumpType == 'examine';
-    },
+  },
+
+  beforeCreate() {
+    that = this;
   },
 
   created() {
@@ -200,11 +216,14 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
         status: this.screenForm.status,
+        orderNo: this.screenForm.orderNum,
+        customerName: this.screenForm.jxsName,
+        customerNumber: this.screenForm.jxsNum,
+        materialName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;
@@ -240,14 +259,21 @@ export default {
     },
 
     // 进入详情
-    toDetail(type, item) {
-      this.jumpType = type;
+    toDetail(item) {
+      this.queryItem = item;
+      this.isShowDetail = true;
+    },
+
+    // 进入审批
+    toExamine(item) {
       this.queryItem = item;
+      this.isShowExamine = true;
     },
 
     backList() {
-      this.jumpType = '';
       this.queryItem = {};
+      this.isShowDetail = false;
+      this.isShowExamine = false;
     },
   }
 }