Ver código fonte

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

howie 3 anos atrás
pai
commit
7670db3ad1
47 arquivos alterados com 3719 adições e 628 exclusões
  1. 1 1
      src/api/finance/credit_list.js
  2. 8 0
      src/api/finance/rebate_list.js
  3. 75 3
      src/api/supply/displace.js
  4. 18 0
      src/api/supply/return.js
  5. 5 7
      src/views/basic_data/material/machine_list.vue
  6. 31 17
      src/views/basic_data/taker/taker_car.vue
  7. 17 12
      src/views/basic_data/taker/taker_list.vue
  8. 4 1
      src/views/finance/change_apply.vue
  9. 573 0
      src/views/finance/components/rebate_list-edit.vue
  10. 2 1
      src/views/finance/components/rebate_list-examine.vue
  11. 10 8
      src/views/finance/components/rebate_list-review.vue
  12. 2 1
      src/views/finance/components/receivable_list-add.vue
  13. 4 5
      src/views/finance/components/receivable_list-approval.vue
  14. 2 3
      src/views/finance/components/receivable_list-detail.vue
  15. 41 23
      src/views/finance/credit_list.vue
  16. 33 9
      src/views/finance/rebate_form.vue
  17. 28 4
      src/views/finance/rebate_list.vue
  18. 17 2
      src/views/finance/receivable_list.vue
  19. 90 14
      src/views/finance/standbook_list.vue
  20. 11 11
      src/views/issue/index.vue
  21. 1 6
      src/views/pset/login_setting.vue
  22. 4 6
      src/views/supply/apply/components/apply_form.vue
  23. 3 3
      src/views/supply/apply/components/engin_form.vue
  24. 16 15
      src/views/supply/deliver/commerce_list.vue
  25. 56 52
      src/views/supply/deliver/components/commerce_detail.vue
  26. 236 0
      src/views/supply/deliver/components/home_detail.vue
  27. 347 0
      src/views/supply/deliver/home_list.vue
  28. 100 66
      src/views/supply/displace/components/displace_detail.vue
  29. 317 0
      src/views/supply/displace/components/displace_examine.vue
  30. 787 62
      src/views/supply/displace/components/displace_form.vue
  31. 283 0
      src/views/supply/displace/components/displace_return.vue
  32. 147 51
      src/views/supply/displace/displace_list.vue
  33. 3 7
      src/views/supply/engin/components/engin_detail.vue
  34. 6 5
      src/views/supply/engin/components/engin_examine.vue
  35. 1 5
      src/views/supply/engin/components/engin_form.vue
  36. 3 3
      src/views/supply/engin/engin_list.vue
  37. 26 3
      src/views/supply/pickup/check.vue
  38. 9 9
      src/views/supply/pickup/components/pickup_form.vue
  39. 10 5
      src/views/supply/pickup/pickup_list.vue
  40. 7 3
      src/views/supply/pickup/sum_list.vue
  41. 11 7
      src/views/supply/reserve/components/reserve_detail.vue
  42. 5 4
      src/views/supply/reserve/components/reserve_form.vue
  43. 8 4
      src/views/supply/reserve/reserve_list.vue
  44. 0 1
      src/views/supply/retail/components/retail_form.vue
  45. 33 81
      src/views/supply/return/components/return_detail.vue
  46. 298 75
      src/views/supply/return/components/return_form.vue
  47. 30 33
      src/views/supply/return/return_list.vue

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

@@ -52,7 +52,7 @@ export function getCreditRecordList(params) {
 // 经销商钱包列表
 export function getWalletCustomerList(params) {
     return request({
-      url: '/wallet/customer/list',
+      url: '/wallet/customer/list/page',
       method: 'get',
       params
     })

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

@@ -46,4 +46,12 @@ export function getRebateOrderAck(data) {
     method: 'post',
     data
   })
+}
+// 编辑
+export function getRebateOrderUpdate(data) {
+  return request({
+    url: '/rebate/order/update',
+    method: 'post',
+    data
+  })
 }

