给单据录入界面增加历史单据链接

This commit is contained in:
季圣华
2022-05-23 22:59:26 +08:00
parent 286bc0c375
commit cb67604c69
6 changed files with 293 additions and 4 deletions

View File

@@ -0,0 +1,237 @@
<template>
<a-modal
:title="title"
:width="1250"
:visible="visible"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
</template>
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item :label="organLabel" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-select v-model="queryParam.organId" :dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<a-select-option v-for="(item,index) in supplierList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="单号" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="商品" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="条码|名称|规格|型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="4" :sm="24">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
<template slot="customRenderStatus" slot-scope="text, record">
<a-tag v-if="record.status === '0'" color="red">未审核</a-tag>
<a-tag v-if="record.status === '1'" color="green">已审核</a-tag>
<a-tag v-if="record.status === '2' && queryParam.subType === '采购订单'" color="cyan">完成采购</a-tag>
<a-tag v-if="record.status === '2' && queryParam.subType === '销售订单'" color="cyan">完成销售</a-tag>
<a-tag v-if="record.status === '3' && queryParam.subType === '采购订单'" color="blue">部分采购</a-tag>
<a-tag v-if="record.status === '3' && queryParam.subType === '销售订单'" color="blue">部分销售</a-tag>
</template>
</a-table>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="billDetail"></bill-detail>
</a-modal>
</template>
<script>
import BillDetail from './BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { findBySelectSup, findBySelectCus, findBillDetailByNumber} from '@/api/api'
import Vue from 'vue'
export default {
name: 'HistoryBillList',
mixins:[JeecgListMixin],
components: {
BillDetail,
},
data () {
return {
title: "历史单据",
visible: false,
disableMixinCreated: true,
organLabel: '',
supplierList: [],
queryParam: {
organId: "",
number: "",
materialParam: "",
type: "",
subType: "",
roleType: Vue.ls.get('roleType'),
status: ""
},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
// 表头
columns: [
{
title: '#', dataIndex: '', key:'rowIndex', width:40, align:"center", customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '', dataIndex: 'organName',width:120, ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:150,
scopedSlots: { customRender: 'numberCustomRender' },
},
{ title: '商品信息', dataIndex: 'materialsList',width:280, ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145},
{ title: '操作员', dataIndex: 'userName',width:70},
{ title: '金额合计', dataIndex: 'totalPrice',width:70},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:70,
customRender:function (text,record,index) {
if(record.discountLastMoney) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
} else {
return record.totalPrice;
}
}
},
{ title: '状态', dataIndex: 'status', width: 70, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
}
],
dataSource:[],
url: {
list: "/depotHead/list"
}
}
},
created() {
},
methods: {
show(type, subType, organType, organId) {
this.queryParam.type = type
this.queryParam.subType = subType
this.columns[1].title = organType
this.organLabel = organType
this.model = Object.assign({}, {})
this.visible = true
this.loadSupplier(organType, organId)
this.loadData(1)
},
loadSupplier(organType, organId) {
if(organType === '供应商') {
findBySelectSup({}).then((res)=>{
if(res) {
this.supplierList = res
if(organId) {
this.queryParam.organId = organId
this.loadData(1)
}
}
})
} else if(organType === '客户') {
findBySelectCus({}).then((res)=>{
if(res) {
this.supplierList = res
if(organId) {
this.queryParam.organId = organId
this.loadData(1)
}
}
})
}
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
},
onDateChange: function (value, dateString) {
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
onDateOk(value) {
console.log(value);
},
searchReset() {
this.queryParam = {
type: this.queryParam.type,
subType: this.queryParam.subType,
status: ""
}
this.loadData(1);
},
myHandleDetail(record) {
let that = this
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
let type = res.data.depotHeadType
type = type.replace('其它','')
that.$refs.billDetail.show(res.data, type);
that.$refs.billDetail.title="详情";
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -13,20 +13,20 @@
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="请输入单据编号查询" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="条码|名称|规格|型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="7" :sm="10">
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
style="width: 100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"

View File

@@ -94,6 +94,11 @@
</a-dropdown>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;padding-bottom: 5px;">
<a-col :md="24" :sm="24">
<a-button style="margin-left: 8px" @click="handleHistoryBillList"><a-icon type="history" />历史单据</a-button>
</a-col>
</a-row>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
@@ -180,6 +185,7 @@
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
<history-bill-list ref="historyBillListModalForm"></history-bill-list>
</j-modal>
</template>
@@ -191,6 +197,7 @@
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import HistoryBillList from '../dialog/HistoryBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
@@ -209,6 +216,7 @@
DepotModal,
AccountModal,
BatchSetDepot,
HistoryBillList,
JUpload,
JDate,
VNodes: {
@@ -391,6 +399,11 @@
rows: JSON.stringify(detailArr),
}
},
handleHistoryBillList() {
let organId = this.form.getFieldValue('organId')
this.$refs.historyBillListModalForm.show('入库', '采购', '供应商', organId);
this.$refs.historyBillListModalForm.disableSubmit = false;
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1,3")
this.$refs.linkBillList.title = "选择采购订单"

View File

@@ -82,6 +82,11 @@
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;padding-bottom: 5px;">
<a-col :md="24" :sm="24">
<a-button style="margin-left: 8px" @click="handleHistoryBillList"><a-icon type="history" />历史单据</a-button>
</a-col>
</a-row>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
@@ -124,12 +129,14 @@
</a-spin>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<history-bill-list ref="historyBillListModalForm"></history-bill-list>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import LinkBillList from '../dialog/LinkBillList'
import VendorModal from '../../system/modules/VendorModal'
import HistoryBillList from '../dialog/HistoryBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
@@ -144,6 +151,7 @@
components: {
LinkBillList,
VendorModal,
HistoryBillList,
JUpload,
JDate,
VNodes: {
@@ -299,6 +307,11 @@
rows: JSON.stringify(detailArr),
}
},
handleHistoryBillList() {
let organId = this.form.getFieldValue('organId')
this.$refs.historyBillListModalForm.show('其它', '采购订单', '供应商', organId);
this.$refs.historyBillListModalForm.disableSubmit = false;
},
onSearchLinkNumber() {
this.$refs.linkBillList.purchaseShow('其它', '销售订单', '客户', "1,3","0,3")
this.$refs.linkBillList.title = "选择销售订单"

View File

@@ -82,6 +82,11 @@
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;padding-bottom: 5px;">
<a-col :md="24" :sm="24">
<a-button style="margin-left: 8px" @click="handleHistoryBillList"><a-icon type="history" />历史单据</a-button>
</a-col>
</a-row>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
@@ -123,11 +128,13 @@
</a-form>
</a-spin>
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
<history-bill-list ref="historyBillListModalForm"></history-bill-list>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import CustomerModal from '../../system/modules/CustomerModal'
import HistoryBillList from '../dialog/HistoryBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
@@ -141,6 +148,7 @@
mixins: [JEditableTableMixin, BillModalMixin],
components: {
CustomerModal,
HistoryBillList,
JUpload,
JDate,
JSelectMultiple,
@@ -285,6 +293,11 @@
rows: JSON.stringify(detailArr),
}
},
handleHistoryBillList() {
let organId = this.form.getFieldValue('organId')
this.$refs.historyBillListModalForm.show('其它', '销售订单', '客户', organId);
this.$refs.historyBillListModalForm.disableSubmit = false;
},
}
}
</script>

View File

@@ -95,6 +95,11 @@
</a-dropdown>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;padding-bottom: 5px;">
<a-col :md="24" :sm="24">
<a-button style="margin-left: 8px" @click="handleHistoryBillList"><a-icon type="history" />历史单据</a-button>
</a-col>
</a-row>
</template>
</j-editable-table>
<a-row class="form-row" :gutter="24">
@@ -185,6 +190,7 @@
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
<history-bill-list ref="historyBillListModalForm"></history-bill-list>
</j-modal>
</template>
<script>
@@ -195,6 +201,7 @@
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import HistoryBillList from '../dialog/HistoryBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
@@ -214,6 +221,7 @@
DepotModal,
AccountModal,
BatchSetDepot,
HistoryBillList,
JUpload,
JDate,
JSelectMultiple,
@@ -397,6 +405,11 @@
rows: JSON.stringify(detailArr),
}
},
handleHistoryBillList() {
let organId = this.form.getFieldValue('organId')
this.$refs.historyBillListModalForm.show('出库', '销售', '客户', organId);
this.$refs.historyBillListModalForm.disableSubmit = false;
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('其它', '销售订单', '客户', "1,3")
this.$refs.linkBillList.title = "选择销售订单"