chenrui 4 anni fa
parent
commit
da76057bf0
2 ha cambiato i file con 182 aggiunte e 0 eliminazioni
  1. 25 0
      src/config/router.config.js
  2. 157 0
      src/views/salesManagement/giftRecord/list.vue

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

@@ -292,6 +292,31 @@ export const asyncRouterMap = [{
             }
           }
         ]
+      },
+      {
+        path: '/salesManagement/giftRecord',
+        redirect: '/salesManagement/giftRecord/list',
+        name: 'giftRecord',
+        component: RouteView,
+        meta: {
+          title: '赠品记录',
+          icon: 'idcard'
+          // permission: 'M_goodsManage_list'
+        },
+        hideChildrenInMenu: true,
+        children: [
+          {
+            path: '/salesManagement/giftRecord/list',
+            name: 'giftRecordList',
+            component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/giftRecord/list.vue'),
+            meta: {
+              title: '赠品记录列表',
+              icon: 'profile',
+              hidden: true
+              // permission: 'M_goodsManage_list'
+            }
+          }
+        ]
       }
     ]
   },

+ 157 - 0
src/views/salesManagement/giftRecord/list.vue

@@ -0,0 +1,157 @@
+<template>
+  <a-card :bordered="false" class="giftRecordList-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="giftRecordList-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-input id="giftRecordList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="原厂编码">
+              <a-input id="giftRecordList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入原厂编码"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关联销售单号">
+                <a-input id="giftRecordList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入关联销售单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="赠送客户">
+                <a-select id="giftRecordList-bundleName" placeholder="请选择" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
+                  <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
+                </a-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="giftRecordList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="giftRecordList-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>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered></s-table>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+// import { getProvince, getCityByPro, getDistrictByCity } from '@/api/data'
+import { STable, VSelect } from '@/components'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      advanced: false,  // 高级搜索 展开/关闭
+      queryParam: { //  查询条件
+        bundleName: '', //  供应商名称
+        state: undefined,  //  状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      dateFormat: 'YYYY-MM-DD',
+      time: [],  //  创建时间
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
+        { title: '创建时间', dataIndex: 'inventoryMoney', width: 180, align: 'center' },
+        { title: '产品编码', dataIndex: 'inventosryMoney', width: 180, align: 'center' },
+        { title: '赠品名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOldNum', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '赠送数量', dataIndex: 'productBrand', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '关联销售单号', dataIndex: 'productType', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '赠送客户', dataIndex: 'invaentoryNum', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本价', dataIndex: 'invenstoryNum', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本总计', dataIndex: 'invdentoryNum', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        // return customerBundleDelayList( 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
+        // })
+        const _this = this
+        return new Promise(function(resolve, reject){
+          const data = {
+            pageNo: 1,
+            pageSize: 10,
+            list: [
+              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
+            ]
+          }
+          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
+          resolve(data)
+        })
+      },
+    }
+  },
+  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)
+    },
+  }
+}
+</script>
+
+<style lang="less">
+  .giftRecordList-wrap{
+    .sTable{
+      table{
+        width: auto;
+      }
+    }
+  }
+</style>