报表增加打印功能;单据退货可以从原单直接关联数据

This commit is contained in:
季圣华 2021-06-24 19:48:54 +08:00
parent ed7d2e205e
commit b08b55457d
19 changed files with 436 additions and 233 deletions

View File

@ -241,7 +241,11 @@
{{model.number}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
{{model.linkNumber}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"
@ -447,7 +451,11 @@
{{model.number}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
{{model.linkNumber}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="18" :md="12" :sm="24">
@ -587,7 +595,11 @@
{{model.number}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
{{model.linkNumber}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"

View File

@ -42,9 +42,9 @@
queryParam: {
number: "",
searchMaterial: "",
type: "其它",
type: "",
subType: "",
status: "1"
status: ""
},
// 表头
columns: [
@ -84,8 +84,9 @@
created() {
},
methods: {
show(subType, organType) {
show(type, subType, organType, status) {
this.queryParam.subType = subType
this.queryParam.status = status
this.columns[1].title = organType
this.model = Object.assign({}, {});
this.visible = true;

View File

@ -35,7 +35,11 @@
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
<a-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
@ -109,15 +113,18 @@
</a-spin>
</j-modal>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort, changeListFmtMinus} from "@/utils/util"
import { getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
@ -125,6 +132,7 @@
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
LinkBillList,
JDate
},
data () {
@ -258,6 +266,50 @@
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allPrice})
});
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('出库', '采购', '供应商', "0")
this.$refs.linkBillList.title = "选择采购出库"
},
linkBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
for(let j=0; j<list.length; j++){
let info = list[j];
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}

View File

@ -276,7 +276,7 @@
});
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('采购订单', '供应商')
this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1")
this.$refs.linkBillList.title = "选择采购订单"
},
linkBillListOk(selectBillRows) {

View File

@ -1,4 +1,5 @@
<template>
<a-card :bordered="false">
<j-modal
:title="title"
:width="width"
@ -34,7 +35,11 @@
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
<a-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="18" :md="12" :sm="24">
@ -91,19 +96,24 @@
</a-form>
</a-spin>
</j-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import LinkBillList from '../dialog/LinkBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import { getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "RetailBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
LinkBillList,
JDate
},
data () {
@ -231,6 +241,51 @@
this.$nextTick(() => {
this.form.setFieldsValue({'backAmount':backAmount})
});
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('出库', '零售', '会员', "0")
this.$refs.linkBillList.title = "选择零售出库"
},
linkBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'getAmount': record.totalPrice,
'changeAmount': record.totalPrice,
'backAmount': 0
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
for(let j=0; j<list.length; j++){
let info = list[j];
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}

View File

@ -35,7 +35,11 @@
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
<a-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
@ -112,15 +116,18 @@
</a-spin>
</j-modal>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort, changeListFmtMinus } from "@/utils/util"
import { getAction } from '@/api/manage'
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
@ -129,6 +136,7 @@
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
LinkBillList,
JDate,
JSelectMultiple
},
@ -272,6 +280,50 @@
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allPrice})
});
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('出库', '销售', '客户', "0")
this.$refs.linkBillList.title = "选择销售出库"
},
linkBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
for(let j=0; j<list.length; j++){
let info = list[j];
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}

View File

@ -281,7 +281,7 @@
});
},
onSearchLinkNumber() {
this.$refs.linkBillList.show("销售订单", '客户')
this.$refs.linkBillList.show('其它', '销售订单', '客户', "1")
this.$refs.linkBillList.title = "选择销售订单"
},
linkBillListOk(selectBillRows) {

View File

@ -16,9 +16,10 @@
<a-input placeholder="请输入编号" v-model="queryParam.serialNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="2" :sm="24" >
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
<a-col :md="3" :sm="24" >
@ -35,7 +36,7 @@
</a-form>
</div>
<!-- table区域-begin -->
<div>
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -50,7 +51,7 @@
<a @click="showAccountInOutList(record)">流水</a>
</span>
</a-table>
</div>
</section>
<!-- table区域-end -->
<account-in-out-list ref="accountInOutList" @ok="modalFormOk"></account-in-out-list>
</a-card>

View File

@ -19,12 +19,14 @@
<a-col :md="6" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -36,6 +38,7 @@
:loading="loading"
@change="handleTableChange">
</a-table>
</section>
<!-- table区域-end -->
</a-card>
</a-col>

View File

@ -18,7 +18,7 @@
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
style="width: 250px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
@ -27,9 +27,10 @@
/>
</a-form-item>
</a-col>
<a-col :md="2" :sm="24">
<a-col :md="4" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
<a-col :md="8" :sm="24">
@ -41,6 +42,7 @@
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -55,6 +57,7 @@
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalBillDetail"></bill-detail>

View File

@ -47,12 +47,14 @@
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -67,6 +69,7 @@
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalDetail"></bill-detail>

View File

@ -47,12 +47,14 @@
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -64,6 +66,7 @@
:loading="loading"
@change="handleTableChange">
</a-table>
</section>
<!-- table区域-end -->
</a-card>
</a-col>

View File

@ -32,6 +32,7 @@
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" type="primary" icon="download" @click="handleExportXls('库存状况')">导出</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
<a-col :md="4" :sm="24" >
@ -43,6 +44,7 @@
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -54,6 +56,7 @@
:loading="loading"
@change="handleTableChange">
</a-table>
</section>
<!-- table区域-end -->
</a-card>
</a-col>

View File

@ -33,7 +33,7 @@
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#materialStockPrint'" type="primary" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
<a-col :md="4" :sm="24" >
@ -50,7 +50,7 @@
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="materialStockPrint">
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"

View File

@ -47,12 +47,14 @@
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -67,6 +69,7 @@
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalDetail"></bill-detail>

View File

@ -47,12 +47,14 @@
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -64,6 +66,7 @@
:loading="loading"
@change="handleTableChange">
</a-table>
</section>
<!-- table区域-end -->
</a-card>
</a-col>

View File

@ -19,12 +19,14 @@
<a-col :md="3" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -36,6 +38,7 @@
:loading="loading"
@change="handleTableChange">
</a-table>
</section>
<!-- table区域-end -->
</a-card>
</a-col>

View File

@ -27,12 +27,14 @@
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" type="primary" icon="download" @click="handleExportXls('库存预警')">导出</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -44,6 +46,7 @@
:loading="loading"
@change="handleTableChange">
</a-table>
</section>
<!-- table区域-end -->
</a-card>
</a-col>

View File

@ -18,7 +18,7 @@
<a-col :md="6" :sm="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
style="width: 250px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
@ -27,9 +27,10 @@
/>
</a-form-item>
</a-col>
<a-col :md="2" :sm="24">
<a-col :md="4" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" type="primary" icon="printer">打印</a-button>
</span>
</a-col>
<a-col :md="8" :sm="24">
@ -41,6 +42,7 @@
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
@ -55,6 +57,7 @@
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalBillDetail"></bill-detail>