zh 2 лет назад
Родитель
Сommit
8fc9b2c982

+ 2 - 2
src/api/priceType.js

@@ -1,4 +1,4 @@
-import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+import request, { postBlob } from '@/utils/request'
 export function getProductPriceListV2(params) {
   return request({
     url: `/product-price/v2/list?moduleId=${params.moduleId}`,
@@ -31,7 +31,7 @@ export function editProductPrice(params) {
 }
 export function updateProductPriceStatus(params) {
   return request({
-    url: `/product-price/status/update`,
+    url: `/price-type/status/update`,
     method: 'post',
     params
   })

+ 15 - 5
src/views/sales_policy/components/AddPolicy.vue

@@ -264,6 +264,7 @@
                   size="mini"
                   filterable
                   @change="setText($event, scope.$index, scope.row, 'priceType')"
+                  @focus="handlePriceType(scope.row)"
                 >
                   <el-option
                     v-for="item in priceList"
@@ -495,7 +496,7 @@ import {
   setStauts,
   updateCondition
 } from '@/api/policy_list'
-import { getProductPriceListV2 } from '@/api/priceType'
+import { getPriceSalesRelaListV2 } from '@/api/priceType'
 import { downloadFiles, handleImport } from '@/utils/util'
 // import Transfer from './Transfer'
 import TabelTransfer from './TabelTransfer'
@@ -714,7 +715,6 @@ export default {
       // 获取销售类型列表
       const typeData = await getTypeList(params)
       this.typeList = typeData.data.records
-      this.getProductPriceListV2()
     },
     handleSalesType(e, row, index, name) {
       console.log(e)
@@ -1042,13 +1042,23 @@ export default {
       // this.isFlag = 1
       this.$emit('upDataIsFlag')
     },
-    getProductPriceListV2() {
-      getProductPriceListV2({
+    getPriceSalesRelaListV2(val) {
+      getPriceSalesRelaListV2({
         pageNum: 1,
-        pageSize: -1
+        pageSize: -1,
+        params: [
+          {
+            'param': 'b.sale_code',
+            'compare': 'like',
+            'value': val
+          }
+        ]
       }).then(res => {
         this.priceList = res.data.records
       })
+    },
+    handlePriceType(e) {
+      this.getPriceSalesRelaListV2(e.saleTypeCode)
     }
   },
   components: {

+ 39 - 5
src/views/sales_policy/components/OperationRecords.vue

@@ -1,14 +1,28 @@
 <template>
   <div>
     <h4>操作记录</h4>
-    <div>
+    <div class="table">
       <zj-table
+        :loading="loading"
         :table-attributes="tableAttributes"
         :is-drop="true"
         :columns="columns"
         :table-data="tableData"
       />
     </div>
+    <!-- 分页 -->
+    <div style="margin: 20px 0">
+      <el-pagination
+        :current-page="currentPages"
+        :page-sizes="[10, 20, 30, 50]"
+        :page-size="10"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="listTotal"
+        @size-change="handleSizeChanges"
+        @current-change="handleCurrentChanges"
+      />
+    </div>
+
   </div>
 </template>
 
@@ -26,7 +40,11 @@ export default {
       tableAttributes: {
         maxHeight: 600
       },
-      tableData: []
+      tableData: [],
+      listTotal: 0,
+      currentPages: 1, // 当前页码
+      pageSizes: 10, // 每页数量
+      loading: false
     }
   },
   computed: {
@@ -62,13 +80,27 @@ export default {
   },
   methods: {
     getCommonLogList() {
+      this.loading = true
       commonLogList({
         objId: this.policyId,
-        pageNum: 1,
-        pageSize: -1
+        pageNum: this.currentPages,
+        pageSize: this.pageSizes
       }).then(res => {
         this.tableData = res.data.records
+        this.listTotal = res.data.total
+        this.loading = false
       })
+    },
+    // 更改每页数量
+    handleSizeChanges(val) {
+      this.pageSizes = val
+      this.currentPages = 1
+      this.getCommonLogList()
+    },
+    // 更改当前页
+    handleCurrentChanges(val) {
+      this.currentPages = val
+      this.getCommonLogList()
     }
   }
 
@@ -76,5 +108,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
+.table{
+  height: 600px;
+}
 </style>

+ 20 - 8
src/views/sales_policy/components/editPolicy.vue

@@ -268,6 +268,7 @@
                     size="mini"
                     filterable
                     @change="setText($event, scope.$index, scope.row, 'priceType')"
+                    @focus="handlePriceType(scope.row)"
                   >
                     <el-option
                       v-for="item in priceList"
@@ -525,7 +526,7 @@ import {
   updatePolicy,
   setStauts
 } from '@/api/policy_list'
-import { getProductPriceListV2 } from '@/api/priceType'
+import { getPriceSalesRelaListV2 } from '@/api/priceType'
 
 import { downloadFiles, handleImport } from '@/utils/util'
 // import Transfer from './Transfer'
@@ -764,12 +765,6 @@ export default {
       const typeData = await getTypeList(params)
 
       this.typeList = typeData.data.records
-      getProductPriceListV2({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.priceList = res.data.records
-      })
     },
     handleSalesType(e, row, index, name) {
       let item
@@ -937,7 +932,6 @@ export default {
         .then(result => {
           result.data.records.forEach(k => {
             k.fang = true
-
             k.walletIds = []
             k.rebateWalletIds = []
             if (!k.specification) {
@@ -1137,6 +1131,24 @@ export default {
       this.isCondition = 0
 
       this.$emit('upDataIsFlag')
+    },
+    getPriceSalesRelaListV2(val) {
+      getPriceSalesRelaListV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            'param': 'b.sale_code',
+            'compare': 'like',
+            'value': val
+          }
+        ]
+      }).then(res => {
+        this.priceList = res.data.records
+      })
+    },
+    handlePriceType(e) {
+      this.getPriceSalesRelaListV2(e.saleTypeCode)
     }
 
   },

+ 1 - 1
src/views/supply/salesReturnOrder/salesReturnOrderDetail.vue

@@ -220,7 +220,7 @@ export default {
         {
           columnAttributes: {
             label: '产品编码',
-            prop: 'materialoldMumber',
+            prop: 'materialOldNumber',
             width: 200
           }
         },