Przeglądaj źródła

Merge branch 'develop_xnyh03' of jianguan-web/qpls-md-html into pre-release

李磊 3 lat temu
rodzic
commit
3bdd54a4b3

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
 {
-  "version": "1.1.8",
+  "version": "1.2.0",
   "message": "发现有新版本发布,确定更新系统?"
   "message": "发现有新版本发布,确定更新系统?"
 }
 }

+ 1 - 1
src/views/common/custList.vue

@@ -4,7 +4,7 @@
     label-in-value
     label-in-value
     :size="size"
     :size="size"
     :value="dealerName"
     :value="dealerName"
-    placeholder="请输入名称搜索"
+    placeholder="请输入客户名称搜索"
     style="width: 100%"
     style="width: 100%"
     :filter-option="false"
     :filter-option="false"
     :not-found-content="fetching ? undefined : null"
     :not-found-content="fetching ? undefined : null"

+ 21 - 2
src/views/salesManagement/productPricing/list.vue

@@ -63,7 +63,18 @@
       :scroll="{ y: tableHeight }"
       :scroll="{ y: tableHeight }"
       :defaultLoadData="false"
       :defaultLoadData="false"
       bordered>
       bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-primary"
+          @click="handleDetail(record)"
+        >销售记录</a-button>
+      </template>
     </s-table>
     </s-table>
+    <!-- 销售记录 -->
+    <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="openModal = false" />
   </a-card>
   </a-card>
 </template>
 </template>
 
 
@@ -74,13 +85,15 @@ import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import ProductBrand from '../../common/productBrand.js'
 import { getCurrentDealer } from '@/api/product'
 import { getCurrentDealer } from '@/api/product'
 import { dealerProductPriceList } from '@/api/dealerProduct'
 import { dealerProductPriceList } from '@/api/dealerProduct'
+import productSalesRecordModal from './productSalesRecordModal.vue'
 export default {
 export default {
   name: 'DealerProductPriceList',
   name: 'DealerProductPriceList',
-  components: { STable, VSelect, ProductType, ProductBrand },
+  components: { STable, VSelect, ProductType, ProductBrand, productSalesRecordModal },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
     return {
     return {
       tableHeight: 0,
       tableHeight: 0,
+      openModal: false,
       advanced: true, // 高级搜索 展开/关闭
       advanced: true, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         name: '',
         name: '',
@@ -131,7 +144,8 @@ export default {
         // { title: '市级价', dataIndex: 'cityPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '市级价', dataIndex: 'cityPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '特约价', dataIndex: 'specialPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '特约价', dataIndex: 'specialPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '终端会员价', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '终端会员价', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
       ]
       if (this.isCostPrice) {
       if (this.isCostPrice) {
         arr.splice(6, 0, { title: '成本价', dataIndex: 'offerCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(6, 0, { title: '成本价', dataIndex: 'offerCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -176,6 +190,11 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
     },
+    // 销售记录
+    handleDetail (row) {
+      this.openModal = true
+      this.$refs.salseRecord.getDetail(row)
+    },
     pageInit () {
     pageInit () {
       const _this = this
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 177 - 0
src/views/salesManagement/productPricing/productSalesRecordModal.vue

@@ -0,0 +1,177 @@
+<template>
+  <div v-if="isShow">
+    <a-modal
+      centered
+      class="salesRecord-price-modal"
+      :footer="null"
+      :maskClosable="false"
+      :title="modalTit"
+      v-model="isShow"
+      @cancle="isShow=false"
+      :width="960">
+      <div>
+        <div v-if="baseData" style="line-height: 28px;margin-bottom: 10px;">
+          <div>产品编码:{{ baseData.code }}</div>
+          <div>产品名称:{{ baseData.name }}</div>
+        </div>
+        <div style="display: flex;padding-bottom: 15px;align-items: center;">
+          <span>选择客户:</span>
+          <div style="width: 40%;"><custList ref="custList" @change="custChange" placeholder="输入客户名称搜索" v-model="queryParam.buyerSn"></custList></div>
+          <div style="padding: 0 15px;color: #999;">
+            <a-button type="primary" @click="handelSearch(1)">查询</a-button>
+            <a-button type="default" style="margin-left: 5px" @click="reset">重置</a-button>
+          </div>
+        </div>
+        <!-- 表格 -->
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :dataSource="list"
+          :loading="loading"
+          :pagination="false"
+          bordered>
+        </a-table>
+        <!-- 分页 -->
+        <tablePagination
+          ref="tablePagination"
+          :total="paginationProps.total"
+          :current="paginationProps.current"
+          :pageSize="paginationProps.pageSize"
+          @changePageSize="changePageSize"
+          @changePage="changePage" />
+      </div>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { salesRecordlList } from '@/api/salesDetail.js'
+import { STable } from '@/components'
+import tablePagination from '@/views/common/tablePagination.vue'
+import custList from '@/views/common/custList.vue'
+export default {
+  name: 'SalesRecordModal',
+  components: { STable, tablePagination, custList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      return '销售记录'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      queryParam: {
+        productSn: null,
+        buyerSn: undefined
+      },
+      // 表头
+      columns: [
+        { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: 250, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售价(¥)', dataIndex: 'price', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'salesBillEntity.buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      list: [],
+      loading: false,
+      paginationProps: {
+        total: 0, //  分页总条数
+        current: 1,
+        pageSize: 20
+      },
+      baseData: null
+    }
+  },
+  methods: {
+    reset () {
+      this.queryParam.buyerSn = undefined
+      this.$refs.custList.setData(undefined)
+      this.getDetail(this.baseData)
+    },
+    // 客户 change
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key || undefined
+    },
+    //  获取详情
+    getDetail (row) {
+      this.queryParam.productSn = row.productSn
+      this.handelSearch(1)
+      this.baseData = row
+    },
+    // 查询列表
+    handelSearch (pageNo) {
+      this.paginationProps.current = pageNo || this.paginationProps.current
+      const params = {
+        pageNo: this.paginationProps.current,
+        pageSize: this.paginationProps.pageSize
+      }
+      // 开始查询
+      this.loading = true
+      salesRecordlList({ ...params, ...this.queryParam }).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = data.pageNo
+          this.list = data.list
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.paginationProps.pageSize = 20
+          this.list = []
+        }
+      })
+    },
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.paginationProps.current = current
+      this.paginationProps.pageSize = pageSize
+      this.handelSearch()
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.paginationProps.current = current
+      this.handelSearch()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paginationProps.total = 0
+        this.paginationProps.current = 1
+        this.paginationProps.pageSize = 20
+        this.curTab = '1'
+        this.list = []
+        this.queryParam.buyerSn = undefined
+        this.$refs.custList.setData(undefined)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .salesRecord-price-modal{
+    .ant-modal-body {
+      padding: 20px;
+    }
+  }
+</style>