增加关联订单的功能

This commit is contained in:
季圣华
2021-04-21 22:18:27 +08:00
parent 86da349243
commit a28233c7de
6 changed files with 316 additions and 114 deletions

View File

@@ -287,7 +287,11 @@
{{model.number}} {{model.number}}
</a-form-item> </a-form-item>
</a-col> </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="关联订单">
{{model.linkNumber}}
</a-form-item>
</a-col>
</a-row> </a-row>
<a-table <a-table
ref="table" ref="table"
@@ -670,7 +674,11 @@
{{model.number}} {{model.number}}
</a-form-item> </a-form-item>
</a-col> </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="关联订单">
{{model.linkNumber}}
</a-form-item>
</a-col>
</a-row> </a-row>
<a-table <a-table
ref="table" ref="table"

View File

@@ -0,0 +1,127 @@
<template>
<a-modal
:title="title"
:width="1000"
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<!-- table区域-begin -->
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType}">
</a-table>
<!-- table区域-end -->
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'LinkBillList',
mixins:[JeecgListMixin],
data () {
return {
title: "操作",
visible: false,
disableMixinCreated: true,
selectedRowKeys: [],
selectionRows: [],
selectBillRows: [],
selectBillIds: '',
queryParam: {
number: "",
searchMaterial: "",
type: "其它",
subType: "",
status: "1"
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '', dataIndex: 'organName',width:120},
{ title: '单据编号', dataIndex: 'number',width:150},
{ title: '商品信息', dataIndex: 'materialsList',width:220, ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145},
{ title: '操作员', dataIndex: 'userName',width:60},
{ title: '金额合计', dataIndex: 'totalPrice',width:70}
],
url: {
list: "/depotHead/list"
}
}
},
computed: {
getType: function () {
return 'radio';
}
},
created() {
},
methods: {
show(subType, organType) {
this.queryParam.subType = subType
this.columns[1].title = organType
this.model = Object.assign({}, {});
this.visible = true;
this.loadData(1)
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
handleOk () {
this.getSelectBillRows();
this.$emit('ok', this.selectBillRows);
this.close();
},
getSelectBillRows() {
let dataSource = this.dataSource;
let billIds = "";
this.selectBillRows = [];
for (let i = 0, len = dataSource.length; i < len; i++) {
if (this.selectedRowKeys.includes(dataSource[i].id)) {
this.selectBillRows.push(dataSource[i]);
billIds = billIds + "," + dataSource[i].id
}
}
this.selectBillIds = billIds.substring(1);
}
}
}
</script>
<style scoped>
</style>

View File

@@ -35,7 +35,11 @@
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/> <a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/>
</a-form-item> </a-form-item>
</a-col> </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>
<j-editable-table <j-editable-table
:ref="refKeys[0]" :ref="refKeys[0]"
@@ -108,12 +112,14 @@
</a-spin> </a-spin>
</j-modal> </j-modal>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal> <many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
</a-card> </a-card>
</template> </template>
<script> <script>
import pick from 'lodash.pick' import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal' import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import { FormTypes } from '@/utils/JEditableTableUtil' import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin' import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin' import { BillModalMixin } from '../mixins/BillModalMixin'
@@ -125,6 +131,7 @@
mixins: [JEditableTableMixin, BillModalMixin], mixins: [JEditableTableMixin, BillModalMixin],
components: { components: {
ManyAccountModal, ManyAccountModal,
LinkBillList,
JDate JDate
}, },
data () { data () {
@@ -251,6 +258,30 @@
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allPrice}) this.form.setFieldsValue({'changeAmount':allPrice})
}); });
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('采购订单', '供应商')
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.requestSubTableData(this.url.detailList, params, this.materialTable);
}
} }
} }
} }

View File

@@ -68,13 +68,15 @@
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin' import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin' import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util" import { getMpListShort } from "@/utils/util"
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import JDate from '@/components/jeecg/JDate' import JDate from '@/components/jeecg/JDate'
import Vue from 'vue' import Vue from 'vue'
export default { export default {
name: "SaleOrderModal", name: "SaleOrderModal",
mixins: [JEditableTableMixin, BillModalMixin], mixins: [JEditableTableMixin, BillModalMixin],
components: { components: {
JDate JDate,
JSelectMultiple
}, },
data () { data () {
return { return {
@@ -141,11 +143,13 @@
editAfter() { editAfter() {
if (this.action === 'add') { if (this.action === 'add') {
this.addInit("XSDD") this.addInit("XSDD")
this.personList.value = ''
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr
this.personList.value = this.model.salesMan
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark', this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount')) 'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','salesMan'))
}); });
// 加载子表数据 // 加载子表数据
let params = { let params = {
@@ -171,6 +175,7 @@
if(this.model.id){ if(this.model.id){
billMain.id = this.model.id billMain.id = this.model.id
} }
billMain.salesMan = this.personList.value
return { return {
info: JSON.stringify(billMain), info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr), rows: JSON.stringify(detailArr),

View File

@@ -1,4 +1,5 @@
<template> <template>
<a-card :bordered="false" class="card-area">
<j-modal <j-modal
:title="title" :title="title"
:width="width" :width="width"
@@ -34,7 +35,11 @@
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/> <a-input placeholder="请输入单据编号" v-decorator.trim="[ 'number' ]" :readOnly="true"/>
</a-form-item> </a-form-item>
</a-col> </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>
<j-editable-table <j-editable-table
:ref="refKeys[0]" :ref="refKeys[0]"
@@ -105,9 +110,12 @@
</a-form> </a-form>
</a-spin> </a-spin>
</j-modal> </j-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
</a-card>
</template> </template>
<script> <script>
import pick from 'lodash.pick' import pick from 'lodash.pick'
import LinkBillList from '../dialog/LinkBillList'
import { FormTypes } from '@/utils/JEditableTableUtil' import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin' import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin' import { BillModalMixin } from '../mixins/BillModalMixin'
@@ -119,6 +127,7 @@
name: "SaleOutModal", name: "SaleOutModal",
mixins: [JEditableTableMixin, BillModalMixin], mixins: [JEditableTableMixin, BillModalMixin],
components: { components: {
LinkBillList,
JDate, JDate,
JSelectMultiple JSelectMultiple
}, },
@@ -238,6 +247,30 @@
rows: JSON.stringify(detailArr), rows: JSON.stringify(detailArr),
} }
}, },
onSearchLinkNumber() {
this.$refs.linkBillList.show("销售订单", '客户')
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.requestSubTableData(this.url.detailList, params, this.materialTable);
}
}
} }
} }
</script> </script>

View File

@@ -40,9 +40,7 @@
components: { components: {
BillDetail, BillDetail,
FinancialDetail, FinancialDetail,
JEllipsis, JEllipsis
findBillDetailByNumber,
findFinancialDetailByNumber
}, },
data () { data () {
return { return {