优化收款单

This commit is contained in:
季圣华
2021-06-29 01:07:16 +08:00
parent 225eb16bba
commit dc2ba7237c
17 changed files with 293 additions and 97 deletions

View File

@@ -406,7 +406,7 @@
@mouseout="()=>{handleMouseoutCommono(row,col)}">
<j-select-material
:multi="false"
:multi="col.multi"
:value="getPopupJshValue(id)"
@change="(v)=>handleChangePopupJshCommon(v,id,row,col,rowIndex)" />
</span>

View File

@@ -93,7 +93,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -95,7 +95,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -95,7 +95,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -101,7 +101,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -101,7 +101,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -163,7 +163,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -164,7 +164,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -104,7 +104,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '10%', type: FormTypes.input, readonly: true },

View File

@@ -144,7 +144,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '10%', type: FormTypes.input, readonly: true },

View File

@@ -141,7 +141,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '10%', type: FormTypes.input, readonly: true },

View File

@@ -168,7 +168,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -107,7 +107,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -168,7 +168,7 @@
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh,
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh, multi: false,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },

View File

@@ -0,0 +1,147 @@
<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}"
:customRow="rowAction">
</a-table>
<!-- table区域-end -->
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'DebtBillList',
mixins:[JeecgListMixin],
data () {
return {
title: "操作",
visible: false,
disableMixinCreated: true,
selectedRowKeys: [],
selectionRows: [],
selectBillRows: [],
selectBillIds: '',
queryParam: {
number: "",
searchMaterial: "",
type: "",
subType: "",
status: ""
},
// 表头
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 'checkbox';
}
},
created() {
},
methods: {
show(type, subType, organType, status) {
this.queryParam.type = type
this.queryParam.subType = subType
this.queryParam.status = status
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);
},
rowAction(record, index) {
return {
on: {
click: () => {
let arr = []
arr.push(record.id)
this.selectedRowKeys = arr
},
dblclick: () => {
let arr = []
arr.push(record.id)
this.selectedRowKeys = arr
this.handleOk()
}
}
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -404,7 +404,7 @@
{ title: '备注',dataIndex: 'remark', width: '30%'}
],
moneyInColumns: [
{ title: '账户名称',dataIndex: 'accountName',width: '20%'},
{ title: '销售单据编号',dataIndex: 'billNumber',width: '20%'},
{ title: '金额',dataIndex: 'eachAmount', width: '10%'},
{ title: '备注',dataIndex: 'remark', width: '30%'}
],

View File

@@ -1,92 +1,112 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
<a-select placeholder="选择客户" v-decorator="[ 'organId', validatorRules.organId ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in cusList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="经手人">
<a-select placeholder="选择经手人" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true" />
<a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="24" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" style="margin-top:8px;"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠金额">
<a-input placeholder="请输入优惠金额" v-decorator.trim="[ 'changeAmount' ]" />
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
<a-card :bordered="false">
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
<a-select placeholder="选择客户" v-decorator="[ 'organId', validatorRules.organId ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in cusList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="经手人">
<a-select placeholder="选择经手人" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime']" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<!-- 操作按钮 -->
<div class="action-button">
<a-button type="primary" icon="plus" @click="handleClickAdd">批量新增</a-button>
<span class="gap"></span>
<a-button type="primary" icon="minus" @click="handleClear">清空</a-button>
</div>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="24">
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="false"
:actionButton="false" />
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="24" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" style="margin-top:8px;"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠金额">
<a-input placeholder="请输入优惠金额" v-decorator.trim="[ 'changeAmount' ]" />
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
<debt-bill-list ref="debtBillList" @ok="debtBillListOk"></debt-bill-list>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import DebtBillList from '../dialog/DebtBillList'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "MoneyInModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
DebtBillList,
JDate
},
data () {
@@ -95,7 +115,7 @@
width: '1200px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
addDefaultRowNum: 0,
visible: false,
model: {},
labelCol: {
@@ -112,9 +132,7 @@
loading: false,
dataSource: [],
columns: [
{ title: '账户名称',key: 'accountId',width: '20%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '销售单据编号',key: 'billNumber',width: '20%', type: FormTypes.input, readonly: true },
{ title: '金额',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
@@ -179,10 +197,41 @@
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
handleClickAdd() {
this.$refs.debtBillList.show('出库', '销售', '客户', "0")
this.$refs.debtBillList.title = "选择销售出库"
},
handleClear() {
this.accountTable.dataSource = []
},
debtBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
this.requestSubTableDataEx(selectBillRows, this.accountTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(selectBillRows, tab, success) {
tab.loading = true
let listEx = []
for(let i=0; i<selectBillRows.length; i++){
let info = selectBillRows[i]
info.billNumber = info.number
info.eachAmount = info.totalPrice
listEx.push(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
tab.loading = false
}
}
}
</script>
<style scoped>
.action-button {
margin-bottom: 8px;
}
.gap {
padding-left: 8px;
}
</style>