+ 75 - 3
src/api/supply/displace.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取列表
 export function getList(params) {
   return request({
-    url: '/retreat/list',
+    url: '/displace-order/list',
     method: 'get',
     params
   })
@@ -12,8 +12,80 @@ export function getList(params) {
 // 获取详情
 export function getDetail(params) {
   return request({
-    url: '/retreat/detail',
+    url: '/displace-order/detail',
     method: 'get',
     params
   })
-}
+}
+
+// 查询引用单明细
+export function queryRefDetail(params) {
+  return request({
+    url: '/displace-order/query-ref-detail',
+    method: 'get',
+    params
+  })
+}
+
+// 新增
+export function addData(params) {
+  return request({
+    url: '/displace-order/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑
+export function editData(params) {
+  return request({
+    url: '/displace-order/edit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 提交审核
+export function submitData(params) {
+  return request({
+    url: '/displace-order/submit',
+    method: 'post',
+    params
+  })
+}
+
+// 撤回
+export function revokeOrder(params) {
+  return request({
+    url: '/displace-order/revoke',
+    method: 'post',
+    params
+  })
+}
+
+// 删除
+export function deleteOrder(params) {
+  return request({
+    url: '/displace-order/del',
+    method: 'post',
+    params
+  })
+}
+
+// 审批
+export function examineOrder(params) {
+  return request({
+    url: '/displace-order/examine',
+    method: 'post',
+    data: params
+  })
+}
+
+// 退订
+export function returnOrder(params) {
+  return request({
+    url: '/displace-order/refund',
+    method: 'post',
+    data: params
+  })
+}

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

@@ -16,4 +16,22 @@ export function getDetail(params) {
     method: 'get',
     params
   })
+}
+
+// 获取引用列表
+export function getGoodsList(params) {
+  return request({
+    url: '/retreat/listInvoice',
+    method: 'get',
+    params
+  })
+}
+
+// 新增
+export function addData(params) {
+  return request({
+    url: '/retreat/add',
+    method: 'post',
+    data: params
+  })
 }

+ 5 - 7
src/views/basic_data/material/machine_list.vue

@@ -129,13 +129,7 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              {{
-                scope.row.type == "INNER"
-                  ? "内机"
-                  : scope.row.type == "OUTSIDE"
-                  ? "外机"
-                  : "配件"
-              }}
+              {{ findMachineType(scope.row.type) }}
             </template>
           </el-table-column>
           <el-table-column
@@ -497,6 +491,10 @@ export default {
         outsideMachineVolume: 2,
       };
     },
+    findMachineType(val) {
+      const obj = this.distList.find((value) => value.dictCode === val)
+      return obj ? obj.dictValue : ''
+    },
   },
 };
 </script>

+ 31 - 17
src/views/basic_data/taker/taker_car.vue

@@ -41,24 +41,30 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small" @click="addDataList"
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="small"
+          @click="addDataList"
           >新增</el-button
         >
 
-        <el-popconfirm @onConfirm="delFn" title="这是一段内容确定删除吗?">
+        <el-popconfirm
+          class="delClass"
+          @onConfirm="delFn"
+          title="这是一段内容确定删除吗?"
+        >
           <el-button
-            size="small"
-            type="primary"
-            class="textColor"
             slot="reference"
+            type="danger"
+            icon="el-icon-minus"
+            size="small"
             >批量删除</el-button
           >
         </el-popconfirm>
       </div>
       <div class="fr">
-        <el-button type="primary" size="small" @click="exportFn"
-          >导出</el-button
-        >
+        <ExportButton :exUrl="'/take-car-record/export'" :exParams="exParams" />
       </div>
     </div>
     <!-- 列表 -->
@@ -281,6 +287,14 @@ export default {
       ids: [],
     };
   },
+  computed: {
+    exParams() {
+      return {
+        carBrand: this.searchForm.carBrand,
+        customerName: this.searchForm.customerName,
+      };
+    },
+  },
   async created() {
     this.getDataList({ pageNum: 1, pageSize: 10 });
     this.getDealerDataList({ pageNum: 1, pageSize: 10 });
@@ -295,14 +309,14 @@ export default {
       this.ids = selection.map((v) => v.id);
       console.log(this.ids);
     },
-    //导出
-    exportFn() {
-      let screenData = {
-        customerName: this.searchForm.customerName,
-        carBrand: this.searchForm.carBrand,
-      };
-      downloadFiles("/take-car-record/export", screenData);
-    },
+    // //导出
+    // exportFn() {
+    //   let screenData = {
+    //     customerName: this.searchForm.customerName,
+    //     carBrand: this.searchForm.carBrand,
+    //   };
+    //   downloadFiles("/take-car-record/export", screenData);
+    // },
     //取消
     async cancelFn() {
       if (this.addForm.id) {
@@ -430,4 +444,4 @@ export default {
 ::v-deep .el-dialog__header {
   background-color: #dddddd;
 }
-</style>
+</style>

+ 17 - 12
src/views/basic_data/taker/taker_list.vue

@@ -52,9 +52,7 @@
         <el-button type="primary" size="small" @click="addFn">新增</el-button>
       </div>
       <div class="fr">
-        <el-button type="primary" size="small" @click="exportFn"
-          >导出</el-button
-        >
+        <ExportButton :exUrl="'/taker-record/export'" :exParams="exParams" />
       </div>
     </div>
     <!-- 列表 -->
@@ -308,6 +306,13 @@ export default {
   },
   computed: {
     ...mapGetters(["customerId", "customerName"]),
+    exParams() {
+      return {
+        customerName: this.searchForm.customerName,
+        takerName: this.searchForm.takerName,
+        phoneKeyword: this.searchForm.phoneKeyword,
+      };
+    },
   },
   data() {
     return {
@@ -453,14 +458,14 @@ export default {
     handlefile(response, file, fileList) {
       console.log(response, file, fileList);
     },
-    //导出
-    exportFn() {
-      let screenData = {
-        customerName: this.searchForm.customerName,
-        takerName: this.searchForm.takerName,
-      };
-      downloadFiles("/taker-record/export", screenData);
-    },
+    // //导出
+    // exportFn() {
+    //   let screenData = {
+    //     customerName: this.searchForm.customerName,
+    //     takerName: this.searchForm.takerName,
+    //   };
+    //   downloadFiles("/taker-record/export", screenData);
+    // },
     //停用提货人档案
     async stopFn(id) {
       await stopTaker({ id });
@@ -607,4 +612,4 @@ export default {
 .right {
   float: right;
 }
-</style>
+</style>

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

@@ -242,6 +242,9 @@ export default {
 
     // //返利类型数据
     async changeCustomerFn(v, index) {
+      if (v.customerId == "") {
+        return;
+      }
       console.log(v, index, 123456789);
       v.name = "";
       let res = await getWalletCustomerList({
@@ -347,4 +350,4 @@ export default {
 .dateStyle {
   width: 100%;
 }
-</style>
+</style>

+ 573 - 0
src/views/finance/components/rebate_list-edit.vue

@@ -0,0 +1,573 @@
+<template>
+  <div>
+    <div class="sty">
+      <el-page-header @back="goBack" content="销售返利单"> </el-page-header>
+    </div>
+    <el-divider></el-divider>
+    <!-- 表头 -->
+    <div>
+      <el-form
+        ref="searchForm"
+        :rules="rules"
+        :model="searchForm"
+        label-width="100px"
+        size="small"
+        label-position="left"
+      >
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="返利日期" prop="theTime">
+              <el-date-picker
+                class="selectStyle"
+                v-model="searchForm.theTime"
+                type="datetime"
+                placeholder="选择日期时间"
+                default-time="23:59:59"
+                value-format="yyyy-MM-dd HH:mm:ss"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="备注" prop="remark">
+              <el-input
+                v-model="searchForm.remark"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fl">
+        <el-button type="primary" size="small" @click="addFn">保存</el-button>
+      </div>
+      <div class="fr" v-if="state == 'SAVE'">
+        <el-button type="primary" size="small" @click="addRowFn"
+          >添加行</el-button
+        >
+        <el-button type="primary" size="small" @click="delRowFn"
+          >删除行</el-button
+        >
+      </div>
+    </div>
+    <!-- 列表 -->
+    <div v-if="this.state != 'SAVE'" class="mymain-container">
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          :row-class-name="rouClassNameFn"
+          @row-click="onRowClick"
+        >
+          <el-table-column
+            align="center"
+            label="序号"
+            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="200"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利类型"
+            prop="walletName"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利总金额"
+            prop="amount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="暂扣返利"
+            prop="withholdAmount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文件流水号"
+            prop="policyFileNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文号"
+            prop="policyDocNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策年份"
+            prop="policyYear"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策月份"
+            prop="policyMonth"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策归属部门"
+            prop="policyOrg"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户区域"
+            prop="customerArea"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户属性"
+            prop="customerAttr"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="建立实际归属客户"
+            prop="rewardActualCustomers"
+            min-width="160"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注1"
+            prop="remark1"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark1"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注2"
+            prop="remark2"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark2"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+    <!-- 列表 -->
+    <div v-if="this.state == 'SAVE'" class="mymain-container">
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          :row-class-name="rouClassNameFn"
+          @row-click="onRowClick"
+        >
+          <el-table-column
+            align="center"
+            label="序号"
+            type="index"
+            width="100"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商编码"
+            prop="customerNumber"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input disabled v-model="scope.row.customerNumber"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="经销商名称"
+            prop="customerName"
+            min-width="200"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-select
+                @change="changeCustomerFn($event, scope.$index, scope.row)"
+                v-model="scope.row.customerId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in customerData"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利类型"
+            prop="customerWalletId"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-select
+                v-if="state2"
+                v-model="scope.row.customerWalletId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in scope.row.walletList"
+                  :key="item.customerWalletId"
+                  :label="item.name"
+                  :value="item.customerWalletId"
+                >
+                </el-option>
+              </el-select>
+              <el-select
+                v-else
+                v-model="scope.row.walletName"
+                placeholder="请选择"
+              >
+                <el-option :label="scope.row.walletName" value=""> </el-option>
+              </el-select>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="返利总金额"
+            prop="amount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model.number="scope.row.amount"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="暂扣返利"
+            prop="withholdAmount"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model.number="scope.row.withholdAmount"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文件流水号"
+            prop="policyFileNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyFileNo"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策文号"
+            prop="policyDocNo"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyDocNo"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策年份"
+            prop="policyYear"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyYear"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策月份"
+            prop="policyMonth"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyMonth"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="政策归属部门"
+            prop="policyOrg"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyOrg"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户区域"
+            prop="customerArea"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.customerArea"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="客户属性"
+            prop="customerAttr"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.customerAttr"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="建立实际归属客户"
+            prop="rewardActualCustomers"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.rewardActualCustomers"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注1"
+            prop="remark1"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark1"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="备注2"
+            prop="remark2"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark2"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  getRebateOrderDetail,
+  getRebateOrderUpdate,
+} from "@/api/finance/rebate_list";
+import {
+  getCustomerList,
+  getWalletCustomerList,
+} from "@/api/finance/rebate_form";
+export default {
+  props: {
+    detailId: {
+      type: String,
+      required: true,
+    },
+  },
+  data() {
+    return {
+      state: "", //单据状态
+      state2: false, //状态
+      dataList: [],
+      listLoading: false, // 列表加载loading
+      searchForm: {
+        theTime: "",
+        remark: "",
+      },
+      customerData: [],
+      rules: {
+        theTime: [
+          {
+            required: true,
+            message: "请选择返利日期",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getDataList();
+    this.getCustomerData();
+  },
+  methods: {
+    goBack() {
+      this.$parent.showPage = 1;
+    },
+    //获取详情数据
+    async getDataList() {
+      let res = await getRebateOrderDetail({ id: this.detailId });
+      console.log(res, 11111);
+      //   this.searchForm.rebateOrderId = res.data.id;
+      this.searchForm.theTime = res.data.theTime;
+      //   this.searchForm.createBy = res.data.createBy;
+      //   this.searchForm.createTime = res.data.createTime;
+      this.searchForm.remark = res.data.remark;
+      this.dataList = res.data.items;
+      this.state = res.data.examineStatus;
+    },
+    //保存
+    async addFn() {
+      await this.$refs.searchForm.validate();
+
+      if (this.state2) {
+        this.dataList.forEach((v) => {
+          const arr = v.walletList.filter(
+            (i) => i.customerWalletId == v.customerWalletId
+          );
+
+          v.walletName = arr[0].name;
+        });
+      }
+
+      console.log(this.dataList);
+      await getRebateOrderUpdate({
+        ...this.searchForm,
+        items: this.dataList,
+        id: this.detailId,
+      });
+      this.$emit("updateList");
+
+      this.$message.success("保存成功");
+      this.$parent.showPage = 1;
+    },
+    //选择经销商名称事件
+    async changeCustomerFn(v, index, value) {
+      this.state2 = true;
+      this.$nextTick(function () {
+        value.customerWalletId = "";
+        value.walletName = "";
+      });
+
+      const res = await getWalletCustomerList({
+        customerId: v,
+        type: "REBATE",
+      });
+      const res2 = this.customerData.filter((i) => i.id == v);
+
+      this.$set(this.dataList[index], "customerNumber", res2[0].number);
+      this.$set(this.dataList[index], "customerName", res2[0].name);
+      this.$set(this.dataList[index], "walletList", res.data);
+    },
+    //获取经销商数据
+    async getCustomerData() {
+      const res = await getCustomerList({ pageSize: -1, pageNum: 1 });
+      this.customerData = res.data.records;
+    },
+    rouClassNameFn({ row, rowIndex }) {
+      //把每一行的索引放进row
+      row.index = rowIndex;
+    },
+    onRowClick(row, event, column) {
+      this.delIndex = row.index;
+    },
+    //删除行
+    delRowFn() {
+      this.dataList.splice(this.delIndex, 1);
+    },
+    //添加行
+    addRowFn() {
+      this.dataList.push({
+        customerNumber: "",
+        customerName: "",
+        customerWalletId: "",
+        amount: null,
+        withholdAmount: null,
+        policyFileNo: "",
+        policyDocNo: "",
+        policyYear: "",
+        policyMonth: "",
+        policyOrg: "",
+        customerArea: "",
+        customerAttr: "",
+        rewardActualCustomers: "",
+        remark1: "",
+        remark2: "",
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
+</style>

+ 2 - 1
src/views/finance/components/rebate_list-examine.vue

@@ -246,7 +246,7 @@ export default {
   data() {
     return {
       examineRemark: "",
-      examineStatus: "",
+      examineStatus: "OK",
       searchForm: {
         rebateOrderId: "",
         theTime: "",
@@ -276,6 +276,7 @@ export default {
       });
       this.$emit("updateList");
       this.$message.success("审核成功");
+      this.$parent.showPage = 1;
     },
     //获取详情数据
     async getDataList() {

+ 10 - 8
src/views/finance/components/rebate_list-review.vue

@@ -306,9 +306,9 @@
             min-width="160"
             show-overflow-tooltip
           >
-            <!-- <template slot-scope="scope">
+            <template slot-scope="scope">
               <el-input v-model="scope.row.allowanceCode"></el-input>
-            </template> -->
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -317,9 +317,9 @@
             min-width="160"
             show-overflow-tooltip
           >
-            <!-- <template slot-scope="scope">
+            <template slot-scope="scope">
               <el-input v-model="scope.row.allowanceAccount"></el-input>
-            </template> -->
+            </template>
           </el-table-column>
           <el-table-column
             align="center"
@@ -376,13 +376,13 @@
           <div class="label">操作</div>
           <div class="value">
             <el-radio v-model="examineStatus" label="OK">复核通过</el-radio>
-            <el-radio v-model="examineStatus" label="FALL">取消复核</el-radio>
+            <el-radio v-model="examineStatus" label="FAIL">取消复核</el-radio>
           </div>
         </el-col>
         <el-col :span="24" class="item">
-          <div class="label">复核状态</div>
+          <div class="label">复核说明</div>
           <div class="value">
-            <el-input v-model="examineRemark" placeholder=""></el-input>
+            <el-input v-model="examineRemark" placeholder="复核说明"></el-input>
           </div>
         </el-col>
       </el-row>
@@ -409,7 +409,7 @@ export default {
   data() {
     return {
       examineRemark: "",
-      examineStatus: "",
+      examineStatus: "OK",
       searchForm: {
         rebateOrderId: "",
         theTime: "",
@@ -444,7 +444,9 @@ export default {
         examineStatus: this.examineStatus,
         items: this.selectArr,
       });
+      this.$emit("updateList");
       this.$message.success("复核成功");
+      this.$parent.showPage = 1;
     },
     //获取详情数据
     async getDataList() {

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

@@ -332,6 +332,7 @@ export default {
         v.customerNumber = res[0].number;
         let res2 = v.walletList.filter((j) => j.mainId == v.walletId);
         v.customerWalletId = res2[0].customerWalletId;
+        v.walletId = res2[0].walletRebateId;
       });
       console.log(this.dataList);
       await getFinanceOtherReceAdd({
@@ -386,4 +387,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 4 - 5
src/views/finance/components/receivable_list-approval.vue

@@ -168,7 +168,7 @@
           <el-table-column
             align="center"
             label="现金钱包"
-            prop=""
+            prop="customerWalletName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -268,7 +268,7 @@ export default {
   data() {
     return {
       examineRemark: "",
-      examineStatus: "",
+      examineStatus: "OK",
       dataList: [],
       listLoading: false, // 列表加载loading
       searchForm: {
@@ -318,7 +318,7 @@ export default {
         totalAmount: res.data.totalAmount,
         create: res.data.create,
         createTime: res.data.createTime,
-        examineStatus: res.data.examineStatus,
+        examineStatus: res.data.examineStatus == "WAIT" ? "待审核" : "",
         remark: res.data.remark,
       };
       this.dataList = res.data.items;
@@ -330,5 +330,4 @@ export default {
 };
 </script>
 
-<style>
-</style>
+<style></style>

+ 2 - 3
src/views/finance/components/receivable_list-detail.vue

@@ -150,7 +150,7 @@
           <el-table-column
             align="center"
             label="现金钱包"
-            prop=""
+            prop="customerWalletName"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
@@ -285,5 +285,4 @@ export default {
 };
 </script>
 
-<style>
-</style>
+<style></style>

+ 41 - 23
src/views/finance/credit_list.vue

@@ -43,9 +43,11 @@
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fr">
-          <el-button type="primary" size="small" @click="exportList"
-            >导出</el-button
-          >
+          <ExportButton
+            :exUrl="'/wallet/customer/list/export'"
+            :exParams="exParams"
+            class="exportClass"
+          />
           <el-button type="primary" size="small">打印</el-button>
         </div>
       </div>
@@ -123,7 +125,7 @@
             </el-table-column>
           </el-table>
         </div>
-        <!-- 分页
+        <!-- 分页 -->
         <div class="fr">
           <el-pagination
             @size-change="handleSizeChange"
@@ -135,7 +137,7 @@
             :total="listTotal"
           >
           </el-pagination>
-        </div> -->
+        </div>
       </div>
     </div>
     <CreditListDetail :recordsListId="recordsListId" v-else />
@@ -202,9 +204,9 @@ export default {
   },
   data() {
     return {
-      // currentPage: 1, // 当前页码
-      // pageSize: 10, // 每页数量
-      // listTotal: 0, // 列表总数
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
         customerId: "",
@@ -245,8 +247,20 @@ export default {
       },
     };
   },
+  computed: {
+    exParams() {
+      return {
+        customerId: this.searchForm.customerId,
+        type: "COMMONLY",
+      };
+    },
+  },
   created() {
-    this.getDataList({ type: "COMMONLY" });
+    this.getDataList({
+      type: "COMMONLY",
+      pageSize: this.pageSize,
+      pageNum: this.currentPage,
+    });
     this.getCustomerData({ pageSize: -1, pageNum: 1 });
   },
   methods: {
@@ -264,23 +278,18 @@ export default {
       };
       this.dialogForm = true;
     },
-    //导出
-    exportList() {
-      let screenData = {
-        amount: this.searchForm.amount,
-        customerNumber: this.searchForm.customerNumber,
-        customerName: this.searchForm.customerName,
-        walletName: this.searchForm.walletName,
-      };
-      downloadFiles("/credit/exportData", screenData);
-    },
     //清空
     clearFn() {
       this.$refs.searchForm.resetFields();
     },
     //搜索
     searchFn() {
-      this.getDataList({ ...this.searchForm, type: "COMMONLY" });
+      this.getDataList({
+        ...this.searchForm,
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        type: "COMMONLY",
+      });
     },
     // 更改每页数量
     handleSizeChange(val) {
@@ -297,14 +306,19 @@ export default {
     async getDataList(data) {
       const res = await getWalletCustomerList(data);
       console.log(res);
-      this.dataList = res.data;
+      this.dataList = res.data.records;
+      this.listTotal = res.data.total;
     },
 
     //确定
     async addDataFn() {
       await this.$refs.addForm.validate();
       await getCreditListEdit({ ...this.addForm, ...this.data });
-      this.getDataList({ type: "COMMONLY" });
+      this.getDataList({
+        type: "COMMONLY",
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+      });
       this.$message.success("设置成功");
       this.dialogForm = false;
     },
@@ -327,4 +341,8 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+.exportClass {
+  display: inline-block;
+  margin-right: 10px;
+}
+</style>

+ 33 - 9
src/views/finance/rebate_form.vue

@@ -6,6 +6,7 @@
     <div>
       <el-form
         ref="searchForm"
+        :rules="rules"
         :model="searchForm"
         label-width="100px"
         size="small"
@@ -18,7 +19,7 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="返利日期" prop="">
+            <el-form-item label="返利日期" prop="theTime">
               <el-date-picker
                 class="selectStyle"
                 v-model="searchForm.theTime"
@@ -31,7 +32,7 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="备注" prop="">
+            <el-form-item label="备注" prop="remark">
               <el-input
                 v-model="searchForm.remark"
                 placeholder="请输入"
@@ -41,12 +42,13 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <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-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单日期" prop="">
               <el-date-picker
                 class="selectStyle"
@@ -58,7 +60,7 @@
               >
               </el-date-picker>
             </el-form-item>
-          </el-col>
+          </el-col> -->
         </el-row>
       </el-form>
     </div>
@@ -306,6 +308,7 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 import {
   getCustomerList,
   getWalletCustomerList,
@@ -321,15 +324,28 @@ export default {
       customerData: [],
       searchForm: {
         theTime: "",
-        createTime: "",
+
         remark: "",
         createBy: "",
       },
       delIndex: null,
+      rules: {
+        theTime: [
+          {
+            required: true,
+            message: "请选择返利日期",
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
+  computed: {
+    ...mapGetters(["name"]),
+  },
   created() {
     this.getCustomerData();
+    this.searchForm.createBy = this.name;
   },
   methods: {
     //重置
@@ -363,26 +379,34 @@ export default {
     },
     //新增
     async addFn() {
-      console.log(this.searchForm);
+      let arr;
+      await this.$refs.searchForm.validate();
       this.dataList.forEach((v) => {
-        delete v.walletList;
+        arr = v.walletList.filter(
+          (i) => i.customerWalletId == v.customerWalletId
+        );
+        console.log(arr);
+        v.walletName = arr[0].name;
       });
       console.log(this.dataList);
       await getRebateOrderAdd({ ...this.searchForm, items: this.dataList });
       this.$message.success("保存成功");
+      this.$router.push("/finance/rebate_list");
     },
     //选择经销商名称事件
     async changeCustomerFn(v, index, value) {
       value.customerWalletId = "";
-      console.log(v, 322311);
+
       const res = await getWalletCustomerList({
         customerId: v,
         type: "REBATE",
       });
       const res2 = this.customerData.filter((i) => i.id == v);
+      console.log(res2, 8888);
 
       this.$set(this.dataList[index], "customerNumber", res2[0].number);
       this.$set(this.dataList[index], "customerName", res2[0].name);
+
       this.$set(this.dataList[index], "walletList", res.data);
     },
     //获取经销商数据
@@ -418,4 +442,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 28 - 4
src/views/finance/rebate_list.vue

@@ -105,7 +105,7 @@
                 <el-tag v-show="scope.row.examineStatus == 'OK'"
                   >复核通过</el-tag
                 >
-                <el-tag v-show="scope.row.examineStatus == 'FALL'"
+                <el-tag v-show="scope.row.examineStatus == 'FAIL'"
                   >不通过</el-tag
                 >
                 <el-tag v-show="scope.row.examineStatus == 'CLOSE'"
@@ -345,6 +345,12 @@
                 <el-button
                   type="text"
                   class="textColor"
+                  @click="editFn(scope.row.rebateOrderId)"
+                  >编辑</el-button
+                >
+                <el-button
+                  type="text"
+                  class="textColor"
                   v-show="scope.row.examineStatus == 'SAVE' && !isCustomer"
                   @click="applyFn(scope.row.rebateOrderId)"
                   >申请</el-button
@@ -390,7 +396,7 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  v-if="isCustomer"
+                  v-if="isCustomer && scope.row.examineStatus == 'OK_ONE'"
                   @click="confirmFn(scope.row.rebateOrderId)"
                   >确认</el-button
                 >
@@ -419,11 +425,21 @@
       :detailId="detailId"
       v-else-if="showPage == 3"
     />
-    <RebateListReview :detailId="detailId" v-else-if="showPage == 4" />
+    <RebateListReview
+      @updateList="updateList"
+      :detailId="detailId"
+      v-else-if="showPage == 4"
+    />
     <!-- 详情 -->
     <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
     <!-- 确定 -->
     <RebateListConfirm :detailId="detailId" v-else-if="showPage == 6" />
+    <!-- 编辑 -->
+    <RebateListEdit
+      @updateList="updateList"
+      :detailId="detailId"
+      v-else-if="showPage == 7"
+    />
   </div>
 </template>
 
@@ -437,6 +453,8 @@ import RebateListExamine from "./components/rebate_list-examine.vue";
 import RebateListReview from "./components/rebate_list-review.vue";
 import RebateListDetail from "./components/rebate_list-detail";
 import RebateListConfirm from "./components/rebate_list-confirm";
+import RebateListEdit from "./components/rebate_list-edit.vue";
+
 export default {
   components: {
     RebateListDetail,
@@ -444,6 +462,7 @@ export default {
     RebateListExamine,
     RebateListReview,
     RebateListConfirm,
+    RebateListEdit,
   },
   data() {
     return {
@@ -545,6 +564,11 @@ export default {
       this.detailId = id;
       this.showPage = 5;
     },
+    //编辑
+    editFn(id) {
+      this.detailId = id;
+      this.showPage = 7;
+    },
   },
 };
 </script>
@@ -552,4 +576,4 @@ export default {
 .selectStyle {
   width: 100%;
 }
-</style>
+</style>

+ 17 - 2
src/views/finance/receivable_list.vue

@@ -111,7 +111,10 @@
           </el-popconfirm>
         </div>
         <div class="fr">
-          <el-button type="primary" size="small">导出</el-button>
+          <ExportButton
+            :exUrl="'/finance/other/rece/listExport'"
+            :exParams="exParams"
+          />
         </div>
       </div>
       <!-- 列表 -->
@@ -294,6 +297,18 @@ export default {
       deleList: null,
     };
   },
+  computed: {
+    exParams() {
+      return {
+        source: this.searchForm.source,
+        code: this.searchForm.code,
+        userName: this.searchForm.userName,
+        startTime: this.searchForm.startTime,
+        endTime: this.searchForm.endTime,
+        examineStatus: this.examine,
+      };
+    },
+  },
   created() {
     this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
   },
@@ -375,4 +390,4 @@ export default {
 .delClass {
   margin-left: 10px;
 }
-</style>
+</style>

+ 90 - 14
src/views/finance/standbook_list.vue

@@ -469,12 +469,50 @@ export default {
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = 1;
-      this.getDataList({ pageNum: 1, pageSize: this.pageSize });
+      // this.getDataList({
+      //   type: this.bill,
+      //   pageNum: this.currentPage,
+      //   pageSize: this.pageSize,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+        });
+      }
     },
     // 更改当前页
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.getDataList({ pageNum: val, pageSize: 10 });
+      // this.getDataList({
+      //   type: this.bill,
+      //   pageNum: this.currentPage,
+      //   pageSize: this.pageSize,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+        });
+      }
     },
     //获取品类
     async getDataDict() {
@@ -495,13 +533,32 @@ export default {
       //   (v) => v.walletRebateId == this.searchForm.walletRebateId
       // );
       // console.log(res);
-      this.getDataList({
-        ...this.searchForm,
-        mainId: this.mainId,
-        type: this.bill,
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-      });
+      // this.getDataList({
+      //   ...this.searchForm,
+      //   mainId: this.mainId,
+      //   type: this.bill,
+      //   pageSize: this.pageSize,
+      //   pageNum: this.currentPage,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+        });
+      }
     },
 
     //钱包数据
@@ -515,11 +572,30 @@ export default {
     //切换列表
     checkFn(v) {
       this.resetFn();
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        type: v,
-      });
+      // this.getDataList({
+      //   pageSize: 10,
+      //   pageNum: 1,
+      //   type: v,
+      // });
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: 10,
+          pageNum: 1,
+          type: v,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        });
+      } else {
+        this.getDataList({
+          ...this.searchForm,
+          mainId: this.mainId,
+          pageSize: 10,
+          pageNum: 1,
+          type: v,
+        });
+      }
       this.getWalletList();
     },
     //

+ 11 - 11
src/views/issue/index.vue

@@ -23,7 +23,7 @@
       <div class="btn-group clearfix">
         <div class="fl">
           <el-button class="fl" size="small" type="primary" icon="el-icon-plus" @click="clickImport()">新增</el-button>
-          <div class="tips fl">导入模板第一行必须为空白行、第一列必须为公司编号(S9219801)</div>
+          <div class="tips fl">导入模板第一行必须为空白行、第一列必须为经销商编号(S9219801)</div>
         </div>
       </div>
       <div class="table">
@@ -45,10 +45,10 @@
           </el-table-column>
           <el-table-column align="center" prop="remark" label="备注" min-width="140" 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>
       </div>
-      
+
       <div class="pagination clearfix">
         <div class="fr">
           <el-pagination
@@ -87,12 +87,12 @@
     <!-- 详情 -->
     <el-dialog title="详情" :visible.sync="detailDialog" :show-close="false" width="70%" :close-on-click-modal="false">
       <div class="table" style="margin: 10px 0 20px;">
-        <el-table 
-          v-loading="detailTable_listLoading" 
-          :data="detailTable_dataList" 
-          element-loading-text="Loading" 
-          tooltip-effect="dark" 
-          style="width: 100%" 
+        <el-table
+          v-loading="detailTable_listLoading"
+          :data="detailTable_dataList"
+          element-loading-text="Loading"
+          tooltip-effect="dark"
+          style="width: 100%"
           max-height="270">
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
           <el-table-column align="center" prop="title" label="标题" min-width="140" show-overflow-tooltip></el-table-column>
@@ -162,7 +162,7 @@ export default {
     }
   },
   computed: {
-    
+
   },
   created() {
     this.getList();
@@ -316,4 +316,4 @@ export default {
   line-height: 32px;
   margin-left: 10px;
 }
-</style>
+</style>

+ 1 - 6
src/views/pset/login_setting.vue

@@ -315,12 +315,7 @@
                     this.dataList = res.data;
                     this.listLoading = false;
                 });
-                getProductList({
-                    productCategoryName: "",
-                    productCategoryNumber: "",
-                }).then((res) => {
-                    this.productList = res.data;
-                });
+
             },
             handleChange(e) {
                 this.productList.find((k) => {

+ 4 - 6
src/views/supply/apply/components/apply_form.vue

@@ -211,9 +211,7 @@ export default {
         createMan: '',
       },
       mainFormRules: {
-        date: [
-          { required: true, message: '请选择单据日期', trigger: 'change' }
-        ],
+        date: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
       },
       dealerList: [],
       fileList: [],
@@ -282,9 +280,9 @@ export default {
           url: data.fileUrl,
           name: data.fileName
         }] : [];
-        data.orders.forEach(item => {
-          item.orderId = item.id;
-        })
+        // data.orders.forEach(item => {
+        //   item.orderId = item.id;
+        // })
         this.goodsList = data.orders;
         this.screenForm.type = data.mainId;
       })

+ 3 - 3
src/views/supply/apply/components/engin_form.vue

@@ -423,9 +423,9 @@ export default {
           url: data.fileUrl,
           name: data.fileName,
         }] : [];
-        data.orders.forEach(item => {
-          item.orderId = item.id;
-        })
+        // data.orders.forEach(item => {
+        //   item.orderId = item.id;
+        // })
         this.goodsList = data.orders;
       })
     },

+ 16 - 15
src/views/supply/deliver/engin_list.vue → src/views/supply/deliver/commerce_list.vue

@@ -19,11 +19,11 @@
                 <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="仓库" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入仓库"></el-input>
+            <!-- <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="仓库" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="经销商编号" prop="jxsNum">
                 <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
@@ -74,28 +74,28 @@
             <!-- <el-button size="small" type="warning" icon="el-icon-close">退货</el-button> -->
           </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'ship/pExport'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="发货单号" prop="id" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="发货日期" prop="orderTime" min-width="160" 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="enginOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="100" 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="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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制单人" prop="createBy" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制单日期" prop="createTime" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审单人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审单日期" prop="approvalTime" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审单日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.examineStatus | statusFilter}}
@@ -159,19 +159,19 @@
       </div>
     </el-dialog>
     
-    <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
 
   </div>
 </template>
 
 <script>
 import { getEnginList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
-import EnginDetail from "@/views/supply/deliver/components/engin_detail";
+import CommerceDetail from "@/views/supply/deliver/components/commerce_detail";
 
 let that
 export default {
   components: {
-    EnginDetail,
+    CommerceDetail,
   },
   filters: {
     statusFilter(val) {
@@ -188,6 +188,7 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         orderNum: '',
+        warehouse: '',
         jxsName: '',
         chName: '',
         model: '',

+ 56 - 52
src/views/supply/deliver/components/engin_detail.vue → src/views/supply/deliver/components/commerce_detail.vue

@@ -10,111 +10,99 @@
         <el-row :gutter="0">
           <el-col :span="8" class="item">
             <div class="label">发货单号</div>
-            <div class="value">{{detailData.retreatOrderNo}}</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">发货日期</div>
-            <div class="value">{{detailData.shipTime}}</div>
+            <div class="value">{{detailData.orderTime}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">业务类型</div>
-            <div class="value">{{detailData.type}}</div>
+            <div class="label">单据状态</div>
+            <div class="value">{{detailData.type | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">销售类型</div>
             <div class="value">{{detailData.salesType}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">订单号</div>
-            <div class="value">{{detailData.orderNo}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">发票号</div>
-            <div class="value">{{detailData.billNumber}}</div>
+            <div class="label">发货申请单号</div>
+            <div class="value">{{detailData.invoiceOrderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">客户名称</div>
-            <div class="value">{{detailData.clientName}}</div>
+            <div class="label">订单类型</div>
+            <div class="value">{{detailData.orderType | orderTypeFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">销售部门</div>
-            <div class="value">{{detailData.salesDep}}</div>
+            <div class="label">经销商编码</div>
+            <div class="value">{{detailData.customerNumber}}</div>
           </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">业务员</div>
-            <div class="value">{{detailData.salesman}}</div>
+          <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.projectNumber}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">币种</div>
-            <div class="value">{{detailData.currency}}</div>
+            <div class="label">厂工程编码</div>
+            <div class="value">{{detailData.factoryNumber}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">订单类型</div>
-            <div class="value">{{detailData.orderType}}</div>
+            <div class="label">项目名称</div>
+            <div class="value">{{detailData.projectName}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">仓库</div>
-            <div class="value">{{detailData.stockName}}</div>
+            <div class="value">{{detailData.correspondName}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">发货申请单号</div>
-            <div class="value">{{detailData.invoiceOrderNo}}</div>
+            <div class="label">税率</div>
+            <div class="value">{{detailData.taxRate}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">台账备注</div>
-            <div class="value">{{detailData.iedgerRemark}}</div>
+            <div class="label">发票号</div>
+            <div class="value">{{detailData.billNumber}}</div>
           </el-col>
           <el-col :span="16" class="item">
             <div class="label">备注</div>
             <div class="value">{{detailData.remark}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">项目名称</div>
-            <div class="value">{{detailData.projectName}}</div>
+            <div class="label">币种</div>
+            <div class="value">{{detailData.currency}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">外仓印刷单号</div>
             <div class="value">{{detailData.printingSheet}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">厂工程编码</div>
-            <div class="value">{{detailData.factoryNumber}}</div>
+            <div class="label">制单人</div>
+            <div class="value">{{detailData.createBy}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">开票日期</div>
-            <div class="value">{{detailData.billingTime}}</div>
+            <div class="label">制单日期</div>
+            <div class="value">{{detailData.createTime}}</div>
           </el-col>
           <el-col :span="16" class="item">
             <div class="label">文件编号</div>
             <div class="value">{{detailData.fileNumber}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">税率</div>
-            <div class="value">{{detailData.taxRate}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">订单日期</div>
-            <div class="value">{{detailData.createTime}}</div>
+            <div class="label">出库日期</div>
+            <div class="value">{{detailData.outTime}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">制单人</div>
-            <div class="value">{{detailData.createBy}}</div>
+            <div class="label">审核人</div>
+            <div class="value">{{detailData.approvalName}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">制单时间</div>
-            <div class="value">{{detailData.createTime}}</div>
+            <div class="label">审核日期</div>
+            <div class="value">{{detailData.approvalTime}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">审核人</div>
-            <div class="value">{{detailData.retreatOrderNo}}</div>
-          </el-col>
-          <el-col :span="16" class="item">
-            <div class="label">审核时间</div>
-            <div class="value">{{detailData.retreatOrderNo}}</div>
+            <div class="label">开票日期</div>
+            <div class="value">{{detailData.billingTime}}</div>
           </el-col>
         </el-row>
       </div>
@@ -147,7 +135,7 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button>
+        <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -159,15 +147,31 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getEnginDetail } from "@/api/supply/return";
+import { getEnginDetail } from "@/api/supply/deliver";
 
 export default {
-  name: 'EnginDetail',
-  componentName: 'EnginDetail',
+  name: 'commerceDetail',
+  componentName: 'commerceDetail',
   props: ['listItem'],
   directives: {
     print
   },
+  filters: {
+    statusFilter(val) {
+      const MAP = {
+        1: '已受理'
+      }
+      return MAP[val];
+    },
+    orderTypeFilter(val) {
+      const MAP = {
+        1: '零售订单',
+        2: '家用工程订单',
+        3: '商用工程订单',
+      }
+      return MAP[val];
+    }
+  },
   data() {
     return {
       printObj: {

+ 236 - 0
src/views/supply/deliver/components/home_detail.vue

@@ -0,0 +1,236 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="详情"></el-page-header>
+
+    <div id="printMe">
+      <div class="main-title">
+        <div class="title">发货单信息</div>
+      </div>
+      <div class="diy-table-1">
+        <el-row :gutter="0">
+          <el-col :span="8" class="item">
+            <div class="label">发货单号</div>
+            <div class="value">{{detailData.id}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">发货日期</div>
+            <div class="value">{{detailData.orderTime}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">单据状态</div>
+            <div class="value">{{detailData.type | statusFilter}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">销售类型</div>
+            <div class="value">{{detailData.salesType}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">发货申请单号</div>
+            <div class="value">{{detailData.invoiceOrderNo}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">订单类型</div>
+            <div class="value">{{detailData.orderType | orderTypeFilter}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">经销商编码</div>
+            <div class="value">{{detailData.customerNumber}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">经销商名称</div>
+            <div class="value">{{detailData.customerName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">工程编号</div>
+            <div class="value">{{detailData.projectNumber}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">厂工程编码</div>
+            <div class="value">{{detailData.factoryNumber}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">项目名称</div>
+            <div class="value">{{detailData.projectName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓库</div>
+            <div class="value">{{detailData.correspondName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">税率</div>
+            <div class="value">{{detailData.taxRate}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">发票号</div>
+            <div class="value">{{detailData.billNumber}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">备注</div>
+            <div class="value">{{detailData.remark}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">币种</div>
+            <div class="value">{{detailData.currency}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">外仓印刷单号</div>
+            <div class="value">{{detailData.printingSheet}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">制单人</div>
+            <div class="value">{{detailData.createBy}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">制单日期</div>
+            <div class="value">{{detailData.createTime}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">文件编号</div>
+            <div class="value">{{detailData.fileNumber}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">出库日期</div>
+            <div class="value">{{detailData.outTime}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">审核人</div>
+            <div class="value">{{detailData.approvalName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">审核日期</div>
+            <div class="value">{{detailData.approvalTime}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">开票日期</div>
+            <div class="value">{{detailData.billingTime}}</div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div class="main-title">
+        <div class="title">货品信息</div>
+      </div>
+      <div class="table">
+        <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="订单号" prop="orderNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="主计量" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="含税单价" prop="includedPrice" min-width="160" 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="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率(%)" prop="rate" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣额" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣后单价" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="退补标记" prop="refund" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="factoryNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
+      </div>
+
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import print from 'vue-print-nb'
+import { getEnginDetail } from "@/api/supply/deliver";
+
+export default {
+  name: 'HomeDetail',
+  componentName: 'HomeDetail',
+  props: ['listItem'],
+  directives: {
+    print
+  },
+  filters: {
+    statusFilter(val) {
+      const MAP = {
+        1: '已受理'
+      }
+      return MAP[val];
+    },
+    orderTypeFilter(val) {
+      const MAP = {
+        1: '零售订单',
+        2: '家用工程订单',
+        3: '商用工程订单',
+      }
+      return MAP[val];
+    }
+  },
+  data() {
+    return {
+      printObj: {
+        id: 'printMe'
+      },
+      detailData: {},
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getEnginDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 30px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+</style>

+ 347 - 0
src/views/supply/deliver/home_list.vue

@@ -0,0 +1,347 @@
+<template>
+  <div class="app-container">
+    <div v-show="!isShowDetail">
+      <!-- 筛选条件 -->
+      <div class="screen-container">
+        <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
+          <el-row :gutter="20">
+            <!-- <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item prop="orderNum" label-width="0">
+                <el-radio-group v-model="screenForm.status" size="medium">
+                  <el-radio-button label="1">全部</el-radio-button>
+                  <el-radio-button label="2">已发货</el-radio-button>
+                  <el-radio-button label="3">已取消</el-radio-button>
+                </el-radio-group>
+              </el-form-item>
+            </el-col> -->
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商编号" prop="jxsNum">
+                <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商名称" prop="jxsName">
+                <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货日期" prop="date">
+                <el-date-picker
+                  v-model="screenForm.date"
+                  type="datetimerange"
+                  range-separator="至"
+                  style="width: 100%;"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="产品名称" prop="chName">
+                <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="规格型号" prop="model">
+                <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+              </el-form-item>
+            </el-col>
+            
+            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+              <el-form-item label="">
+                <el-button size="small" @click="resetScreenForm">清空</el-button>
+                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+
+      <div class="mymain-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <!-- <el-button size="small" type="warning" icon="el-icon-close">退货</el-button> -->
+          </div>
+          <div class="fr">
+            <ExportButton :exUrl="'ship/pExport'" :exParams="exParams" />
+          </div>
+        </div>
+        <div class="table">
+          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+            <el-table-column align="center" label="发货单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="100" 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="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审单人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审单日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="状态" 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="操作" width="200" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
+                <el-button type="text" @click="getPassword(scope.row.id)">获取密码</el-button>
+                <el-button type="text" @click="openShareDetail(scope.row.id)">密码记录</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+
+    <!-- 密码记录 -->
+    <el-dialog title="密码记录" :visible.sync="isShowDialog" :show-close="false" width="50%" :close-on-click-modal="false">
+      <div class="table" style="margin: 10px 0 20px;">
+        <el-table 
+          v-loading="dialogTable_listLoading" 
+          :data="dialogTable_dataList" 
+          element-loading-text="Loading" 
+          tooltip-effect="dark" 
+          style="width: 100%" 
+          max-height="270">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="printPassword" label="密码"></el-table-column>
+          <el-table-column align="center" prop="createTime" label="打印时间"></el-table-column>
+        </el-table>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @current-change="dialogTableCurrentChange"
+            :current-page="dialogTable_currentPage"
+            :page-size="dialogTable_pageSize"
+            background
+            layout="prev, pager, next"
+            :total="dialogTable_listTotal">
+          </el-pagination>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isShowDialog = false">关 闭</el-button>
+      </div>
+    </el-dialog>
+    
+    <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+
+  </div>
+</template>
+
+<script>
+import { getEnginList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
+import HomeDetail from "@/views/supply/deliver/components/home_detail";
+
+let that
+export default {
+  components: {
+    HomeDetail,
+  },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+  },
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: null, // 列表数据
+      listLoading: false, // 列表加载loading
+      screenForm: { // 筛选表单数据
+        orderNum: '',
+        jxsName: '',
+        chName: '',
+        model: '',
+        date: '',
+        jxsNum: '',
+        status: '',
+      },
+      statusList: [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ],
+
+      isShowDialog: false, // 密码记录 - 弹窗
+      dialogTable_dataList: null, // 密码记录 - 列表数据
+      dialogTable_listLoading: true, // 密码记录 - 列表加载loading
+      dialogTable_currentPage: 1, // 密码记录 - 当前页码
+      dialogTable_pageSize: 10, // 密码记录 - 每页数量
+      dialogTable_listTotal: 0, // 密码记录 - 列表总数
+
+      queryItem: {},
+    }
+  },
+
+  computed: {
+    exParams() {
+      return {
+        id: this.screenForm.orderNum,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        materialName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        orderType: 2, // 2家用工程 3商用工程
+      }
+    },
+    isShowDetail() {
+      return this.queryItem.hasOwnProperty('id');
+    },
+  },
+
+  beforeCreate() {
+    that = this;
+  },
+
+  created() {
+    this.getList();
+  },
+
+  methods: {
+    // 查询按钮权限
+    checkBtnRole(value) {
+      // let btnRole = this.$route.meta.roles;
+      // if(!btnRole) {return true}
+      // let index = btnRole.indexOf(value);
+      // return index >= 0;
+      return true
+    },
+
+    // 查询列表
+    getList() {
+      this.listLoading = true;
+
+      let params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        id: this.screenForm.orderNum,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        materialName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        orderType: 2, // 2家用工程 3商用工程
+      };
+      getEnginList(params).then((res) => {
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
+        this.listLoading = false;
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+
+    // 进入详情
+    toDetail(item) {
+      this.queryItem = item;
+    },
+
+    backList() {
+      this.queryItem = {};
+    },
+
+    // 获取密码
+    getPassword(id) {
+      getPassword({id}).then(res => {
+        this.$alert(res.data, '新密码', {
+          confirmButtonText: '确定',
+          callback: action => {}
+        });
+      })
+    },
+
+    // 密码记录 - 获取列表
+    getPasswordRecord(id) {
+      getPasswordRecord({
+        pageNum: this.dialogTable_currentPage,
+        pageSize: this.dialogTable_pageSize,
+        id
+      }).then(res => {
+        this.dialogTable_dataList = res.data.records;
+        this.dialogTable_listTotal = res.data.total;
+        this.dialogTable_listLoading = false;
+      })
+    },
+
+    // 密码记录 - 打开弹窗
+    openShareDetail(id) {
+      this.isShowDialog = true;
+      this.dialogTable_currentPage = 1;
+      this.getPasswordRecord(id);
+    },
+
+    // 密码记录 - 更改列表当前页
+    dialogTableCurrentChange(val) {
+      this.dialogTable_currentPage = val;
+      this.getPasswordRecord();
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 100 - 66
src/views/supply/displace/components/displace_detail.vue

@@ -9,36 +9,52 @@
       <div class="diy-table-1">
         <el-row :gutter="0">
           <el-col :span="8" class="item">
-            <div class="label">单号</div>
-            <div class="value">{{detailData.retreatOrderNo}}</div>
+            <div class="label">置换单号</div>
+            <div class="value">{{detailData.displaceOrderId}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">订单日期</div>
-            <div class="value">{{detailData.retreatTime}}</div>
+            <div class="value">{{ detailData.orderDate ? detailData.orderDate.split(" ")[0] : '' }}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-            <div class="value">{{detailData.aaa}}</div>
+            <div class="value">{{ $parent.findExamineStatus(detailData.examineStatus) }}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">原订单号</div>
-            <div class="value">{{detailData.salesType}}</div>
+            <div class="value">{{detailData.orderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">订单类型</div>
-            <div class="value">{{detailData.orderNo}}</div>
+            <div class="value">{{ $parent.findOrderType(detailData.orderType) }}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">销售政策编号</div>
+            <div class="value">{{detailData.policyCode}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">销售政策</div>
+            <div class="value">{{detailData.policyTitle}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">销售政策说明</div>
+            <div class="value">{{detailData.policyRemark}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">工程登录编码</div>
+            <div class="value">{{detailData.enginRecordNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">业务员</div>
-            <div class="value">{{detailData.billNumber}}</div>
+            <div class="value">{{detailData.serviceName}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">经销商编号</div>
-            <div class="value">{{detailData.clientName}}</div>
+            <div class="value">{{detailData.customerId}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">经销商名称</div>
-            <div class="value">{{detailData.salesDep}}</div>
+            <div class="value">{{detailData.customerName}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label"></div>
@@ -50,76 +66,92 @@
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">申请人</div>
-            <div class="value">{{detailData.salesDep}}</div>
+            <div class="value">{{detailData.createName}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">审核人</div>
-            <div class="value">{{detailData.salesDep}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">关闭人</div>
-            <div class="value">{{detailData.salesDep}}</div>
+            <div class="value">{{detailData.confirmName}}</div>
           </el-col>
         </el-row>
       </div>
 
       <div class="main-title">
-        <div class="title">货品信息</div>
+        <div class="title">原订单货品信息</div>
       </div>
       <div class="table">
-        <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
+        <el-table :data="detailData.originItems" 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="orderNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="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="unit" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税单价" prop="includedPrice" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税金额" prop="includedPrice" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.number * scope.row.includedPrice }}
-            </template>
-          </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="price" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.number * scope.row.price }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="价税合计" prop="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率(%)" prop="rate" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="退补标记" prop="refund" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="厂产品代码" prop="factoryNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单价" prop="price" 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="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="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原数量" prop="displaceQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
     </div>
 
     <div class="main-title">
-        <div class="title">审批记录</div>
-      </div>
-      <div class="diy-table-1">
-        <el-row :gutter="0">
-          <el-col :span="8" class="item">
-            <div class="label">审批人</div>
-            <div class="value">{{detailData.salesDep}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">审批结果</div>
-            <div class="value">{{detailData.salesDep}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">审批时间</div>
-            <div class="value">{{detailData.salesDep}}</div>
-          </el-col>
-          <el-col :xs="24" :sm="24" :lg="24" class="item">
-            <div class="label">审批说明</div>
-            <div class="value">{{detailData.remark}}</div>
-          </el-col>
-        </el-row>
-      </div>
-    
+      <div class="title">置换货品信息</div>
+    </div>
+    <div class="table">
+      <el-table :data="detailData.items" 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="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="unit" min-width="160" 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="qty" min-width="160" 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="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="100" 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="8" class="item">
+          <div class="label">审批人</div>
+          <div class="value">{{detailData.salesDep}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">审批结果</div>
+          <div class="value">{{detailData.salesDep}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">审批时间</div>
+          <div class="value">{{detailData.salesDep}}</div>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button>
@@ -139,7 +171,9 @@ import { getDetail } from "@/api/supply/displace";
 export default {
   name: 'DisplaceDetail',
   componentName: 'DisplaceDetail',
-  props: ['listItem'],
+  props: [
+    'listItem'
+  ],
   directives: {
     print
   },
@@ -176,10 +210,10 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getDetail({ id: this.listItem.displaceOrderId }).then(res => {
         this.detailData = res.data;
       })
-    },
+    }
   }
 }
 </script>
@@ -203,4 +237,4 @@ export default {
       padding-left: 10px;
     }
   }
-</style>
+</style>

+ 317 - 0
src/views/supply/displace/components/displace_examine.vue

@@ -0,0 +1,317 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="审批"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">订单信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">置换单号</div>
+          <div class="value">{{detailData.displaceOrderId}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单日期</div>
+          <div class="value">{{ detailData.orderDate ? detailData.orderDate.split(" ")[0] : '' }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{ $parent.findExamineStatus(detailData.examineStatus) }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">原订单号</div>
+          <div class="value">{{detailData.orderNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单类型</div>
+          <div class="value">{{ $parent.findOrderType(detailData.orderType) }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售政策编号</div>
+          <div class="value">{{detailData.policyCode}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售政策</div>
+          <div class="value">{{detailData.policyTitle}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售政策说明</div>
+          <div class="value">{{detailData.policyRemark}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程登录编码</div>
+          <div class="value">{{detailData.enginRecordNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">业务员</div>
+          <div class="value">{{detailData.serviceName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerId}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</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">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请人</div>
+          <div class="value">{{detailData.createName}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">原订单货品信息</div>
+    </div>
+    <div class="table">
+      <el-table :data="originGoodsList" 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="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="unit" min-width="160" 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="qty" min-width="160" 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="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="置换数量" prop="displaceQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="税率" 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="table" style="margin-top: 20px">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="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="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品旧编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.price" size="small" type="number"></el-input>
+          </template>
+        </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" type="number"></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 || 0) * (scope.row.qty || 0)}}
+          </template>
+        </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="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.discAmount" size="small" type="number"></el-input>
+          </template>
+        </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="remark" min-width="200" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="税率" prop="taxRate" 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">{{userName}}</div>
+        </el-col>
+        <el-col :span="12" class="item">
+          <div class="label">审批结果</div>
+          <div class="value">
+            <el-radio-group v-model="examineForm.examineResult">
+              <el-radio :label="true">通过</el-radio>
+              <el-radio :label="false">驳回</el-radio>
+            </el-radio-group>
+          </div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value"><el-input v-model="examineForm.examineNote" placeholder="请输入内容"></el-input></div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
+        <el-popconfirm
+          title="确定关闭吗?"
+          @onConfirm="goBack"
+          style="margin-left: 10px;"
+        >
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import {examineOrder, getDetail} from "@/api/supply/displace";
+
+export default {
+  name: 'DisplaceExamine',
+  componentName: 'DisplaceExamine',
+  props: ['listItem'],
+  data() {
+    return {
+      detailData: {},
+      goodsList: [],
+      originGoodsList: [],
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+
+      formLoading: false,
+      examineForm: {
+        displaceOrderId: '',
+        orderType: '',
+        orderNo: '',
+        orderDate: '',
+        mainId: '',
+        mainName: '',
+        enginRecordNo: '',
+        projectNo: '',
+        projectName: '',
+        useUnit: '',
+        installAddress: '',
+        policyId: '',
+        policyCode: '',
+        policyTitle: '',
+        policyRemark: '',
+        serviceId: '',
+        serviceName: '',
+        takeDeposit: '',
+        remark: '',
+        examineStatus: '',
+        examineResult: true,
+        examineNote: '',
+      }
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.displaceOrderId}).then(res => {
+        this.detailData = res.data;
+        this.goodsList = res.data.items;
+        this.originGoodsList = res.data.originItems;
+      })
+    },
+
+    clickSubmitForm() {
+      if (this.formLoading) {
+        return
+      }
+      this.formLoading = true;
+      examineOrder({
+        displaceOrderId: this.listItem.displaceOrderId,
+        examineResult: this.examineForm.examineResult,
+        examineNote: this.examineForm.examineNote,
+        originItems: this.originGoodsList,
+        items: this.goodsList,
+      }).then(res => {
+        this.$successMsg('审批成功');
+        this.$nextTick(() => {
+          this.goBack();
+          this.$parent.getList();
+        })
+      }).finally(res => {
+        this.formLoading = false;
+      })
+    },
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 20px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+
+  .add {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border: 1px solid #EBEEF5;
+    border-top: none;
+    height: 50px;
+  }
+
+  ::v-deep input::-webkit-outer-spin-button,
+  ::v-deep input::-webkit-inner-spin-button {
+    -webkit-appearance: none;
+  }
+  ::v-deep input[type='number'] {
+    -moz-appearance: textfield;
+  }
+</style>

+ 787 - 62
src/views/supply/displace/components/displace_form.vue

@@ -9,14 +9,18 @@
     <el-form ref="mainForm" :model="mainForm" label-width="100px" size="small" label-position="left">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="订单号" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入订单号"></el-input>
+          <el-form-item label="订单号" prop="orderNo">
+            <div  >
+              <el-input v-model="mainForm.orderNo" placeholder="请输入订单号" disabled>
+                <el-button slot="append" icon="el-icon-search" @click="openShareDetail" class="choose-order">选择</el-button>
+              </el-input>
+            </div>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
-          <el-form-item label="单据日期" prop="date">
+          <el-form-item label="单据日期" prop="orderDate" :rules="{ required: true, message: '单据日期不能为空', trigger: 'blur' }">
             <el-date-picker
-              v-model="mainForm.date"
+              v-model="mainForm.orderDate"
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
@@ -25,42 +29,46 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="品类" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入品类"></el-input>
+          <el-form-item label="品类" prop="mainName">
+            <el-input :value="mainForm.mainName" placeholder="品类" disabled></el-input>
           </el-form-item>
         </el-col>
+        <template v-if="mainForm.policyCode">
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item label="销售政策编号" prop="policyCode">
+              <el-input :value="mainForm.policyCode" placeholder="销售政策编号" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item label="销售政策" prop="policyTitle">
+              <el-input :value="mainForm.policyTitle" placeholder="销售政策" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item label="销售政策说明" prop="policyRemark">
+              <el-input :value="mainForm.policyRemark" placeholder="销售政策说明" disabled></el-input>
+            </el-form-item>
+          </el-col>
+        </template>
+        <template v-if="mainForm.enginRecordNo">
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item label="工程登录编码" prop="enginRecordNo">
+              <el-input :value="mainForm.enginRecordNo" placeholder="工程登录编码" disabled></el-input>
+            </el-form-item>
+          </el-col>
+        </template>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="销售政策编号" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入销售政策编号"></el-input>
+          <el-form-item label="订单类型" prop="orderType">
+            <el-input :value="$parent.findOrderType(mainForm.orderType)"  placeholder="订单类型" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="销售政策" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入销售政策"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="销售政策说明" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入销售政策说明"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="工程登录编码" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入工程登录编码"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="附件" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入附件"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="业务员" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入业务员"></el-input>
+          <el-form-item label="业务员" prop="serviceName">
+            <el-input :value="mainForm.serviceName" placeholder="业务员" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
-          <el-form-item label="备注" prop="warehouse">
+          <el-form-item label="备注" prop="remark">
             <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
           </el-form-item>
         </el-col>
@@ -68,62 +76,368 @@
     </el-form>
 
     <div class="main-title">
-      <div class="title">货品信息</div>
-      <div>
-        <el-button type="primary" size="small">检查库存</el-button>
-      </div>
-      
+      <div class="title">原订单货品信息</div>
     </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="originGoodsList" 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="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="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="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="unit" min-width="160" 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="qty" min-width="160" 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="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="原数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="置换数量" prop="displaceQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>
     </div>
-    
+
+    <div class="main-title" v-if="mainForm.orderNo">
+      <div class="title">置换货品信息</div>
+      <div v-if="!listItem">
+        <el-select v-model="warehouseValue" placeholder="请选择发货仓库" size="small" style="margin-right: 10px">
+          <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+        </el-select>
+        <el-button type="primary" size="small" icon="el-icon-search" @click="checkStock">检查库存</el-button>
+        <el-divider direction="vertical"></el-divider>
+        <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加货品</el-button>
+      </div>
+    </div>
+    <div class="table" style="margin-top: 20px" v-if="mainForm.orderNo">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="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="unit" min-width="160" 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="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="changeWallet(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="120" 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>
+              <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="payAmount" 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="remark" min-width="160">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip v-if="!listItem">
+          <template slot-scope="scope">
+            <div>{{ scope.row.status1 | status1Filter }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="仓库状态" prop="status2" min-width="100" show-overflow-tooltip v-if="!listItem">
+          <template slot-scope="scope">
+            <div>{{ status2Filter(scope.row) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
-        <el-button type="primary" @click="clickSubmitForm">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
       </div>
     </div>
 
+
+    <!-- 订单列表 -->
+    <el-dialog title="订单列表" :visible.sync="isShowOriginDialog" width="70%" :close-on-click-modal="false">
+      <el-form v-if="mainForm.examineStatus === ''" ref="screenOriginForm" :model="screenOriginForm" label-width="80px" size="small">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item label="原订单号"
+                          prop="orderNo"
+                          :rules="{ required: true, message: '原订单号不能为空', trigger: 'blur' }"
+            >
+              <el-input v-model="screenOriginForm.orderNo" placeholder="原订单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-form-item label="">
+              <el-button size="small" type="primary" @click="submitScreenOriginForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div class="table" style="margin: 10px 0 20px;">
+        <el-table
+          ref="originOrderTable"
+          v-loading="dialogTable_listLoading"
+          :data="dialogTable_dataList"
+          element-loading-text="Loading"
+          tooltip-effect="dark"
+          style="width: 100%"
+          border
+          max-height="270">
+          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column align="center" prop="orderType" label="订单类型" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ $parent.findOrderType(dialogTable_data.orderType) }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="saleTypeName" label="销售类型" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="materialName" label="货品名称" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="specification" label="规格型号" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="unit" label="单位" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="qty" label="数量" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="refundableQty" label="可退单置换数" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" prop="displaceQty" label="退订置换数" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.displaceQty" size="small"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isShowOriginDialog = false">关 闭</el-button>
+        <el-button @click="chooseDetail">提 交</el-button>
+      </div>
+    </el-dialog>
+
+
+    <el-dialog title="添加产品" :visible.sync="isShowDialog" width="80%">
+      <el-form ref="screenForm" :model="screenForm" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="type">
+              <el-select v-model="mainForm.mainId" placeholder="选择品类" style="width: 100%" disabled>
+                <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="salesType">
+              <el-select v-model="screenForm.salesType" placeholder="选择销售类型" style="width: 100%" clearable>
+                <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="12" :sm="6" :lg="6">
+            <el-form-item prop="proNum">
+              <el-input v-model="screenForm.proNum" placeholder="请输入产品编码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="proName">
+              <el-input v-model="screenForm.proName" placeholder="请输入产品名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="proModel">
+              <el-input v-model="screenForm.proModel" placeholder="请输入产品型号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="price1"  style="display: flex">
+              <el-input v-model="screenForm.price1" placeholder="请输入价格" style="width: 46%"></el-input>
+              <span> - </span>
+              <el-input v-model="screenForm.price2" placeholder="请输入价格" style="width: 46%"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :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>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="tables">
+        <div class="table">
+          <el-table :data="leftGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="leftSelectionChange">
+            <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="name" 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="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
+          </el-table>
+          <div class="pagination clearfix" style="margin-top: 10px">
+            <div class="fr">
+              <el-pagination
+                @current-change="handleTableCurrentChange"
+                :current-page="currentPage"
+                :page-size="10"
+                background
+                layout="prev, pager, next"
+                :total="listTotal">
+              </el-pagination>
+            </div>
+          </div>
+        </div>
+        <div class="buttons">
+          <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
+          <el-button size="small" type="primary" @click="addGoods">添&emsp;加</el-button>
+          <el-button size="small" type="danger" @click="deleteGoods">删&emsp;除</el-button>
+          <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
+        </div>
+        <div class="table">
+          <el-table :data="rightGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="rightSelectionChange">
+            <el-table-column align="center" type="selection" width="55"></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="name" 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="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
+          </el-table>
+        </div>
+      </div>
+
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDialog">取 消</el-button>
+        <el-button type="primary" @click="submitAddGoods">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { getDetail } from "@/api/supply/displace";
+import {getDetail, queryRefDetail, addData, editData} from "@/api/supply/displace";
+import {checkStock, getWalletList, getWarehouseList} from "@/api/supply/engin";
+import {getDictList, getTypeList} from "@/api/common";
+import {getGoodsList} from "@/api/supply/retail";
 
 export default {
   name: 'DisplaceForm',
   componentName: 'DisplaceForm',
   props: ['listItem'],
+  filters: {
+    status1Filter(val) {
+      if (val === '' || val === null || val === undefined) return '未检查';
+      else if (val === 0) return '无货';
+      else if (val > 0 && val <= 30) return val;
+      else if (val > 30 && val <= 1000) return '有货';
+      else if (val > 1000) return '充足';
+    },
+  },
   data() {
     return {
+      editId: '',
       detailData: {},
       mainForm: {
-
+        displaceOrderId: '',
+        orderType: '',
+        orderNo: '',
+        orderDate: '',
+        mainId: '',
+        mainName: '',
+        enginRecordNo: '',
+        projectNo: '',
+        projectName: '',
+        useUnit: '',
+        installAddress: '',
+        policyId: '',
+        policyCode: '',
+        policyTitle: '',
+        policyRemark: '',
+        serviceId: '',
+        serviceName: '',
+        takeDeposit: '',
+        remark: '',
+        examineStatus: ''
+      },
+      isShowOriginDialog: false,
+      isShowDialog: false,
+      dialogTable_data: null, // 列表订单数据
+      dialogTable_dataList: [],
+      dialogTable_listLoading: false, // 列表加载loading
+      screenOriginForm: {
+        orderNo: ''
       },
+      screenForm: {
+        type: '',
+        salesType: '',
+        proNum: '',
+        proName: '',
+        proModel: '',
+        price1: '',
+        price2: '',
+      },
+      currentPage: 1,
+      listTotal: 0,
+
+      salesTypeList: [],
+      typeList: [],
+      goodsList: [],
+      originGoodsList: [],
+      warehouseList: [],
+      warehouseValue: '',
+
+      leftGoodsList: [],
+      rightGoodsList: [],
+
+      leftSelection: [],
+      rightSelection: [],
+
+      xjWalletList: [],
+      flWalletList: []
     }
   },
 
@@ -140,7 +454,20 @@ export default {
   },
 
   created() {
-    this.getDetail();
+    this.getDictList();
+    this.getWalletList();
+    this.getSalesTypeList();
+    this.getWarehouseList();
+
+    if(this.listItem) {
+      this.editId = this.listItem.displaceOrderId;
+      this.getDetail();
+    } else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
+      this.mainForm.jxsName = JSON.parse(localStorage.getItem("supply_user")).customerName;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+      this.mainForm.createDate = this.getDate();
+    }
   },
 
   methods: {
@@ -151,13 +478,390 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
-        this.detailData = res.data;
+      getDetail({id: this.editId}).then(res => {
+        const data = res.data;
+        this.mainForm.displaceOrderId = data.displaceOrderId
+        this.mainForm.orderType = data.orderType
+        this.mainForm.orderNo = data.orderNo
+        this.mainForm.orderDate = data.orderDate
+        this.mainForm.mainId = data.mainId
+        this.mainForm.mainName = data.mainName
+        this.mainForm.enginRecordNo = data.enginRecordNo
+        this.mainForm.projectNo = data.projectNo
+        this.mainForm.projectName = data.projectName
+        this.mainForm.useUnit = data.useUnit
+        this.mainForm.installAddress = data.installAddress
+        this.mainForm.policyId = data.policyId
+        this.mainForm.policyCode = data.policyCode
+        this.mainForm.policyTitle = data.policyTitle
+        this.mainForm.policyRemark = data.policyRemark
+        this.mainForm.serviceId = data.serviceId
+        this.mainForm.serviceName = data.serviceName
+        this.mainForm.takeDeposit = data.takeDeposit
+        this.mainForm.examineStatus = data.examineStatus
+
+        this.originGoodsList = data.originItems
+        this.goodsList = data.items
       })
     },
+    // 原订单列表 - 打开弹窗
+    openShareDetail() {
+      this.isShowOriginDialog = true;
+      if (this.mainForm.examineStatus && this.originGoodsList.length > 0) {
+        this.screenOriginForm.orderNo = this.mainForm.orderNo
+        this.queryRefDetail()
+      }
+    },
+    submitScreenOriginForm() {
+      this.$refs['screenOriginForm'].validate((valid) => {
+        if (valid) {
+          this.queryRefDetail()
+        }
+      })
+    },
+    queryRefDetail() {
+      this.dialogTable_listLoading = true
+      queryRefDetail({
+        originOrderNo: this.screenOriginForm.orderNo
+      }).then(res => {
+        this.dialogTable_data = res.data;
+        this.dialogTable_dataList = this.dialogTable_data.originItems
+        if (this.mainForm.displaceOrderId) {
+          this.originAfterHandle(this.dialogTable_dataList)
+        }
+        this.dialogTable_listLoading = false;
+      }).catch(() => {
+        this.dialogTable_listLoading = false;
+      })
+    },
+    originAfterHandle() {
+      const data = this.dialogTable_dataList
+      // 历史选中的置换数回显
+      this.$nextTick(() => {
+        for (let i = 0; i < data.length; i++) {
+          this.originGoodsList.forEach(goods => {
+            if (goods.materialId === data[i].materialId) {
+              data[i].displaceQty = goods.displaceQty
+              this.$refs['originOrderTable'].toggleRowSelection(data[i], true)
+            }
+          })
+        }
+      })
+    },
+    chooseDetail() {
+      const tableData = this.$refs['originOrderTable'].selection
+      if (!tableData || tableData.length === 0) {
+        return this.$errorMsg('请选择订单明细')
+      }
+      for (let i = 0; i < tableData.length; i++) {
+        if (!tableData[i].displaceQty || tableData[i].displaceQty <= 0) {
+          return this.$errorMsg(tableData[i].materialName + ':置换数量不能少于0')
+        }
+        if (tableData[i].displaceQty > tableData[i].refundableQty) {
+          return this.$errorMsg(tableData[i].materialName + ':置换数量不能大于可退单置换数 ')
+        }
+      }
+      this.originGoodsList = tableData
 
+      this.mainForm.orderType = this.dialogTable_data.orderType
+      this.mainForm.orderNo = this.dialogTable_data.orderNo
+      this.mainForm.mainId = this.dialogTable_data.mainId
+      this.mainForm.mainName = this.dialogTable_data.mainName
+      this.mainForm.enginRecordNo = this.dialogTable_data.enginRecordNo
+      this.mainForm.projectNo = this.dialogTable_data.projectNo
+      this.mainForm.projectName = this.dialogTable_data.projectName
+      this.mainForm.useUnit = this.dialogTable_data.useUnit
+      this.mainForm.installAddress = this.dialogTable_data.installAddress
+      this.mainForm.policyId = this.dialogTable_data.policyId
+      this.mainForm.policyCode = this.dialogTable_data.policyCode
+      this.mainForm.policyTitle = this.dialogTable_data.policyTitle
+      this.mainForm.policyRemark = this.dialogTable_data.policyRemark
+      this.mainForm.serviceId = this.dialogTable_data.serviceId
+      this.mainForm.serviceName = this.dialogTable_data.serviceName
+      this.mainForm.takeDeposit = this.dialogTable_data.takeDeposit
+      this.isShowOriginDialog = false
+    },
     clickSubmitForm() {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          for(let i=0; i<this.goodsList.length; i++) {
+            if (!this.goodsList[i].qty || this.goodsList[i].qty <= 0) {
+              this.$errorMsg(this.goodsList[i].materialName + '数量不能小于0');
+              return;
+            }
+            if(!this.goodsList[i].customerWalletId) {
+              this.$errorMsg('请选择现金钱包');
+              return;
+            }
+          }
+          let params = {
+            orderDate: this.mainForm.orderDate + ' 00:00:00',
+            orderNo: this.mainForm.orderNo,
+            remark: this.mainForm.remark,
+            originItems: this.originGoodsList,
+            items: this.goodsList
+          }
+          if(this.listItem) {
+            params.displaceOrderId = this.editId;
+            editData(params).then(res => {
+              this.$successMsg('编辑成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }else {
+            addData(params).then(res => {
+              this.$successMsg('添加成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }
+        }
+      })
+    },
+    // 获取钱包列表
+    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 => {
+        this.typeList = res.data;
+      })
+    },
+
+    // 获取销售类型列表
+    getSalesTypeList() {
+      getTypeList({
+        pageNum: 1,
+        pageSize: -1
+      }).then((res) => {
+        this.salesTypeList = res.data.records;
+      })
+    },
+
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1
+      }).then((res) => {
+        this.warehouseList = res.data.records;
+      })
+    },
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+        month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+        strDate = "0" + strDate;
+      }
+      return year + seperator1 + month + seperator1 + strDate;
+    },
+    // 检查库存
+    checkStock() {
+      if(!this.warehouseValue) {
+        return this.$errorMsg('请选择仓库');
+      }
+      if(!this.goodsList) {
+        return this.$errorMsg('请添加货品');
+      }
+      let ids = [];
+      this.goodsList.forEach(item => {
+        ids.push(item.materialId);
+      })
+      checkStock({
+        correspondId: this.warehouseValue,
+        materialId: ids.join(',')
+      }).then(res => {
+        if(res.data) {
+          this.goodsList.forEach((item, index) => {
+            item.status1 = res.data[index].allStockNum;
+            item.status2 = res.data[index].stockNum;
+          })
+        }
+      })
+    },
+    // 点击 选择商品
+    openDialog() {
+      this.getSalesTypeList();
+      this.getGoodsList();
+      this.isShowDialog = true;
+    },
+    // 关闭 弹窗
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
+    // 左侧列表选择
+    leftSelectionChange(val) {
+      this.leftSelection = val;
+    },
+
+    // 右侧列表选择
+    rightSelectionChange(val) {
+      this.rightSelection = val;
+    },
+
+    // 数组去重
+    delRepeat(arr1, arr2) {
+      let allArr = arr1.concat(arr2); // 两个数组对象合并
+      let newArr = []; // 存放去重后数据的新数组
+      for(let i=0; i<allArr.length; i++){  // 循环allArr数组对象的内容
+        let flag = true;  // 建立标记,判断数据是否重复,true为不重复
+        for(let j=0; j<newArr.length; j++){  // 循环新数组的内容
+          if(allArr[i].materialId == newArr[j].materialId){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
+            flag = false;
+          }
+        }
+        if(flag){ // 判断是否重复
+          newArr.push(allArr[i]); // 不重复的放入新数组。  新数组的内容会继续进行上边的循环。
+        }
+      }
+      return newArr;
+    },
+
+    // 全部添加
+    addAllGoods() {
+      this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList);
+    },
+
+    // 添加
+    addGoods() {
+      this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList);
+    },
+
+    // 删除
+    deleteGoods() {
+      let rightGoodsList = this.rightGoodsList;
+      let rightSelection = this.rightSelection;
+      for(let i = 0; i < rightGoodsList.length; i++) {
+        for(let j = 0; j < rightSelection.length; j++) {
+          if(rightSelection[j].materialId == rightGoodsList[i].materialId){
+            this.rightGoodsList.splice(i, 1);
+          }
+        }
+      }
+    },
+
+    // 全部删除
+    deleteAllGoods() {
+      this.rightGoodsList = [];
+    },
+
+    // 确定 添加产品
+    submitAddGoods() {
+      this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
+      this.isShowDialog = false;
+      this.leftGoodsList = [];
+      this.rightGoodsList = [];
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      this.currentPage = val;
+      this.getGoodsList();
+    },
+    // 修改返利钱包
+    changeWallet(index) {
+      if(this.goodsList[index].customerWalletId2) {
+        let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
+        this.goodsList[index].rebateRate = obj.rebateRate;
+      }else {
+        this.goodsList[index].rebateRate = '';
+      }
+    },
+    status2Filter(item) {
+      if (item.status2 === '' || item.status2 === null || item.status2 === undefined) return '未检查';
+      else if (item.status2 >= item.qty) return '可用';
+      else return '短缺';
+    },
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.currentPage,
+        pageSize: 10,
+        mainId: this.mainForm.mainId,
+        saleId: this.screenForm.salesType,
+        materialCode: this.screenForm.proNum,
+        materialName: this.screenForm.proName,
+        specification: this.screenForm.proModel,
+        price1: this.screenForm.price1,
+        price2: this.screenForm.price2,
+      }).then(res => {
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = res.data.records;
+        for(let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for(let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if(newItem.materialId === oldItem.materialId){
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+        res.data.records.forEach(item => {
+          item.materialName = item.name;
+          item.materialCode = item.number;
+          item.saleTypeName = item.saleName;
+          item.unit = item.baseUnit;
+          item.price = item.batchPrice;
+          item.tax = item.taxRate;
+          item.isDirectTransfer = false;
+          item.directTransferQty = '';
+          item.status1 = '';
+          item.status2 = '';
+          item.rebateAmount = '';
+          item.rebateRate = '';
+          item.productPriceId = item.id;
+        });
+        this.leftGoodsList = res.data.records;
+        this.listTotal = res.data.total;
+      })
     },
   }
 }
@@ -182,4 +886,25 @@ export default {
       padding-left: 10px;
     }
   }
-</style>
+  .tables {
+    display: flex;
+    margin-top: 10px;
+    .table {
+      width: 45%;
+    }
+    .buttons {
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+      padding: 0 10px;
+      button {
+        margin: 0;
+        margin-top: 10px;
+      }
+    }
+  }
+  .choose-order {
+
+  }
+</style>

+ 283 - 0
src/views/supply/displace/components/displace_return.vue

@@ -0,0 +1,283 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="退订"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">订单信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">置换单号</div>
+          <div class="value">{{detailData.displaceOrderId}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单日期</div>
+          <div class="value">{{ detailData.orderDate ? detailData.orderDate.split(" ")[0] : '' }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{ $parent.findExamineStatus(detailData.examineStatus) }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">原订单号</div>
+          <div class="value">{{detailData.orderNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单类型</div>
+          <div class="value">{{ $parent.findOrderType(detailData.orderType) }}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售政策编号</div>
+          <div class="value">{{detailData.policyCode}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售政策</div>
+          <div class="value">{{detailData.policyTitle}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">销售政策说明</div>
+          <div class="value">{{detailData.policyRemark}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程登录编码</div>
+          <div class="value">{{detailData.enginRecordNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">业务员</div>
+          <div class="value">{{detailData.serviceName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerId}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</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">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请人</div>
+          <div class="value">{{detailData.createName}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">原订单货品信息</div>
+    </div>
+    <div class="table">
+      <el-table :data="detailData.originItems" 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="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="unit" min-width="160" 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="qty" min-width="160" 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="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="置换数量" prop="displaceQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="税率" 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="table" style="margin-top: 20px">
+      <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="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="unit" min-width="160" 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="qty" min-width="160" 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="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="退订数量" prop="retiredQty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.retiredQty" size="small"></el-input>
+          </template>
+        </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">{{userName}}</div>
+        </el-col>
+        <el-col :span="12" class="item">
+          <div class="label">退订日期</div>
+          <div class="value">{{getDate()}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">退订说明</div>
+          <div class="value"><el-input v-model="returnForm.remark" placeholder="请输入退订说明"></el-input></div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm()">确定退订</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getDetail, returnOrder } from "@/api/supply/displace";
+
+export default {
+  name: 'CommerceReturn',
+  componentName: 'CommerceReturn',
+  props: ['listItem'],
+  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 {
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+      detailData: {},
+
+      formLoading: false,
+      returnForm: {
+        remark: '',
+      }
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({ id: this.listItem.displaceOrderId }).then(res => {
+        this.detailData = res.data;
+        this.detailData.items.forEach(item => {
+          item.retiredQty = 0
+        })
+      })
+    },
+
+    // 退订
+    clickSubmitForm(val) {
+      this.$confirm('此操作将退订订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let params = {
+          displaceOrderId: this.detailData.displaceOrderId,
+          items: this.detailData.items,
+          refundNote: this.returnForm.remark
+        };
+        returnOrder(params).then(res => {
+          this.$successMsg();
+          this.goBack();
+          this.$parent.getList();
+        })
+      }).catch(() => {});
+    },
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 20px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+</style>

+ 147 - 51
src/views/supply/displace/displace_list.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div v-show="!isShowDetail && !isShowForm">
+    <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
       <!-- 筛选条件 -->
       <div class="screen-container">
         <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
@@ -11,18 +11,18 @@
               </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 label="原订单号" prop="originOrderNo">
+                <el-input v-model="screenForm.originOrderNo" placeholder="请输入原订单号"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商名称" prop="jxsName">
-                <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
+              <el-form-item label="经销商名称" prop="customerKeyword">
+                <el-input v-model="screenForm.customerKeyword" 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 label="产品名称" prop="productName">
+                <el-input v-model="screenForm.productName" placeholder="请输入产品名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -39,21 +39,24 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="申请人" prop="sqMan">
-                <el-input v-model="screenForm.sqMan" placeholder="请输入申请人"></el-input>
+              <el-form-item label="申请人" prop="createName">
+                <el-input v-model="screenForm.createName" placeholder="请输入申请人"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="审核人" prop="shMan">
-                <el-input v-model="screenForm.shMan" placeholder="请输入审核人"></el-input>
+              <el-form-item label="审核人" prop="confirmName">
+                <el-input v-model="screenForm.confirmName" placeholder="请输入审核人"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="销售订单类型" prop="shMan">
-                <el-input v-model="screenForm.shMan" placeholder="请输入销售订单类型"></el-input>
+              <el-form-item label="订单类型" prop="orderType">
+                <el-select v-model="screenForm.orderType" placeholder="选择订单类型" style="width: 100%">
+                  <el-option label="全部" value="" />
+                  <el-option v-for="item in orderType" :key="item.val" :label="item.label" :value="item.val"></el-option>
+                </el-select>
               </el-form-item>
             </el-col>
-            
+
             <el-col :xs="24" :sm="24" :lg="24" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
@@ -75,26 +78,42 @@
         </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="retreatOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="retreatTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="原订单号" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单类型" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商编号" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商名称" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品编码" prop="totalPrice" min-width="160" 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="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="业务员" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="申请人" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="申请日期" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核状态" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单号" prop="displaceOrderId" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="原订单号" prop="orderNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单类型" min-width="160" show-overflow-tooltip>
+              <template slot-scope="{ row }">
+                {{ findOrderType(row.orderType) }}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="经销商编号" prop="customerId" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="业务员" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="申请人" prop="createName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="申请日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="confirmName" min-width="160" 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="审核状态" min-width="100" show-overflow-tooltip>
+              <template slot-scope="{ row }">
+                {{ findExamineStatus(row.examineStatus) }}
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="操作" width="160" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.displaceOrderId)" v-if="scope.row.examineStatus === 'WAIT'" >
+                  <el-button slot="reference" type="text">撤回</el-button>
+                </el-popconfirm>
+                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-button type="text" @click="toReturn(scope.row)" v-if="scope.row.examineStatus === 'OK'">退订</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="handleSubmit(scope.row.displaceOrderId)" v-if="scope.row.examineStatus === 'SAVE'" >
+                  <el-button slot="reference" type="text">提审</el-button>
+                </el-popconfirm>
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.displaceOrderId)" >
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -116,22 +135,27 @@
         </div>
       </div>
     </div>
-    
+
     <DisplaceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <DisplaceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
-
+    <DisplaceExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
+    <DisplaceReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
   </div>
 </template>
 
 <script>
-import { getList } from "@/api/supply/displace";
+import {deleteOrder, getList, revokeOrder, submitData} from "@/api/supply/displace";
 import DisplaceDetail from "@/views/supply/displace/components/displace_detail";
 import DisplaceForm from "@/views/supply/displace/components/displace_form";
+import DisplaceExamine from "@/views/supply/displace/components/displace_examine";
+import DisplaceReturn from "@/views/supply/displace/components/displace_return";
 
 export default {
   components: {
     DisplaceDetail,
     DisplaceForm,
+    DisplaceExamine,
+    DisplaceReturn
   },
   data() {
     return {
@@ -142,16 +166,33 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         orderNum: '',
-        jxsNum: '',
-        jxsName: '',
-        chName: '',
-        model: '',
+        originOrderNo: '',
+        customerKeyword: '',
+        productName: '',
         date: '',
+        createName: '',
+        confirmName: '',
+        orderType: '',
       },
-
       queryItem: {},
       isShowDetail: false,
       isShowForm: false,
+      isShowExamine: false,
+      isShowReturn: false,
+      orderType : [
+        { label: '商用工程', val: 'TRADE'},
+        { label: '家用工程', val: 'HOME'},
+        { label: '零售订单', val: 'RETAIL'},
+        { label: '销售政策单', val: 'RETAIL_POLICY'}
+      ],
+      examineStatus : [
+        { label: '保存', val: 'SAVE'},
+        { label: '待审核', val: 'WAIT'},
+        { label: '通过', val: 'OK'},
+        { label: '不通过', val: 'FAIL'},
+        { label: '关闭', val: 'CLOSE'}
+      ],
+
     }
   },
 
@@ -159,15 +200,14 @@ export default {
     exParams() {
       return {
         retreatOrderNo: this.screenForm.orderNum,
-        customerNumber: this.screenForm.jxsNum,
-        customerName: this.screenForm.jxsName,
+        customerKeyword: this.screenForm.jxsNum,
         productName: this.screenForm.chName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
         status: 1, // 1:退货单,2:电商退货单
       }
-    },
+    }
   },
 
   created() {
@@ -191,14 +231,15 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        retreatOrderNo: this.screenForm.orderNum,
-        customerNumber: this.screenForm.jxsNum,
-        customerName: this.screenForm.jxsName,
-        productName: this.screenForm.chName,
-        specification: this.screenForm.model,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 1, // 1:退货单,2:电商退货单
+        displaceOrderId: this.screenForm.orderNum,
+        originOrderNo: this.screenForm.originOrderNo,
+        customerKeyword: this.screenForm.customerKeyword,
+        productName: this.screenForm.productName,
+        createName: this.screenForm.createName,
+        confirmName: this.screenForm.confirmName,
+        orderType: this.screenForm.orderType,
+        startOrderTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endOrderTime: this.screenForm.date ? this.screenForm.date[1] : ''
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;
@@ -232,27 +273,82 @@ export default {
       this.currentPage = val;
       this.getList();
     },
-
     // 进入表单
     toForm(item) {
       this.queryItem = item;
       this.isShowForm = true;
     },
 
+    // 进入审批
+    toExamine(item) {
+      this.queryItem = item;
+      this.isShowExamine = true;
+    },
+
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
       this.isShowDetail = true;
     },
 
+    // 进入退订
+    toReturn(item) {
+      this.queryItem = item;
+      this.isShowReturn = true;
+    },
+
     backList() {
       this.queryItem = {};
       this.isShowDetail = false;
       this.isShowForm = false;
+      this.isShowExamine = false;
+      this.isShowReturn = false;
+    },
+    handleSubmit(id) {
+      submitData({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+    // 撤回
+    handleWithdraw(id) {
+      revokeOrder({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
     },
 
+    // 删除
     handleDelete(id) {
+      deleteOrder({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;
+        });
+        deleteOrder({ids: ids.join(',')}).then(res => {
+          this.$successMsg();
+          this.getList();
+        })
+      }).catch(() => {});
+    },
+    findOrderType(val) {
+      const obj = this.orderType.find((value) => value.val === val)
+      return obj ? obj.label : ''
+    },
+    findExamineStatus(val) {
+      const obj = this.examineStatus.find((value) => value.val === val)
+      return obj ? obj.label : ''
     }
   }
 }

+ 3 - 7
src/views/supply/engin/components/engin_detail.vue

@@ -17,10 +17,6 @@
           <div class="value">{{detailData.orderDate}}</div>
         </el-col>
         <el-col :span="8" class="item">
-          <div class="label">单据状态</div>
-          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
-        </el-col>
-        <el-col :span="8" class="item">
           <div class="label">经销商编码</div>
           <div class="value">{{detailData.customerId}}</div>
         </el-col>
@@ -74,7 +70,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">业务员</div>
-          <div class="value">{{detailData.serviceId}}</div>
+          <div class="value">{{detailData.serviceName}}</div>
         </el-col>
       </el-row>
     </div>
@@ -120,7 +116,7 @@
         </el-row>
       </div>
     </div>
-    
+
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button @click="goBack">关 闭</el-button>
@@ -211,4 +207,4 @@ export default {
       padding-left: 10px;
     }
   }
-</style>
+</style>

+ 6 - 5
src/views/supply/engin/components/engin_examine.vue

@@ -164,7 +164,7 @@
         <el-col :span="12" class="item">
           <div class="label">审批结果</div>
           <div class="value">
-            <el-radio-group v-model="examineForm.status">
+            <el-radio-group v-model="examineForm.examineResult">
               <el-radio :label="true">通过</el-radio>
               <el-radio :label="false">驳回</el-radio>
             </el-radio-group>
@@ -176,7 +176,7 @@
         </el-col>
       </el-row>
     </div>
-    
+
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
@@ -222,7 +222,7 @@ export default {
 
       formLoading: false,
       examineForm: {
-        status: true,
+        examineResult: true,
         remark: '',
       },
 
@@ -320,7 +320,8 @@ export default {
       this.formLoading = true;
       examineEngin({
         enginInfoId: this.listItem.enginInfoId,
-        examineStatus: this.examineForm.status ? 'OK' : 'FAIL',
+        productCategoryId: this.listItem.productCategoryId,
+        examineResult: this.examineForm.examineResult,
         examineNote: this.examineForm.remark,
         contractExpireDate: this.detailData.contractExpireDate,
         items: this.goodsList,
@@ -373,4 +374,4 @@ export default {
   ::v-deep input[type='number'] {
     -moz-appearance: textfield;
   }
-</style>
+</style>

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

@@ -151,11 +151,7 @@
         <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="规格型号" prop="specification" min-width="200" 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>
-          <template slot-scope="scope">
-            <el-input v-model="scope.row.price" size="small" type="number"></el-input>
-          </template>
-        </el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.qty" size="small" type="number"></el-input>

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

@@ -66,7 +66,7 @@
                 <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
               </el-form-item>
             </el-col>
-            
+
             <el-col :xs="24" :sm="12" :lg="18" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
@@ -141,7 +141,7 @@
         </div>
       </div>
     </div>
-    
+
     <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
     <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
@@ -333,7 +333,7 @@ export default {
 
     // 删除
     handleDelete(id) {
-      deleteEngin({id}).then(res => {
+      deleteEngin({ids: id}).then(res => {
         this.$successMsg();
         this.getList();
       })

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

@@ -65,7 +65,32 @@
               {{ scope.row.printNum ? '已打单':'未打单' }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="提货方式" prop="pickType" min-width="160" show-overflow-tooltip>
+          <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.pickTime | dateToDayFilter }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货申请单号" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品大类" prop="mainName" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
             </template>
@@ -75,8 +100,6 @@
               {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="提货单号" prop="pickOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
     </div>

+ 9 - 9
src/views/supply/pickup/components/pickup_form.vue

@@ -7,19 +7,19 @@
     <div>
       <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="80px" size="small" label-position="left">
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="选择仓库" prop="warehouse">
-              <el-select v-model="mainForm.warehouse" placeholder="请选择仓库">
+              <el-select v-model="mainForm.warehouse" placeholder="请选择仓库" style="width: 100%">
                 <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-button size="small" type="primary" @click="getDeliverList">确定</el-button>
           </el-col>
         </el-row>
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6" style="height: 51px;">
+          <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
             <el-form-item label="预约日期" prop="date">
               <el-date-picker
                 v-model="mainForm.date"
@@ -40,28 +40,28 @@
           </el-col>
         </el-row>
         <el-row :gutter="20">
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="提货方式" prop="pickupWay">
               <el-radio-group v-model="mainForm.pickupWay">
                 <el-radio :label="item.dictCode" v-for="(item, index) in pickupWayList" :key="index">{{item.dictValue}}</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="提货人" prop="pickupMan">
               <el-select v-model="mainForm.pickupMan" placeholder="全部" style="width: 100%">
                 <el-option :label="item.takerName" :value="item.id" v-for="(item, index) in pickupManList" :key="index"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6" v-if="mainForm.pickupWay == '1'">
+          <el-col :xs="24" :sm="12" :lg="8" v-if="mainForm.pickupWay == '1'">
             <el-form-item label="提货车辆" prop="pickupCar">
               <el-select v-model="mainForm.pickupCar" placeholder="全部" style="width: 100%">
                 <el-option :label="item.carBrand" :value="item.id" v-for="(item, index) in pickupCarList" :key="index"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6" v-if="mainForm.pickupWay == '2'">
+          <el-col :xs="24" :sm="12" :lg="8" v-if="mainForm.pickupWay == '2'">
             <el-form-item label="物流公司" prop="company">
               <el-select v-model="mainForm.company" placeholder="全部" style="width: 100%">
                 <el-option :label="item.logisticsCompany" :value="item.logisticsNumber" v-for="(item, index) in companyList" :key="index"></el-option>
@@ -277,7 +277,7 @@ export default {
           });
           let params = {
             stockName: this.mainForm.warehouse,
-            pickTime: this.mainForm.date,
+            pickTime: this.mainForm.date + ' 00:00:00',
             pickStatus: Number(this.mainForm.timeSlot),
             pickType: Number(this.mainForm.pickupWay),
             takerId: this.mainForm.pickupMan,

+ 10 - 5
src/views/supply/pickup/pickup_list.vue

@@ -55,7 +55,7 @@
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="状态" min-width="160" show-overflow-tooltip>
+            <el-table-column align="center" label="状态" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.printNum ? '已打单':'未打单' }}
               </template>
@@ -63,7 +63,11 @@
             <el-table-column align="center" label="打单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="发货申请单号" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.pickTime | dateToDayFilter }}
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
@@ -80,10 +84,11 @@
                 {{ scope.row.orderTime | dateToDayFilter }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程编号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="提货总数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>

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

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

+ 11 - 7
src/views/supply/reserve/components/reserve_detail.vue

@@ -35,22 +35,26 @@
       <div class="table" style="margin-top: 20px">
         <el-table :data="detailData.reservedOrderItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售订单号" prop="orderId" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单日期" prop="orderTime" min-width="120" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.orderTime | dateToDayFilter}}
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="经销商编码" prop="customerId" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单位" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="预留数量" prop="reservedNum" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="订单数量" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="预留数量" prop="reservedNum" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="备注" prop="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="修改人" prop="updateBy" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="修改时间" prop="updateTime" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="修改时间" prop="updateTime" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="关闭人" prop="closureBy" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="关闭时间" prop="closureTime" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="关闭时间" prop="closureTime" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{scope.row.status | statusFilter}}

+ 5 - 4
src/views/supply/reserve/components/reserve_form.vue

@@ -56,10 +56,10 @@
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" @selection-change="tableSelectionChange">
         <el-table-column align="center" type="selection" width="55"></el-table-column>
-        <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+        <el-table-column align="center" label="销售订单号" prop="orderId" min-width="200" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="订单日期" prop="orderTime" min-width="120" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{scope.row.orderDate | dateToDayFilter}}
+            {{scope.row.orderTime | dateToDayFilter}}
           </template>
         </el-table-column>
         <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
@@ -67,7 +67,7 @@
         <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="规格型号" prop="specification" min-width="100" 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="reservedNum" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -409,6 +409,7 @@ export default {
 
     // 关闭 弹窗
     closeDialog() {
+      this.$refs.screenForm.resetFields();
       this.isShowDialog = false;
     },
 

+ 8 - 4
src/views/supply/reserve/reserve_list.vue

@@ -85,10 +85,14 @@
                 {{scope.row.status | statusFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="预留单号" prop="id" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="预留日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售订单号" prop="orderId" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="预留单号" prop="id" min-width="180" 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="orderId" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderTime" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.orderTime | dateToDayFilter}}
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>

+ 0 - 1
src/views/supply/retail/components/retail_form.vue

@@ -75,7 +75,6 @@
             <el-input v-model="scope.row.qty" size="small"></el-input>
           </template>
         </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="订单金额" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{scope.row.price * scope.row.qty}}

+ 33 - 81
src/views/supply/return/components/return_detail.vue

@@ -10,110 +10,62 @@
         <el-row :gutter="0">
           <el-col :span="8" class="item">
             <div class="label">退货单号</div>
-            <div class="value">{{detailData.retreatOrderNo}}</div>
+            <div class="value">{{detailData.id}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">退货日期</div>
-            <div class="value">{{detailData.retreatTime}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <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.salesType}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">订单号</div>
-            <div class="value">{{detailData.orderNo}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">发票号</div>
-            <div class="value">{{detailData.billNumber}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">客户名称</div>
-            <div class="value">{{detailData.clientName}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">销售部门</div>
-            <div class="value">{{detailData.salesDep}}</div>
+            <div class="label">制单人</div>
+            <div class="value">{{detailData.createBy}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">业务员</div>
-            <div class="value">{{detailData.salesman}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">工程编号</div>
-            <div class="value">{{detailData.projectNumber}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">币种</div>
-            <div class="value">{{detailData.currency}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">订单类型</div>
-            <div class="value">{{detailData.orderType}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">仓库</div>
-            <div class="value">{{detailData.stockName}}</div>
+            <div class="label">单据日期</div>
+            <div class="value">{{detailData.retreatTime}}</div>
           </el-col>
           <el-col :span="8" class="item">
-            <div class="label">发货单号</div>
-            <div class="value">{{detailData.invoiceOrderNo}}</div>
+            <div class="label">经销商编码</div>
+            <div class="value">{{detailData.customerNumber}}</div>
           </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">台账备注</div>
-            <div class="value">{{detailData.iedgerRemark}}</div>
+          <el-col :span="16" class="item">
+            <div class="label">经销商名称</div>
+            <div class="value">{{detailData.customerName}}</div>
           </el-col>
-          <el-col :xs="24" :sm="24" :lg="24" class="item">
+          <el-col :span="24" class="item">
             <div class="label">备注</div>
             <div class="value">{{detailData.remark}}</div>
           </el-col>
         </el-row>
       </div>
 
-      <div class="main-title">
-        <div class="title">货品信息</div>
-      </div>
-      <div class="table">
+      <div class="table" style="margin-top: 20px">
         <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="订单号" prop="orderNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货单号" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="仓库名称" prop="correspondName" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编号" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="主计量" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税单价" prop="includedPrice" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税金额" prop="includedPrice" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.number * scope.row.includedPrice }}
-            </template>
-          </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="price" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.number * scope.row.price }}
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="价税合计" prop="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率(%)" prop="rate" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="退补标记" prop="refund" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="厂产品代码" prop="factoryNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="num" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="含税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="含税金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="无税金额" prop="noTotalAmount" 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="tax" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣金额" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="退补标记" prop="status" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
     </div>
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+        <!-- <el-button  type="primary" icon="el-icon-printer" v-print="printObj">打 印</el-button> -->
+        <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
 

+ 298 - 75
src/views/supply/return/components/return_form.vue

@@ -5,100 +5,91 @@
     <div class="main-title">
       <div class="title">退货申请</div>
     </div>
-    <div class="diy-table-1">
-      <el-row :gutter="0">
-        <el-col :span="8" class="item">
-          <div class="label">发货申请单号</div>
-          <div class="value"><el-input v-model="mainForm.remark" placeholder="请输入发货申请单号"></el-input></div>
+    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="90px" size="small" label-position="right">
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="退货单号" prop="orderNum">
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
+          </el-form-item>
         </el-col>
-        <el-col :span="8" class="item">
-          <div class="label">申请日期</div>
-          <div class="value">2022123233435342</div>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" readonly></el-input>
+          </el-form-item>
         </el-col>
-        <el-col :span="8" class="item">
-          <div class="label">单据状态</div>
-          <div class="value">2022123233435342</div>
+        <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
+          <el-form-item label="单据日期" prop="date">
+            <el-date-picker
+              v-model="mainForm.date"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width: 100%;"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
         </el-col>
-        <el-col :span="8" class="item">
-          <div class="label">经销商编号</div>
-          <div class="value">万豪仓</div>
+        
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="经销商编号" prop="jxsNum">
+            <el-input v-model="mainForm.jxsNum" readonly></el-input>
+          </el-form-item>
         </el-col>
-        <el-col :span="8" class="item">
-          <div class="label">经销商名称</div>
-          <div class="value">2022123233435342</div>
+        <el-col :xs="24" :sm="12" :lg="16">
+          <el-form-item label="经销商名称" prop="jxsName">
+            <el-input v-model="mainForm.jxsName" readonly></el-input>
+          </el-form-item>
         </el-col>
-        <el-col :span="8" class="item">
-          <div class="label">仓库</div>
-          <div class="value">广州格匠机电有限公司</div>
-        </el-col>
-        <el-col :xs="24" :sm="24" :lg="24" class="item">
-          <div class="label">备注</div>
-          <div class="value">2022123233435342</div>
-        </el-col>
-        <el-col :span="8" class="item">
-          <div class="label">制单人</div>
-          <div class="value">广州格匠机电有限公司</div>
-        </el-col>
-        <el-col :span="16" class="item">
-          <div class="label">制表日期</div>
-          <div class="value">广州格匠机电有限公司</div>
+        <el-col :xs="24" :sm="24" :lg="24">
+          <el-form-item label="备注" prop="remark">
+            <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
+          </el-form-item>
         </el-col>
       </el-row>
-    </div>
+    </el-form>
 
     <div class="main-title">
-      <div class="title">货品信息</div>
+      <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
     </div>
     <div class="table">
-      <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
+      <el-table :data="goodsList" 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="salesType" min-width="160" show-overflow-tooltip>
+        <el-table-column align="center" label="发货单号" prop="id" min-width="200" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="发货仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="出货状态" prop="shipStatus" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{ scope.row.salesType }}
+            {{scope.row.shipStatus | chStatusFilter}}
           </template>
         </el-table-column>
-        <el-table-column align="center" label="发货仓库" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="销售订单号" prop="retreatTime" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="产品编码" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="规格型号" prop="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="number" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="是否退货" prop="isReturn" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.billStatus | kpStatusFilter}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否退货" prop="isReturn" min-width="100">
           <template slot-scope="scope">
             <el-checkbox v-model="scope.row.isReturn"></el-checkbox>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="可退数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="退货数量" prop="number" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="退货数量" prop="num" min-width="120" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.num" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.number" placeholder="请输入退货数量"></el-input>
+            <el-input v-model="scope.row.remark" size="small"></el-input>
           </template>
         </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">
-            <el-input v-model="mainForm.remark" placeholder="请输入退货说明"></el-input>
-          </div>
-        </el-col>
-      </el-row>
-    </div>
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
@@ -109,26 +100,119 @@
       </div>
     </div>
 
+    <el-dialog title="添加引用" :visible.sync="isShowDialog" width="80%">
+      <el-form ref="screenForm" :model="screenForm" size="small" label-position="left" label-width="70px">
+        <el-row :gutter="20">
+          <el-col :xs="12" :sm="12" :lg="12">
+            <el-form-item prop="orderNum" label="发货单号">
+              <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item label="">
+              <el-button size="small" @click="resetScreenForm">清空</el-button>
+              <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="table">
+        <el-table :data="tableGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="tableSelectionChange">
+          <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
+          <el-table-column align="center" label="发货单号" prop="id" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="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="shipStatus" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.shipStatus | chStatusFilter}}
+            </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 | kpStatusFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
+        <div class="pagination clearfix" style="margin-top: 10px">
+          <div class="fr">
+            <el-pagination
+              @current-change="handleTableCurrentChange"
+              :current-page="currentPage"
+              :page-size="10"
+              background
+              layout="prev, pager, next"
+              :total="listTotal">
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+      
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDialog">取 消</el-button>
+        <el-button type="primary" @click="submitAddGoods">确 定</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { getDetail } from "@/api/supply/return";
+import { getDetail, getGoodsList, addData } from "@/api/supply/return";
 
 export default {
   name: 'ReturnForm',
   componentName: 'ReturnForm',
   props: ['listItem'],
+  filters: {
+    chStatusFilter(val) {
+      const MAP = {
+        0: '未出货',
+        1: '已出货',
+      }
+      return MAP[val];
+    },
+    kpStatusFilter(val) {
+      const MAP = {
+        0: '未开票',
+        1: '已开票',
+      }
+      return MAP[val];
+    }
+  },
   data() {
     return {
       detailData: {},
       formLoading: false,
       mainForm: {
+        orderNum: '',
+        createMan: '',
+        date: '',
+        jxsNum: '',
+        jxsName: '',
         remark: '',
       },
-      goodsList: [{
-        goodsId: 1,
-      }]
+      mainFormRules: {
+        date: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+      },
+      goodsList: [],
+
+      isShowDialog: false,
+      screenForm: {
+        orderNum: '',
+      },
+      currentPage: 1,
+      listTotal: 0,
+      
+      tableGoodsList: [],
+      tableSelection: [],
     }
   },
 
@@ -145,7 +229,13 @@ export default {
   },
 
   created() {
-    this.getDetail();
+    if(this.listItem) {
+      this.getDetail();
+    }else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
+      this.mainForm.jxsName = JSON.parse(localStorage.getItem("supply_user")).customerName;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+    }
   },
 
   methods: {
@@ -161,8 +251,141 @@ export default {
       })
     },
 
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.currentPage,
+        pageSize: 10,
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        id: this.screenForm.orderNum,
+      }).then(res => {
+        res.data.records.forEach(item => {
+          item.num = '';
+          item.remark = '';
+          item.isReturn = true;
+        });
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = res.data.records;
+        for(let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for(let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if(newItem.materialId === oldItem.materialId){
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+
+        this.tableGoodsList = newGoodsList;
+        this.listTotal = res.data.total;
+      })
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 点击 选择商品
+    openDialog() {
+      this.isShowDialog = true;
+      if(this.screenForm.orderNum) {
+        this.getGoodsList();
+      }
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      if(!this.screenForm.orderNum) {
+        return this.$errorMsg('请填写发货申请单号');
+      }
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.tableGoodsList = [];
+      // this.getGoodsList();
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      if(this.tableSelection.length > 0) {
+        return this.$errorMsg('已选择产品不可切换');
+      }
+      this.currentPage = val;
+      this.getGoodsList();
+    },
+
+    // 关闭 弹窗
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
+    // 列表选择
+    tableSelectionChange(val) {
+      this.tableSelection = val;
+    },
+
+    // 确定 添加产品
+    submitAddGoods() {
+      this.goodsList = this.goodsList.concat(this.tableSelection);
+      this.isShowDialog = false;
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+    },
+
     clickSubmitForm() {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          if(this.goodsList.length < 1) {
+            return this.$errorMsg('请添加引用');
+          }
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].num) {
+              this.$errorMsg('请输入退货数量');
+              return;
+            }
+            if(this.goodsList[i].num > this.goodsList[i].refundableQty) {
+              this.$errorMsg('退货数量不能大于可退数量');
+              return;
+            }
+          }
+
+          let goodsList = this.goodsList.filter(item => {
+            return item.isReturn;
+          })
+          goodsList = goodsList.map(item => {
+            return {
+              invoiceOrderId: item.invoiceOrderId,
+              num: item.num,
+              remark: item.remark
+            }
+          })
+          let params = {
+            retreatTime: this.mainForm.date + ' 00:00:00',
+            remark: this.mainForm.remark,
+            retreatDocumentOrder: goodsList,
+          }
+          addData(params).then(res => {
+            this.$successMsg('添加成功');
+            this.goBack();
+            this.$parent.getList();
+          })
 
+        }
+      })
     },
   }
 }

+ 30 - 33
src/views/supply/return/return_list.vue

@@ -21,8 +21,8 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="存货名称" prop="chName">
-                <el-input v-model="screenForm.chName" placeholder="请输入存货名称"></el-input>
+              <el-form-item label="产品名称" prop="goodsName">
+                <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -56,31 +56,29 @@
 
       <div class="mymain-container">
         <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">退货</el-button>
+          </div>
           <div class="fr">
-            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+            <ExportButton :exUrl="'retreat/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="退换单号" prop="retreatOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="退换单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="退货日期" prop="retreatTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="仓库" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="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="productName" 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="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="无税金额" prop="price" min-width="100" show-overflow-tooltip>
-              <template slot-scope="scope">
-                {{ scope.row.number * scope.row.price }}
-              </template>
-            </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="number" 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="noTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="num" min-width="100" 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">
+            <el-table-column align="center" label="操作" width="100" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toDetail('detail', scope.row)">详情</el-button>
-                <el-button type="text" @click="toDetail('form', scope.row)">退货</el-button>
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -108,7 +106,6 @@
 </template>
 
 <script>
-import { COMMON_SELECT } from '@/utils/select_data'
 import { getList } from "@/api/supply/return";
 import ReturnDetail from "@/views/supply/return/components/return_detail";
 import ReturnForm from "@/views/supply/return/components/return_form";
@@ -129,13 +126,14 @@ export default {
         orderNum: '',
         jxsNum: '',
         jxsName: '',
-        chName: '',
+        goodsName: '',
         model: '',
         date: '',
       },
 
-      jumpType: '',
       queryItem: {},
+      isShowDetail: false,
+      isShowForm: false,
     }
   },
 
@@ -145,19 +143,12 @@ export default {
         retreatOrderNo: this.screenForm.orderNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
-        productName: this.screenForm.chName,
+        materialName: this.screenForm.goodsName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 1, // 1:退货单,2:电商退货单
       }
     },
-    isShowDetail() {
-      return this.queryItem.hasOwnProperty('id') && this.jumpType == 'detail';
-    },
-    isShowForm() {
-      return this.queryItem.hasOwnProperty('id') && this.jumpType == 'form';
-    },
   },
 
   created() {
@@ -184,11 +175,10 @@ export default {
         retreatOrderNo: this.screenForm.orderNum,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
-        productName: this.screenForm.chName,
+        materialName: this.screenForm.goodsName,
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 1, // 1:退货单,2:电商退货单
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;
@@ -224,14 +214,21 @@ export default {
     },
 
     // 进入详情
-    toDetail(type, item) {
-      this.jumpType = type;
+    toDetail(item) {
+      this.queryItem = item;
+      this.isShowDetail = true;
+    },
+    
+    // 进入表单
+    toForm(item) {
       this.queryItem = item;
+      this.isShowForm = true;
     },
 
     backList() {
-      this.jumpType = '';
       this.queryItem = {};
+      this.isShowForm = false;
+      this.isShowDetail = false;
     },
   }
 }