Browse Source

散件退货

chenrui 4 years ago
parent
commit
26dcb31f80

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

@@ -1258,6 +1258,64 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/bulkManagement/bulkReturnGoods',
+            redirect: '/bulkManagement/bulkReturnGoods/list',
+            name: 'bulkReturnGoods',
+            component: RouteView,
+            meta: {
+              title: '散件退货',
+              icon: 'gold'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: '/bulkManagement/bulkReturnGoods/list',
+                name: 'bulkReturnGoodsList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/bulkManagement/bulkReturnGoods/list.vue'),
+                meta: {
+                  title: '散件退货列表',
+                  icon: 'gold',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              },
+              {
+                path: '/bulkManagement/bulkReturnGoods/add',
+                name: 'bulkReturnGoodsAdd',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/bulkManagement/bulkReturnGoods/edit.vue'),
+                meta: {
+                  title: '新增散件退货单',
+                  icon: 'gold',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: '/bulkManagement/bulkReturnGoods/edit/:id',
+                name: 'bulkReturnGoodsEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/bulkManagement/bulkReturnGoods/edit.vue'),
+                meta: {
+                  title: '编辑散件退货单',
+                  icon: 'gold',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: '/bulkManagement/bulkReturnGoods/detail/:id',
+                name: 'bulkReturnGoodsDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/bulkManagement/bulkReturnGoods/detail.vue'),
+                meta: {
+                  title: '散件退货单详情',
+                  icon: 'gold',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
           }
         ]
       },

+ 8 - 0
src/views/bulkManagement/bulkReturnGoods/detail.vue

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

+ 8 - 0
src/views/bulkManagement/bulkReturnGoods/edit.vue

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

+ 235 - 0
src/views/bulkManagement/bulkReturnGoods/list.vue

