瀏覽代碼

对接采购退货

chenrui 4 年之前
父節點
當前提交
6a163a7459

+ 43 - 0
src/api/purchaseReturn.js

@@ -0,0 +1,43 @@
+import { axios } from '@/utils/request'
+
+//  采购退货列表  分页
+export const purchaseReturnList = (params) => {
+  const url = `/purchaseReturn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  采购退货 详情 选择产品 列表  分页
+export const purchaseReturnPurchaseBillDetailList = (params) => {
+  const url = `/purchaseReturn/detail/queryPurchaseBillDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  采购退货 详情列表  分页
+export const purchaseReturnDetailList = (params) => {
+  const url = `/purchaseReturn/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  采购退货 详情 选择产品 列表  分页
+export const purchaseReturnSave = (params) => {
+  return axios({
+    url: '/purchaseReturn/detail/save',
+    data: params,
+    method: 'post'
+  })
+}

+ 139 - 81
src/config/router.config.js

@@ -333,87 +333,145 @@ export const asyncRouterMap = [
         ]
       },
       // 采购管理
-      // {
-      //   path: '/purchasingManagement',
-      //   redirect: '/purchasingManagement/purchaseOrder',
-      //   component: PageView,
-      //   meta: {
-      //     title: '采购管理',
-      //     icon: 'money-collect'
-      //     // permission: 'M_shop'
-      //   },
-      //   children: [
-      //     {
-      //       path: '/purchasingManagement/purchaseOrder',
-      //       redirect: '/purchasingManagement/purchaseOrder/list',
-      //       name: 'purchaseOrder',
-      //       component: RouteView,
-      //       meta: {
-      //         title: '采购单管理',
-      //         icon: 'money-collect'
-      //         // permission: 'M_goodsManage_list'
-      //       },
-      //       hideChildrenInMenu: true,
-      //       children: [
-      //         {
-      //           path: 'list',
-      //           name: 'purchaseOrderList',
-      //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/list.vue'),
-      //           meta: {
-      //             title: '采购单列表',
-      //             icon: 'money-collect',
-      //             hidden: true
-      //             // permission: 'M_goodsManage_list'
-      //           }
-      //         },
-      //         {
-      //           path: 'add',
-      //           name: 'purchaseOrderAdd',
-      //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
-      //           meta: {
-      //             title: '新增采购单',
-      //             icon: 'money-collect',
-      //             hidden: true
-      //             // permission: 'B_goodsManage_edit'
-      //           }
-      //         },
-      //         {
-      //           path: 'edit/:id',
-      //           name: 'purchaseOrderEdit',
-      //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
-      //           meta: {
-      //             title: '编辑采购单',
-      //             icon: 'money-collect',
-      //             hidden: true
-      //             // permission: 'B_goodsManage_edit'
-      //           }
-      //         },
-      //         {
-      //           path: 'detail/:id',
-      //           name: 'purchaseOrderDetail',
-      //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/detail.vue'),
-      //           meta: {
-      //             title: '采购单详情',
-      //             icon: 'money-collect',
-      //             hidden: true
-      //             // permission: 'B_goodsManage_edit'
-      //           }
-      //         },
-      //         {
-      //           path: 'warehousing/:id',
-      //           name: 'purchaseOrderWarehousing',
-      //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/warehousing.vue'),
-      //           meta: {
-      //             title: '入库',
-      //             icon: 'money-collect',
-      //             hidden: true
-      //             // permission: 'B_goodsManage_edit'
-      //           }
-      //         }
-      //       ]
-      //     }
-      //   ]
-      // },
+      {
+        path: '/purchasingManagement',
+        redirect: '/purchasingManagement/purchaseOrder',
+        component: PageView,
+        meta: {
+          title: '采购管理',
+          icon: 'money-collect'
+          // permission: 'M_shop'
+        },
+        children: [
+          //     {
+          //       path: '/purchasingManagement/purchaseOrder',
+          //       redirect: '/purchasingManagement/purchaseOrder/list',
+          //       name: 'purchaseOrder',
+          //       component: RouteView,
+          //       meta: {
+          //         title: '采购单管理',
+          //         icon: 'money-collect'
+          //         // permission: 'M_goodsManage_list'
+          //       },
+          //       hideChildrenInMenu: true,
+          //       children: [
+          //         {
+          //           path: 'list',
+          //           name: 'purchaseOrderList',
+          //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/list.vue'),
+          //           meta: {
+          //             title: '采购单列表',
+          //             icon: 'money-collect',
+          //             hidden: true
+          //             // permission: 'M_goodsManage_list'
+          //           }
+          //         },
+          //         {
+          //           path: 'add',
+          //           name: 'purchaseOrderAdd',
+          //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
+          //           meta: {
+          //             title: '新增采购单',
+          //             icon: 'money-collect',
+          //             hidden: true
+          //             // permission: 'B_goodsManage_edit'
+          //           }
+          //         },
+          //         {
+          //           path: 'edit/:id',
+          //           name: 'purchaseOrderEdit',
+          //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/edit.vue'),
+          //           meta: {
+          //             title: '编辑采购单',
+          //             icon: 'money-collect',
+          //             hidden: true
+          //             // permission: 'B_goodsManage_edit'
+          //           }
+          //         },
+          //         {
+          //           path: 'detail/:id',
+          //           name: 'purchaseOrderDetail',
+          //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/detail.vue'),
+          //           meta: {
+          //             title: '采购单详情',
+          //             icon: 'money-collect',
+          //             hidden: true
+          //             // permission: 'B_goodsManage_edit'
+          //           }
+          //         },
+          //         {
+          //           path: 'warehousing/:id',
+          //           name: 'purchaseOrderWarehousing',
+          //           component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseOrder/warehousing.vue'),
+          //           meta: {
+          //             title: '入库',
+          //             icon: 'money-collect',
+          //             hidden: true
+          //             // permission: 'B_goodsManage_edit'
+          //           }
+          //         }
+          //       ]
+          //     }
+          {
+            path: '/purchasingManagement/purchaseReturn',
+            redirect: '/purchasingManagement/purchaseReturn/list',
+            name: 'purchaseReturn',
+            component: RouteView,
+            meta: {
+              title: '采购退货',
+              icon: 'money-collect'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'purchaseReturnList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseReturn/list.vue'),
+                meta: {
+                  title: '采购退货列表',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              },
+              {
+                path: 'add',
+                name: 'purchaseReturnAdd',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseReturn/edit.vue'),
+                meta: {
+                  title: '新增采购退货单',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'edit/:id/:sn',
+                name: 'purchaseReturnEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseReturn/edit.vue'),
+                meta: {
+                  title: '编辑采购退货单',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'detail/:id/:sn',
+                name: 'purchaseReturnDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/purchasingManagement/purchaseReturn/detail.vue'),
+                meta: {
+                  title: '采购退货详情',
+                  icon: 'money-collect',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 调拨管理
       {
         path: '/allocationManagement',

+ 1 - 1
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -161,7 +161,7 @@
                 id="storeTransferOutEdit-outQty"
                 v-model="record.outQty"
                 :precision="0"
-                :min="0"
+                :min="1"
                 :max="999999"
                 placeholder="请输入"
                 @blur="e => outQtyChange(e.target.value, record)"

+ 4 - 4
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -99,7 +99,7 @@
                   id="bulkWarehousingOrderEdit-putCost"
                   v-model="record.putCost"
                   :precision="2"
-                  :min="0"
+                  :min="1"
                   :max="999999"
                   placeholder="请输入"
                   style="width: 100%;" />
@@ -110,7 +110,7 @@
                   id="bulkWarehousingOrderEdit-putQty"
                   v-model="record.putQty"
                   :precision="0"
-                  :min="0"
+                  :min="1"
                   :max="999999"
                   placeholder="请输入"
                   style="width: 100%;" />
@@ -172,7 +172,7 @@
                   id="bulkWarehousingOrderEdit-choose-putCost"
                   v-model="record.putCost"
                   :precision="2"
-                  :min="0"
+                  :min="1"
                   :max="999999"
                   placeholder="请输入"
                   @blur="e => putCostChange(e.target.value, record)"
@@ -184,7 +184,7 @@
                   id="bulkWarehousingOrderEdit-choose-putQty"
                   v-model="record.putQty"
                   :precision="0"
-                  :min="0"
+                  :min="1"
                   :max="999999"
                   placeholder="请输入"
                   @blur="e => putQtyChange(e.target.value, record)"

+ 8 - 0
src/views/purchasingManagement/purchaseReturn/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 419 - 0
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -0,0 +1,419 @@
+<template>
+  <div class="purchaseReturnEdit-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="purchaseReturnEdit-back" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+      </template>
+    </a-page-header>
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions :column="3">
+            <a-descriptions-item label="供应商名称">箭冠营销总部</a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 选择产品 -->
+    <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="选择产品">
+          <!-- 筛选条件 -->
+          <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-row :gutter="15">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="采购单号" prop="productCode">
+                    <a-input id="purchaseReturnEdit-productCode" v-model="queryParam.productCode" placeholder="请输入采购单号" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品编码" prop="productCode">
+                    <a-input id="purchaseReturnEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="产品名称" prop="productName">
+                    <a-input id="purchaseReturnEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
+          <!-- 列表 -->
+          <a-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :dataSource="loadData"
+            :scroll="{ x: 1280, y: 300 }"
+            :pagination="paginationProps"
+            bordered>
+            <!-- 数量 -->
+            <template slot="putQty" slot-scope="text, record">
+              <a-input-number
+                id="purchaseReturnEdit-putQty"
+                v-model="record.putQty"
+                :precision="0"
+                :min="1"
+                :max="999999"
+                placeholder="请输入"
+                style="width: 100%;" />
+            </template>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="purchaseReturnEdit-add-btn">添加</a-button>
+            </template>
+          </a-table>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <!-- 已选产品 -->
+    <a-card size="small" :bordered="false" class="purchaseReturnEdit-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1">
+          <template slot="header">
+            已选产品
+            <a-button size="small" class="import-btn" id="purchaseReturnEdit-import-btn" @click.stop="handleImport">导入明细</a-button>
+            <a-button
+              size="small"
+              type="primary"
+              class="import-btn"
+              id="purchaseReturnEdit-delAll-btn"
+              @click.stop="handleDelAll"
+              style="margin-left: 10px;">整单删除</a-button>
+          </template>
+          <!-- 列表 -->
+          <a-table
+            class="sTable"
+            ref="chooseTable"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="chooseColumns"
+            :dataSource="chooseLoadData"
+            :scroll="{ x: 1185, y: 300 }"
+            :pagination="choosePaginationProps"
+            bordered>
+            <!-- 退货数量 -->
+            <template slot="outQty" slot-scope="text, record">
+              <a-input-number
+                id="purchaseReturnEdit-outQty"
+                v-model="record.outQty"
+                :precision="0"
+                :min="1"
+                :max="999999"
+                placeholder="请输入"
+                @blur="e => outQtyChange(e.target.value, record)"
+                style="width: 100%;" />
+            </template>
+            <!-- 退货原因 -->
+            <template slot="remarks" slot-scope="text, record">
+              <a-input
+                id="purchaseReturnEdit-remarks"
+                v-model="record.remarks"
+                :maxLength="30"
+                placeholder="退货原因(最多30个字符)"
+                @change="e => outQtyChange(e.target.value, record)"
+                style="width: 100%;" />
+            </template>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
+            </template>
+          </a-table>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <a-affix :offset-bottom="0">
+      <div style="text-align: center;width: 100%;background-color: #fff;padding: 30px 0;box-shadow: 0 0 20px #dcdee2;">
+        <a-button type="primary" id="purchaseReturnEdit-submit" size="large" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
+      </div>
+    </a-affix>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { purchaseReturnPurchaseBillDetailList, purchaseReturnDetailList, purchaseReturnSave } from '@/api/purchaseReturn'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      queryParam: {
+        productCode: '',
+        productName: '',
+        warehouseSn: undefined,
+        brandSn: undefined,
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined
+      },
+      chooseQueryParam: {
+        productCode: '',
+        productName: ''
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      chooseDisabled: false, //  查询、重置按钮是否可操作
+      advanced: false, // 高级搜索 展开/关闭
+      productBrandList: [], //  产品品牌  下拉数据
+      productTypeList: [], //  产品分类  下拉数据
+      productType: [],
+      warehouseList: [], //  仓库  下拉数据
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 200, align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 200, align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', ellipsis: true },
+        { title: '采购总数', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', scopedSlots: { customRender: 'putQty' }, width: 200, align: 'center' },
+        { title: '采购价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      loadData: [],
+      pageNo: 1, //  分页页码
+      pageSize: 10, //  分页 每页多少条
+      paginationProps: {
+        showSizeChanger: true, //  是否可以改变 pageSize
+        total: 0, //  分页总条数
+        current: 1,
+        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
+        onChange: (current) => this.changePage(current)
+      },
+      // 表头
+      chooseColumns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 200, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
+        { title: '采购总数', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货数量', scopedSlots: { customRender: 'putQty' }, width: 100, align: 'center' },
+        { title: '采购价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', scopedSlots: { customRender: 'remarks' }, width: 100, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
+      ],
+      chooseLoadData: [],
+      choosePageNo: 1, //  分页页码
+      choosePageSize: 10, //  分页 每页多少条
+      choosePaginationProps: {
+        showSizeChanger: true, //  是否可以改变 pageSize
+        total: 0, //  分页总条数
+        current: 1,
+        onShowSizeChange: (current, pageSize) => this.changeChoosePageSize(current, pageSize),
+        onChange: (current) => this.changeChoosePage(current)
+      },
+      productTotal: null //  合计
+    }
+  },
+  methods: {
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 已选产品  重置
+    chooseResetSearchForm () {
+      this.chooseQueryParam.productCode = ''
+      this.chooseQueryParam.productName = ''
+      this.getChooseProductList(1)
+    },
+    //  添加/编辑
+    handleAdd (row, isEdit) {
+      const params = {
+        id: isEdit ? row.id : undefined,
+        storeCallOutSn: this.$route.params.sn,
+        outCost: row.putCost,
+        outQty: isEdit ? row.outQty : 1, //  添加时调出数量默认为1
+        productSn: row.productSn,
+        productCode: row.productCode,
+        productOrigCode: row.productOrigCode || undefined,
+        productTypeSn1: row.productTypeSn1,
+        productTypeSn2: row.productTypeSn2,
+        productTypeSn3: row.productTypeSn3,
+        brandSn: row.brandSn,
+        warehouseSn: row.warehouseSn,
+        warehouseLocationSn: row.warehouseLocationSn
+      }
+      purchaseReturnSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.getChooseProductList()
+        }
+      })
+    },
+    // 双击快速添加
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            this.handleAdd(record)
+          }
+        }
+      }
+    },
+    // 导入明细
+    handleImport () {},
+    // 整单删除
+    handleDelAll () {},
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          storeCallOutDetailDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getChooseProductList()
+            }
+          })
+        }
+      })
+    },
+    //  提交
+    handleSubmit () {
+      const _this = this
+      storeCallOutSubmit({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          setTimeout(() => {
+            _this.handleBack()
+          }, 1000)
+        }
+      })
+    },
+    //  导入明细
+    handleImport () {},
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/purchasingManagement/purchaseReturn/list' })
+    },
+    // 选择产品  列表
+    getPurchaseBillDetailList (pageNo) {
+      this.pageNo = this.pageNo || pageNo
+      this.disabled = true
+      this.queryParam = {}
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      purchaseReturnPurchaseBillDetailList(params).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = this.pageNo
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.loadData = data.list
+          this.disabled = false
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.loadData = []
+        }
+      })
+    },
+    //  已选产品 分页  一页多少条change
+    changeChoosePageSize (current, pageSize) {
+      this.choosePageNo = current
+      this.choosePageSize = pageSize
+      this.getChooseProductList()
+    },
+    //  已选产品 分页 页码change
+    changeChoosePage (current) {
+      this.choosePageNo = current
+      this.getChooseProductList()
+    },
+    // 已选产品列表数据
+    getChooseProductList (pageNo) {
+      this.choosePageNo = this.choosePageNo || pageNo
+      this.chooseDisabled = true
+      const params = {
+        pageNo: this.choosePageNo,
+        pageSize: this.choosePageSize,
+        purchaseBillNo: this.$route.params.sn
+      }
+      purchaseReturnDetailList(Object.assign(params, this.chooseQueryParam)).then(res => {
+        if (res.status == 200) {
+          const data = res.data
+          this.choosePaginationProps.total = Number(res.data.count) || 0
+          this.choosePaginationProps.current = data.pageNo
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.chooseLoadData = data.list
+          this.chooseDisabled = false
+        } else {
+          this.choosePaginationProps.total = 0
+          this.choosePaginationProps.current = 1
+          this.chooseLoadData = []
+        }
+      })
+    },
+    // 已选产品 调出数量  change
+    outQtyChange (val, record) {
+      this.handleAdd(record, 'edit')
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getPurchaseBillDetailList()
+      vm.getChooseProductList(1)
+      // vm.getProductBrand()
+      // vm.getProductType()
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .purchaseReturnEdit-wrap{
+    .purchaseReturnEdit-back{
+      margin-bottom: 15px;
+    }
+    .purchaseReturnEdit-cont{
+      margin-bottom: 15px;
+      .sub-title{
+        font-size: 12px;
+        color: #808695;
+        margin-left: 10px;
+      }
+      .tag-txt{
+        font-size: 12px;
+        color: #ed1c24;
+      }
+      .edit-circle-btn{
+        margin-left: 15px;
+        i{
+          vertical-align: text-bottom;
+        }
+      }
+      .import-btn{
+        margin-left: 15px;
+      }
+    }
+  }
+</style>

+ 188 - 0
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -0,0 +1,188 @@
+<template>
+  <a-card size="small" :bordered="false" class="purchaseReturnList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <a-range-picker
+                style="width:100%"
+                id="purchaseReturnList-createDate"
+                :disabledDate="disabledDate"
+                v-model="createDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="退货单号">
+              <a-input id="purchaseReturnList-putPersonName" v-model.trim="queryParam.putPersonName" allowClear placeholder="请输入退货单号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="业务状态">
+              <v-select
+                v-model="queryParam.state"
+                ref="state"
+                id="purchaseReturnList-state"
+                code="STORE_CALL_OUT_STATE"
+                placeholder="请选择业务状态"
+                allowClear
+              ></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-button id="purchaseReturnList-add" type="primary" @click="handleEdit()">新增</a-button>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1170 }"
+      bordered>
+      <!-- 店内调出单号 -->
+      <template slot="storeCallOutNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.storeCallOutNo }}</span>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="primary"
+          v-if="record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT'"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="purchaseReturnList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="primary"
+          v-if="record.state == 'WAIT_SUBMIT' || record.state == 'WAIT_AUDIT'"
+          class="button-error"
+          @click="handleDel(record)"
+          id="purchaseReturnList-del-btn">删除</a-button>
+      </template>
+    </s-table>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { STable, VSelect } from '@/components'
+import { purchaseReturnList } from '@/api/purchaseReturn'
+import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      createDate: [], //  创建时间
+      queryParam: { //  查询条件
+        putPersonName: undefined, //  调往对象
+        callOutType: undefined, //  调拨类型
+        state: undefined, //  业务状态
+        settleState: undefined //  财务状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      dateFormat: 'YYYY-MM-DD',
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '采购单号', scopedSlots: { customRender: 'storeCallOutNo' }, align: 'center' },
+        { title: '退货数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货金额', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
+        { title: '财务状态', dataIndex: 'settleStateDictValue', width: 110, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // 创建时间
+        if (this.createDate && this.createDate.length > 0) {
+          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        return purchaseReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+          const 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
+          return data
+        })
+      },
+      storeCallOutTypeList: [], //  调拨类型
+      itemId: '' //  当前id
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.putPersonName = undefined
+      this.queryParam.callOutType = undefined
+      this.queryParam.state = undefined
+      this.createDate = undefined
+      this.$refs.table.refresh(true)
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        centered: true,
+        onOk () {
+          storeCallOutDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ path: `/purchasingManagement/purchaseReturn/detail/${row.id}/${row.purchaseBillNo}` })
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      const _this = this
+      if (row) { //  编辑
+        _this.$router.push({ path: `/purchasingManagement/purchaseReturn/edit/${row.id}/${row.purchaseBillNo}` })
+      } else { //  新增
+        this.$confirm({
+          title: '提示',
+          content: '退货供应商:箭冠营销总部',
+          centered: true,
+          onOk () {
+            _this.$router.push({ path: '/purchasingManagement/purchaseReturn/add' })
+          }
+        })
+      }
+    }
+  }
+}
+</script>

+ 18 - 3
src/views/salesManagement/outboundOrder/list.vue

@@ -76,12 +76,12 @@
       class="sTable"
       ref="table"
       size="default"
-      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      :row-selection="rowSelection"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
       :showPagination="false"
-      :scroll="{ x: 1410 }"
+      :scroll="{ x: 1550 }"
       bordered>
       <!-- 状态 -->
       <template slot="state" slot-scope="text, record">
@@ -121,6 +121,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'inventoryMoneys', width: 160, align: 'center' },
         { title: '关联单号', dataIndex: 'productName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库类型', dataIndex: 'prodsssuctName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'productBrand', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'productType', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'inventoryNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -150,7 +151,8 @@ export default {
             pageNo: 1,
             pageSize: 10,
             list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+              { id: '1', productNum: 'jgqp11111111111', isDisabled: true, productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' },
+              { id: '2', productNum: 'jgqp11111111111', isDisabled: false, productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
             ]
           }
           const no = (data.pageNo - 1) * data.pageSize
@@ -166,6 +168,19 @@ export default {
   computed: {
     hasSelected () {
       return this.selectedRowKeys.length > 0
+    },
+    rowSelection () {
+      return {
+        selectedRowKeys: this.selectedRowKeys,
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.onSelectChange(selectedRowKeys)
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.isDisabled // Column configuration not to be checked
+          }
+        })
+      }
     }
   },
   methods: {

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.16.102:8503/qpls-md',
+        target: 'http://192.168.16.194:8503/qpls-md',
         // target: 'http://qpls-md.360arrow.com.cn/qpls-md',
         // target: 'http://380d150d.nat123.fun:38226/qpls-md',
         ws: false,