|
@@ -1,21 +1,14 @@
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
- title="上限"
|
|
|
+ title="经销商上限"
|
|
|
:visible.sync="linitVisible"
|
|
|
width="60%"
|
|
|
:show-close="false"
|
|
|
:append-to-body="true"
|
|
|
+ :close-on-click-modal="false"
|
|
|
@close="onCancel"
|
|
|
>
|
|
|
<div>
|
|
|
- <!-- <div style="margin: 20px 0">
|
|
|
- <el-button
|
|
|
- v-if="!linitType || linitType === 'add'"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="handleAddItmeData"
|
|
|
- >添加</el-button>
|
|
|
- </div> -->
|
|
|
<zj-table :table-attributes="tableAttributes" :is-drop="true" :columns="columns" :table-data="dataList" />
|
|
|
</div>
|
|
|
<span slot="footer">
|
|
@@ -28,9 +21,17 @@
|
|
|
<script>
|
|
|
import { getMaterialListV2 } from '@/api/basic_data/material'
|
|
|
import { getDealerListV2 } from '@/api/basic_data/dealer'
|
|
|
-
|
|
|
+import { getCustomerList, getMaterialList } from '@/api/policy_list'
|
|
|
export default {
|
|
|
props: {
|
|
|
+ operationType: {
|
|
|
+ type: String,
|
|
|
+ default: null
|
|
|
+ },
|
|
|
+ detailType: {
|
|
|
+ type: String,
|
|
|
+ default: null
|
|
|
+ },
|
|
|
linitVisible: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
@@ -59,7 +60,7 @@ export default {
|
|
|
dealerList: [],
|
|
|
tableAttributes: {
|
|
|
border: true,
|
|
|
- maxheight: '600px',
|
|
|
+ maxHeight: '600px',
|
|
|
headerCellClassName: 'headerRowColor',
|
|
|
size: 'mini'
|
|
|
}
|
|
@@ -81,17 +82,15 @@ export default {
|
|
|
style='width:100%'
|
|
|
value={row.customerNumber}
|
|
|
onInput={e => (row.customerNumber = e)}
|
|
|
- onChange={ e => this.handleChange(e, row)}
|
|
|
+ onChange={e => this.handleChange(e, row)}
|
|
|
filterable
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
size='mini'
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
placeholder='请输入经销商编号'
|
|
|
- remote-method={e => this.remoteMethod2(e, 'number')}
|
|
|
loading={this.loading}
|
|
|
>
|
|
|
{this.dealerList.map(k => {
|
|
|
- return <el-option key={k.id} label={k.number} value={k.id}></el-option>
|
|
|
+ return <el-option key={k.id} label={k.customerNumber} value={k.id}></el-option>
|
|
|
})}
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -111,139 +110,204 @@ export default {
|
|
|
style='width:100%'
|
|
|
value={row.customerName}
|
|
|
onInput={e => (row.customerName = e)}
|
|
|
- onChange={ e => this.handleChange(e, row)}
|
|
|
+ onChange={e => this.handleChange(e, row)}
|
|
|
filterable
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
size='mini'
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
placeholder='请输入经销商名称'
|
|
|
- remote-method={e => this.remoteMethod2(e, 'name')}
|
|
|
loading={this.loading}
|
|
|
>
|
|
|
{this.dealerList.map(k => {
|
|
|
- return <el-option key={k.id} label={k.name} value={k.id}></el-option>
|
|
|
+ return <el-option key={k.id} label={k.customerName} value={k.id}></el-option>
|
|
|
})}
|
|
|
</el-select>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- columnAttributes: {
|
|
|
- label: '物料名称',
|
|
|
- prop: 'materialName',
|
|
|
- 'min-width': '200px'
|
|
|
- },
|
|
|
- render: (h, { column, row, index }) => {
|
|
|
- return (
|
|
|
- <div style='margin:0 10px'>
|
|
|
- <el-select
|
|
|
- style='width:100%'
|
|
|
- value={row.materialName}
|
|
|
- onInput={e => (row.materialName = e)}
|
|
|
- onChange={ e => this.handleChange2(e, row)}
|
|
|
- filterable
|
|
|
- size='mini'
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
- placeholder='请输入物料名称'
|
|
|
- remote-method={e => this.remoteMethod(e, 'name')}
|
|
|
- loading={this.loading}
|
|
|
- >
|
|
|
- {this.k3List.map(k => {
|
|
|
- return <el-option key={k.id} label={k.materialName} value={k.id}></el-option>
|
|
|
- })}
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- columnAttributes: {
|
|
|
- label: '物料编号',
|
|
|
- prop: 'materialNumber',
|
|
|
- 'min-width': '200px'
|
|
|
- },
|
|
|
- render: (h, { column, row, index }) => {
|
|
|
- return (
|
|
|
- <div style='margin:0 10px'>
|
|
|
- <el-select
|
|
|
- style='width:100%'
|
|
|
- value={row.materialNumber}
|
|
|
- onInput={e => (row.materialNumber = e)}
|
|
|
- onChange={ e => this.handleChange2(e, row)}
|
|
|
-
|
|
|
- filterable
|
|
|
- size='mini'
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
- placeholder='请输入物料编号'
|
|
|
- remote-method={e => this.remoteMethod(e, 'number')}
|
|
|
- loading={this.loading}
|
|
|
- >
|
|
|
- {this.k3List.map(k => {
|
|
|
- return <el-option key={k.id} label={k.materialNumber} value={k.id}></el-option>
|
|
|
- })}
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- columnAttributes: {
|
|
|
- label: '规格型号',
|
|
|
- prop: 'specification',
|
|
|
- 'min-width': '200px'
|
|
|
- },
|
|
|
- render: (h, { column, row, index }) => {
|
|
|
- return (
|
|
|
- <div style='margin:0 10px'>
|
|
|
- <el-select
|
|
|
- style='width:100%'
|
|
|
- value={row.specification}
|
|
|
- onInput={e => (row.specification = e)}
|
|
|
- onChange={ e => this.handleChange2(e, row)}
|
|
|
-
|
|
|
- filterable
|
|
|
- size='mini'
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
- placeholder='请输入规格型号'
|
|
|
- remote-method={e => this.remoteMethod(e, 'specification')}
|
|
|
- loading={this.loading}
|
|
|
- >
|
|
|
- {this.k3List.map(k => {
|
|
|
- return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
|
|
|
- })}
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- columnAttributes: {
|
|
|
- label: '订货上限',
|
|
|
- prop: 'limitQty'
|
|
|
- },
|
|
|
- render: (h, { column, row, index }) => {
|
|
|
- return (
|
|
|
- <div style='margin:0 10px'>
|
|
|
- <el-input
|
|
|
- type='number'
|
|
|
- value={row.limitQty}
|
|
|
- onInput={e => (row.limitQty = e)}
|
|
|
- placeholder='请输入'
|
|
|
- size='mini'
|
|
|
- clearable
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- },
|
|
|
+ ...(() => {
|
|
|
+ return !this.operationType
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '物料名称',
|
|
|
+ prop: 'materialName',
|
|
|
+ 'min-width': '200px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-select
|
|
|
+ style='width:100%'
|
|
|
+ value={row.materialName}
|
|
|
+ onInput={e => (row.materialName = e)}
|
|
|
+ onChange={e => this.handleChange2(e, row)}
|
|
|
+ filterable
|
|
|
+ size='mini'
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
+ placeholder='请输入物料名称'
|
|
|
+ loading={this.loading}
|
|
|
+ >
|
|
|
+ {this.k3List.map(k => {
|
|
|
+ return <el-option key={k.id} label={k.materialName} value={k.id}></el-option>
|
|
|
+ })}
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '物料编号',
|
|
|
+ prop: 'materialNumber',
|
|
|
+ 'min-width': '200px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-select
|
|
|
+ style='width:100%'
|
|
|
+ value={row.materialNumber}
|
|
|
+ onInput={e => (row.materialNumber = e)}
|
|
|
+ onChange={e => this.handleChange2(e, row)}
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
+ filterable
|
|
|
+ size='mini'
|
|
|
+ placeholder='请输入物料编号'
|
|
|
+ loading={this.loading}
|
|
|
+ >
|
|
|
+ {this.k3List.map(k => {
|
|
|
+ return <el-option key={k.id} label={k.materialNumber} value={k.id}></el-option>
|
|
|
+ })}
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '规格型号',
|
|
|
+ prop: 'specification',
|
|
|
+ 'min-width': '200px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-select
|
|
|
+ style='width:100%'
|
|
|
+ value={row.specification}
|
|
|
+ onInput={e => (row.specification = e)}
|
|
|
+ onChange={e => this.handleChange2(e, row)}
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
+ filterable
|
|
|
+ size='mini'
|
|
|
+ placeholder='请输入规格型号'
|
|
|
+ loading={this.loading}
|
|
|
+ >
|
|
|
+ {this.k3List.map(k => {
|
|
|
+ return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
|
|
|
+ })}
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '订货上限',
|
|
|
+ prop: 'limitQty',
|
|
|
+ 'min-width': '100px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-input
|
|
|
+ type='number'
|
|
|
+ value={row.limitQty}
|
|
|
+ onInput={e => (row.limitQty = e)}
|
|
|
+ placeholder='请输入'
|
|
|
+ size='mini'
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ : this.detailType === 'LIMIT'
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '最小提货数量',
|
|
|
+ prop: 'minBuyNum',
|
|
|
+ 'min-width': '100px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-input
|
|
|
+ type='number'
|
|
|
+ value={row.minBuyNum}
|
|
|
+ onInput={e => (row.minBuyNum = e)}
|
|
|
+ placeholder='请输入'
|
|
|
+ size='mini'
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '最大提货组数',
|
|
|
+ prop: 'maxBuyNum',
|
|
|
+ 'min-width': '100px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-input
|
|
|
+ type='number'
|
|
|
+ value={row.maxBuyNum}
|
|
|
+ onInput={e => (row.maxBuyNum = e)}
|
|
|
+ placeholder='请输入'
|
|
|
+ size='mini'
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ : [
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '配提上限组数',
|
|
|
+ prop: 'groupLimitNum',
|
|
|
+ 'min-width': '100px'
|
|
|
+ },
|
|
|
+ render: (h, { column, row, index }) => {
|
|
|
+ return (
|
|
|
+ <div style='margin:0 10px'>
|
|
|
+ <el-input
|
|
|
+ type='number'
|
|
|
+ value={row.groupLimitNum}
|
|
|
+ onInput={e => (row.groupLimitNum = e)}
|
|
|
+ placeholder='请输入'
|
|
|
+ size='mini'
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })(),
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
label: '已下订单数',
|
|
|
- prop: 'orderNums'
|
|
|
+ prop: 'orderNums',
|
|
|
+ 'min-width': '100px'
|
|
|
},
|
|
|
render: (h, { column, row, index }) => {
|
|
|
return (
|
|
@@ -251,6 +315,7 @@ export default {
|
|
|
<el-input
|
|
|
type='number'
|
|
|
value={row.orderNums}
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
onInput={e => (row.orderNums = e)}
|
|
|
placeholder='请输入'
|
|
|
size='mini'
|
|
@@ -263,7 +328,8 @@ export default {
|
|
|
{
|
|
|
columnAttributes: {
|
|
|
label: '已审订单数',
|
|
|
- prop: 'examineOrderNums'
|
|
|
+ prop: 'examineOrderNums',
|
|
|
+ 'min-width': '100px'
|
|
|
},
|
|
|
render: (h, { column, row, index }) => {
|
|
|
return (
|
|
@@ -272,6 +338,7 @@ export default {
|
|
|
type='number'
|
|
|
value={row.examineOrderNums}
|
|
|
onInput={e => (row.examineOrderNums = e)}
|
|
|
+ disabled={this.linitType === 'edit'}
|
|
|
placeholder='请输入'
|
|
|
size='mini'
|
|
|
clearable
|
|
@@ -283,26 +350,48 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
mounted() {
|
|
|
- if (this.linitType === 'add') {
|
|
|
- this.dataList.push({
|
|
|
- customerId: '',
|
|
|
- id: '',
|
|
|
- limitQty: 0,
|
|
|
- materialId: '',
|
|
|
- policyId: this.policyId,
|
|
|
- customerName: '',
|
|
|
- customerNumber: '',
|
|
|
- examineOrderNums: 0,
|
|
|
- materialName: '',
|
|
|
- materialNumber: '',
|
|
|
- orderNums: 0,
|
|
|
- policyType: '',
|
|
|
- specification: ''
|
|
|
- })
|
|
|
+ if (!this.operationType) {
|
|
|
+ if (this.linitType === 'add') {
|
|
|
+ this.dataList.push({
|
|
|
+ customerId: '',
|
|
|
+ id: '',
|
|
|
+ limitQty: null,
|
|
|
+ materialId: '',
|
|
|
+ policyId: this.policyId,
|
|
|
+ customerName: '',
|
|
|
+ customerNumber: '',
|
|
|
+ examineOrderNums: null,
|
|
|
+ materialName: '',
|
|
|
+ materialNumber: '',
|
|
|
+ orderNums: null,
|
|
|
+ policyType: '',
|
|
|
+ specification: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.linitType === 'add') {
|
|
|
+ this.dataList.push({
|
|
|
+ customerId: '',
|
|
|
+ id: '',
|
|
|
+ minBuyNum: null,
|
|
|
+ maxBuyNum: null,
|
|
|
+ groupLimitNum: null,
|
|
|
+ policyId: this.policyId,
|
|
|
+ customerName: '',
|
|
|
+ customerNumber: '',
|
|
|
+ examineOrderNums: null,
|
|
|
+ orderNums: null,
|
|
|
+ policyType: '',
|
|
|
+ specification: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getCustomerList()
|
|
|
+ this.getMaterialList()
|
|
|
+ },
|
|
|
methods: {
|
|
|
remoteMethod(query, name) {
|
|
|
const params = []
|
|
@@ -371,24 +460,41 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- handleAddItmeData() {
|
|
|
-
|
|
|
+ getCustomerList() {
|
|
|
+ getCustomerList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ policyId: this.policyId
|
|
|
+ }).then(res => {
|
|
|
+ this.dealerList = res.data.records
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getMaterialList() {
|
|
|
+ getMaterialList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ policyId: this.policyId
|
|
|
+ }).then(res => {
|
|
|
+ this.k3List = res.data.records
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
handleChange(e, row) {
|
|
|
const item = this.dealerList.find(k => k.id === e)
|
|
|
- this.$set(row, 'customerId', item.id)
|
|
|
- this.$set(row, 'customerName', item.name)
|
|
|
- this.$set(row, 'customerNumber', item.number)
|
|
|
+ this.$set(row, 'customerId', item.customerId)
|
|
|
+ this.$set(row, 'customerName', item.customerName)
|
|
|
+ this.$set(row, 'customerNumber', item.customerNumber)
|
|
|
},
|
|
|
handleChange2(e, row) {
|
|
|
const item = this.k3List.find(k => k.id === e)
|
|
|
- this.$set(row, 'materialId', item.id)
|
|
|
- this.$set(row, 'materialName', item.name)
|
|
|
- this.$set(row, 'materialNumber', item.number)
|
|
|
+ this.$set(row, 'materialId', item.materialId)
|
|
|
+ this.$set(row, 'materialName', item.materialName)
|
|
|
+ this.$set(row, 'materialNumber', item.materialNumber)
|
|
|
this.$set(row, 'specification', item.specification)
|
|
|
},
|
|
|
onSbumit() {
|
|
|
- this.$emit('sbumit', { dataList: this.dataList, type: this.linitType })
|
|
|
+ this.$emit('sbumit', { dataList: this.dataList, type: this.linitType, operationType: this.operationType })
|
|
|
},
|
|
|
onCancel() {
|
|
|
this.$emit('cancel')
|