@@ -0,0 +1,235 @@
+<template>
+  <a-card :bordered="false" class="bulkReturnGoodsList-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-input id="bulkReturnGoodsList-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入散件退货单号"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <a-range-picker
+                style="width:100%"
+                id="bulkReturnGoodsList-creatTime"
+                :disabledDate="disabledDate"
+                v-model="time"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="供应商">
+              <a-select id="bulkReturnGoodsList-customerTypeSn" v-model="queryParam.customerTypeSn" placeholder="请选择供应商">
+                <a-select-option v-for="item in custTypeList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据状态">
+                <v-select code="CHECK_ENABLE_STATE" id="bulkReturnGoodsList-satelliteFlag" v-model="queryParam.satelliteFlag" allowClear placeholder="请选择"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="结算状态">
+                <v-select code="CHECK_ENABLE_STATE" id="bulkReturnGoodsList-satelliteFlag" v-model="queryParam.satelliteFlag" allowClear placeholder="请选择"></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkReturnGoodsList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="bulkReturnGoodsList-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>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-button id="bulkReturnGoodsList-add" type="primary" @click="handleAdd()">新增散件退货单</a-button>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">共 <strong>6</strong> 条记录,总数量合计 <strong>14</strong> ,总金额合计 <strong>¥14</strong> </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 是否转销售单 -->
+      <template slot="invenstoryNum" slot-scope="text, record">
+        <span>{{ record.invenstoryNum == 1 ? '是' : '否' }}</span>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button size="small" type="primary" @click="handleEdit(record)" id="bulkReturnGoodsList-edit-btn">编辑</a-button>
+        <a-button size="small" @click="handleDetail(record)" id="bulkReturnGoodsList-detail-btn" style="margin: 0 0 10px 8px">详情</a-button>
+        <a-button size="small" @click="handleAdopt(record)" id="bulkReturnGoodsList-isAdopt-btn" style="margin: 0 0 10px 8px">{{ record.adopt == 0 ? '通过' : '不通过' }}</a-button>
+        <a-button size="small" type="danger" @click="handleDel(record)" id="bulkReturnGoodsList-del-btn" style="margin: 0 0 0 8px">删除</a-button>
+      </template>
+    </s-table>
+    <!-- 选择基本信息弹框 -->
+    <!-- <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" /> -->
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { sparePartsRetList } from '@/api/sparePartsRet'
+import { STable, VSelect } from '@/components'
+// import basicInfoModal from './basicInfoModal.vue'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      queryParam: { //  查询条件
+        sparePartsReturnNo: '', //  散件退货单号
+        supplierSn: undefined, //  供应商
+        settleState: undefined, //  结算状态
+        state: undefined //  单据状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      dateFormat: 'YYYY-MM-DD',
+      time: [], //  创建时间
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '散件退货单号', dataIndex: 'sparePartsReturnNo', width: 180, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 180, align: 'center' },
+        { title: '供应商', dataIndex: 'supplierName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品款数', dataIndex: 'productTotalCategory', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'productTotalQty', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总金额', dataIndex: 'productTotalCost', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单据状态', dataIndex: 'state', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '结算状态', dataIndex: 'settleState', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // 创建时间
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        return sparePartsRetList(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
+        })
+      },
+      custTypeList: [], //  供应商下拉
+      openModal: false // 基本信息弹框是否显示
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.orderBundleNo = ''
+      this.queryParam.orderBundle.custMobile = ''
+      this.queryParam.bundleName = ''
+      this.queryParam.itemName = ''
+      this.oldTime = undefined
+      this.newTime = undefined
+      this.$refs.table.refresh(true)
+    },
+    //  基本信息  保存
+    handleOk () {
+      this.$router.push({ path: `/bulkManagement/bulkReturnGoods/add` })
+    },
+    //  新增
+    handleAdd () {
+      this.openModal = true
+    },
+    //  编辑
+    handleEdit (row) {
+      this.$router.push({ path: `/bulkManagement/bulkReturnGoods/edit/${row.id}` })
+    },
+    //  详情
+    handleDetail (row) {
+      this.$router.push({ path: `/bulkManagement/bulkReturnGoods/detail/${row.id}` })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '删除后不可恢复,确定要进行删除吗?',
+        okText: '确定',
+        cancelText: '取消',
+        centered: true,
+        onOk () {
+          // warehouseDel({
+          //   id: row.id
+          // }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$refs.table.refresh()
+          //   }
+          // })
+        }
+      })
+    },
+    //  是否通过
+    handleAdopt (row) {
+      const _this = this
+      const content = '确认要审核' + row.adopt ? '不' : '' + '通过吗?'
+      this.$confirm({
+        title: '提示',
+        content: '确认要审核通过吗?',
+        okText: '确定',
+        cancelText: '取消',
+        centered: true,
+        onOk () {
+          // warehouseDel({
+          //   id: row.id
+          // }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$refs.table.refresh()
+          //   }
+          // })
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .bulkReturnGoodsList-wrap{
+    .sTable{
+      table{
+        width: auto;
+      }
+    }
+  }
+</style>

+ 17 - 1
src/views/customerManagement/customerInfo/list.vue

@@ -127,6 +127,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { getProvince, getCityByPro, getDistrictByCity } from '@/api/data'
 import { custList, custDel } from '@/api/customer'
 import { custTypeFindAll } from '@/api/custType'
@@ -164,7 +165,22 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        //  最后销售时间
+        // 创建时间
+        if (this.creatTime && this.creatTime.length > 0) {
+          this.queryParam.beginDate = moment(this.creatTime[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.creatTime[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        // 最后销售时间
+        if (this.lastSaleTime && this.lastSaleTime.length > 0) {
+          this.queryParam.saleBeginDate = moment(this.lastSaleTime[0]).format(this.dateFormat)
+          this.queryParam.saleEndDate = moment(this.lastSaleTime[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.saleBeginDate = undefined
+          this.queryParam.saleEndDate = undefined
+        }
         return custList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize