|
@@ -17,14 +17,15 @@
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
<a-select
|
|
|
- id="purchaseOrderList-dealerSn"
|
|
|
+ id="purchaseOrderList-purchaseTargetSn"
|
|
|
placeholder="请选择供应商"
|
|
|
allowClear
|
|
|
- v-model="queryParam.dealerSn"
|
|
|
+ v-model="queryParam.purchaseTargetSn"
|
|
|
:showSearch="true"
|
|
|
option-filter-prop="children"
|
|
|
- :filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in supplierList" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
|
|
|
+ :filter-option="filterOption"
|
|
|
+ @change="tragetTypeChange">
|
|
|
+ <a-select-option v-for="item in supplierList" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -128,7 +129,7 @@
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
|
-import { purchaseList, purchaseDel, purchaseCount, getParentDealer } from '@/api/purchase'
|
|
|
+import { purchaseList, purchaseDel, purchaseCount, purchaseTargetList } from '@/api/purchase'
|
|
|
export default {
|
|
|
components: { STable, VSelect, basicInfoModal, rangeDate },
|
|
|
data () {
|
|
@@ -141,7 +142,8 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
purchaseBillNo: '',
|
|
|
- dealerSn: undefined,
|
|
|
+ purchaseTargetSn: undefined,
|
|
|
+ purchaseTargetType: undefined,
|
|
|
billStatus: undefined,
|
|
|
financialStatus: undefined,
|
|
|
beginDate: '',
|
|
@@ -158,7 +160,7 @@ export default {
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
{ title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: 220, align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '供应商', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '供应商', dataIndex: 'purchaseTargetName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '采购数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '采购金额(¥)', dataIndex: 'discountedAmount', width: 115, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
@@ -192,6 +194,13 @@ export default {
|
|
|
this.totalData = res.data || null
|
|
|
})
|
|
|
},
|
|
|
+ // 供应商change
|
|
|
+ tragetTypeChange (val) {
|
|
|
+ const ind = this.supplierList.findIndex(item => item.purchaseTargetSn == val)
|
|
|
+ if (ind != -1) {
|
|
|
+ this.queryParam.purchaseTargetType = this.supplierList[ind].purchaseTargetType
|
|
|
+ }
|
|
|
+ },
|
|
|
// 时间 change
|
|
|
dateChange (date) {
|
|
|
this.queryParam.beginDate = date[0]
|
|
@@ -243,7 +252,8 @@ export default {
|
|
|
this.queryParam.endDate = ''
|
|
|
this.queryParam.orderBundleNo = ''
|
|
|
this.queryParam.purchaseBillNo = ''
|
|
|
- this.queryParam.dealerSn = ''
|
|
|
+ this.queryParam.purchaseTargetSn = undefined
|
|
|
+ this.queryParam.purchaseTargetType = undefined
|
|
|
this.queryParam.billStatus = undefined
|
|
|
this.queryParam.financialStatus = undefined
|
|
|
this.$refs.table.refresh(true)
|
|
@@ -255,13 +265,11 @@ export default {
|
|
|
},
|
|
|
// 获取供应商数据
|
|
|
getSupperList () {
|
|
|
- this.supplierList = [{ dealerSn: '1', dealerName: '箭冠营销中心' }]
|
|
|
- getParentDealer({}).then(res => {
|
|
|
+ purchaseTargetList({}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.purchaseTragetType = res.data
|
|
|
- if (res.data) {
|
|
|
- this.supplierList.push({ dealerSn: res.data.dealerSn, dealerName: res.data.dealerName })
|
|
|
- }
|
|
|
+ this.supplierList = res.data
|
|
|
+ } else {
|
|
|
+ this.supplierList = []
|
|
|
}
|
|
|
})
|
|
|
}
|