소스 검색

Merge branch 'develop_yh22' of jianguan-web/jg-ocs-html into pre-release

李磊 1 년 전
부모
커밋
1b26a55c8b
51개의 변경된 파일2337개의 추가작업 그리고 384개의 파일을 삭제
  1. BIN
      public/templ/收货产品导入模板.xlsx
  2. BIN
      public/templ/收货产品(不良品)模板.xlsx
  3. BIN
      public/templ/收货产品(良品)模板.xlsx
  4. BIN
      public/templ/销售退货(不良品)产品明细模板.xlsx
  5. BIN
      public/templ/销售退货(良品)产品明细模板.xlsx
  6. 12 0
      src/api/allocateBill.js
  7. 12 0
      src/api/sales.js
  8. 12 0
      src/api/salesReturn.js
  9. 8 0
      src/api/salesReturnDetail.js
  10. 75 0
      src/config/router.config.js
  11. 16 17
      src/store/modules/app.js
  12. 13 2
      src/views/Home.vue
  13. 384 0
      src/views/allocationManagement/allocationList/list.vue
  14. 15 15
      src/views/common/area.js
  15. 3 3
      src/views/common/chooseWarehouse.js
  16. 42 40
      src/views/common/returnReason.js
  17. 48 23
      src/views/reportData/returnSlipReport/list.vue
  18. 45 19
      src/views/reportData/salesReturnDetailReport/list.vue
  19. 37 11
      src/views/reportData/salesReturnsReport/list.vue
  20. 4 4
      src/views/salesManagement/examineVerify/list.vue
  21. 4 0
      src/views/salesManagement/pushOrderManagement/detail.vue
  22. 2 2
      src/views/salesManagement/pushOrderManagement/exportExcelModal.vue
  23. 2 2
      src/views/salesManagement/pushOrderManagement/list.vue
  24. 14 4
      src/views/salesManagement/pushOrderManagement/sendTypeModal.vue
  25. 446 0
      src/views/salesManagement/salesList/list.vue
  26. 37 6
      src/views/salesManagement/salesOrderWarehouse/detail.vue
  27. 53 22
      src/views/salesManagement/salesOrderWarehouse/list.vue
  28. 146 0
      src/views/salesManagement/salesOrderWarehouse/printModal.vue
  29. 6 4
      src/views/salesManagement/sendOutOrder/detailModal.vue
  30. 2 2
      src/views/salesManagement/sendOutOrder/list.vue
  31. 4 0
      src/views/salesManagement/stockPrint/list.vue
  32. 11 2
      src/views/salesManagement/stockPrint/sendTypeModal.vue
  33. 94 20
      src/views/salesReturnManagement/custConfirm/list.vue
  34. 7 3
      src/views/salesReturnManagement/custConfirm/setPriceModal.vue
  35. 66 19
      src/views/salesReturnManagement/receiveCheck/checking.vue
  36. 7 6
      src/views/salesReturnManagement/receiveCheck/chooseImportModal.vue
  37. 22 5
      src/views/salesReturnManagement/receiveCheck/chooseProductsModal.vue
  38. 9 3
      src/views/salesReturnManagement/receiveCheck/importGuideModal.vue
  39. 19 6
      src/views/salesReturnManagement/receiveCheck/list.vue
  40. 55 25
      src/views/salesReturnManagement/receiveCheck/receiving.vue
  41. 7 6
      src/views/salesReturnManagement/returnConfirmation/detailModal.vue
  42. 28 1
      src/views/salesReturnManagement/returnConfirmation/list.vue
  43. 360 0
      src/views/salesReturnManagement/returnSchedule/list.vue
  44. 24 8
      src/views/salesReturnManagement/salesReturn/chooseCustomModal.vue
  45. 4 2
      src/views/salesReturnManagement/salesReturn/chooseImportModal.vue
  46. 19 9
      src/views/salesReturnManagement/salesReturn/detail.vue
  47. 15 26
      src/views/salesReturnManagement/salesReturn/importGuideModal.vue
  48. 46 18
      src/views/salesReturnManagement/salesReturn/list.vue
  49. 23 7
      src/views/salesReturnManagement/salesReturn/queryPart.vue
  50. 77 40
      src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue
  51. 2 2
      vue.config.js

BIN
public/templ/收货产品导入模板.xlsx


BIN
public/templ/收货产品(不良品)模板.xlsx


BIN
public/templ/收货产品(良品)模板.xlsx


BIN
public/templ/销售退货(不良品)产品明细模板.xlsx


BIN
public/templ/销售退货(良品)产品明细模板.xlsx


+ 12 - 0
src/api/allocateBill.js

@@ -211,3 +211,15 @@ export const updatePrintState = params => {
     method: 'post'
   })
 }
+
+// 调拨一览表  列表分页
+export const queryOverviewPage = (params) => {
+  const url = `/allocateBill/queryOverviewPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 12 - 0
src/api/sales.js

@@ -290,3 +290,15 @@ export const exportForWarehouse = params => {
     responseType: 'blob'
   })
 }
+
+// 销售一览表 列表
+export const salesOverviewQueryPage = (params) => {
+  const url = `/salesOverview/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 12 - 0
src/api/salesReturn.js

@@ -279,3 +279,15 @@ export const queryLastFinishDingUser = (params) => {
     method: 'post'
   })
 }
