|
@@ -43,7 +43,7 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.salesTargetSn"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
:defaultLoadData="false"
|
|
@@ -53,132 +53,132 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { STable, VSelect } from '@/components'
|
|
|
- import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
- import { reportCheckWarehouseList, reportCheckWarehouseCount } from '@/api/reportData'
|
|
|
- export default {
|
|
|
- components: { STable, VSelect, rangeDate },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- labelCol: { span: 8 },
|
|
|
- wrapperCol: { span: 16 },
|
|
|
- queryParam: { // 查询条件
|
|
|
- time: [],
|
|
|
- beginDate: '',
|
|
|
- endDate: ''
|
|
|
- },
|
|
|
- productType: [],
|
|
|
- rules: {
|
|
|
- 'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
|
|
|
- },
|
|
|
- disabled: false, // 查询、重置按钮是否可操作
|
|
|
- exportLoading: false,
|
|
|
- columns: [
|
|
|
- { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '库存总数量', dataIndex: 'totalStockQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '库存总成本', dataIndex: 'totalStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '盘盈总数量', dataIndex: 'totalProfitQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '盘盈总成本', dataIndex: 'totalProfitCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '盘亏总数量', dataIndex: 'totalLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '盘亏总成本', dataIndex: 'totalLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '盈亏总数量', dataIndex: 'totalProfitLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '盈亏总成本', dataIndex: 'totalProfitLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
- ],
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
- loadData: parameter => {
|
|
|
- this.disabled = true
|
|
|
- const params = Object.assign(parameter, this.queryParam)
|
|
|
- // this.spinning = true
|
|
|
- this.$emit('spinning', true)
|
|
|
- delete params.time
|
|
|
- if (params.beginDate) {
|
|
|
- return reportCheckWarehouseList(params).then(res => {
|
|
|
- // 总计
|
|
|
- this.getCount(params)
|
|
|
- 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
|
|
|
- // this.spinning = false
|
|
|
- this.$emit('spinning', false)
|
|
|
- return data
|
|
|
- })
|
|
|
- } else {
|
|
|
- const _this = this
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- const data = {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- list: [],
|
|
|
- count: 0
|
|
|
- }
|
|
|
- _this.disabled = false
|
|
|
- // _this.spinning = false
|
|
|
- _this.$emit('spinning', false)
|
|
|
- _this.$message.info('请选择财务审核时间')
|
|
|
- resolve(data)
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- totalData: null // 合计
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 合计
|
|
|
- getCount (params) {
|
|
|
- reportCheckWarehouseCount(params).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.totalData = res.data
|
|
|
- } else {
|
|
|
- this.totalData = null
|
|
|
- }
|
|
|
- })
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import { reportCheckWarehouseList, reportCheckWarehouseCount } from '@/api/reportData'
|
|
|
+export default {
|
|
|
+ components: { STable, VSelect, rangeDate },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ labelCol: { span: 8 },
|
|
|
+ wrapperCol: { span: 16 },
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ time: [],
|
|
|
+ beginDate: '',
|
|
|
+ endDate: ''
|
|
|
},
|
|
|
- // 创建时间 change
|
|
|
- dateChange (date) {
|
|
|
- this.queryParam.time = date
|
|
|
- this.queryParam.beginDate = date[0] || ''
|
|
|
- this.queryParam.endDate = date[1] || ''
|
|
|
+ productType: [],
|
|
|
+ rules: {
|
|
|
+ 'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
|
|
|
},
|
|
|
- // 查询
|
|
|
- handleSearch () {
|
|
|
- this.$refs.ruleForm.validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
- } else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false,
|
|
|
+ columns: [
|
|
|
+ { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '库存总数量', dataIndex: 'totalStockQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '库存总成本', dataIndex: 'totalStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '盘盈总数量', dataIndex: 'totalProfitQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '盘盈总成本', dataIndex: 'totalProfitCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '盘亏总数量', dataIndex: 'totalLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '盘亏总成本', dataIndex: 'totalLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '盈亏总数量', dataIndex: 'totalProfitLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '盈亏总成本', dataIndex: 'totalProfitLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ ],
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
+ // this.spinning = true
|
|
|
+ this.$emit('spinning', true)
|
|
|
+ delete params.time
|
|
|
+ if (params.beginDate) {
|
|
|
+ return reportCheckWarehouseList(params).then(res => {
|
|
|
+ // 总计
|
|
|
+ this.getCount(params)
|
|
|
+ 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
|
|
|
+ // this.spinning = false
|
|
|
+ this.$emit('spinning', false)
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const _this = this
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ const data = {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ list: [],
|
|
|
+ count: 0
|
|
|
+ }
|
|
|
+ _this.disabled = false
|
|
|
+ // _this.spinning = false
|
|
|
+ _this.$emit('spinning', false)
|
|
|
+ _this.$message.info('请选择财务审核时间')
|
|
|
+ resolve(data)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
- // 重置
|
|
|
- resetSearchForm () {
|
|
|
- this.$refs.rangeDate.resetDate()
|
|
|
- this.queryParam.time = []
|
|
|
- this.queryParam.beginDate = ''
|
|
|
- this.queryParam.endDate = ''
|
|
|
- this.$refs.ruleForm.resetFields()
|
|
|
- this.totalData = null
|
|
|
- this.$refs.table.clearTable()
|
|
|
- }
|
|
|
+ totalData: null // 合计
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 合计
|
|
|
+ getCount (params) {
|
|
|
+ reportCheckWarehouseCount(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.totalData = res.data
|
|
|
+ } else {
|
|
|
+ this.totalData = null
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- mounted () {
|
|
|
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
- this.resetSearchForm()
|
|
|
- }
|
|
|
+ // 创建时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.time = date
|
|
|
+ this.queryParam.beginDate = date[0] || ''
|
|
|
+ this.queryParam.endDate = date[1] || ''
|
|
|
},
|
|
|
- activated () {
|
|
|
- // 如果是新页签打开,则重置当前页面
|
|
|
- if (this.$store.state.app.isNewTab) {
|
|
|
- this.resetSearchForm()
|
|
|
- }
|
|
|
+ // 查询
|
|
|
+ handleSearch () {
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
- next(vm => {})
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
+ this.queryParam.time = []
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
+ this.queryParam.endDate = ''
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
+ this.totalData = null
|
|
|
+ this.$refs.table.clearTable()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.resetSearchForm()
|
|
|
}
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {})
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style>
|