123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <template>
- <a-modal
- title="发票号码明细"
- v-model="invoiceNumModVis"
- :confirmLoading="confirmLoading"
- width="86%"
- :footer="null"
- >
-
- <a-spin :spinning="confirmLoading">
-
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="8">
- <a-form-item label="物料">
- <a-input placeholder="请输入物料" v-model="queryParam.cinvName"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" icon="download" @click="exportExcel" style="margin-left: 8px">导出</a-button>
- <JsonExcel
- :fetch="getExportDataList"
- :fields="exportFields"
- :header="exportTitle"
- name="发票号码明细.xls"
- style="display:none"
- >
-
- <a-button type="primary" icon="download" ref="realExportExcel">导出</a-button>
-
- </JsonExcel>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-
- {{ toggleSearchStatus ? '收起' : '展开' }}
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
-
- <div>
- <a-table
- bordered
- :loading="loading"
- :columns="invoiceNumColumns"
- :data-source="invoiceNumData"
- :pagination="false"
- :scroll="{ y: 500 }"
- :footer="showTotal"
- >
- </a-table>
-
- <a-row style="marginTop:20px;">
- <a-col :md="24" :sm="12">
- <span style="float: right;" class="table-operator">
-
- <a-button type="primary" @click="backFabricLossTable" icon="rollback">关闭</a-button>
- </span>
- </a-col>
- </a-row>
- </div>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import JsonExcel from 'vue-json-excel'
- export default {
- name: 'InvoiceNumModal',
- mixins: [JeecgListMixin],
- components: { JEllipsis,JsonExcel },
- data() {
- return {
- exportTitle:"发票号码明细",
-
- invoiceNumColumns: [
- {
- title: '序号',
- width:80,
- customRender: (text, record, index) => {
- if (record.cinvName == "合计")
- return "";
- else
- return index + 1;
- }
- },
- {
- title: '物料',
- dataIndex: 'cinvName',
- width: 400,
- key: '',
- className: 'replacecolor'
- },
- {
- title: '数量',
- dataIndex: 'iquantity',
- width: 120,
- key: '',
- className: 'replacecolor'
- },
- {
- title: '开票单价',
- dataIndex: 'iprice',
- width: 120,
- key: '',
- className: 'replacecolor'
- },
- {
- title: '合计金额',
- dataIndex: 'inatSum',
- width: 120,
- key: '',
- className: 'replacecolor'
- }
- ],
- invoiceNumData: [],
- allDataList:[],
- loading: false,
-
- confirmLoading: false,
- invoiceNumModVis: false,
-
- queryParam: {
- material: '',
- invoicingPrice: ''
- }
- }
- },
-
- props: {
- father: {
- type: Function,
- default: null
- }
- },
- created() {},
- computed: {
-
- totalDataSource(){
-
- var item = {
- "cinvName":"合计"
- };
- var iquantity = 0,inatSum = 0;
- for (let row of this.invoiceNumData){
- iquantity += row.iquantity*1;
- inatSum += row.inatSum*1;
- }
-
- item.iquantity= parseFloat(iquantity.toFixed(4));
- item.inatSum= parseFloat(inatSum.toFixed(2));
- return [item];
- },
-
- exportFields(){
- var ret = {};
- this.invoiceNumColumns.forEach((record,index)=>{
- if (record.title != "序号"){
- if (record.title != "入库单号")
- ret[record.title] = record.dataIndex;
- else
- ret[record.title] = record.dataIndex+"_ex";
- }
- });
- return ret;
- }
- },
- methods: {
-
- handleExportXls() {},
-
- print() {},
-
- backFabricLossTable() {
- console.log('返回到面料损耗表')
-
-
- this.close()
- },
-
- searchQuery() {
- this.invoiceNumData = this.allDataList.filter(e=>
- (this.queryParam.cinvName == null || e.cinvName.toLowerCase().indexOf(this.queryParam.cinvName.toLowerCase())>-1)
- );
- },
-
- searchReset() {
- this.queryParam = {}
-
- },
- close() {
- this.$emit('close')
- this.invoiceNumModVis = false
- },
- showTotal(data) {
- return (
- <a-table
- rowKey={Math.random}
- bordered={false}
- pagination={false}
- columns={this.invoiceNumColumns}
- dataSource={this.totalDataSource || []}
- showHeader={false}
- ></a-table>
- )
- },
-
- exportExcel(){
- this.$refs.realExportExcel.$el.click();
- },
-
- getExportDataList(){
- this.invoiceNumData.forEach((item,index)=>{item["ccode_ex"]=" "+item["ccode"]});
- return this.invoiceNumData;
- }
- }
- }
- </script>
- <style lang="less" scoped>
- @import '~@assets/less/common.less';
- @import '~@assets/less/overwriter.less';
- /deep/ .ant-table-thead > tr > th {
- text-align: center;
- // font-weight: 700;
- }
- /deep/ .ant-table-tbody {
- text-align: center;
- }
- /deep/.ant-modal-body{
- height: auto !important;
- overflow-y: scroll;
- }
- /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
- width: calc(100% + 9px);//减去滚动条的宽度
- }
- // /deep/ th.replacecolor {
- // background-color: #ccc;
- // }
- </style>
|