+
+// 销售退货一览表   列表
+export const queryOverviewPage = (params) => {
+  const url = `/salesReturn/queryOverviewPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 8 - 0
src/api/salesReturnDetail.js

@@ -63,6 +63,14 @@ export const salesReturnDetailSetReason = (params) => {
     method: 'post'
   })
 }
+// 生成新的销退单
+export const salesReturnAgainCreate = (params) => {
+  return axios({
+    url: '/salesReturn/againCreate',
+    data: params,
+    method: 'post'
+  })
+}
 // 修改销售退货明细实收数量
 export const salesReturnDetailUpdateReceiveQty = (params) => {
   return axios({

+ 75 - 0
src/config/router.config.js

@@ -558,6 +558,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/salesManagement/salesList',
+            redirect: '/salesManagement/salesList/list',
+            name: 'salesList',
+            component: BlankLayout,
+            meta: {
+              title: '销售一览表',
+              icon: 'file-protect',
+              permission: 'M_salesList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'salesMainList',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesList/list.vue'),
+                meta: {
+                  title: '销售一览表',
+                  icon: 'file-protect',
+                  hidden: true,
+                  permission: 'M_salesList'
+                }
+              }
+            ]
           }
         ]
       },
@@ -787,6 +812,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/salesReturnManagement/returnSchedule',
+            redirect: '/salesReturnManagement/returnSchedule/list',
+            name: 'returnSchedule',
+            component: BlankLayout,
+            meta: {
+              title: '退货一览表',
+              icon: 'vertical-align-top',
+              permission: 'M_returnScheduleList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'returnScheduleList',
+                component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/returnSchedule/list.vue'),
+                meta: {
+                  title: '退货一览表',
+                  icon: 'vertical-align-top',
+                  hidden: true,
+                  permission: 'M_returnScheduleList'
+                }
+              }
+            ]
           }
         ]
       },
@@ -1609,6 +1659,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/allocationManagement/allocationList',
+            redirect: '/allocationManagement/allocationList/list',
+            name: 'allocationList',
+            component: BlankLayout,
+            meta: {
+              title: '调拨一览表',
+              icon: 'vertical-align-top',
+              permission: 'M_allocationList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'allocationMainList',
+                component: () => import(/* webpackChunkName: "allocationManagement" */ '@/views/allocationManagement/allocationList/list.vue'),
+                meta: {
+                  title: '调拨一览表',
+                  icon: 'vertical-align-top',
+                  hidden: true,
+                  permission: 'M_allocationList'
+                }
+              }
+            ]
           }
         ]
       },

+ 16 - 17
src/store/modules/app.js

@@ -34,7 +34,8 @@ const app = {
     loadingStatus: false,
     closeTabPages: [], // 已关闭的页面
     employeeList: [], // 申请人列表
-    returnReason: [], // 申请退货原因列表
+    defectiveReturnReason: [], // 不良品申请退货列表
+    goodReturnReason: [], // 良品申请退货列表
     tempBillOfData: null, // 临时存储收货单数据
     authMenusList: [], // 权限菜单数据
     priceAuthOptions: [], // 价格权限选项
@@ -102,8 +103,8 @@ const app = {
     SET_employeeList: (state, val) => {
       state.employeeList = val
     },
-    SET_returnReason: (state, val) => {
-      state.returnReason = val
+    SET_returnReason:(state, obj) => {
+      state[obj.key] = obj.val
     },
     SET_showPdfPrint: (state, val) => {
       state.showPdfPrintView = val
@@ -164,20 +165,18 @@ const app = {
         }
       })
     },
-    getReturnReasonData ({ commit }, code) {
-      getLookUpData({
-        pageNo: 1,
-        pageSize: 1000,
-        lookupCode: code,
-        isEnable: 1
-      }).then(res => {
-        if (res.status == 200) {
-          commit('SET_returnReason', res.data.list)
-        } else {
-          commit('SET_returnReason', [])
-        }
-      })
-    }
+    getLookUpDataByCode({ commit }, params) {
+        getLookUpData({
+          pageNo: 1,
+          pageSize: 1000,
+          lookupCode: params.code,
+          isEnable: params.isEnable
+        }).then(res => {
+          if (res.status == 200) {
+            commit('SET_returnReason', {key: params.key, val: res.data.list})
+          }
+        })
+    },
   }
 }
 

+ 13 - 2
src/views/Home.vue

@@ -56,7 +56,7 @@ export default {
   created () {
   },
   methods: {
-    ...mapActions(['GetEmployeeList', 'getReturnReasonData']),
+    ...mapActions(['GetEmployeeList', 'getLookUpDataByCode']),
     // 获取菜单树列表
     getYyMenuList () {
       getYyMenuList().then(res => {
@@ -107,7 +107,18 @@ export default {
       } else {
         vm.openResetPwd = true
       }
-      vm.getReturnReasonData('RETURN_REASON')
+      // 退货原因列表
+        vm.getLookUpDataByCode({
+          code: 'GOOD_PRODUCT_RETURN',
+          key: 'goodReturnReason',
+          isEnable: 1
+        })
+        vm.getLookUpDataByCode({
+          code: 'DEFECTIVE_PRODUCT_RETURN',
+          key: 'defectiveReturnReason',
+          isEnable: 1
+        })
+      // 菜单数据
       vm.getYyMenuList()
       vm.$store.state.app.priceAuthOptions = [
         { label: '售价', value: 'salesPrice' },

+ 384 - 0
src/views/allocationManagement/allocationList/list.vue

@@ -0,0 +1,384 @@
+<template>
+  <a-card size="small" :bordered="false" class="pushOrder-wrap">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper">
+      <a-form-model
+        id="allocateBillList-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :rules="rules"
+        :model="queryParam"
+        @keyup.enter.native="handleSearch">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="创建时间" prop="time">
+              <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="调往对象">
+              <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="费用/调拨类型">
+              <AllocateType id="allocateBillList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
+            </a-form-model-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="收货客户名称">
+                <dealerSearchList ref="receiverSn" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="state"
+                  id="allocateBillList-state"
+                  code="ALLOCATE_STATUS2"
+                  placeholder="请选择业务状态"
+                  allowClear
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="调拨单号">
+                <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="调出仓库">
+                <warehouse
+                  v-model="queryParam.warehouseSn"
+                  id="allocateBillList-warehouseSn"
+                  placeholder="请选择调出仓库"
+                />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="打印状态">
+                <v-select
+                  v-model="queryParam.printState"
+                  ref="printState"
+                  id="allocateBillList-printState"
+                  code="PRINT_STATUS"
+                  placeholder="请选择打印状态"
+                  allowClear
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="对单状态">
+                <v-select
+                  v-model="queryParam.checkStatus"
+                  ref="checkStatus"
+                  id="allocateBillList-checkStatus"
+                  code="CHECK_STATUS"
+                  placeholder="请选择对单状态"
+                  allowClear
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:tableHeight, x:1890 }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 起止时间 -->
+        <template slot="promoDate" slot-scope="text, record">
+          <span v-if="record.promoStartDate || record.promoEndDate">{{ record.promoStartDate }} ~ {{ record.promoEndDate }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 调拨单号 -->
+        <template slot="allocateNo" slot-scope="text, record">
+          <span class="link-bule" @click="handleDetail(record,2)">{{ record.allocateNo }}</span>
+        </template>
+        <!-- 发货单号  -->
+        <template slot="sendBillNo" slot-scope="text, record">
+          <span v-if="record.sendBill&&record.sendBill.sendBillNo" class="link-bule" @click="handleDetail(record,1)">{{ record.sendBill.sendBillNo }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 调拨类型 -->
+        <template slot="allocateType" slot-scope="text, record">
+          <div>
+            <span v-if="record.allocateSortName">{{ record.allocateSortName }}</span>
+            <span v-if="record.allocateSortName&&record.allocateTypeName">/</span>
+            <span v-if="record.allocateTypeName">{{ record.allocateTypeName }}</span>
+          </div>
+        </template>
+      </s-table>
+      <!-- 查看详情 -->
+      <commonModal
+        modalTit="调拨单详情"
+        bodyPadding="10px"
+        width="70%"
+        :showFooter="false"
+        :openModal="showDetailModal"
+        @cancel="showDetailModal = false">
+        <allocationDetailModal v-if="showDetailModal" :outBizSn="bizSn" />
+      </commonModal>
+      <!-- 发货单详情 -->
+      <detailModal v-drag ref="detailModal" :openModal="showTipModal" @cancel="showTipModal=false"></detailModal>
+    </a-spin>
+  </a-card>
+  </div></template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { STable, VSelect } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
+import detailModal from '@/views/salesManagement/sendOutOrder/detailModal.vue'
+import AllocateType from '@/views/common/allocateType.js'
+import dealerSearchList from '@/views/common/dealerSearchList.vue'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import { queryOverviewPage } from '@/api/allocateBill'
+import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
+export default {
+  name: 'PushOrderManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, allocationDetailModal, AllocateType, warehouse, dealerSearchList, rangeDate, commonModal, detailModal },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      showDetailModal: false,
+      showTipModal: false,
+      bizSn: null,
+      tableHeight: 0,
+      allocateTypeVal: [],
+
+      // 查询参数
+      queryParam: { //  查询条件
+        time: [
+          moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+          moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        ],
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        targetName: '', //  调往对象
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类型1
+        allocateTypeSn: undefined, //  调拨类型2
+        state: undefined, //  业务状态
+        allocateNo: '', //  调拨单号
+        receiverSn: undefined,
+        checkStatus: undefined,
+        printState: undefined,
+        warehouseSn: undefined
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return queryOverviewPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '创建时间', dataIndex: 'createDate', width: '130px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '起止时间', scopedSlots: { customRender: 'promoDate' }, align: 'center', width: '150px', fixed: 'left' },
+        { title: '调往对象', dataIndex: 'targetName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '省份', dataIndex: 'provinceName', align: 'center', width: '80px', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '120px', fixed: 'left' },
+        { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '120px', align: 'center' },
+        { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总成本', dataIndex: 'totalCost', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '总售价', dataIndex: 'totalPrice', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '总数量', dataIndex: 'totalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '费用类型', dataIndex: 'costTypeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', scopedSlots: { customRender: 'allocateType' }, width: '100px', align: 'center' },
+        { title: '调出仓库', dataIndex: 'warehouseName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货创建时间', dataIndex: 'sendBill.createDate', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '发货状态', dataIndex: 'sendBill.sendFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货编号', dataIndex: 'sendNo', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '托运日期', dataIndex: 'sendBill.sendDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货人', dataIndex: 'sendBill.customerCacateName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '物流电话', dataIndex: 'sendBill.transportTele', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流单号', dataIndex: 'sendBill.transportNo', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '总件数', dataIndex: 'sendBill.totalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '收货状态', dataIndex: 'sendBill.receiveFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'sendBill.receiveDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流情况', dataIndex: 'sendBill.transportStateDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'sendBill.transportRemark', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择创建时间')
+          return false
+        }
+      })
+    },
+    // 调拨详情
+    handleDetail (row, typeNum) {
+      if (typeNum == 2) {
+        this.bizSn = row.allocateSn
+        this.showDetailModal = true
+      } else {
+        this.showTipModal = true
+        this.$refs.detailModal.getDetail(row.sendBill, typeNum, '发货单详情')
+      }
+    },
+    //  时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    // 调拨类型
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
+    // 收货客户名称
+    custChange (val) {
+      if (val.row) {
+        this.queryParam.receiverSn = val.row.dealerSn
+        this.queryParam.receiverName = undefined
+      } else {
+        this.queryParam.receiverSn = undefined
+        this.queryParam.receiverName = val.key
+      }
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.time = [
+        getDate.getThreeMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.targetName = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
+      this.queryParam.allocateTypeSn = undefined
+      this.queryParam.state = undefined
+      this.queryParam.checkStatus = undefined
+      this.queryParam.printState = undefined
+      this.queryParam.allocateNo = ''
+      this.queryParam.receiverName = ''
+      this.queryParam.receiverSn = undefined
+      this.queryParam.warehouseSn = undefined
+      this.allocateTypeVal = []
+      this.$refs.receiverSn.resetForm()
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      _this.resetSearchForm()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 210
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .pushOrder-wrap{
+    .sTable{
+      margin-top: 10px;
+    }
+  }
+</style>

+ 15 - 15
src/views/common/area.js

@@ -38,25 +38,25 @@ const Area = {
       default: ''
     }
   },
-  data() {
+  data () {
     return {
       defaultVal: this.value,
       list: []
-    };
+    }
   },
   watch: {
-    value(newValue, oldValue) {
+    value (newValue, oldValue) {
       console.log(newValue)
       this.defaultVal = newValue
     },
-    parentId(newValue,oldValue){
-      if(this.leve != 'province'&&newValue){
+    parentId (newValue, oldValue) {
+      if (this.leve != 'province' && newValue) {
         this.getList(this.leve)
       }
     }
   },
-  mounted() {
-    if(this.leve == 'province'){
+  mounted () {
+    if (this.leve == 'province') {
       this.getList(this.leve)
     }
   },
@@ -66,12 +66,12 @@ const Area = {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
-    handleChange(value) {
+    handleChange (value) {
       console.log(value)
-      this.defaultVal = value;
+      this.defaultVal = value
       const item = this.list.find(item => item[this.defValKey] == value)
-      this.$emit('change', this.value, item);
-      this.$emit('input', value);
+      this.$emit('change', value, item)
+      this.$emit('input', value)
     },
     //  省/市/区
     getList (leve) {
@@ -96,10 +96,10 @@ const Area = {
         }
       })
     },
-    clearData(){
+    clearData () {
       this.list = []
     }
-  },
-};
+  }
+}
 
-export default Area
+export default Area

+ 3 - 3
src/views/common/chooseWarehouse.js

@@ -59,7 +59,7 @@ const warehouse = {
   mounted () {
     if (this.isPermission) {
       this.$store.state.app.defWarehouse = null
-      this.$store.state.app.isWarehouse = false
+      this.$store.state.app.isWarehouse = true
     }
     this.getWarehouse()
   },
@@ -86,7 +86,7 @@ const warehouse = {
         if (res.status == 200) {
           // 有权限控制的
           if (this.isPermission) {
-            this.$store.state.app.isWarehouse = res.data && res.data.length > 1
+            this.$store.state.app.isWarehouse = true
             this.$store.state.app.defWarehouse = res.data && res.data[0]
           }
           this.warehouseData = res.data || []
@@ -102,7 +102,7 @@ const warehouse = {
           }
         } else {
           if (this.isPermission) {
-            this.$store.state.app.isWarehouse = false
+            this.$store.state.app.isWarehouse = true
             this.$store.state.app.defWarehouse = null
           }
           this.warehouseData = []

+ 42 - 40
src/views/common/returnReason.js

@@ -1,32 +1,26 @@
-import { removeEmptyStr } from '@/libs/tools'
 const ReturnReason = {
   template: `
-        <a-select
-            allowClear
-            :size="size"
-            mode="combobox"
-            :value="defaultVal"
-            show-search
-            :placeholder="placeholder"
-            option-filter-prop="children"
-            style="width: 100%"
-            :filter-option="filterOption"
-            :dropdownMatchSelectWidth="false"
-            @change="onChange"
-            @blur="onBlur"
-            @focus="open=true"
-            @select="open=false"
-            :open="open"
-          >
-            <a-select-option v-for="item in list" :key="item.code" :value="item.dispName">
-              {{item.dispName}}
-            </a-select-option>
-          </a-select>
+      <a-select
+        :placeholder="placeholder"
+        style="width:100%"
+        :size="size"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        @change="handleChange"
+        option-filter-prop="children"
+        :dropdownMatchSelectWidth="false"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in list" :key="item.code" :value="item.code">
+          {{item.dispName}}
+        </a-select-option>
+      </a-select>
     `,
   props: {
     value: {
       type: String,
-      defatut: ''
+      default: undefined
     },
     id: {
       type: String,
@@ -34,27 +28,41 @@ const ReturnReason = {
     },
     placeholder: {
       type: String,
-      default: '请输入退货原因(最多50字符)'
+      default: '请选择退货原因'
     },
     size: {
       type: String,
       default: 'small'
+    },
+    goodFlag: {
+      type: String,
+      default: ''
     }
   },
   data() {
     return {
       defaultVal: this.value,
-      open: false,
       list: []
     };
   },
-  mounted() {
-    this.list = this.$store.state.app.returnReason
+  created() {
+    // 不良品
+    if(this.goodFlag == 'DEFECTIVE_PRODUCT_RETURN'){
+      this.list = this.$store.state.app.defectiveReturnReason
+    }
+    // 良品
+    if(this.goodFlag == 'GOOD_PRODUCT_RETURN'){
+      this.list = this.$store.state.app.goodReturnReason
+    }
+    // 全部
+    if(!this.goodFlag){
+      this.list = [...this.$store.state.app.defectiveReturnReason, ...this.$store.state.app.goodReturnReason]
+    }
   },
   watch: {
     value(newValue, oldValue) {
-      this.defaultVal = removeEmptyStr(newValue)
-    },
+      this.defaultVal = newValue || undefined
+    }
   },
   methods: {
     filterOption(input, option) {
@@ -62,17 +70,11 @@ const ReturnReason = {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       );
     },
-    onChange(value) {
-      console.log(value,'----')
-      this.open = true;
-      const ret = value?value.substr(0,50):'';
-      this.defaultVal = removeEmptyStr(ret);
-      this.$emit('input', this.defaultVal);
-      this.$emit('change', this.defaultVal);
-    },
-    onBlur(value){
-      this.open = false;
-      this.$emit('blur', removeEmptyStr(value));
+    handleChange(value) {
+      this.defaultVal = value;
+      const row = this.list.find(item => item.code == value)
+      this.$emit('change', value, row);
+      this.$emit('input', value);
     }
   },
 };

+ 48 - 23
src/views/reportData/returnSlipReport/list.vue

@@ -33,13 +33,13 @@
                   allowClear></v-select>
               </a-form-model-item>
             </a-col>
-            
+
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-              <a-form-item label="退货单号">
-                <a-input id="returnSlipReportList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
-              </a-form-item>
-            </a-col>
+                <a-form-item label="退货单号">
+                  <a-input id="returnSlipReportList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
                   <subarea id="returnSlipReportList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
@@ -47,12 +47,33 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                    <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                    <AreaList id="returnSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="returnSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类别" prop="goodFlag">
+                  <v-select
+                    v-model="queryParam.goodFlag"
+                    ref="goodFlag"
+                    id="returnSchedule-goodFlag"
+                    code="GOOD_FLAG"
+                    placeholder="请选择退货类别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类型">
+                  <v-select
+                    v-model="queryParam.salesReturnType"
+                    id="departUser-salesReturnType"
+                    code="SALES_RETURN_TYPE"
+                    placeholder="请选择退货类型"
+                    allowClear></v-select>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -82,7 +103,7 @@
         ref="table"
         size="small"
         :rowKey="(record) => record.no"
-        rowKeyName = 'no'
+        rowKeyName="no"
         :columns="columns"
         :data="loadData"
         :scroll="{ x: tableWidth, y: tableHeight }"
@@ -148,12 +169,14 @@ export default {
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined,
           bizUserSn: undefined
         },
         dealerLevel: undefined,
+        salesReturnType: undefined,
+        goodFlag: undefined,
         salesReturnBillNo: ''
       },
       rules: {
@@ -190,12 +213,12 @@ export default {
       },
       totalData: null,
       columns: [],
-      countLabel:[],
-      countBrandLabel:[],
+      countLabel: [],
+      countBrandLabel: [],
       tableWidth: 0
     }
   },
-  
+
   methods: {
     //  导出
     handleExport () {
@@ -233,7 +256,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          _this.$message.error("请选择退货日期")
+          _this.$message.error('请选择退货日期')
           return false
         }
       })
@@ -251,7 +274,7 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -272,6 +295,8 @@ export default {
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.subareaArea.bizUserSn = undefined
       this.queryParam.dealerLevel = undefined
+      this.queryParam.salesReturnType = undefined
+      this.queryParam.goodFlag = undefined
       this.queryParam.salesReturnBillNo = ''
       this.$refs.custList.resetForm()
       this.totalData = null
@@ -282,34 +307,34 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    areaChange(val){
+    areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
     // 获取表头
-    async getTableTitle(){
+    async getTableTitle () {
       const _this = this
       const tableTitle = await salesReportReturnTitle().then(res => res.data)
       this.columns = tableTitle.list
-      this.countLabel = tableTitle.count.filter(item => item.title.indexOf('品牌')<0)
-      this.countBrandLabel = tableTitle.count.filter(item => item.title.indexOf('品牌')>=0)
+      this.countLabel = tableTitle.count.filter(item => item.title.indexOf('品牌') < 0)
+      this.countBrandLabel = tableTitle.count.filter(item => item.title.indexOf('品牌') >= 0)
       this.columns.map(item => {
-        let mw = 40
-        if(item.customRender == 'amount'){
+        let mw = 20
+        if (item.customRender == 'amount') {
           mw = 15
           item.customRender = function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-        }else{
+        } else {
           item.customRender = function (text) { return text || '--' }
         }
         const w = item.title.length * mw
-        const tw = w <= 80 ? mw*5 : w
+        const tw = w <= 80 ? mw * 5 : w
         item.width = tw + 'px'
         this.tableWidth = this.tableWidth + tw
       })
       this.resetSearchForm()
     },
-    pageInit(){
+    pageInit () {
       this.getTableTitle()
     }
   },

+ 45 - 19
src/views/reportData/salesReturnDetailReport/list.vue

@@ -17,22 +17,22 @@
                 <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-model-item label="退货单号">
                 <a-input id="salesReturnDetailList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-model-item label="产品编码">
                 <a-input id="salesReturnDetailList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-model-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="salesReturnDetailList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品名称">
-                  <a-input id="salesReturnDetailList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-                </a-form-model-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="客户名称">
                   <a-input id="salesReturnDetailList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客户名称"/>
@@ -76,12 +76,33 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                    <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                    <AreaList id="salesReturnDetailList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="salesReturnDetailList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类别" prop="goodFlag">
+                  <v-select
+                    v-model="queryParam.goodFlag"
+                    ref="goodFlag"
+                    id="returnSchedule-goodFlag"
+                    code="GOOD_FLAG"
+                    placeholder="请选择退货类别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类型">
+                  <v-select
+                    v-model="queryParam.salesReturnType"
+                    id="departUser-salesReturnType"
+                    code="SALES_RETURN_TYPE"
+                    placeholder="请选择退货类型"
+                    allowClear></v-select>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -180,13 +201,15 @@ export default {
         productName: '',
         dealerName: '',
         dealerLevel: undefined,
+        goodFlag: undefined,
+        salesReturnType: undefined,
         productBrandTypeSn: undefined,
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         warehouseSn: undefined,
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined,
           bizUserSn: undefined
@@ -239,7 +262,8 @@ export default {
         { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
@@ -251,7 +275,7 @@ export default {
         { title: '仓库实收数量', dataIndex: 'receiveQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'badQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'backStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
         // { title: '退货开单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -271,17 +295,17 @@ export default {
         arr.push({ title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      } 
-      if (this.$hasPermissions('M_salesReturnDetailReportList_cityPrice')) { 
+      }
+      if (this.$hasPermissions('M_salesReturnDetailReportList_cityPrice')) {
         arr.push({ title: '市级价金额', dataIndex: 'totalWholesalePrice2', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) {   
+      if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) {
         arr.push({ title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '再入库单价', dataIndex: 'cost', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       arr.push({ title: '正常退货数量', dataIndex: 'normalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) {  //  价权限
+      if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) { //  价权限
         arr.push({ title: '正常退货金额', dataIndex: 'totalNormalPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -310,7 +334,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          _this.$message.error("请选择退货完成日期")
+          _this.$message.error('请选择退货完成日期')
           return false
         }
       })
@@ -354,7 +378,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -384,6 +408,8 @@ export default {
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
       this.queryParam.warehouseSn = undefined
+      this.queryParam.goodFlag = undefined
+      this.queryParam.salesReturnType = undefined
       this.productType = []
       if (this.advanced) {
         this.$refs.subarea.clearData()
@@ -393,7 +419,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    areaChange(val){
+    areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
       this.queryParam.dealerCountySn = val[2] ? val[2] : ''

+ 37 - 11
src/views/reportData/salesReturnsReport/list.vue

@@ -28,12 +28,12 @@
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="5" :sm="24">
+              <a-col :md="7" :sm="24">
                 <a-form-model-item label="客户名称">
                   <dealerSubareaScopeList ref="custList" id="salesReturnsReportList-dealerSn" @change="custChange" />
                 </a-form-model-item>
               </a-col>
-              <a-col :md="5" :sm="24">
+              <a-col :md="7" :sm="24">
                 <a-form-model-item label="客户级别">
                   <v-select
                     v-model="queryParam.dealerLevel"
@@ -46,16 +46,37 @@
               </a-col>
               <a-col :md="5" :sm="24">
                 <a-form-model-item label="地区">
-                    <AreaList id="salesReturnsReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="salesReturnsReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="5" :sm="24">
+                <a-form-model-item label="退货类型">
+                  <v-select
+                    v-model="queryParam.salesReturnType"
+                    id="departUser-salesReturnType"
+                    code="SALES_RETURN_TYPE"
+                    placeholder="请选择退货类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="7" :sm="24">
                 <a-form-model-item label="退货仓库">
                   <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
+              <a-col :md="7" :sm="24">
+                <a-form-model-item label="退货类别" prop="goodFlag">
+                  <v-select
+                    v-model="queryParam.goodFlag"
+                    ref="goodFlag"
+                    id="returnSchedule-goodFlag"
+                    code="GOOD_FLAG"
+                    placeholder="请选择退货类别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
             </template>
-            <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
                 class="button-info"
@@ -141,13 +162,14 @@ export default {
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         salesReturnBillNo: '',
-        subareaArea:{
+        goodFlag: undefined,
+        salesReturnType: undefined,
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
         warehouseSn: undefined,
         dealerSn: '',
-        dealerLevel: undefined,
         dealerProvinceSn: undefined,
         dealerCitySn: undefined,
         dealerCountySn: undefined
@@ -188,10 +210,12 @@ export default {
         { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '退货数量', dataIndex: 'totalQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货仓库', dataIndex: 'warehouseName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货仓库', dataIndex: 'warehouseName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
         // { title: '开单退货金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '经销商价', dataIndex: 'totalWholesalePrice2', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '服务中心价', dataIndex: 'totalWholesalePrice1', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -265,7 +289,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          _this.$message.error("请选择退货完成日期")
+          _this.$message.error('请选择退货完成日期')
           return false
         }
       })
@@ -283,7 +307,7 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -305,6 +329,8 @@ export default {
       this.queryParam.dealerProvinceSn = undefined
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
+      this.queryParam.goodFlag = undefined
+      this.queryParam.salesReturnType = undefined
       this.$refs.subarea.clearData()
       if (this.advanced) {
         this.$refs.custList.resetForm()
@@ -314,7 +340,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    areaChange(val){
+    areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
       this.queryParam.dealerCountySn = val[2] ? val[2] : ''

+ 4 - 4
src/views/salesManagement/examineVerify/list.vue

@@ -247,21 +247,21 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单据来源', dataIndex: 'salesBillEntity.salesBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据来源', dataIndex: 'salesBillEntity.salesBillSourceDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '10%', align: 'center' },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '10%', align: 'center' },
         { title: '出库单号', dataIndex: 'stockOutNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'buyerName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '售价', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '备货时间', dataIndex: 'stockUpDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
 	  // 仓库管理权限设置是否显示 (当客户有且只有一条仓库管理权限时,不显示仓库信息)
 	  if (this.isShowWarehouse) {
-	    arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+	    arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
 	  }
       if (this.$hasPermissions('M_examineVerifyList_salesPrice')) { //  售价权限
         arr.splice(this.isShowWarehouse ? 9 : 8, 0, { title: '售价', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })

+ 4 - 0
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -279,6 +279,10 @@ export default {
         if(obj.origCode == 1){
           params.type = params.type + '_ORIG_CODE'
         }
+        // 装箱号
+        if(obj.packNo == 1){
+          params.type = params.type + '_PACK_NUM'
+        }
         printFun(
           dispatchDetailPrint,
           Object.assign(params, obj || {}),

+ 2 - 2
src/views/salesManagement/pushOrderManagement/exportExcelModal.vue

@@ -59,7 +59,7 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: {
         priceType: undefined,
-        origCode: undefined
+        origCode: '0'
       },
       rules: {
         priceType: [{ required: true, message: '请选择产品售价', trigger: 'change' }],
@@ -79,7 +79,7 @@ export default {
       _this.$store.state.app.curActionPermission = 'B_dispatchExport'
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          if(!this.$hasPermissions('B_dispatchExport_salesPrice')){
+          if (!this.$hasPermissions('B_dispatchExport_salesPrice')) {
             _this.form.priceType = 'DISPATCH_BILL'
           }
           _this.form.priceType += _this.form.origCode == 1 ? '_ORIG_CODE' : ''

+ 2 - 2
src/views/salesManagement/pushOrderManagement/list.vue

@@ -85,7 +85,7 @@
                   <Area id="pushOrder-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="6" :sm="24" v-if="isShowWarehouse">
                 <a-form-model-item label="出库仓库">
                   <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
                 </a-form-model-item>
@@ -280,7 +280,7 @@ export default {
         { title: '发货说明', scopedSlots: { customRender: 'explainInfo' }, width: '150px', align: 'center', ellipsis: true },
         { title: '客户名称', dataIndex: 'buyerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收货客户名称', dataIndex: 'receiverName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '出库仓库', dataIndex: 'warehouseName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '出库仓库', dataIndex: 'warehouseName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'totalCategory', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品数量', dataIndex: 'totalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '总售价', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 14 - 4
src/views/salesManagement/pushOrderManagement/sendTypeModal.vue

@@ -4,7 +4,7 @@
     :footer="null"
     :maskClosable="false"
     class="pushOrderManagement-print-type-modal"
-    title="发货分类打印"
+    :title="nowType=='print'?'发货分类打印':'发货分类导出'"
     v-model="isShow"
     @cancel="handleCancel"
     :width="600">
@@ -53,6 +53,12 @@
             <a-radio value="0">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <a-form-model-item label="装箱号" prop="packNo" v-if="nowType=='print'">
+          <a-radio-group v-model="form.packNo">
+            <a-radio value="1">打印</a-radio>
+            <a-radio value="0">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button id="pushOrderManagement-print-back" @click="handleCancel">取消</a-button>
@@ -107,12 +113,14 @@ export default {
       form: {
         id: 'all',
         orderBy: undefined,
-        origCode: undefined
+        origCode: '0',
+        packNo: '0'
       },
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }],
-        origCode: [{ required: true, message: '请选择原厂编码', trigger: 'change' }]
+        origCode: [{ required: true, message: '请选择原厂编码', trigger: 'change' }],
+        packNo: [{ required: true, message: '请选择装箱号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -143,6 +151,7 @@ export default {
               obj.orderBy = _this.form.orderBy
             }
             obj.origCode = _this.form.origCode
+            obj.packNo = _this.form.packNo
             _this.$emit('ok', obj, '发货分类', type)
           }
           _this.isShow = false
@@ -158,7 +167,8 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.form.id = 'all'
       this.form.orderBy = undefined
-      this.form.origCode = undefined
+      this.form.origCode = '0'
+      this.form.packNo = '0'
     },
     // 获取该销售单产品二级分类
     getTypeData (dispatchBillSn) {

+ 446 - 0
src/views/salesManagement/salesList/list.vue

@@ -0,0 +1,446 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="salesList-wrap">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="allocateBillList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="提交时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="submitDateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="销售单号">
+                <a-input id="salesList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="所属区域/分区">
+                <subarea id="salesList-subarea" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesList-buyerName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.financialStatus"
+                    ref="financialStatus"
+                    id="salesList-financialStatus"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="审核时间">
+                  <rangeDate ref="processRangeDate" :value="examineTime" @change="processDateChange" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="收款时间">
+                  <rangeDate ref="collectionRangeDate" :value="paymentTime" @change="collectionDateChange" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="salesList-billStatus"
+                    code="SALES_OVERVIEW_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="发货状态">
+                  <v-select
+                    v-model="queryParam.sendFlag"
+                    ref="sendFlag"
+                    id="outboundOrderList-sendFlag"
+                    code="SEND_FLAG"
+                    placeholder="请选择发货状态"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="省份" prop="provinceSn">
+                  <Area id="salesList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="24" :sm="24">
+              <div class="table-page-search-submitButtons" style="text-align:center;">
+                <a-button type="primary" :disabled="disabled" @click="handleSearch">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </div>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false" style="margin-top:8px;">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y:tableHeight, x:1890 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 超时环节提示 -->
+          <template slot="tip" slot-scope="text, record">
+            <a-tooltip placement="top" v-if="record.dispatchOverDay*1!=0||record.sendOverDay*1!=0||record.settleOverDay*1!=0">
+              <template slot="title">
+                <div v-if="record.dispatchOverDay*1>0">已超时{{ record.dispatchOverDay }}天(要求销售单下推后3天内备货)</div>
+                <div v-if="record.settleOverDay*1>0">已超时{{ record.settleOverDay }}天(要求销售单下推后2天内收款)</div>
+                <div v-if="record.sendOverDay*1>0">已超时{{ record.sendOverDay }}天(要求销售单允许打印后3天内发货)</div>
+              </template>
+              <div class="statusBox">
+                <a-icon type="exclamation-circle" :style="{color:'#ed1c24',fontSize:'20px',marginRight:'8px',display:'inlineBlock'}"/>
+                <span v-if="record.dispatchOverDay*1>0">未备货</span>
+                <span v-if="record.settleOverDay*1>0">未收款</span>
+                <span v-if="record.sendOverDay*1>0">未发货</span>
+              </div>
+            </a-tooltip>
+            <span v-else>--</span>
+          </template>
+          <!-- 销售单号 -->
+          <template slot="salesBillNo" slot-scope="text, record">
+            <span class="link-bule" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
+          </template>
+          <!-- 备货单号 -->
+          <template slot="dispatchBillNo" slot-scope="text, record">
+            <span class="link-bule" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
+          </template>
+          <!-- 发货单号  -->
+          <template slot="sendBillNo" slot-scope="text, record">
+            <span class="link-bule" @click="handleDetail(record,2)">{{ record.dispatchBillNo }}</span>
+          </template>
+        </s-table>
+
+        <!-- 查看销售单或备货单详情 -->
+        <commonModal
+          :modalTit="detailType?'备货单详情':'销售单详情'"
+          bodyPadding="10px"
+          width="70%"
+          :showFooter="false"
+          :openModal="showDetailModal"
+          @cancel="closeDetailModal">
+          <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+          <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
+        </commonModal>
+        <!-- 发货单详情 -->
+        <detailModal v-drag ref="detailModal" :openModal="showTipModal" @cancel="showTipModal=false" @ok="sendSuccess"></detailModal>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { STable, VSelect } from '@/components'
+import subarea from '@/views/common/subarea.js'
+import Area from '@/views/common/area.js'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import commonModal from '@/views/common/commonModal.vue'
+import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
+import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
+import detailModal from '@/views/salesManagement/sendOutOrder/detailModal.vue'
+import { salesOverviewQueryPage } from '@/api/sales'
+export default {
+  name: 'SalesListManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, dispatchDetail, commonModal, Area, salesDetail, detailModal },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      showDetailModal: false,
+      showTipModal: false,
+      bizSn: null,
+      tableHeight: 0,
+      detailType: 0,
+      examineTime: [],
+      paymentTime: [],
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
+      },
+      // 查询参数
+      queryParam: {
+        time: [
+          moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+          moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        ],
+        submitBeginDate: getDate.getCurrMonthDays().starttime,
+        submitEndDate: getDate.getCurrMonthDays().endtime,
+        salesBillNo: '', //  销售单号
+        subareaSn: undefined,
+        subareaAreaSn: undefined,
+        buyerSn: undefined, //  收货客户
+        buyerName: undefined,
+        financialStatus: undefined, // 财务状态
+        auditBeginDate: undefined, // 审核时间
+        auditEndDate: undefined,
+        beginDate: undefined, // 收款开始时间
+        endDate: undefined,
+        billStatus: undefined, //  业务状态
+        sendFlag: '', // 发货状态
+        provinceSn: undefined// 省份
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return salesOverviewQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '超时环节提醒', scopedSlots: { customRender: 'tip' }, width: '160px', align: 'center', fixed: 'left' },
+        { title: '提交时间', dataIndex: 'submitDate', width: '130px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '省份', dataIndex: 'provinceName', align: 'center', width: '80px', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '120px', align: 'center', fixed: 'left' },
+        { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '120px', align: 'center' },
+        { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '120px', align: 'center' },
+        { title: '所在区域', dataIndex: 'subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所在分区', dataIndex: 'subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '审核时间', dataIndex: 'auditDate', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下推数量', dataIndex: 'dispatchTotalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '下推金额', dataIndex: 'dispatchTotalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '收款金额', dataIndex: 'dispatchSettledAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '收款时间', dataIndex: 'dispatchSettleTime', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '备货允许打印时间', dataIndex: 'dispatchAllowPrintTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备货时间', dataIndex: 'dispatchAuditDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货编号', dataIndex: 'dispatchSendNo', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货创建时间', dataIndex: 'sendCreateDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发货状态', dataIndex: 'sendFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '托运日期', dataIndex: 'sendDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货人', dataIndex: 'sendCustomerContactName', width: '80px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '物流电话', dataIndex: 'sendTransportTele', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流单号', dataIndex: 'sendTransportNo', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总件数', dataIndex: 'sendTotalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '运费合计', dataIndex: 'sendTotalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '收货状态', dataIndex: 'sendReceiveFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'sendReceiveDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '物流情况', dataIndex: 'sendTransportStateDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'sendRemarks', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择提交时间')
+          return false
+        }
+      })
+    },
+    //  提交时间  change
+    submitDateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.submitBeginDate = date[0] || ''
+      this.queryParam.submitEndDate = date[1] || ''
+    },
+    // 审核时间 change
+    processDateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
+    // 收款开始时间  change
+    collectionDateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    custChange (val) {
+      if (val.row) {
+        this.queryParam.buyerSn = val.row.dealerSn
+        this.queryParam.buyerName = undefined
+      } else {
+        this.queryParam.buyerSn = undefined
+        this.queryParam.buyerName = val.key
+      }
+    },
+    // 详情
+    handleDetail (row, type) {
+      this.detailType = type
+      if (type != 2) {
+        this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
+        this.$nextTick(() => {
+          this.showDetailModal = true
+        })
+      } else {
+        this.showTipModal = true
+        const infoObj = {
+          sendBillSn: row.sendBillSn,
+          customeName: row.buyerName
+        }
+        this.$refs.detailModal.getDetail(infoObj, 1, '发货单详情')
+      }
+    },
+    closeDetailModal () {
+      this.showDetailModal = false
+      this.bizSn = null
+    },
+    sendSuccess () {
+      this.showTipModal = false
+      this.$refs.table.refresh()
+    },
+    subareaChange (val) {
+      this.queryParam.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.submitBeginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.submitEndDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesBillNo = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.subareaAreaSn = undefined
+      this.queryParam.buyerName = ''
+      this.queryParam.buyerSn = undefined
+      this.queryParam.financialStatus = undefined
+      this.queryParam.auditBeginDate = undefined
+      this.queryParam.auditEndDate = undefined
+      this.queryParam.settleBeginDate = undefined
+      this.queryParam.settleEndDate = undefined
+      this.queryParam.billStatus = undefined
+      this.queryParam.sendFlag = ''
+      this.queryParam.provinceSn = undefined
+      this.examineTime = []
+      this.paymentTime = []
+      this.$refs.subarea.clearData()
+      if (this.advanced) {
+        this.$refs.dealerSubareaScopeList.resetForm()
+        this.$refs.processRangeDate.resetDate()
+        this.$refs.collectionRangeDate.resetDate()
+      }
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      _this.resetSearchForm()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 236
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less" scoped>
+  .salesList-wrap{
+    .sTable{
+      margin-top: 10px;
+    }
+  }
+  .statusBox{
+    span{
+      vertical-align:top;
+         }
+    span::after{
+      content:'/';
+    }
+    span:last-child::after{
+       content:'' !important;
+    }
+  }
+</style>

+ 37 - 6
src/views/salesManagement/salesOrderWarehouse/detail.vue

@@ -3,7 +3,15 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" style="padding:16px 24px;">
         <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+           <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+        </template>
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="primary"
+            class="button-info"
+            v-if="$hasPermissions('B_salesOrderWarehouseExport')"
+            @click="handlePrint">导出Excel</a-button>
         </template>
       </a-page-header>
       <!-- 基础信息 -->
@@ -29,7 +37,7 @@
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
-        <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData!=null">
+        <a-alert type="info" style="margin-bottom: 10px;" v-if="countData">
           <div slot="message">
             <span>
               总款数:<strong>{{ countData.totalCategory || countData.totalCategory==0? countData.totalCategory : '--' }}</strong>;
@@ -58,17 +66,22 @@
         </s-table>
       </a-card>
     </a-spin>
+    <!-- 导出excel -->
+    <print-modal :openModal="openModal" :itemData="detailData" @ok="handleOk" @close="closePrint" />
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import { queryPageForWarehouseDetail, queryCountForWarehouseDetail, salesDetailBySn } from '@/api/sales'
+import moment from 'moment'
+import { exportExcel } from '@/libs/JGPrint.js'
+import { queryPageForWarehouseDetail, queryCountForWarehouseDetail, salesDetailBySn, salesDetailExcel } from '@/api/sales'
+import printModal from './printModal.vue'
 export default {
   name: 'SalesOrderWarehouseDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect },
+  components: { STable, VSelect ,printModal},
   data () {
     return {
       disabled: false,
@@ -91,7 +104,8 @@ export default {
       },
       detailData: null, //  详情数据
       countData: null, // 数量数据
-      fromRouter: null
+      fromRouter: null,
+      openModal:false,
     }
   },
   computed: {
@@ -111,6 +125,23 @@ export default {
     }
   },
   methods: {
+    handlePrint(){
+      this.openModal = true
+    },
+    // 确定打印或预览,导出
+    handleOk (objs) {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(objs))
+      console.log(params)
+      delete params.type
+      _this.spinning = true
+      exportExcel(salesDetailExcel, params, '销售清单' + moment().format('YYYYMMDDHHmmss'), () => {
+        _this.spinning = false
+      })
+    },
+    closePrint () {
+      this.openModal = false
+    },
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesOrderWarehouseList' })
@@ -158,7 +189,7 @@ export default {
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
   .salesDetail-wrap{
     .salesDetail-cont{
       margin-bottom: 10px;

+ 53 - 22
src/views/salesManagement/salesOrderWarehouse/list.vue

@@ -3,25 +3,32 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form-model
+          id="salesOrderWarehouseList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-              </a-form-item>
+              <a-form-model-item label="创建时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
+              <a-form-model-item label="客户名称">
                 <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="销售单号">
+              <a-form-model-item label="销售单号">
                 <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="业务状态">
+              <a-form-model-item label="业务状态">
                 <v-select
                   v-model="queryParam.billStatus"
                   ref="billStatus"
@@ -29,7 +36,7 @@
                   code="SALES_BILL_STATUS"
                   placeholder="请选择业务状态"
                   allowClear></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
@@ -42,7 +49,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
@@ -55,8 +62,8 @@
               >导出</a-button>
             </a-col>
           </a-row>
-        </a-form>
-      </div>
+          </a-form>
+        </a-form-model></div>
       <!-- alert -->
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
@@ -108,15 +115,15 @@ export default {
     return {
       spinning: false,
       tableHeight: 0,
-      time: [
-        moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ],
       queryParam: { //  查询条件
+        time: [
+          moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+          moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        ],
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         buyerSn: '', //  客户名称
-        billStatus: undefined, //  业务状态
+        billStatus: 'WAIT_AUDIT', //  业务状态
         salesBillNo: '', // 销售单号
         shippingAddrProvinceSn: undefined,
         warehouseSn: undefined
@@ -126,6 +133,9 @@ export default {
       loading: false,
       totalData: null,
       showExport: false,
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
+      },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -169,6 +179,18 @@ export default {
     }
   },
   methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择创建时间')
+          return false
+        }
+      })
+    },
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
@@ -195,17 +217,26 @@ export default {
     },
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     //  重置
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.$refs.dealerSubareaScopeList.resetForm()
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.buyerSn = ''
-      this.queryParam.billStatus = undefined
+      this.queryParam.billStatus = 'WAIT_AUDIT'
       this.queryParam.salesBillNo = ''
       this.queryParam.shippingAddrProvinceSn = undefined
       this.queryParam.warehouseSn = undefined

+ 146 - 0
src/views/salesManagement/salesOrderWarehouse/printModal.vue

@@ -0,0 +1,146 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="sales-print-type-modal"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="sales-print-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="销售单号">{{ itemData&&itemData.salesBillNo || '--' }}</a-form-model-item>
+        <a-form-model-item label="客户名称">{{ itemData&&itemData.buyerName || '--' }}</a-form-model-item>
+        <a-form-model-item label="是否缺货产品" prop="dataScope">
+          <a-radio-group v-model="form.dataScope">
+            <a-radio value="all">全部</a-radio>
+            <a-radio value="ENOUGH">有库存</a-radio>
+            <a-radio value="LESS">缺货</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="原厂编码" prop="orgCode">
+          <a-radio-group v-model="form.orgCode">
+            <a-radio value="1">导出</a-radio>
+            <a-radio value="0">不导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="sales-print-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" style="margin-left: 15px;" id="sales-print-save" @click="handleSave">导出</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { salesDetailProductType } from '@/api/sales'
+export default {
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    },
+    nowType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      form: {
+        id: 'all',
+        dataScope: 'all',
+        priceType: undefined,
+        orgCode: "1"
+      },
+      rules: {
+        id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
+        dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
+        orgCode: [{ required: true, message: '请选择原厂编码', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 15 }
+      },
+      spinning: false,
+      typeList: []
+    }
+  },
+  computed: {
+    modalTit () {
+      return '导出Excel'
+    }
+  },
+  methods: {
+    // 确认
+    handleSave (isPrint) {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+           _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
+           _this.form.priceType += _this.form.orgCode == "1" ? '_ORIG_CODE':''
+           const obj = {
+             salesBillSn: _this.itemData.salesBillSn,
+             priceType: _this.form.priceType,
+             dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
+             type: isPrint || 'preview'
+           }
+           _this.$emit('ok', obj)
+           _this.isShow = false
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 取消选择分类
+    handleCancel () {
+       this.isShow = false
+    },
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.form = {
+          id: 'all',
+          dataScope: 'all',
+          priceType: undefined,
+          orgCode: "1"
+        }
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .sales-print-type-modal{
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 6 - 4
src/views/salesManagement/sendOutOrder/detailModal.vue

@@ -53,14 +53,16 @@
             <span v-else>{{ detail.receiveDate||'--' }}</span>
           </div>
           <div style="flex-basis:30%" v-else></div>
-          <div style="flex-basis:30%">
+          <div style="flex-basis:30%;display:flex;">
             <label>物流备注:</label>
-            <a-textarea v-model="form.transportRemark" placeholder="请输入备注" v-if="type==0"/>
-            <span v-else>{{ detail.transportRemark||'--' }}</span>
+            <div style="padding:0 10px;max-width: 80%;">
+              <a-textarea style="width:300px;" v-model="form.transportRemark" :maxLength="100" placeholder="请输入备注(最多100字符)" v-if="type==0"/>
+              <span v-else>{{ detail.transportRemark||'--' }}</span>
+            </div>
           </div>
           <div style="flex-basis:60%;display:flex;" v-if="detail.receiveFlag == 1 && type!=0">
             问题反馈:
-            <div style="padding:0 10px;max-width: 60%;">
+            <div style="max-width: 60%;">
               <div v-if="showEditQus" style="width:400px;">
                 <a-textarea
                   ref="issue"

+ 2 - 2
src/views/salesManagement/sendOutOrder/list.vue

@@ -243,11 +243,11 @@ export default {
         { title: '收款时间', dataIndex: 'settleTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收货时间', dataIndex: 'receiveDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '物流情况', dataIndex: 'transportStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'transportRemark', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'transportRemark', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.isShowWarehouse) {
-        arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'left', customRender: function (text) { return text || '--' } })
+        arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     }

+ 4 - 0
src/views/salesManagement/stockPrint/list.vue

@@ -357,6 +357,10 @@ export default {
       if(obj.origCode == 1){
         params.type = params.type + '_ORIG_CODE'
       }
+      // 装箱号
+      if(obj.packNo == 1){
+        params.type = params.type + '_PACK_NUM'
+      }
       _this.spinning = true
       printFun(
         dispatchDetailPrint,

+ 11 - 2
src/views/salesManagement/stockPrint/sendTypeModal.vue

@@ -53,6 +53,12 @@
             <a-radio value="0">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <a-form-model-item label="装箱号" prop="packNo" v-if="nowType=='print'">
+          <a-radio-group v-model="form.packNo">
+            <a-radio value="1">打印</a-radio>
+            <a-radio value="0">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button id="pushOrderManagement-print-back" @click="handleCancel">取消</a-button>
@@ -101,12 +107,14 @@ export default {
       form: {
         id: 'all',
         orderBy: undefined,
-        origCode: undefined
+        origCode: '0',
+        packNo: '0'
       },
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }],
-        origCode: [{ required: true, message: '请选择原厂编码', trigger: 'change' }]
+        origCode: [{ required: true, message: '请选择原厂编码', trigger: 'change' }],
+        packNo: [{ required: true, message: '请选择装箱号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -137,6 +145,7 @@ export default {
               obj.orderBy = _this.form.orderBy
             }
             obj.origCode = _this.form.origCode
+            obj.packNo = _this.form.packNo
             _this.$emit('ok', obj, '发货分类', type)
           }
           _this.isShow = false

+ 94 - 20
src/views/salesReturnManagement/custConfirm/list.vue

@@ -6,6 +6,9 @@
         <template slot="subTitle">
           <a id="custConfirm-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+          <span style="margin: 0 10px;color: #666;">
+            退货类别:{{ ordeDetail&&ordeDetail.goodFlagDictValue }}
+          </span>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="custConfirm-cont">
@@ -26,7 +29,8 @@
           <a-button type="primary" :loading="loading" class="button-error" @click="handlePlss">批量设置退货单价</a-button>
           <a-button style="margin-left:5px;" :loading="loading" @click="openPlSetReason">批量设置退货原因</a-button>
           <span style="margin-left:10px;" v-if="selNums">已选{{ selNums }}项</span>
-          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+          <a-button type="primary" :loading="loading" class="button-info" @click="setNewSalesRetrunOrder">生成新销退单</a-button>
+          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品;黄色行表示客服确认时新增的产品;退货原因文字显示红色表示退货原因和退货类别不一致;</div>
         </div>
         <!-- 已选配件列表 -->
         <s-table
@@ -115,8 +119,19 @@
           </template>
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
-            <returnReason v-if="record.isEdit" v-model="record.returnReason" @blur="blurReason(record)"></returnReason>
-            <span v-else>{{ record.returnReason||'--' }}</span>
+            <returnReason v-if="record.isEdit" v-model="record.returnReasonCode"></returnReason>
+            <span v-else title="退货原因和退货类别不一致" :style="{color:record.needHandleFlag==1?'red':''}">{{ record.returnReason||'--' }}</span>
+          </template>
+          <!-- 备注 -->
+          <template slot="remarks" slot-scope="text, record">
+            <a-input
+              v-if="record.isEdit"
+              size="small"
+              :maxLength="50"
+              v-model.trim="record.returnReasonRemarks"
+              allowClear
+              placeholder="请输入备注信息(最多50字符)"/>
+            <span v-else>{{ record.returnReasonRemarks||'--' }}</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
@@ -188,11 +203,18 @@
       @addProduct="addProduct"></chooseProductsModal>
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
-      <div style="text-align: center;">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+      <div style="text-align: left;">
         <div style="line-height: 24px;">
+          <div><span style="color:red;">*</span>退货原因</div>
           <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
         </div>
+        <div style="line-height: 24px;margin-top:10px;">
+          <a-checkbox :checked="showEditRemarks" @change="e => showEditRemarks=!showEditRemarks">是否设置备注</a-checkbox>
+        </div>
+        <div style="line-height: 24px;margin-top:10px;" v-if="showEditRemarks">
+          <div>备注</div>
+          <div><a-input size="large" :maxLength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
+        </div>
       </div>
     </commonModal>
   </div>
@@ -206,7 +228,7 @@ import commonModal from '@/views/common/commonModal.vue'
 import returnReason from '@/views/common/returnReason'
 import chooseProductsModal from '../receiveCheck/chooseProductsModal.vue'
 import { salesReturnDetail, customerServiceConfirm } from '@/api/salesReturn'
-import { salesReturnDetailList, updateByCustomerService, deleteByCustomerService, insertByCustomerService, salesReturnDetailSetReason } from '@/api/salesReturnDetail'
+import { salesReturnDetailList, updateByCustomerService, deleteByCustomerService, insertByCustomerService, salesReturnDetailSetReason, salesReturnAgainCreate } from '@/api/salesReturnDetail'
 export default {
   name: 'CustConfirm',
   mixins: [commonMixin],
@@ -224,6 +246,7 @@ export default {
       tableHeight: 0, // 表格高度
       orderSn: null,
       disabled: false,
+      showEditRemarks: false,
       ordeDetail: null,
       loading: false,
       queryParam: {
@@ -244,7 +267,6 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].isEdit = false
-              data.list[i].returnReasonBackups = data.list[i].returnReason
             }
             this.disabled = false
           }
@@ -254,19 +276,28 @@ export default {
       rowSelectionInfo: null,
       showSetPriceModal: false,
       chooseData: [],
+      returnReasonList: [],
       openProductModal: false,
-      plReturnReason: '',
-      showPlModal: false
+      plReturnReason: undefined,
+      plReturnRemark: undefined,
+      showPlModal: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 14 }
     }
   },
   watch: {
     showPlModal (newValue, oldValue) {
       if (!newValue) {
-        this.plReturnReason = ''
+        this.plReturnReason = undefined
+        this.plReturnRemark = undefined
+        this.showEditRemarks = false
       }
     }
   },
   computed: {
+    goodFlag () {
+      return this.ordeDetail && this.ordeDetail.goodFlag || ''
+    },
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
@@ -284,7 +315,8 @@ export default {
         // { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货单价说明', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', dataIndex: 'remarks', width: '15%', align: 'center', scopedSlots: { customRender: 'remarks' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
       ]
       if (this.$hasPermissions('B_salesReturnConfirm_salesPrice')) { //  售价权限
@@ -295,6 +327,37 @@ export default {
     }
   },
   methods: {
+    // 生成新销退单
+    setNewSalesRetrunOrder () {
+      if (!this.selNums) {
+        this.$message.warning('请先选择产品!')
+        return
+      }
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '选择的产品将生成新的销退单,并且从当前列表中删除!是否确认生成?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.loading = true
+          _this.spinning = true
+          const snList = []
+          const arr = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
+          arr.map(item => {
+            snList.push(item.salesReturnDetailSn)
+          })
+          salesReturnAgainCreate({ sourceBillSn: _this.orderSn, salesReturnBillDetailSnList: snList }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm(false)
+            }
+            _this.$message.info(res.message)
+            _this.loading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -305,9 +368,14 @@ export default {
     },
     // 添加产品
     addProduct (data) {
+      const a = this.$store.state.app.goodReturnReason.find(item => item.code == data.returnReasonCode)
+      const b = this.$store.state.app.defectiveReturnReason.find(item => item.code == data.returnReasonCode)
+      const goodFlag = a ? a.lookupCode : b.lookupCode
+
       const params = {
         'salesReturnBillSn': this.orderSn,
         'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        'goodFlag': goodFlag,
         ...data
       }
       insertByCustomerService(params).then(res => {
@@ -338,11 +406,6 @@ export default {
       this.$refs.table.clearSelected()
       this.resetSearchForm(false)
     },
-    blurReason (row) {
-      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
-        row.returnReason = row.returnReasonBackups
-      }
-    },
     // 批量设置退货原因
     openPlSetReason () {
       if (this.selNums) {
@@ -352,18 +415,23 @@ export default {
       }
     },
     setPlReturnReason () {
-      if (this.plReturnReason == '') {
-        this.$message.warning('请输入退货原因!')
+      if (!this.plReturnReason) {
+        this.$message.warning('请选择退货原因!')
       } else {
         this.spinning = true
         const snList = []
         const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
         arr.map(item => {
           snList.push(item.salesReturnDetailSn)
         })
         salesReturnDetailSetReason({
           salesReturnBillDetailSnList: snList,
-          returnReason: this.plReturnReason
+          salesReturnBillSn: this.orderSn,
+          returnReason: rows ? rows.dispName : '',
+          returnReasonCode: this.plReturnReason,
+          returnReasonRemarks: this.showEditRemarks ? this.plReturnRemark || '' : undefined,
+          goodFlag: rows.lookupCode
         }).then(res => {
           if (res.status == 200) {
             this.showPlModal = false
@@ -376,7 +444,7 @@ export default {
     },
     // 保存
     handleSave (record) {
-      if (!record.returnReason) {
+      if (!record.returnReasonCode) {
         this.$message.warning('请先选择退货原因!')
         return
       }
@@ -384,6 +452,9 @@ export default {
         this.$message.warning('仓库实收数量必需等于良品数量和坏件数量之和!')
         return
       }
+      const rows = this.returnReasonlist.find(item => item.code == record.returnReasonCode)
+      record.returnReason = rows ? rows.dispName : ''
+      record.goodFlag = rows.lookupCode
       this.spinning = true
       updateByCustomerService(record).then(res => {
         if (res.status == 200) {
@@ -428,6 +499,9 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if (res.data) {
+          this.returnReasonlist = [...this.$store.state.app.goodReturnReason, ...this.$store.state.app.defectiveReturnReason]
+        }
       })
     },
     // 审核销售单

+ 7 - 3
src/views/salesReturnManagement/custConfirm/setPriceModal.vue

@@ -44,7 +44,7 @@
           </div>
           <div v-else>
             销售单号:
-            <a-input placeholder="请输入销售单号" v-model.trim="form.salesBillNo" :maxlength="50" @change="fetchUser"/>
+            <a-input placeholder="请输入销售单号" v-model.trim="form.salesBillNo" :maxLength="50" @change="fetchUser"/>
             <span class="mleft">{{ buyerName }}</span>
             <a-button type="primary" :disabled="disabled" @click="handleSave" class="button-error">设置完成</a-button>
           </div>
@@ -64,7 +64,7 @@
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="setPrice-reset">重置</a-button>
             </a-form-item>
           </a-form>
-          <div style="float:right;color:#999;margin-top:10px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+          <div style="float:right;color:#999;margin-top:10px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品;退货原因文字显示红色表示退货原因和退货类别不一致;</div>
         </div>
         <!-- 表格数据 -->
         <s-table
@@ -78,6 +78,10 @@
           :scroll="{ y: 400 }"
           :showPagination="false"
           bordered>
+          <!-- 退货原因 -->
+          <template slot="returnReason" slot-scope="text, record">
+            <span title="退货原因和退货类别不一致" :style="{color:record.needHandleFlag==1?'red':''}">{{ record.returnReason||'--' }}</span>
+          </template>
         </s-table>
       </div>
     </a-spin>
@@ -138,7 +142,7 @@ export default {
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货单价', dataIndex: 'price', align: 'right', width: '10%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
         { title: '退货单价说明', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

+ 66 - 19
src/views/salesReturnManagement/receiveCheck/checking.vue

@@ -6,6 +6,9 @@
         <template slot="subTitle">
           <a id="salesReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+          <span style="margin: 0 10px;color: #666;">
+            退货类别:{{ ordeDetail&&ordeDetail.goodFlagDictValue }}
+          </span>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnCheck-cont">
@@ -70,7 +73,16 @@
           </template>
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
-            <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
+            <returnReason v-model="record.returnReasonCode" @change="e => updateReason(e, record, 0)"></returnReason>
+          </template>
+          <!-- 备注 -->
+          <template slot="remarksInfo" slot-scope="text, record">
+            <a-input
+              size="small"
+              v-model.trim="record.returnReasonRemarks"
+              @blur="e => updateReason(e, record, 1)"
+              :maxLength="50"
+              placeholder="请输入备注信息(最多50字符)"/>
           </template>
         </s-table>
         <div class="footer-btn">
@@ -89,11 +101,18 @@
     <chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
-      <div style="text-align: center;">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+      <div style="text-align: left;">
         <div style="line-height: 24px;">
+          <div><span style="color:red;">*</span>退货原因</div>
           <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
         </div>
+        <div style="line-height: 24px;margin-top:10px;">
+          <a-checkbox :checked="showEditRemarks" @change="e => showEditRemarks=!showEditRemarks">是否设置备注</a-checkbox>
+        </div>
+        <div style="line-height: 24px;margin-top:10px;" v-if="showEditRemarks">
+          <div>备注</div>
+          <div><a-input size="large" :maxLength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
+        </div>
       </div>
     </commonModal>
   </div>
@@ -138,6 +157,8 @@ export default {
         productName: ''
       },
       chooseLoadData: [],
+      labelCol: { span: 8 },
+      wrapperCol: { span: 14 },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -155,6 +176,7 @@ export default {
               data.list[i].goodQtyBackups = data.list[i].goodQty
               data.list[i].backStockQtyBackups = data.list[i].backStockQty
               data.list[i].returnReasonBackups = data.list[i].returnReason
+              data.list[i].bakReamrks = data.list[i].returnReasonRemarks
             }
             this.disabled = false
             this.chooseLoadData = data.list
@@ -163,18 +185,26 @@ export default {
         })
       },
       rowSelectionInfo: null,
-      plReturnReason: '',
-      showPlModal: false
+      plReturnReason: undefined,
+      plReturnRemark: undefined,
+      showPlModal: false,
+      showEditRemarks: false,
+      returnReasonlist: []
     }
   },
   watch: {
     showPlModal (newValue, oldValue) {
       if (!newValue) {
-        this.plReturnReason = ''
+        this.plReturnReason = undefined
+        this.plReturnRemark = undefined
+        this.showEditRemarks = false
       }
     }
   },
   computed: {
+    goodFlag () {
+      return this.ordeDetail && this.ordeDetail.goodFlag || ''
+    },
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
@@ -189,7 +219,8 @@ export default {
         { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', width: '10%', align: 'center', scopedSlots: { customRender: 'goodQty' } },
         { title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', dataIndex: ' remarksInfo', width: '20%', align: 'center', scopedSlots: { customRender: 'remarksInfo' } }
       ]
       return arr
     }
@@ -276,18 +307,23 @@ export default {
       }
     },
     setPlReturnReason () {
-      if (this.plReturnReason == '') {
-        this.$message.warning('请输入退货原因!')
+      if (!this.plReturnReason) {
+        this.$message.warning('请选择退货原因!')
       } else {
         this.spinning = true
         const snList = []
         const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
         arr.map(item => {
           snList.push(item.salesReturnDetailSn)
         })
         salesReturnDetailSetReason({
           salesReturnBillDetailSnList: snList,
-          returnReason: this.plReturnReason
+          salesReturnBillSn: this.orderSn,
+          returnReason: rows ? rows.dispName : '',
+          returnReasonCode: this.plReturnReason,
+          returnReasonRemarks: this.showEditRemarks ? this.plReturnRemark || '' : undefined,
+          goodFlag: rows.lookupCode
         }).then(res => {
           if (res.status == 200) {
             this.showPlModal = false
@@ -299,17 +335,25 @@ export default {
       }
     },
     // 修改退货原因
-    updateReason (row) {
-      // 空或没有改变时不保存数据
-      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
-        row.returnReason = row.returnReasonBackups
-        return
+    updateReason (val, record, type) {
+      const params = {
+        salesReturnDetailSn: record.salesReturnDetailSn
+      }
+      // 退货原因
+      if (type == 0) {
+        const rows = this.returnReasonlist.find(item => item.code == val)
+        params.returnReasonCode = val || ''
+        params.returnReason = rows ? rows.dispName : ''
+        params.goodFlag = rows.lookupCode
+      } else {
+        // 备注
+        params.returnReasonRemarks = val.target.value
+        if (params.returnReasonRemarks == record.bakReamrks) {
+          return
+        }
       }
       this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: row.salesReturnDetailSn,
-        returnReason: row.returnReason
-      }).then(res => {
+      salesReturnDetailUpdateReason(params).then(res => {
         if (res.status == 200) {
           this.$refs.table.refresh()
           this.$message.success(res.message)
@@ -376,6 +420,9 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if (res.data) {
+          this.returnReasonlist = [...this.$store.state.app.goodReturnReason, ...this.$store.state.app.defectiveReturnReason]
+        }
       })
     },
     //  重置

+ 7 - 6
src/views/salesReturnManagement/receiveCheck/chooseImportModal.vue

@@ -95,23 +95,24 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'initialQtyText', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库实收数量', dataIndex: 'receiveQtyText', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库实收数量', dataIndex: 'receiveQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '25%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'initialQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库实收数量', dataIndex: 'receiveQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '20%', align: 'center' }
       ],
       unLoadData: [],

+ 22 - 5
src/views/salesReturnManagement/receiveCheck/chooseProductsModal.vue

@@ -14,6 +14,7 @@
           <!-- 查询配件列表 -->
           <queryPart
             ref="partQuery"
+            :showRemark="true"
             :showReceiveQty="true"
             :isShowPrice="isShowPrice"
             :returnReasonList="returnReasonList"
@@ -48,6 +49,10 @@ export default {
     isShowPrice: { //  弹框显示状态
       type: Boolean,
       default: true
+    },
+    goodFlag: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -69,14 +74,16 @@ export default {
         this.$message.info('请输入仓库实收数量')
         return
       }
-      if (!row.returnReason) {
+      if (!row.returnReasonCode) {
         this.$message.info('请选择退货原因')
         return
       }
+      const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
       const params = {
         'price': row.productPrice,
-        // 'cost': row.lastStockCost,
-        'returnReason': row.returnReason,
+        'returnReasonCode': row.returnReasonCode,
+        'returnReason': rows ? rows.dispName : '',
+        'returnReasonRemarks': row.returnReasonRemarks,
         'productSn': row.productSn,
         'initialQty': row.qty,
         'receiveQty': row.receiveQty
@@ -98,9 +105,19 @@ export default {
       if (!newValue) {
         this.$emit('close')
       } else {
-        this.returnReasonList = this.$store.state.app.returnReason
+        if (this.goodFlag == 'DEFECTIVE_PRODUCT_RETURN') {
+          this.returnReasonlist = this.$store.state.app.defectiveReturnReason
+        }
+        // 良品
+        if (this.goodFlag == 'GOOD_PRODUCT_RETURN') {
+          this.returnReasonlist = this.$store.state.app.goodReturnReason
+        }
+        // 全部
+        if (!this.goodFlag) {
+          this.returnReasonlist = [...this.$store.state.app.goodReturnReason, ...this.$store.state.app.defectiveReturnReason]
+        }
         this.$nextTick(() => {
-          this.$refs.partQuery.pageInit(this.buyerSn, 0)
+          this.$refs.partQuery.pageInit(this.buyerSn, 0, this.goodFlag)
         })
       }
     }

+ 9 - 3
src/views/salesReturnManagement/receiveCheck/importGuideModal.vue

@@ -15,7 +15,7 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“仓库实收数量”、“退货原因”的列,“产品编码”必填,其它列可自定义,不影响数据导入</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“仓库实收数量”、“退货原因”、“备注”的列,“产品编码”必填,其它列可自定义,不影响数据导入</li>
             <li>
               <a :href="filePath" style="margin: 5px 0 0;display: block;">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
@@ -79,6 +79,10 @@ export default {
     params: {
       type: Object,
       default: null
+    },
+    goodFlag: {
+      type: [String, Number],
+      default: ''
     }
   },
   data () {
@@ -91,7 +95,7 @@ export default {
         savePathType: 'local',
         salesReturnBillSn: this.params.salesReturnBillSn
       },
-      filePath: location.protocol + '//' +location.host + '/templ/收货产品导入模板.xlsx'
+      filePath: ''
     }
   },
   methods: {
@@ -128,7 +132,7 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -140,6 +144,8 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.resetSearchForm()
+      } else {
+        this.filePath = location.protocol + '//' + location.host + (this.goodFlag == 1 ? '/templ/收货产品(良品)模板.xlsx' : '/templ/收货产品(不良品)模板.xlsx')
       }
     }
   }

+ 19 - 6
src/views/salesReturnManagement/receiveCheck/list.vue

@@ -20,6 +20,17 @@
                 <dealerSubareaScopeList ref="dealerSubareaScopeList" id="receiveCheck-buyerSn" @change="custChange" />
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="退货类别">
+                <v-select
+                  v-model="queryParam.goodFlag"
+                  ref="goodFlag"
+                  id="receiveCheck-goodFlag"
+                  code="GOOD_FLAG"
+                  placeholder="请选择退货类别"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="业务状态">
                 <v-select
@@ -142,7 +153,8 @@ export default {
         buyerSn: undefined, //  客户名称
         salesReturnBillNo: undefined, //  总部销退单号
         billStatus: undefined, // 业务状态
-        warehouseSn: undefined
+        warehouseSn: undefined,
+        goodFlag: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -175,19 +187,19 @@ export default {
       const arr = [
         { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '退货仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '8%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'totalGoodQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
       if (this.isShowWarehouse) {
-        arr.splice(4, 0, { title: '退货仓库', dataIndex: 'warehouseName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true })
+        arr.splice(5, 0, { title: '退货仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       }
       return arr
     }
@@ -222,6 +234,7 @@ export default {
       this.queryParam.salesReturnBillNo = ''
       this.queryParam.billStatus = undefined
       this.queryParam.warehouseSn = undefined
+      this.queryParam.goodFlag = undefined
       this.$refs.table.refresh(true)
     },
     pageInit () {

+ 55 - 25
src/views/salesReturnManagement/receiveCheck/receiving.vue

@@ -6,6 +6,9 @@
         <template slot="subTitle">
           <a id="salesReturnReceive-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
+          <span style="margin: 0 10px;color: #666;">
+            退货类别:{{ ordeDetail&&ordeDetail.goodFlagDictValue }}
+          </span>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnReceive-cont">
@@ -22,16 +25,16 @@
           </a-form-item>
         </a-form>
         <div style="border-top:1px solid #eee;padding-top:10px;">
+          <a-button type="primary" :loading="loading" class="button-error" @click="handlePlss">批量实收</a-button>
+          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys&&rowSelectionInfo.selectedRowKeys.length">已选{{ rowSelectionInfo.selectedRowKeys.length }}项</span>
           <a-button
             type="primary"
             ghost
             :loading="loading"
             @click="openGuideModal=true"
-            style="margin-right:5px;"
-            >导入产品</a-button>
+            style="margin:0 5px 0 10px;"
+          >导入产品</a-button>
           <a-button type="primary" :loading="loading" class="button-info" @click="openModal = true">新增产品</a-button>
-          <a-button type="primary" :loading="loading" class="button-error" @click="handlePlss">批量实收</a-button>
-          <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys&&rowSelectionInfo.selectedRowKeys.length">已选{{ rowSelectionInfo.selectedRowKeys.length }}项</span>
           <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品</div>
         </div>
         <!-- 已选配件列表 -->
@@ -78,11 +81,18 @@
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
             <returnReason
-              v-model="record.returnReason"
+              v-model="record.returnReasonCode"
+              :goodFlag="goodFlag"
               v-if="record.addFlag == '1'&&record.addType == 'WAREHOUSE_RECEIVE'"
-              @blur="e => onCellBlurReturnReason(e, record)"></returnReason>
+              @change="e => onCellBlurReturnReason(e, record, 0)"></returnReason>
             <span v-else>{{ record.returnReason }}</span>
           </template>
+          <!-- 备注 -->
+          <template slot="remarks" slot-scope="text, record">
+            <div @dblclick.stop>
+              <a-input :maxLength="50" size="small" v-model="record.returnReasonRemarks" @blur="e => onCellBlurReturnReason(e, record, 1)" placeholder="请输入备注(最多50字符)"/>
+            </div>
+          </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <div>
@@ -111,13 +121,14 @@
     <!-- 添加产品 -->
     <chooseProductsModal
       ref="chooseProduct"
+      :goodFlag="goodFlag"
       :isShowPrice="false"
       :openModal="openModal"
       :buyerSn="$route.params.buyerSn"
       @close="openModal=false"
       @addProduct="addProduct"></chooseProductsModal>
-      <!-- 导入产品 -->
-      <importGuideModal :params="{salesReturnBillSn: $route.params.sn}" :openModal="openGuideModal" @close="openGuideModal=false" @ok="importOk" />
+    <!-- 导入产品 -->
+    <importGuideModal :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0" :params="{salesReturnBillSn: $route.params.sn}" :openModal="openGuideModal" @close="openGuideModal=false" @ok="importOk" />
   </div>
 </template>
 
@@ -172,6 +183,7 @@ export default {
               data.list[i].receiveQtyBackups = data.list[i].receiveQty
               data.list[i].initialQtyBackups = data.list[i].initialQty
               data.list[i].returnReasonBackups = data.list[i].returnReason
+              data.list[i].bakReamrks = data.list[i].returnReasonRemarks
             }
             this.disabled = false
             this.chooseLoadData = data.list
@@ -183,20 +195,25 @@ export default {
       queryParam: {
         productCode: '',
         productName: ''
-      }
+      },
+      returnReasonlist: []
     }
   },
   computed: {
+    goodFlag () {
+      return this.ordeDetail && this.ordeDetail.goodFlag || ''
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '10%', scopedSlots: { customRender: 'initialQty' } },
-        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', scopedSlots: { customRender: 'receiveQty' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '8%', scopedSlots: { customRender: 'initialQty' } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '8%', scopedSlots: { customRender: 'receiveQty' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '25%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '19%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', dataIndex: 'remarks', width: '19%', align: 'center', scopedSlots: { customRender: 'remarks' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       return arr
@@ -212,10 +229,10 @@ export default {
       this.$router.push({ name: 'receiveCheckList' })
     },
     // 确认导入明细
-    importOk(data){
+    importOk (data) {
       this.spinning = true
-      salesReturnDetailBatchByReceive({detailList:data, salesReturnBillSn: this.orderSn}).then(res => {
-        if(res.status == 200){
+      salesReturnDetailBatchByReceive({ detailList: data, salesReturnBillSn: this.orderSn }).then(res => {
+        if (res.status == 200) {
           this.resetSearchForm()
           this.$message.info(res.message)
         }
@@ -227,6 +244,7 @@ export default {
       const params = {
         'salesReturnBillSn': this.orderSn,
         'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
+        'goodFlag': this.goodFlag,
         ...data
       }
       insertByReceive(params).then(res => {
@@ -336,18 +354,27 @@ export default {
       }
     },
     // 修改退货原因
-    onCellBlurReturnReason (e, record) {
-      // 空或没有改变时不保存数据
-      if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
-        record.returnReason = record.returnReasonBackups
-        return
+    onCellBlurReturnReason (val, record, type) {
+      const params = {
+        salesReturnDetailSn: record.salesReturnDetailSn,
+        goodFlag: this.goodFlag
       }
+      // 退货原因
+      if (type == 0) {
+        const rows = this.returnReasonlist.find(item => item.code == val)
+        params.returnReasonCode = val || ''
+        params.returnReason = rows ? rows.dispName : ''
+      } else {
+        // 备注
+        params.returnReasonRemarks = val.target.value
+        if (params.returnReasonRemarks == record.bakReamrks) {
+          return
+        }
+      }
+
       this.loading = true
       this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: record.salesReturnDetailSn,
-        returnReason: record.returnReason
-      }).then(res => {
+      salesReturnDetailUpdateReason(params).then(res => {
         if (res.status == 200) {
           this.resetSearchForm(false)
           this.$message.success(res.message)
@@ -362,6 +389,9 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if (res.data) {
+          this.returnReasonlist = [...this.$store.state.app.goodReturnReason, ...this.$store.state.app.defectiveReturnReason]
+        }
       })
     },
     // 审核销售单

+ 7 - 6
src/views/salesReturnManagement/returnConfirmation/detailModal.vue

@@ -101,12 +101,13 @@ export default {
         { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_returnConfirmation_detail_salesPrice')) { //  售价权限
-        arr.splice(10, 0, { title: '实际退货单价', dataIndex: 'price', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(11, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(12, 0, { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(11, 0, { title: '实际退货单价', dataIndex: 'price', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(12, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(13, 0, { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     }
@@ -134,10 +135,10 @@ export default {
         this.detailData = null
         this.$refs.table.clearTable()
         this.$store.state.app.curActionPermission = ''
-      }else{
+      } else {
         this.$store.state.app.curActionPermission = 'B_returnConfirmation_detail'
         this.getDetail()
-        this.$nextTick(()=>{
+        this.$nextTick(() => {
           this.$refs.table.refresh(true)
         })
       }

+ 28 - 1
src/views/salesReturnManagement/returnConfirmation/list.vue

@@ -48,6 +48,27 @@
                   <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类别" prop="goodFlag">
+                  <v-select
+                    v-model="queryParam.goodFlag"
+                    ref="goodFlag"
+                    id="returnSchedule-goodFlag"
+                    code="GOOD_FLAG"
+                    placeholder="请选择退货类别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类型">
+                  <v-select
+                    v-model="queryParam.salesReturnType"
+                    id="departUser-salesReturnType"
+                    code="SALES_RETURN_TYPE"
+                    placeholder="请选择退货类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="returnConfirmationList-refresh">查询</a-button>
@@ -118,7 +139,9 @@ export default {
         buyerSn: undefined,
         salesReturnBillSource: undefined,
         billStatus: undefined, //  状态
-        warehouseSn: undefined //  仓库
+        warehouseSn: undefined, //  仓库
+        goodFlag: undefined,
+        salesReturnType: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       advanced: true,
@@ -153,6 +176,8 @@ export default {
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -186,6 +211,8 @@ export default {
       this.queryParam.salesReturnBillSource = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.warehouseSn = undefined
+      this.queryParam.goodFlag = undefined
+      this.queryParam.salesReturnType = undefined
       this.$refs.dealerSubareaScopeList.resetForm()
       this.$refs.table.refresh(true)
     },

+ 360 - 0
src/views/salesReturnManagement/returnSchedule/list.vue

@@ -0,0 +1,360 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="returnSchedule-wrap">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="allocateBillList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="提交时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="退货申请审核时间">
+                <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="所属区域/分区">
+                <subarea id="returnSchedule-subareaSn" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="returnSchedule-buyerSn" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="总部销退单号">
+                  <a-input id="returnSchedule-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="returnSchedule-billStatus"
+                    code="SALES_RETURN_BILL_STATUS2"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="省份" prop="provinceSn">
+                  <Area id="salesReturn-provinceSn" ref="provinceBox" v-model="queryParam.provinceSn" placeholder="请选择省" @change="chooseArea"></Area>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类别" prop="goodFlag">
+                  <v-select
+                    v-model="queryParam.goodFlag"
+                    ref=" goodFlag"
+                    id="returnSchedule-goodFlag"
+                    code="GOOD_FLAG"
+                    placeholder="请选择退货类别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="24" :sm="24" style="margin-top:16px;text-align:center">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnSchedule-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnSchedule-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x:1300,y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 超时环节提示 -->
+          <template slot="tip" slot-scope="text, record">
+            <a-tooltip placement="top" v-if="record.customerServiceConfirmOverDay && record.customerServiceConfirmOverDay*1>3">
+              <template slot="title">
+                <span>已超时{{ record.customerServiceConfirmOverDay }}天(要求提货后3-5天内完成清点)</span>
+              </template>
+              <div>
+                <a-icon type="exclamation-circle" :style="{color:'#ed1c24',fontSize:'20px',marginRight:'8px',display:'inlineBlock'}"/>
+                <a-icon v-if="record.customerServiceConfirmOverDay*1>5" type="exclamation-circle" :style="{color:'#ed1c24',fontSize:'20px',marginRight:'8px',display:'inlineBlock'}"/>
+                <span style="vertical-align: top;">未清点</span>
+              </div>
+            </a-tooltip>
+            <span v-else>--</span>
+          </template>
+          <!-- 总部销退单号 -->
+          <template slot="salesReturnBillNo" slot-scope="text, record">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { STable, VSelect } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import chooseWarehouse from '@/views/common/chooseWarehouse'
+import subarea from '@/views/common/subarea.js'
+import Area from '@/views/common/area.js'
+import { queryOverviewPage } from '@/api/salesReturn'
+export default {
+  name: 'ReturnSchedule',
+  mixins: [commonMixin],
+  components: { STable, VSelect, subarea, dealerSubareaScopeList, rangeDate, chooseWarehouse, Area },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [
+          moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+          moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        ],
+        beginSubmitDate: getDate.getCurrMonthDays().starttime,
+        endSubmitDate: getDate.getCurrMonthDays().endtime,
+        beginAuditDate: undefined,
+        endAuditDate: undefined,
+        buyerSn: undefined,
+        buyerName: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        goodFlag: undefined,
+        salesReturnBillNo: '', //  单号
+        billStatus: undefined, //  业务状态
+        provinceName: undefined,
+        provinceSn: undefined,
+        salesReturnType: undefined// 退货类别
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return queryOverviewPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false,
+      itemSn: ''
+    }
+  },
+  // 根据权限显示列表字段
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '超时环节提醒', scopedSlots: { customRender: 'tip' }, width: '130px', align: 'center', fixed: 'left' },
+        { title: '提交时间', dataIndex: 'submitTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '省份', dataIndex: 'provinceName', align: 'center', width: '100px', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '客户名称', dataIndex: 'buyerName', align: 'center', width: '200px', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '130px', align: 'center', fixed: 'left' },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所在区域', dataIndex: 'subareaArea.subareaName', align: 'center', width: '130px', customRender: function (text) { return text || '--' } },
+        { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', align: 'center', width: '130px', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '申请退货金额', dataIndex: 'initialAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '退货申请审核时间', dataIndex: 'auditTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提货审核时间', dataIndex: 'pickUpAuditDate', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'receiveTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品检时间', dataIndex: 'checkTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客服确认时间', dataIndex: 'customerServiceConfirmTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalGoodQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择提交时间')
+          return false
+        }
+      })
+    },
+    //  提交时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginSubmitDate = date[0] || ''
+      this.queryParam.endSubmitDate = date[1] || ''
+    },
+    // 审核时间
+    dateExamineChange (date) {
+      this.queryParam.beginAuditDate = date[0]
+      this.queryParam.endAuditDate = date[1]
+    },
+    // 客户名称
+    custChange (val) {
+      if (val.row) {
+        this.queryParam.buyerSn = val.row.dealerSn
+        this.queryParam.buyerName = undefined
+      } else {
+        this.queryParam.buyerSn = undefined
+        this.queryParam.buyerName = val.key
+      }
+    },
+    // 区域分区
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginSubmitDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endSubmitDate = getDate.getCurrMonthDays().endtime
+
+      this.queryParam.beginAuditDate = undefined
+      this.queryParam.endAuditDate = undefined
+      this.$refs.rangeExamineDate.resetDate()
+
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
+      this.$refs.subarea.clearData()
+      this.queryParam.buyerSn = undefined
+      this.queryParam.buyerName = undefined
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.billStatus = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.provinceName = undefined
+      this.queryParam.salesReturnType = undefined
+      this.queryParam.goodFlag = undefined
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.$refs.table.refresh(true)
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn }, query: { path: 'returnSchedule' } })
+    },
+    // 选择省份
+    chooseArea (con, item) {
+      this.queryParam.provinceSn = con
+      this.queryParam.provinceName = item.name
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 240
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .returnSchedule-wrap{
+    margin-bottom:10px;
+    .active{
+      color: #ed1c24;
+      cursor: pointer;
+    }
+    .ant-tooltip{
+      max-width:300px !important;
+    }
+    .common{
+      color: rgba(0, 0, 0);
+    }
+  }
+</style>

+ 24 - 8
src/views/salesReturnManagement/salesReturn/chooseCustomModal.vue

@@ -52,7 +52,7 @@
         </a-row>
         <a-row :gutter="15">
           <a-col :span="20">
-          <a-form-model-item label="退货仓库" prop="warehouseSn">
+            <a-form-model-item label="退货仓库" prop="warehouseSn">
               <warehouse
                 v-model="form.warehouseSn"
                 showDef
@@ -63,6 +63,19 @@
             </a-form-model-item>
           </a-col>
         </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="退货类别" prop="goodFlag">
+              <v-select
+                code="GOOD_FLAG"
+                showType="radio"
+                id="chooseCustom-goodFlag"
+                v-model="form.goodFlag"
+                allowClear
+                placeholder="请选择退货类别"></v-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
           <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
           <a-button @click="cancel" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
@@ -113,12 +126,14 @@ export default {
         countyName: '',
         customerAddr: '', //  详细地址
         warehouseSn: undefined, // 退货仓库
-        syncFlag: undefined // 是否同步
+        syncFlag: undefined, // 是否同步
+        goodFlag: undefined
       },
       rules: {
         buyerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }],
         warehouseSn: [{ required: true, message: '请选择退货仓库', trigger: 'change' }],
-        syncFlag: [{ required: true, message: '请选择是否同步', trigger: ['change', 'blur'] }]
+        syncFlag: [{ required: true, message: '请选择是否同步', trigger: ['change', 'blur'] }],
+        goodFlag: [{ required: true, message: '请选择退货类别', trigger: ['change', 'blur'] }]
       },
       fetching: false,
       dealerData: []
@@ -157,9 +172,9 @@ export default {
             countyName: data.districtName,
             customerAddr: data.address //  详细地址
           })
+          console.log(this.form)
         } else {
           this.$message.error('获取客户信息失败')
-          this.$refs.ruleForm.resetFields()
         }
       })
     },
@@ -194,7 +209,7 @@ export default {
         }
       })
     },
-    getDefaultWarehouse(){
+    getDefaultWarehouse () {
       getDefaultWarehouse().then(res => {
         this.form.warehouseSn = res.data ? res.data.warehouseSn : undefined
       })
@@ -214,8 +229,9 @@ export default {
         countySn: '', // 区
         countyName: '',
         customerAddr: '', //  详细地址
-        warehouseSn: undefined, 
-        syncFlag: undefined // 是否同步
+        warehouseSn: undefined,
+        syncFlag: undefined, // 是否同步
+        goodFlag: undefined
       }
       this.$refs.ruleForm.resetFields()
       this.dealerData = []
@@ -225,7 +241,7 @@ export default {
   watch: {
     show (newValue, oldValue) {
       this.opened = newValue
-      if(newValue){
+      if (newValue) {
         this.getDefaultWarehouse()
       }
     }

+ 4 - 2
src/views/salesReturnManagement/salesReturn/chooseImportModal.vue

@@ -99,7 +99,8 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReason', width: 150, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: 150, align: 'center', customRender: function (text) { return text || '--' } }
       ]
       return arr
     },
@@ -109,7 +110,8 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货原因', dataIndex: 'returnReason', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'errorDesc', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '错误说明', dataIndex: 'errorDesc', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ]
       return arr
     }

+ 19 - 9
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -49,9 +49,10 @@
               <a-descriptions-item label="客户采退申请单号">{{ detailData&&detailData.purchaseReturnApplyNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="是否同步给客户">{{ detailData&&detailData.syncFlag ? ['否', '是'][detailData.syncFlag] : '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货类别">{{ detailData&&detailData.goodFlagDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货类型">{{ detailData&&detailData.salesReturnTypeDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
               <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditTime || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="退货类型">{{ detailData&&detailData.salesReturnTypeDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="附件" v-if="detailData" :span="3">
                 <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.attachmentList" :key="item.id">
                   {{ item.fileName }}
@@ -81,7 +82,7 @@
               </div>
             </a-alert>
             <div style="display:flex;align-items:center;justify-content: space-between;margin-bottom: 10px;">
-              <div>说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+              <div>说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品;退货原因文字显示红色表示退货原因和退货类别不一致;</div>
             </div>
             <!-- 列表 -->
             <s-table
@@ -93,7 +94,13 @@
               :rowKey="record => record.id"
               :columns="columns"
               :data="loadData"
-              bordered></s-table>
+              :scroll="{ x: 'calc(700px + 50%)'}"
+              bordered>
+              <!-- 退货原因 -->
+              <template slot="returnReason" slot-scope="text, record">
+                <span title="退货原因和退货类别不一致" :style="{color:record.needHandleFlag==1?'red':''}">{{ record.returnReason||'--' }}</span>
+              </template>
+            </s-table>
           </a-tab-pane>
           <a-tab-pane :key="2" tab="审核进度" >
             <auditDetail v-if="$hasPermissions('B_salesReturnAudit')" ref="auditDetail" businessType="SALES_RETURN" :itemSn="$route.params.sn"></auditDetail>
@@ -203,14 +210,15 @@ export default {
         { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_salesReturnDetail_salesPrice') && this.showFlag != 0) { //  售价权限
-        arr.splice(10, 0, { title: '参考退货单价', dataIndex: 'initialPrice', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(11, 0, { title: '参考退货金额', dataIndex: 'initialAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(12, 0, { title: '实际退货单价', dataIndex: 'price', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(13, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(14, 0, { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(11, 0, { title: '参考退货单价', dataIndex: 'initialPrice', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(12, 0, { title: '参考退货金额', dataIndex: 'initialAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(13, 0, { title: '实际退货单价', dataIndex: 'price', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(14, 0, { title: '实际退货金额', dataIndex: 'totalAmount', align: 'right', width: '6%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(15, 0, { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     }
@@ -220,6 +228,8 @@ export default {
     handleBack () {
       if (this.$route.query.path == 'receiveCheck') {
         this.$router.push({ name: 'receiveCheckList' })
+      } else if (this.$route.query.path == 'returnSchedule') {
+        this.$router.push({ name: 'returnSchedule' })
       } else {
         this.$router.push({ name: 'salesReturnList' })
       }

+ 15 - 26
src/views/salesReturnManagement/salesReturn/importGuideModal.vue

@@ -15,11 +15,15 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“退货原因”的列,且名称必须相同</li>
-            <li>2) 除了“产品编码”、“数量”、“退货原因”四列,其他列可自定义,不影响数据导入</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“退货原因”、“备注”的列,且名称必须相同</li>
+            <li>2) 除了“产品编码”、“数量”、“退货原因”、“备注”四列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -80,6 +84,10 @@ export default {
     params: {
       type: Object,
       default: null
+    },
+    goodFlag: {
+      type: [String,Number],
+      default: ''
     }
   },
   data () {
@@ -91,7 +99,8 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false,
+      filePath: ''
     }
   },
   methods: {
@@ -124,28 +133,6 @@ export default {
       this.openImportModal = false
       this.isShow = false
     },
-    // 下载模板
-    handleExport () {
-      this.exportLoading = true
-      setTimeout(() => {
-        this.exportLoading = false
-      }, 1000)
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx?t=' + new Date().getTime()
-      link.setAttribute('download', '销售退货单产品导入模板' + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-      document.body.removeChild(link)
-    }
-    //  下载模板
-    // handleExport () {
-    //   const _this = this
-    //   _this.spinning = true
-    //   exportExcel(downLoadTemp, { type: 'XSTHMX' }, '销售退货单产品导入模板', function () {
-    //     _this.spinning = false
-    //   }, true)
-    // }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -158,6 +145,8 @@ export default {
         this.$emit('close')
         this.paramsData = null
         this.$refs.importUpload.setFileList('')
+      }else{
+        this.filePath = location.protocol + '//' +location.host + (this.goodFlag==1 ? '/templ/销售退货(良品)产品明细模板.xlsx' : '/templ/销售退货(不良品)产品明细模板.xlsx')
       }
     }
   }

+ 46 - 18
src/views/salesReturnManagement/salesReturn/list.vue

@@ -20,12 +20,33 @@
                 <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesReturn-buyerSn" @change="custChange" />
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="退货类别" prop="goodFlag">
+                <v-select
+                  v-model="queryParam.goodFlag"
+                  ref="goodFlag"
+                  id="returnSchedule-goodFlag"
+                  code="GOOD_FLAG"
+                  placeholder="请选择退货类别"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="退货类型">
+                <v-select
+                  v-model="queryParam.salesReturnType"
+                  id="departUser-salesReturnType"
+                  code="SALES_RETURN_TYPE"
+                  placeholder="请选择退货类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="总部销退单号">
+                <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+              </a-form-item>
+            </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="总部销退单号">
-                  <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="客户采退申请单号">
                   <a-input id="salesReturn-purchaseReturnApplyNo" v-model.trim="queryParam.purchaseReturnApplyNo" allowClear placeholder="请输入客户采退申请单号"/>
@@ -71,8 +92,8 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
-                    <Area id="salesReturn-provinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                  </a-form-model-item>
+                  <Area id="salesReturn-provinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="退货仓库">
@@ -105,7 +126,7 @@
             良品数量:{{ countData&&countData.totalGoodQty||0 }};
             返库数量:{{ countData&&countData.totalBackStockQty||0 }};
             <span v-if="$hasPermissions('M_salesReturnList_salesPrice')">
-            实际退货金额:{{ countData&&countData.totalAmount?toThousands(countData.totalAmount):0 }};
+              实际退货金额:{{ countData&&countData.totalAmount?toThousands(countData.totalAmount):0 }};
             </span>
           </div>
         </a-alert>
@@ -261,13 +282,16 @@ export default {
         purchaseReturnApplyNo: '',
         syncFlag: undefined, // 是否同步给客户
         billStatus: undefined, // 业务状态
+        goodFlag: undefined,
+        salesReturnType: undefined,
         warehouseSn: undefined, // 仓库
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
         shippingAddrProvinceSn: undefined,
         salesReturnBillSource: undefined
+
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -302,11 +326,13 @@ export default {
         { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '5%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
-        { title: '客户采退申请单号', dataIndex: 'purchaseReturnApplyNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '8%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '同步给客户', dataIndex: 'syncFlag', width: '5%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
+        { title: '客户采退申请单号', dataIndex: 'purchaseReturnApplyNo', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '7%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', width: '7%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -316,8 +342,8 @@ export default {
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
-      if(this.$hasPermissions('M_salesReturnList_salesPrice')){
-        arr.splice(13,0,{ title: '实际退货金额', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+      if (this.$hasPermissions('M_salesReturnList_salesPrice')) {
+        arr.splice(13, 0, { title: '实际退货金额', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }
@@ -367,7 +393,7 @@ export default {
       }
     },
     // 取消
-    handleCansel(row){
+    handleCansel (row) {
       const _this = this
       this.$confirm({
         title: '提示',
@@ -428,7 +454,7 @@ export default {
         this.spinning = false
       })
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -452,6 +478,8 @@ export default {
       this.queryParam.salesReturnBillSource = undefined
       this.queryParam.shippingAddrProvinceSn = undefined
       this.queryParam.warehouseSn = undefined
+      this.queryParam.goodFlag = undefined
+      this.queryParam.salesReturnType = undefined
       if (this.advanced) {
         this.$refs.subarea.clearData()
       }

+ 23 - 7
src/views/salesReturnManagement/salesReturn/queryPart.vue

@@ -64,7 +64,13 @@
       <!-- 退货原因 -->
       <template slot="returnReason" slot-scope="text, record">
         <div @dblclick.stop>
-          <returnReason v-model.trim="record.returnReason"></returnReason>
+          <returnReason :goodFlag="goodFlag" v-model.trim="record.returnReasonCode"></returnReason>
+        </div>
+      </template>
+      <!-- 备注 -->
+      <template slot="remarks" slot-scope="text, record">
+        <div @dblclick.stop>
+          <a-input :maxLength="50" size="small" v-model="record.returnReasonRemarks" placeholder="请输入备注(最多50字符)"/>
         </div>
       </template>
       <span slot="customTitle">
@@ -111,6 +117,10 @@ export default {
     showReceiveQty: {
       type: Boolean,
       default: false
+    },
+    showRemark: {
+      type: Boolean,
+      default: false
     }
   },
   data () {
@@ -123,6 +133,7 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [],
+      goodFlag:'',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -136,6 +147,7 @@ export default {
               data.list[i].no = no + i + 1
               data.list[i].qty = this.showReceiveQty ? 0 : 1
               data.list[i].receiveQty = 1
+              data.list[i].returnReasonRemarks = ''
             }
             this.disabled = false
           }
@@ -165,16 +177,17 @@ export default {
       this.queryParam.code = ''
       this.$refs.table.refresh(true)
     },
-    pageInit (buyerSn, warehouseSn) {
+    pageInit (buyerSn, warehouseSn, goodFlag) {
       this.buyerSn = buyerSn
+      this.goodFlag = goodFlag
       // this.queryParam.warehouseSn = warehouseSn
       const arr = [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '27%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'code', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'qty', width: '9%', align: 'center', scopedSlots: { customRender: 'qty' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '10%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '申请退货数量', dataIndex: 'qty', width: '8%', align: 'center', scopedSlots: { customRender: 'qty' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '12%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
         { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       let i = 5
@@ -184,7 +197,10 @@ export default {
       }
       // 实收数量是否显示
       if (this.showReceiveQty) {
-        arr.splice(i, 0, { title: '仓库实收数量', dataIndex: 'receiveQty', width: '9%', align: 'center', scopedSlots: { customRender: 'receiveQty' } })
+        arr.splice(i, 0, { title: '仓库实收数量', dataIndex: 'receiveQty', width: '8%', align: 'center', scopedSlots: { customRender: 'receiveQty' } })
+      }
+      if (this.showRemark) {
+        arr.splice(i + 2, 0, { title: '备注', dataIndex: 'remarks', width: '12%', align: 'center', scopedSlots: { customRender: 'remarks' } })
       }
       this.columns = arr
       this.resetSearchForm()

+ 77 - 40
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -6,16 +6,11 @@
         <template slot="subTitle">
           <a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
-          <span style="margin: 0 15px;color: #666;" v-if="ordeDetail">
-            退货仓库:<warehouse
-              style="width:200px;"
-              :allowClear="false"
-              disabled
-              v-model="ordeDetail.warehouseSn"
-              @change="updateWarehouse"
-              id="basicInfo-warehouseSn"
-              placeholder="请选择退货仓库"
-            />
+          <span style="margin: 0 10px;color: #666;">
+            退货仓库:{{ ordeDetail&&ordeDetail.warehouseName }}
+          </span>
+          <span style="margin: 0 10px;color: #666;">
+            退货类别:{{ ordeDetail&&ordeDetail.goodFlagDictValue }}
           </span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
@@ -115,7 +110,11 @@
           </template>
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
-            <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
+            <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode" @change="e => updateReason(e, record, 0)"></returnReason>
+          </template>
+          <!-- 备注 -->
+          <template slot="returnRemarks" slot-scope="text, record">
+            <a-input size="small" placeholder="请输入备注" v-model="record.returnReasonRemarks" @blur="e => updateReason(e, record, 1)"></a-input>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
@@ -143,13 +142,20 @@
     <!-- 选择审核人员 -->
     <chooseDepartUserModal ref="chooseDepart" :showDefUser="true" :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
     <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
+    <importGuideModal :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0" :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
-      <div style="text-align: center;">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+      <div style="text-align: left;">
         <div style="line-height: 24px;">
-          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+          <div><span style="color:red;">*</span>退货原因</div>
+          <div><returnReason size="large" :goodFlag="goodFlag" v-model="plReturnReason"></returnReason></div>
+        </div>
+        <div style="line-height: 24px;margin-top:10px;">
+          <a-checkbox :checked="showEditRemarks" @change="e => showEditRemarks=!showEditRemarks">是否设置备注</a-checkbox>
+        </div>
+        <div style="line-height: 24px;margin-top:10px;" v-if="showEditRemarks">
+          <div>备注</div>
+          <div><a-input size="large" :maxLength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
         </div>
       </div>
     </commonModal>
@@ -230,7 +236,8 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].qtyBackups = data.list[i].initialQty
-              data.list[i].returnReasonBackups = data.list[i].returnReason
+              data.list[i].returnReasonBackups = data.list[i].returnReasonCode
+              data.list[i].bakReamrks = data.list[i].returnReasonRemarks
             }
             this.disabled = false
             this.chooseLoadData = data.list
@@ -242,29 +249,38 @@ export default {
       openGuideModal: false, //  导入产品引导
       total: 0,
       rowSelectionInfo: null,
-      plReturnReason: '',
-      showPlModal: false
+      plReturnReason: undefined,
+      plReturnRemark: undefined,
+      showEditRemarks: false,
+      showPlModal: false,
+      returnReasonlist: []
     }
   },
   watch: {
     showPlModal (newValue, oldValue) {
       if (!newValue) {
-        this.plReturnReason = ''
+        this.plReturnReason = undefined
+        this.plReturnRemark = undefined
+        this.showEditRemarks = false
       }
     }
   },
   computed: {
+    goodFlag () {
+      return this.ordeDetail && this.ordeDetail.goodFlag || ''
+    },
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
         { title: '退货原因', dataIndex: 'returnReason', align: 'center', width: '13%', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', scopedSlots: { customRender: 'returnRemarks' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('B_salesReturnEdit_salesPrice')) { //  售价权限
@@ -322,24 +338,31 @@ export default {
       })
     },
     // 修改退货原因
-    updateReason (row) {
-      console.log(row.returnReason)
-      row.returnReason = removeEmptyStr(row.returnReason)
-      // 空或没有改变时不保存数据
-      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
-        row.returnReason = row.returnReasonBackups
-        return
+    updateReason (val, record, type) {
+      console.log(val, record, type)
+      const params = {
+        salesReturnDetailSn: record.salesReturnDetailSn,
+        goodFlag: this.goodFlag
+      }
+      // 退货原因
+      if (type == 0) {
+        const rows = this.returnReasonlist.find(item => item.code == val)
+        params.returnReasonCode = val || ''
+        params.returnReason = rows ? rows.dispName : ''
+      } else {
+        // 备注
+        params.returnReasonRemarks = val.target.value
+        if (params.returnReasonRemarks == record.bakReamrks) {
+          return
+        }
       }
       this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: row.salesReturnDetailSn,
-        returnReason: row.returnReason
-      }).then(res => {
+      salesReturnDetailUpdateReason(params).then(res => {
         if (res.status == 200) {
           this.resetTable(false)
           this.$message.success(res.message)
         } else {
-          row.returnReason = row.returnReasonBackups
+          row.returnReasonCode = record.returnReasonBackups
         }
         this.spinning = false
       })
@@ -353,18 +376,22 @@ export default {
       }
     },
     setPlReturnReason () {
-      if (this.plReturnReason == '') {
-        this.$message.warning('请输入退货原因!')
+      if (!this.plReturnReason) {
+        this.$message.warning('请选择退货原因!')
       } else {
         this.spinning = true
         const snList = []
         const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
         arr.map(item => {
           snList.push(item.salesReturnDetailSn)
         })
         salesReturnDetailSetReason({
           salesReturnBillDetailSnList: snList,
-          returnReason: this.plReturnReason
+          salesReturnBillSn: this.$route.params.sn,
+          returnReason: rows ? rows.dispName : '',
+          returnReasonCode: this.plReturnReason,
+          returnReasonRemarks: this.showEditRemarks ? this.plReturnRemark || '' : undefined
         }).then(res => {
           if (res.status == 200) {
             this.showPlModal = false
@@ -379,8 +406,16 @@ export default {
     getOrderDetail (flag) {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if (res.data.goodFlag == 'DEFECTIVE_PRODUCT_RETURN') {
+          this.returnReasonlist = this.$store.state.app.defectiveReturnReason
+        }
+        // 良品
+        if (res.data.goodFlag == 'GOOD_PRODUCT_RETURN') {
+          this.returnReasonlist = this.$store.state.app.goodReturnReason
+        }
+        this.$refs.table.refresh(!flag)
         if (!flag) {
-          this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn)
+          this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn, this.goodFlag)
         }
       })
     },
@@ -414,7 +449,6 @@ export default {
     resetSearchForm (flag) {
       this.productForm.productName = ''
       this.productForm.productCode = ''
-      this.$refs.table.refresh(!!flag)
       this.getOrderDetail(flag)
     },
     // 添加或修改产品
@@ -423,13 +457,16 @@ export default {
       if (this.isInster) {
         return
       }
+      // 退货原因
+      const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
       this.isInster = true
       const params = {
         'salesReturnBillSn': this.orderSn,
         'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
         'price': row.productPrice,
-        // 'cost': row.lastStockCost,
-        'returnReason': row.returnReason,
+        'returnReasonCode': row.returnReasonCode,
+        'returnReason': rows ? rows.dispName : '',
+        'goodFlag': this.goodFlag,
         'productSn': row.productSn,
         'initialQty': row.qty
       }

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.2.111/ocs-admin',
+        // target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {