|
@@ -91,6 +91,11 @@
|
|
|
:data="loadData"
|
|
|
:scroll="{ x: 2390 }"
|
|
|
bordered>
|
|
|
+ <template slot="footer" slot-scope="currentPageData">
|
|
|
+ <span>
|
|
|
+ 合计: 期初数量:{{ totalData.beginQty || 0 }} 期初金额:{{ totalData.beginAmount || 0 }} 收入数量:{{ totalData.putQty || 0 }} 收入金额:{{ totalData.putAmount || 0 }} 发出数量:{{ totalData.outQty || 0 }} 发出金额:{{ totalData.outAmount || 0 }} 结算数量:{{ totalData.endQty || 0 }} 结算金额:{{ totalData.endAmount || 0 }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
</template>
|
|
@@ -100,6 +105,7 @@ import { STable, VSelect } from '@/components'
|
|
|
import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import { linkageReportPageList, linkageReportPageTotal } from '@/api/reportData.js'
|
|
|
// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
|
|
|
// import { allocateTypeAllList } from '@/api/allocateType'
|
|
|
export default {
|
|
@@ -123,7 +129,8 @@ export default {
|
|
|
labelCol: { span: 8 },
|
|
|
wrapperCol: { span: 16 },
|
|
|
rules: {
|
|
|
- 'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }]
|
|
|
+ 'targetName': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
|
|
|
+ 'date': [{ required: true, message: '请选择日期', trigger: 'change' }]
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false,
|
|
@@ -131,15 +138,7 @@ export default {
|
|
|
{ title: '序号',
|
|
|
dataIndex: 'no',
|
|
|
width: 80,
|
|
|
- align: 'center',
|
|
|
- customRender: function (value, row, index) {
|
|
|
- const obj = { children: value, attrs: {} }
|
|
|
- if (value == '合计') {
|
|
|
- console.log(111)
|
|
|
- obj.attrs.colSpan = 7
|
|
|
- }
|
|
|
- return obj
|
|
|
- }
|
|
|
+ align: 'center'
|
|
|
// fixed: 'left'
|
|
|
},
|
|
|
{ title: '产品编码',
|
|
@@ -147,42 +146,47 @@ export default {
|
|
|
width: 220,
|
|
|
align: 'center',
|
|
|
customRender: function (value, row, index) {
|
|
|
- value = value || '--'
|
|
|
+ value = row.productEntity && row.productEntity.code ? row.productEntity.code : '--'
|
|
|
const obj = { children: value, attrs: {} }
|
|
|
if (value == '合计') { obj.attrs.colSpan = 0 }
|
|
|
+ obj.children = row.productEntity && row.productEntity.code ? row.productEntity.code : '--'
|
|
|
return obj
|
|
|
}
|
|
|
},
|
|
|
{ title: '产品名称',
|
|
|
dataIndex: 'name',
|
|
|
+ width: 220,
|
|
|
align: 'center',
|
|
|
customRender: function (value, row, index) {
|
|
|
value = value || '--'
|
|
|
const obj = { children: value, attrs: {} }
|
|
|
if (value == '合计') { obj.attrs.colSpan = 0 }
|
|
|
+ obj.children = row.productEntity && row.productEntity.name ? row.productEntity.name : '--'
|
|
|
return obj
|
|
|
},
|
|
|
ellipsis: true
|
|
|
},
|
|
|
{ title: '品牌',
|
|
|
- dataIndex: 'brand',
|
|
|
+ dataIndex: 'productBrandName',
|
|
|
align: 'center',
|
|
|
width: 200,
|
|
|
customRender: function (value, row, index) {
|
|
|
value = value || '--'
|
|
|
const obj = { children: value, attrs: {} }
|
|
|
if (value == '合计') { obj.attrs.colSpan = 0 }
|
|
|
+ obj.children = row.productEntity && row.productEntity.productBrandName ? row.productEntity.productBrandName : '--'
|
|
|
return obj
|
|
|
}
|
|
|
},
|
|
|
{ title: '三级分类',
|
|
|
- dataIndex: 'productLeve',
|
|
|
+ dataIndex: 'productTypeName3',
|
|
|
width: 150,
|
|
|
align: 'center',
|
|
|
customRender: function (value, row, index) {
|
|
|
value = value || '--'
|
|
|
const obj = { children: value, attrs: {} }
|
|
|
if (value == '合计') { obj.attrs.colSpan = 0 }
|
|
|
+ obj.children = row.productEntity && row.productEntity.productTypeName3 ? row.productEntity.productTypeName3 : '--'
|
|
|
return obj
|
|
|
}
|
|
|
},
|
|
@@ -194,6 +198,7 @@ export default {
|
|
|
value = value || '--'
|
|
|
const obj = { children: value, attrs: {} }
|
|
|
if (value == '合计') { obj.attrs.colSpan = 0 }
|
|
|
+ obj.children = row.productEntity && row.productEntity.origCode ? row.productEntity.origCode : '--'
|
|
|
return obj
|
|
|
}
|
|
|
},
|
|
@@ -205,178 +210,47 @@ export default {
|
|
|
value = value || '--'
|
|
|
const obj = { children: value, attrs: {} }
|
|
|
if (value == '合计') { obj.attrs.colSpan = 0 }
|
|
|
+ obj.children = row.productEntity && row.productEntity.unit ? row.productEntity.unit : '--'
|
|
|
return obj
|
|
|
}
|
|
|
},
|
|
|
- { title: '期初数量', dataIndex: 'sqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '期初单价(¥)', dataIndex: 'sprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '期初金额(¥)', dataIndex: 'samount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '收入数量', dataIndex: 'srqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '收入单价(¥)', dataIndex: 'srprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '收入金额(¥)', dataIndex: 'sramount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '发出数量', dataIndex: 'fcqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '发出单价(¥)', dataIndex: 'fcprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '发出金额(¥)', dataIndex: 'fcamount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '结存数量', dataIndex: 'dcqty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '结存单价(¥)', dataIndex: 'dcprice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '结存金额(¥)', dataIndex: 'dcamount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ { title: '期初数量', dataIndex: 'beginQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '期初单价(¥)', dataIndex: 'beginPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '期初金额(¥)', dataIndex: 'beginAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '收入数量', dataIndex: 'putQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '收入单价(¥)', dataIndex: 'putPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '收入金额(¥)', dataIndex: 'putAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '发出数量', dataIndex: 'outQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '发出单价(¥)', dataIndex: 'outPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '发出金额(¥)', dataIndex: 'outAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '结存数量', dataIndex: 'endQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '结存单价(¥)', dataIndex: 'endPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '结存金额(¥)', dataIndex: 'endAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
- loadData: parameter => {
|
|
|
- this.disabled = true
|
|
|
- // return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
- // const data = res.data
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
- // }
|
|
|
- // this.disabled = false
|
|
|
- // return data
|
|
|
- // })
|
|
|
- const _this = this
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- const data = {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- list: [
|
|
|
- { id: '1',
|
|
|
- code: '0000 1110 V003 / 000 1110 V004',
|
|
|
- name: '广州非品牌 空调滤清器',
|
|
|
- brand: '非品牌',
|
|
|
- productLeve: '空调滤清器',
|
|
|
- origCode: '',
|
|
|
- unit: '个',
|
|
|
- sqty: '18',
|
|
|
- sprice: '4.72',
|
|
|
- samount: '85.00',
|
|
|
- srqty: '0',
|
|
|
- srprice: '0',
|
|
|
- sramount: '0',
|
|
|
- fcqty: '0',
|
|
|
- fcprice: '0',
|
|
|
- fcamount: '0',
|
|
|
- dcqty: '18',
|
|
|
- dcprice: '4.72',
|
|
|
- dcamount: '85.00'
|
|
|
- },
|
|
|
- { id: '2',
|
|
|
- code: '0000015',
|
|
|
- name: '辅助单位测试',
|
|
|
- brand: '雪企',
|
|
|
- productLeve: '雪种油',
|
|
|
- origCode: '',
|
|
|
- unit: '升',
|
|
|
- sqty: '24',
|
|
|
- sprice: '32.71',
|
|
|
- samount: '785.00',
|
|
|
- srqty: '0',
|
|
|
- srprice: '0',
|
|
|
- sramount: '0',
|
|
|
- fcqty: '0',
|
|
|
- fcprice: '0',
|
|
|
- fcamount: '0',
|
|
|
- dcqty: 24,
|
|
|
- dcprice: '32.71',
|
|
|
- dcamount: '785.00'
|
|
|
- },
|
|
|
- { id: '3',
|
|
|
- code: '0000015',
|
|
|
- name: '辅助单位',
|
|
|
- brand: '阿尔派',
|
|
|
- productLeve: '电喇叭',
|
|
|
- origCode: '',
|
|
|
- unit: '个',
|
|
|
- sqty: '16',
|
|
|
- sprice: '120.00',
|
|
|
- samount: '1920.00',
|
|
|
- srqty: '0',
|
|
|
- srprice: '0',
|
|
|
- sramount: '0',
|
|
|
- fcqty: '0',
|
|
|
- fcprice: '0',
|
|
|
- fcamount: '0',
|
|
|
- dcqty: 16,
|
|
|
- dcprice: '120.00',
|
|
|
- dcamount: '1920.00'
|
|
|
- },
|
|
|
- { id: '4',
|
|
|
- code: '0000015',
|
|
|
- name: '辅助单位',
|
|
|
- brand: '阿尔派',
|
|
|
- productLeve: '电喇叭',
|
|
|
- origCode: '',
|
|
|
- unit: '个',
|
|
|
- sqty: '11',
|
|
|
- sprice: '120.00',
|
|
|
- samount: '1320.00',
|
|
|
- srqty: '0',
|
|
|
- srprice: '0',
|
|
|
- sramount: '0',
|
|
|
- fcqty: '0',
|
|
|
- fcprice: '0',
|
|
|
- fcamount: '0',
|
|
|
- dcqty: 11,
|
|
|
- dcprice: '120.00',
|
|
|
- dcamount: '1320.00'
|
|
|
- },
|
|
|
- { id: '5',
|
|
|
- code: '00089',
|
|
|
- name: 'SOFT99车蜡 氟素镀膜 白色车身用 防水保护效果持久',
|
|
|
- brand: 'SOFT99',
|
|
|
- productLeve: '车蜡',
|
|
|
- origCode: '',
|
|
|
- unit: '瓶',
|
|
|
- sqty: '32',
|
|
|
- sprice: '34.38',
|
|
|
- samount: '1100.00',
|
|
|
- srqty: '0',
|
|
|
- srprice: '0',
|
|
|
- sramount: '0',
|
|
|
- fcqty: '0',
|
|
|
- fcprice: '0',
|
|
|
- fcamount: '0',
|
|
|
- dcqty: 32,
|
|
|
- dcprice: '34.38',
|
|
|
- dcamount: '1100.00'
|
|
|
- },
|
|
|
- { id: '6',
|
|
|
- code: '合计',
|
|
|
- name: '合计',
|
|
|
- brand: '合计',
|
|
|
- productLeve: '合计',
|
|
|
- origCode: '合计',
|
|
|
- unit: '合计',
|
|
|
- sqty: '2208',
|
|
|
- sprice: '',
|
|
|
- samount: '48254.44',
|
|
|
- srqty: 18,
|
|
|
- srprice: '',
|
|
|
- sramount: '135.00',
|
|
|
- fcqty: '0',
|
|
|
- fcprice: '0.00',
|
|
|
- fcamount: '0.00',
|
|
|
- dcqty: 2226,
|
|
|
- dcprice: '',
|
|
|
- dcamount: '48389.00'
|
|
|
- }
|
|
|
- ],
|
|
|
- count: 10
|
|
|
- }
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- if (i < data.list.length - 1) {
|
|
|
- data.list[i].no = i + 1
|
|
|
- } else {
|
|
|
- data.list[i].no = '合计'
|
|
|
- }
|
|
|
- }
|
|
|
- _this.disabled = false
|
|
|
- resolve(data)
|
|
|
- })
|
|
|
+ loadData: async parameter => {
|
|
|
+ if (this.queryParam.beginDate) {
|
|
|
+ this.disabled = true
|
|
|
+ return linkageReportPageList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ const data = res.data
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
+ }
|
|
|
+ this.disabled = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ resolve([])
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
productType: [],
|
|
|
productBrandList: [], // 品牌下拉数据
|
|
|
productTypeList: [], // 分类下拉数据
|
|
|
- allocateTypeList: [] // 调拨类型
|
|
|
+ allocateTypeList: [], // 调拨类型
|
|
|
+ totalData: {} // 合计
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -387,12 +261,32 @@ export default {
|
|
|
},
|
|
|
// 查询
|
|
|
handleSearch () {
|
|
|
- this.$refs.ruleForm.validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ if (!this.queryParam.beginDate) {
|
|
|
+ return this.$message.error('请先选择日期')
|
|
|
+ }
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ this.getTotal()
|
|
|
+ // this.$refs.ruleForm.validate(valid => {
|
|
|
+ // if (valid) {
|
|
|
+ // if (!this.queryParam.beginDate) {
|
|
|
+ // return this.$message.error('请先选择日期')
|
|
|
+ // }
|
|
|
+ // this.$refs.table.refresh(true)
|
|
|
+ // this.getTotal()
|
|
|
+ // } else {
|
|
|
+ // console.log('error submit!!')
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // 查询总计
|
|
|
+ getTotal () {
|
|
|
+ linkageReportPageTotal(this.queryParam).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ console.log(res, 'rrrrrrrrr')
|
|
|
+ this.totalData = res.data
|
|
|
} else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
+ this.totalData = {}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -418,8 +312,10 @@ export default {
|
|
|
// 产品品牌 列表
|
|
|
getProductBrand () {
|
|
|
dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
|
|
|
+ console.log(res, 'rrrrrr')
|
|
|
if (res.status == 200) {
|
|
|
this.productBrandList = res.data
|
|
|
+ console.log(this.productBrandList, res, '--------pinpai--------')
|
|
|
} else {
|
|
|
this.productBrandList = []
|
|
|
}
|