|
@@ -505,7 +505,29 @@
|
|
|
handelBatchData()
|
|
|
}"
|
|
|
>批量修改</el-button> -->
|
|
|
+ <template v-if="detail.type === 'LIMIT'">
|
|
|
+ <el-button
|
|
|
+ v-if="policyLimitGroupList.length"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="()=>{
|
|
|
+ buyNumvisible = true
|
|
|
+ handelLimitGroupData()
|
|
|
+ }"
|
|
|
+ >批量修改上限</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
|
|
|
+ <el-button
|
|
|
+ v-if="list.length"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="()=>{
|
|
|
+ visible = true
|
|
|
+ handelBatchData()
|
|
|
+ }"
|
|
|
+ >批量修改上限</el-button>
|
|
|
+ </template>
|
|
|
<el-divider />
|
|
|
</div>
|
|
|
<div>
|
|
@@ -540,16 +562,6 @@
|
|
|
<span>{{ scope.row.customerName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="minBuyNum" label="最小提货数量" align="left" min-width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.minBuyNum }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="maxBuyNum" label="最大提货组数" align="left" min-width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.maxBuyNum }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
<el-table-column prop="materialName" label="物料名称" align="left" min-width="200">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.materialName }}
|
|
@@ -592,7 +604,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
- <div v-if=" detail && detail.type == 'PROVISION'">
|
|
|
+ <div>
|
|
|
<div>
|
|
|
<h4 style="display: inline-block; margin-right: 20px">经销商配提套数上限</h4>
|
|
|
<el-divider />
|
|
@@ -613,6 +625,15 @@
|
|
|
ex-text="导出经销商配提套数"
|
|
|
:ex-params="{ policyId: detail.code }"
|
|
|
/>
|
|
|
+ <el-button
|
|
|
+ v-if="policyLimitGroupList.length"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="()=>{
|
|
|
+ limitGroupvisible = true
|
|
|
+ handelLimitGroupData()
|
|
|
+ }"
|
|
|
+ >批量修改配提套数上限</el-button>
|
|
|
<!-- <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy"
|
|
|
>下载模板</el-button
|
|
|
> -->
|
|
@@ -656,12 +677,25 @@
|
|
|
<span>{{ scope.row.customerName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" min-width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.groupLimitNum }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template v-if="detail.type == 'LIMIT'">
|
|
|
+ <el-table-column prop="minBuyNum" label="最小提货数量" align="left" min-width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.minBuyNum }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="maxBuyNum" label="最大提货组数" align="left" min-width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.maxBuyNum }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" min-width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.groupLimitNum }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
<!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.orderNums }}
|
|
@@ -730,20 +764,13 @@
|
|
|
>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
|
|
|
- <el-col :span="4" :offset="0"> 最小提货数量 </el-col>
|
|
|
- <el-col :span="8" :offset="0"> <el-input v-model="minBuyNum" size="mini" /></el-col>
|
|
|
- <el-col :span="4" :offset="0"> 最大提货组数 </el-col>
|
|
|
- <el-col :span="8" :offset="0"> <el-input v-model="maxBuyNum" size="mini" /></el-col>
|
|
|
+ <el-col :span="4" :offset="0"> 购买量上限 </el-col>
|
|
|
+ <el-col :span="8" :offset="0"> <el-input v-model.number="limitQty" type="number" size="mini" /></el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" :offset="0" style="margin-bottom: 20px">
|
|
|
<div style="display: flex">
|
|
|
- <el-input v-model="buyNumKeyWord" placeholder="输入关键字搜索" size="mini" />
|
|
|
- <el-button
|
|
|
- style="margin-left: 20px"
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- @click="handelBatchData('search')"
|
|
|
- >查询</el-button>
|
|
|
+ <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
|
|
|
+ <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
|
|
|
<el-button size="mini" @click="onReset">重置</el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -769,7 +796,103 @@
|
|
|
</div>
|
|
|
<span slot="footer">
|
|
|
<el-button @click="handleDialogVisible">取消</el-button>
|
|
|
- <el-button type="primary" @click="onSubmit('limit')">确定</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit($event,'limit')">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="批量修改"
|
|
|
+ :visible.sync="limitGroupvisible"
|
|
|
+ width="50%"
|
|
|
+ :append-to-body="true"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ @close="handleLimitDialogVisible"
|
|
|
+ >
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
|
|
|
+ <el-col :span="4" :offset="0"> 配提套数上限 </el-col>
|
|
|
+ <el-col :span="8" :offset="0"> <el-input v-model.number="limitGroupNum" type="number" size="mini" /></el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" :offset="0" style="margin-bottom: 20px">
|
|
|
+ <div style="display: flex">
|
|
|
+ <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
|
|
|
+ <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelLimitGroupData('search')">查询</el-button>
|
|
|
+ <el-button size="mini" @click="onLimitReset">重置</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <zj-table
|
|
|
+ :table-attributes="tableAttributes"
|
|
|
+ :table-events="tableEvents"
|
|
|
+ :is-drop="true"
|
|
|
+ :columns="limitColumns"
|
|
|
+ :table-data="limitTableData"
|
|
|
+ />
|
|
|
+ <div style="margin: 20px 0">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="limitCurrentPages"
|
|
|
+ :page-sizes="[10, 20, 30, 50]"
|
|
|
+ :page-size="10"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="limitTotal"
|
|
|
+ @size-change="handleLimitSizeChanges"
|
|
|
+ @current-change="handleLimitCurrentChanges"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <span slot="footer">
|
|
|
+ <el-button @click="handleLimitDialogVisible">取消</el-button>
|
|
|
+ <el-button type="primary" @click="onLimitSubmit($event, 'limit')">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="批量修改"
|
|
|
+ :visible.sync="buyNumvisible"
|
|
|
+ width="50%"
|
|
|
+ :append-to-body="true"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ @close="handleLimitDialogVisible"
|
|
|
+ >
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
|
|
|
+ <el-col :span="4" :offset="0"> 最小提货数量 </el-col>
|
|
|
+ <el-col :span="8" :offset="0"> <el-input v-model.number="minBuyNum" type="number" size="mini" /></el-col>
|
|
|
+ <el-col :span="4" :offset="0"> 最大提货组数 </el-col>
|
|
|
+ <el-col :span="8" :offset="0"> <el-input v-model.number="maxBuyNum" type="number" size="mini" /></el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" :offset="0" style="margin-bottom: 20px">
|
|
|
+ <div style="display: flex">
|
|
|
+ <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
|
|
|
+ <el-button
|
|
|
+ style="margin-left: 20px"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="handelLimitGroupData('search')"
|
|
|
+ >查询</el-button>
|
|
|
+ <el-button size="mini" @click="onLimitReset">重置</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <zj-table
|
|
|
+ :table-attributes="tableAttributes"
|
|
|
+ :table-events="tableEvents"
|
|
|
+ :is-drop="true"
|
|
|
+ :columns="limitColumns"
|
|
|
+ :table-data="limitTableData"
|
|
|
+ />
|
|
|
+ <div style="margin: 20px 0">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="limitCurrentPages"
|
|
|
+ :page-sizes="[10, 20, 30, 50]"
|
|
|
+ :page-size="10"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="limitTotal"
|
|
|
+ @size-change="handleLimitSizeChanges"
|
|
|
+ @current-change="handleLimitCurrentChanges"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <span slot="footer">
|
|
|
+ <el-button @click="handleLimitDialogVisible">取消</el-button>
|
|
|
+ <el-button type="primary" @click="onLimitSubmit">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -797,7 +920,8 @@ import {
|
|
|
updatePolicy,
|
|
|
getPolicyList,
|
|
|
updateLimitBatchupdate,
|
|
|
- getPolicyLimitGroupList
|
|
|
+ getPolicyLimitGroupList,
|
|
|
+ updateLimitGrouppdate
|
|
|
} from '@/api/policy_list'
|
|
|
import { downloadFiles, handleImport } from '@/utils/util'
|
|
|
import AddCondition from './AddCondition'
|
|
@@ -893,11 +1017,10 @@ export default {
|
|
|
tableEvents: {
|
|
|
'selection-change': this.selectionChange
|
|
|
},
|
|
|
- limitQty: 0,
|
|
|
- maxBuyNum: 0,
|
|
|
- minBuyNum: 0,
|
|
|
+ limitQty: null,
|
|
|
+ maxBuyNum: null,
|
|
|
limitQtyKeyWord: '',
|
|
|
- buyNumKeyWord: '',
|
|
|
+ maxBuyNumKeyWord: '',
|
|
|
selectedData: [],
|
|
|
batchCurrentPages: 1,
|
|
|
batchPageSizes: 10,
|
|
@@ -907,7 +1030,16 @@ export default {
|
|
|
policyCurrentPages: 1,
|
|
|
policyPageSize: 10,
|
|
|
policyListTotal: 0,
|
|
|
- policyKeyWord: ''
|
|
|
+ policyKeyWord: '',
|
|
|
+ limitGroupvisible: false,
|
|
|
+ limitGroupNum: null,
|
|
|
+ limitGroupKeyWord: '',
|
|
|
+ limitCurrentPages: 1,
|
|
|
+ limitTotal: 0,
|
|
|
+ limitPageSizes: 10,
|
|
|
+ limitTableData: [],
|
|
|
+ buyNumvisible: false,
|
|
|
+ minBuyNum: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -943,6 +1075,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
+ },
|
|
|
+ limitColumns() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '经销商编码',
|
|
|
+ prop: 'customerNumber'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '经销商名称',
|
|
|
+ prop: 'customerName'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
created() {},
|
|
@@ -1325,35 +1473,32 @@ export default {
|
|
|
pageNum: this.batchCurrentPages,
|
|
|
pageSize: this.batchPageSizes,
|
|
|
policyId: this.id,
|
|
|
- keyword: this.buyNumKeyWord
|
|
|
+ keyword: this.limitQtyKeyWord
|
|
|
}).then(res => {
|
|
|
this.tableData = res.data.records
|
|
|
this.batchTotal = res.data.total
|
|
|
})
|
|
|
},
|
|
|
- handelBatchData2() {
|
|
|
- this.maxBuyNumVisible = true
|
|
|
- },
|
|
|
handleDialogVisible() {
|
|
|
this.visible = false
|
|
|
+ this.buyNumvisible = false
|
|
|
this.maxBuyNumVisible = false
|
|
|
this.batchCurrentPages = 1
|
|
|
this.batchPageSizes = 10
|
|
|
- this.limitQty = 0
|
|
|
- this.maxBuyNum = 0
|
|
|
- this.minBuyNum = 0
|
|
|
+ this.limitQty = null
|
|
|
+ this.maxBuyNum = null
|
|
|
+ this.minBuyNum = null
|
|
|
this.limitQtyKeyWord = ''
|
|
|
- this.buyNumKeyWord = ''
|
|
|
+ this.maxBuyNumKeyWord = ''
|
|
|
},
|
|
|
- onSubmit(type) {
|
|
|
+ onSubmit(e, type) {
|
|
|
+ console.log(type)
|
|
|
if (!this.selectedData.length) {
|
|
|
this.$errorMsg('不能为空,请选择')
|
|
|
return
|
|
|
}
|
|
|
- if (this.minBuyNum <= 0) {
|
|
|
- this.$errorMsg('最小起起提数不能小于0')
|
|
|
- return
|
|
|
- }
|
|
|
+ let params = {}
|
|
|
+
|
|
|
const customerIds = this.selectedData
|
|
|
.map(k => {
|
|
|
return k.customerId
|
|
@@ -1364,30 +1509,36 @@ export default {
|
|
|
return k.id
|
|
|
})
|
|
|
.join(',')
|
|
|
- const params = {
|
|
|
- customerIds,
|
|
|
- ids,
|
|
|
- minBuyNum: this.minBuyNum,
|
|
|
- maxBuyNum: this.maxBuyNum
|
|
|
+ if (type) {
|
|
|
+ if (this.limitQty <= 0) {
|
|
|
+ this.$errorMsg('购买量上限不能小于0或不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ customerIds,
|
|
|
+ ids,
|
|
|
+ limitQty: this.limitQty
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
updateLimitBatchupdate(params).then(res => {
|
|
|
this.handleDialogVisible()
|
|
|
+ this.getPolicyList()
|
|
|
+ this.getPolicyLimitGroupList()
|
|
|
this.$successMsg('批量修改成功')
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
handleBatchSizeChanges(val) {
|
|
|
this.batchCurrentPages = 1
|
|
|
this.batchPageSizes = val
|
|
|
this.handelBatchData()
|
|
|
},
|
|
|
- handleBatchCurrentChanges(val) {
|
|
|
- this.batchCurrentPages = val
|
|
|
+ onReset() {
|
|
|
+ this.limitQtyKeyWord = ''
|
|
|
+ this.maxBuyNumKeyWord = ''
|
|
|
this.handelBatchData()
|
|
|
},
|
|
|
- onReset() {
|
|
|
- this.handleDialogVisible()
|
|
|
+ handleBatchCurrentChanges(val) {
|
|
|
+ this.batchCurrentPages = val
|
|
|
this.handelBatchData()
|
|
|
},
|
|
|
getPolicyLimitGroupList() {
|
|
@@ -1395,7 +1546,7 @@ export default {
|
|
|
getPolicyLimitGroupList({
|
|
|
pageNum: this.policyCurrentPages,
|
|
|
pageSize: this.policyPageSize,
|
|
|
- policyId: this.detail.code,
|
|
|
+ policyId: this.id,
|
|
|
keyword: this.policyKeyWord
|
|
|
}).then(res => {
|
|
|
this.policyLimitGroupList = res.data.records
|
|
@@ -1426,8 +1577,8 @@ export default {
|
|
|
const file = param.file
|
|
|
const formData = new FormData()
|
|
|
formData.append('file', file)
|
|
|
- formData.append('policyId', this.detail.code)
|
|
|
- // formData.append('type', this.policyType)
|
|
|
+ formData.append('policyId', this.id)
|
|
|
+ // formData.append('type', this.detail.type)
|
|
|
|
|
|
// formData.append("mainId", this.searchForm.mainId);
|
|
|
const result = await handleImport('policy/limit/group/import', formData)
|
|
@@ -1444,6 +1595,87 @@ export default {
|
|
|
confirmButtonText: '确定'
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ handelLimitGroupData(search) {
|
|
|
+ if (search) {
|
|
|
+ this.limitCurrentPages = 1
|
|
|
+ }
|
|
|
+ this.limitGroupvisible = true
|
|
|
+ getPolicyLimitGroupList({
|
|
|
+ pageNum: this.limitCurrentPages,
|
|
|
+ pageSize: this.limitPageSizes,
|
|
|
+ policyId: this.id,
|
|
|
+ keyword: this.limitGroupKeyWord
|
|
|
+ }).then(res => {
|
|
|
+ this.limitTableData = res.data.records
|
|
|
+ this.limitTotal = res.data.total
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onLimitSubmit(e, type) {
|
|
|
+ if (!this.selectedData.length) {
|
|
|
+ this.$errorMsg('不能为空,请选择')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const ids = this.selectedData
|
|
|
+ .map(k => {
|
|
|
+ return k.id
|
|
|
+ })
|
|
|
+ .join(',')
|
|
|
+ let params = {}
|
|
|
+ if (type) {
|
|
|
+ if (this.limitGroupNum <= 0) {
|
|
|
+ this.$errorMsg('配提套数上限不能小于0或不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ ids,
|
|
|
+ limitGroupNum: this.limitGroupNum
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.minBuyNum <= 0 || !this.minBuyNum) {
|
|
|
+ this.$errorMsg('最小提货数量不能小于0或不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ ids,
|
|
|
+ minBuyNum: this.minBuyNum,
|
|
|
+ maxBuyNum: this.maxBuyNum
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ updateLimitGrouppdate(params).then(res => {
|
|
|
+ this.handleLimitDialogVisible()
|
|
|
+ this.$successMsg('批量修改成功')
|
|
|
+ this.getPolicyLimitGroupList()
|
|
|
+ this.getPolicyList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleLimitSizeChanges(val) {
|
|
|
+ this.limitCurrentPages = 1
|
|
|
+ this.limitPageSizes = val
|
|
|
+ this.handelLimitGroupData()
|
|
|
+ },
|
|
|
+ handleLimitCurrentChanges(val) {
|
|
|
+ this.limitCurrentPages = val
|
|
|
+ this.handelLimitGroupData()
|
|
|
+ },
|
|
|
+ onLimitReset() {
|
|
|
+ this.limitGroupKeyWord = ''
|
|
|
+ this.handelLimitGroupData()
|
|
|
+ },
|
|
|
+ handleLimitDialogVisible() {
|
|
|
+ this.buyNumvisible = false
|
|
|
+ this.limitGroupvisible = false
|
|
|
+ this.limitGroupNum = null
|
|
|
+ this.limitGroupKeyWord = ''
|
|
|
+ this.limitCurrentPages = 1
|
|
|
+ this.limitTotal = 0
|
|
|
+ this.limitPageSizes = 10
|
|
|
+ this.maxBuyNum = null
|
|
|
+ this.minBuyNum = null
|
|
|
+ this.limitQtyKeyWord = ''
|
|
|
+ this.maxBuyNumKeyWord = ''
|
|
|
}
|
|
|
}
|
|
|
}
|