vue版本上线

This commit is contained in:
季圣华
2021-04-07 23:53:57 +08:00
parent 76a0033a4e
commit f4ef5aa067
803 changed files with 171959 additions and 27 deletions

View File

@@ -0,0 +1,162 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<allocation-out-modal ref="modalForm" @ok="modalFormOk"></allocation-out-modal>
</a-card>
</template>
<script>
import AllocationOutModal from './modules/AllocationOutModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "AllocationOutList",
mixins:[JeecgListMixin,BillListMixin],
components: {
AllocationOutModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "出库",
subType: "调拨"
},
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: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,162 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<assemble-modal ref="modalForm" @ok="modalFormOk"></assemble-modal>
</a-card>
</template>
<script>
import AssembleModal from './modules/AssembleModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "AssembleList",
mixins:[JeecgListMixin,BillListMixin],
components: {
AssembleModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "其它",
subType: "组装单"
},
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: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,162 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<disassemble-modal ref="modalForm" @ok="modalFormOk"></disassemble-modal>
</a-card>
</template>
<script>
import DisassembleModal from './modules/DisassembleModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "DisassembleList",
mixins:[JeecgListMixin,BillListMixin],
components: {
DisassembleModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "其它",
subType: "拆卸单"
},
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: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,163 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<other-in-modal ref="modalForm" @ok="modalFormOk"></other-in-modal>
</a-card>
</template>
<script>
import OtherInModal from './modules/OtherInModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "OtherInList",
mixins:[JeecgListMixin,BillListMixin],
components: {
OtherInModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "入库",
subType: "其它"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,163 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<other-out-modal ref="modalForm" @ok="modalFormOk"></other-out-modal>
</a-card>
</template>
<script>
import OtherOutModal from './modules/OtherOutModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "OtherOutList",
mixins:[JeecgListMixin,BillListMixin],
components: {
OtherOutModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "出库",
subType: "其它"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,170 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<purchase-back-modal ref="modalForm" @ok="modalFormOk"></purchase-back-modal>
</a-card>
</template>
<script>
import PurchaseBackModal from './modules/PurchaseBackModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "PurchaseBackList",
mixins:[JeecgListMixin,BillListMixin],
components: {
PurchaseBackModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "出库",
subType: "采购退货"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '优惠后金额', dataIndex: 'discountLastMoney',width:100},
{ title: '收款', dataIndex: 'changeAmount',width:50},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,170 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<purchase-in-modal ref="modalForm" @ok="modalFormOk"></purchase-in-modal>
</a-card>
</template>
<script>
import PurchaseInModal from './modules/PurchaseInModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "PurchaseInList",
mixins:[JeecgListMixin,BillListMixin],
components: {
PurchaseInModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "入库",
subType: "采购"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '优惠后金额', dataIndex: 'discountLastMoney',width:100},
{ title: '付款', dataIndex: 'changeAmount',width:50},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,174 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<template slot="customRenderStatus" slot-scope="status">
<a-tag v-if="status == '0'" color="red">未审核</a-tag>
<a-tag v-if="status == '1'" color="green">已审核</a-tag>
<a-tag v-if="status == '2'" color="blue">已转采购</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<purchase-order-modal ref="modalForm" @ok="modalFormOk"></purchase-order-modal>
</a-card>
</template>
<script>
import PurchaseOrderModal from './modules/PurchaseOrderModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "PurchaseOrderList",
mixins:[JeecgListMixin,BillListMixin],
components: {
PurchaseOrderModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "其它",
subType: "采购订单"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch",
batchSetStatusUrl: "/depotHead/batchSetStatus"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,164 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<retail-back-modal ref="modalForm" @ok="modalFormOk"></retail-back-modal>
</a-card>
</template>
<script>
import RetailBackModal from './modules/RetailBackModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "RetailBackList",
mixins:[JeecgListMixin,BillListMixin],
components: {
RetailBackModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "入库",
subType: "零售退货"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '付款', dataIndex: 'changeAmount',width:50},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,164 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<retail-out-modal ref="modalForm" @ok="modalFormOk"></retail-out-modal>
</a-card>
</template>
<script>
import RetailOutModal from './modules/RetailOutModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "RetailOutList",
mixins:[JeecgListMixin,BillListMixin],
components: {
RetailOutModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "出库",
subType: "零售"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '收款', dataIndex: 'changeAmount',width:50},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,162 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sale-back-modal ref="modalForm" @ok="modalFormOk"></sale-back-modal>
</a-card>
</template>
<script>
import SaleBackModal from './modules/SaleBackModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "SaleBackList",
mixins:[JeecgListMixin,BillListMixin],
components: {
SaleBackModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "入库",
subType: "销售退货"
},
// 表头
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:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '优惠后金额', dataIndex: 'discountLastMoney',width:100},
{ title: '付款', dataIndex: 'changeAmount',width:50},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,174 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<template slot="customRenderStatus" slot-scope="status">
<a-tag v-if="status == '0'" color="red">未审核</a-tag>
<a-tag v-if="status == '1'" color="green">已审核</a-tag>
<a-tag v-if="status == '2'" color="blue">已转采购</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sale-order-modal ref="modalForm" @ok="modalFormOk"></sale-order-modal>
</a-card>
</template>
<script>
import SaleOrderModal from './modules/SaleOrderModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "SaleOrderList",
mixins:[JeecgListMixin,BillListMixin],
components: {
SaleOrderModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "其它",
subType: "销售订单"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{title: '状态', dataIndex: 'status', width: 70, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch",
batchSetStatusUrl: "/depotHead/batchSetStatus"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,170 @@
<template>
<a-card :bordered="false" class="card-area">
<!-- 查询区域 -->
<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="单据编号" :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-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="10">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
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="6" :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>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sale-out-modal ref="modalForm" @ok="modalFormOk"></sale-out-modal>
</a-card>
</template>
<script>
import SaleOutModal from './modules/SaleOutModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "SaleOutList",
mixins:[JeecgListMixin,BillListMixin],
components: {
SaleOutModal,
JDate
},
data () {
return {
// 查询条件
queryParam: {
number: "",
searchMaterial: "",
type: "出库",
subType: "销售"
},
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},
{ title: '单据编号', dataIndex: 'number',width:160,
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[]";
} else {
return text;
}
}
},
{ 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:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '优惠后金额', dataIndex: 'discountLastMoney',width:100},
{ title: '收款', dataIndex: 'changeAmount',width:50},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/depotHead/list",
delete: "/depotHead/delete",
deleteBatch: "/depotHead/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@@ -0,0 +1,170 @@
<template>
<a-modal
:title="title"
:width="650"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:20%;height: 60%;overflow-y: hidden">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row class="form-row" :gutter="24">
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户1">
<a-select style="width:185px;" placeholder="请选择结算账户" v-decorator="[ 'oneAccountId' ]" :dropdownMatchSelectWidth="false" allowClear>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算金额">
<a-input-number placeholder="请输入金额" v-decorator.trim="[ 'oneAccountPrice' ]" />
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户2">
<a-select style="width:185px;" placeholder="请选择结算账户" v-decorator="[ 'twoAccountId' ]" :dropdownMatchSelectWidth="false" allowClear>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算金额">
<a-input-number placeholder="请输入金额" v-decorator.trim="[ 'twoAccountPrice' ]" />
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户3">
<a-select style="width:185px;" placeholder="请选择结算账户" v-decorator="[ 'threeAccountId' ]" :dropdownMatchSelectWidth="false" allowClear>
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算金额">
<a-input-number placeholder="请输入金额" v-decorator.trim="[ 'threeAccountPrice' ]" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import {getAccount} from '@/api/api'
export default {
name: 'ManyAccountModal',
data () {
return {
title:"操作",
visible: false,
model: {},
accountList: [],
accountIdList: [],
accountMoneyList: [],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this)
}
},
created () {
this.initAccount()
},
methods: {
edit (idStr, moneyStr) {
this.form.resetFields();
this.model = Object.assign({}, {});
if(idStr && idStr.indexOf(',')>-1) {
let idList = idStr.split(",")
if(idList[0]) {this.model.oneAccountId = idList[0]-0}
if(idList[1]) {this.model.twoAccountId = idList[1]-0}
if(idList[2]) {this.model.threeAccountId = idList[2]-0}
let moneyList = moneyStr.split(",")
if(moneyList[0]) {this.model.oneAccountPrice = moneyList[0]}
if(moneyList[1]) {this.model.twoAccountPrice = moneyList[1]}
if(moneyList[2]) {this.model.threeAccountPrice = moneyList[2]}
}
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'oneAccountId','oneAccountPrice',
'twoAccountId','twoAccountPrice','threeAccountId','threeAccountPrice'))
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
let allPrice = 0
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
console.log(formData)
if(formData.oneAccountId!==undefined) {
that.accountIdList.push(formData.oneAccountId)
}
if(formData.twoAccountId!==undefined) {
that.accountIdList.push(formData.twoAccountId)
}
if(formData.threeAccountId!==undefined) {
that.accountIdList.push(formData.threeAccountId)
}
if(formData.oneAccountPrice!==undefined) {
that.accountMoneyList.push(formData.oneAccountPrice)
allPrice = allPrice + formData.oneAccountPrice
}
if(formData.twoAccountPrice!==undefined) {
that.accountMoneyList.push(formData.twoAccountPrice)
allPrice = allPrice + formData.twoAccountPrice
}
if(formData.threeAccountPrice!==undefined) {
that.accountMoneyList.push(formData.threeAccountPrice)
allPrice = allPrice + formData.threeAccountPrice
}
that.$emit('ok', that.accountIdList, that.accountMoneyList, allPrice);
that.close();
}
})
},
handleCancel () {
this.close()
},
initAccount(){
let that = this;
getAccount({}).then((res)=>{
if(res && res.code === 200) {
that.accountList = res.data.accountList
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,50 @@
export const BillListMixin = {
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
isBatchDelEnabled: function () {
for (let i = 0; i < this.selectedRowKeys.length; i++) {
if (!this.selectionRows[i].actionsEnabled.delete) {
return false;
}
}
return true;
}
},
methods: {
myHandleAdd() {
this.$refs.modalForm.action = "add";
this.handleAdd();
},
myHandleEdit(record) {
this.$refs.modalForm.action = "edit";
this.handleEdit(record);
},
myHandleDetail(record) {
this.$refs.modalForm.action = "detail";
this.handleDetail(record);
},
handleApprove(record) {
this.$refs.modalForm.action = "approve";
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "审核";
},
searchReset() {
this.queryParam = {
type: this.queryParam.type,
subType: this.queryParam.subType
}
this.loadData(1);
},
onDateChange: function (value, dateString) {
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
onDateOk(value) {
console.log(value);
}
}
}

View File

@@ -0,0 +1,324 @@
import { VALIDATE_NO_PASSED, validateFormAndTables } from '@/utils/JEditableTableUtil'
import {findBySelectSup,findBySelectCus,findBySelectRetail,getMaterialByBarCode,findStockByDepotAndBarCode,getAccount} from '@/api/api'
import { getAction,putAction } from '@/api/manage'
import { getMpListShort, getNowFormatDateTime } from "@/utils/util"
import Vue from 'vue'
export const BillModalMixin = {
data() {
return {
action: '',
manyAccountBtnStatus: false,
supList: [],
cusList: [],
retailList: [],
depotList: [],
accountList: [],
accountIdList: [],
accountMoneyList: [],
spans: {
labelCol1: {span: 2},
wrapperCol1: {span: 22},
//1_5: 分为1.5列相当于占了2/3
labelCol1_5: { span: 3 },
wrapperCol1_5: { span: 21 },
labelCol2: {span: 4},
wrapperCol2: {span: 20},
labelCol3: {span: 6},
wrapperCol3: {span: 18},
labelCol6: {span: 12},
wrapperCol6: {span: 12}
},
};
},
created () {
this.initSupplier()
this.initCustomer()
this.initRetail()
this.initDepot()
this.initAccount()
},
computed: {
readOnly: function() {
return this.action !== "add" && this.action !== "edit";
}
},
methods: {
addInit(amountNum) {
getAction('/sequence/buildNumber').then((res) => {
if (res && res.code === 200) {
this.form.setFieldsValue({'number':amountNum + res.data.defaultNumber})
}
})
this.$nextTick(() => {
this.form.setFieldsValue({'operTime':getNowFormatDateTime(), 'discount': 0,
'discountMoney': 0, 'discountLastMoney': 0, 'otherMoney': 0, 'changeAmount': 0, 'debt': 0})
})
this.$nextTick(() => {
getAccount({}).then((res)=>{
if(res && res.code === 200) {
for (const item of res.data.accountList) {
if(item.isDefault){
this.form.setFieldsValue({'accountId': item.id})
}
}
}
})
})
this.$nextTick(() => {
this.form.setFieldsValue({'payType': '现金'})
})
this.accountIdList = []
this.accountMoneyList = []
this.manyAccountBtnStatus = false
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
initCustomer() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.cusList = res;
}
});
},
initRetail() {
let that = this;
findBySelectRetail({}).then((res)=>{
if(res) {
that.retailList = res;
}
});
},
initDepot() {
let that = this;
getAction('/depot/findDepotByUserId?UBType=UserDepot&UBKeyId=').then((res) => {
if (res) {
for(let i=0; i<res.length; i++) {
let depotInfo = {};
depotInfo.value = res[i].id+'' //注意-此处value必须为字符串格式
depotInfo.text = res[i].depotName
depotInfo.title = res[i].depotName
for(let item of that.materialTable.columns){
if(item.key == 'depotId' || item.key == 'anotherDepotId') {
item.options.push(depotInfo)
}
}
}
}
})
},
initAccount(){
let that = this;
getAccount({}).then((res)=>{
if(res && res.code === 200) {
let list = res.data.accountList
list.splice(0,0,{id: 0, name: '多账户'})
that.accountList = list
}
})
},
handleManyAccount(){
this.selectAccount(0)
},
selectAccount(value){
if(value === 0) { //多账户
this.$refs.manyAccountModalForm.edit(this.accountIdList, this.accountMoneyList)
this.$refs.manyAccountModalForm.title = "多账户结算"
this.manyAccountBtnStatus = true
} else {
this.accountIdList = []
this.accountMoneyList = []
this.manyAccountBtnStatus = false
}
},
//单元值改变一个字符就触发一次
onValueChange(event) {
let that = this
const { type, row, column, value, target } = event
let param,operNumber,unitPrice,taxUnitPrice,allPrice,taxRate,taxMoney,taxLastMoney
switch(column.key) {
case "depotId":
if(row.barCode){
that.getStockByDepotBarCode(row, target)
}
break;
case "barCode":
param = {
barCode: value,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
getMaterialByBarCode(param).then((res) => {
if (res && res.code === 200) {
target.setValues([{
rowKey: row.id,
values: {
barCode: res.data.mBarCode,
name: res.data.name,
standard: res.data.standard,
model: res.data.model,
materialOther: res.data.materialOther,
unit: res.data.commodityUnit,
operNumber: 1,
unitPrice: res.data.purchaseDecimal,
taxUnitPrice: res.data.purchaseDecimal,
allPrice: res.data.purchaseDecimal,
taxRate: 0,
taxMoney: 0,
taxLastMoney: res.data.purchaseDecimal
}
}]);
that.getStockByDepotBarCode(row, target)
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
}
});
break;
case "operNumber":
operNumber = value-0
taxRate = row.taxRate-0 //税率
unitPrice = row.unitPrice-0 //单价
taxUnitPrice = row.taxUnitPrice-0
allPrice = (unitPrice*operNumber).toFixed(2)-0
taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0
taxLastMoney = (allPrice + taxMoney).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {allPrice: allPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
case "unitPrice":
operNumber = row.operNumber-0 //数量
unitPrice = value-0 //单价
taxRate = row.taxRate-0 //税率
taxUnitPrice = (unitPrice*(1+taxRate*0.01)).toFixed(2)-0
allPrice = (unitPrice*operNumber).toFixed(2)-0
taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0
taxLastMoney = (allPrice + taxMoney).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {taxUnitPrice: taxUnitPrice, allPrice: allPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
case "allPrice":
operNumber = row.operNumber-0 //数量
taxRate = row.taxRate-0 //税率
allPrice = value-0
unitPrice = (allPrice/operNumber).toFixed(2)-0 //单价
taxUnitPrice =(unitPrice*(1+taxRate*0.01)).toFixed(2)-0
taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0
taxLastMoney = (allPrice + taxMoney).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {unitPrice: unitPrice, taxUnitPrice: taxUnitPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
case "taxRate":
operNumber = row.operNumber-0 //数量
allPrice = row.allPrice-0
unitPrice = row.unitPrice-0
taxRate = value-0 //税率
taxUnitPrice =(unitPrice*(1+taxRate*0.01)).toFixed(2)-0
taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0
taxLastMoney = (allPrice + taxMoney).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {taxUnitPrice: taxUnitPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
case "taxLastMoney":
operNumber = row.operNumber-0 //数量
taxLastMoney = value-0
taxRate = row.taxRate-0 //税率
taxUnitPrice = (taxLastMoney/operNumber).toFixed(2)-0
unitPrice = (taxUnitPrice/(1+taxRate*0.01)).toFixed(2)-0
allPrice = (unitPrice*operNumber).toFixed(2)-0
taxMoney =(taxLastMoney-allPrice).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {unitPrice: unitPrice, taxUnitPrice: taxUnitPrice, allPrice: allPrice, taxMoney: taxMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
}
},
//删除一行或多行的时候触发
onDeleted(ids, target) {
target.recalcAllStatisticsColumns()
this.autoChangePrice(target)
},
//根据仓库和条码查询库存
getStockByDepotBarCode(row, target){
findStockByDepotAndBarCode({ depotId: row.depotId, barCode: row.barCode }).then((res) => {
if (res && res.code === 200) {
target.setValues([{rowKey: row.id, values: {stock: res.data.stock}}])
target.recalcAllStatisticsColumns()
}
})
},
//改变优惠、本次付款、欠款的值
autoChangePrice(target) {
let allTaxLastMoney = target.statisticsColumns.taxLastMoney
let discount = this.form.getFieldValue('discount')-0
let otherMoney = this.form.getFieldValue('otherMoney')-0
let discountMoney = (discount*0.01*allTaxLastMoney).toFixed(2)-0
let discountLastMoney = (allTaxLastMoney-discountMoney).toFixed(2)-0
let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'discount':discount,'discountMoney':discountMoney,'discountLastMoney':discountLastMoney,
'changeAmount':changeAmountNew,'debt':0})
});
},
//改变优惠率
onKeyUpDiscount(e) {
const value = e.target.value-0
let discountMoney = this.form.getFieldValue('discountMoney')-0
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
let otherMoney = this.form.getFieldValue('otherMoney')-0
let allTaxLastMoney = (discountMoney + discountLastMoney).toFixed(2)-0
let discountMoneyNew = (allTaxLastMoney*value*0.01).toFixed(2)-0
let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2)-0
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'discountMoney':discountMoneyNew,'discountLastMoney':discountLastMoneyNew,
'changeAmount':changeAmountNew,'debt':0})
});
},
//改变付款优惠
onKeyUpDiscountMoney(e) {
const value = e.target.value-0
let discount = this.form.getFieldValue('discount')-0
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
let otherMoney = this.form.getFieldValue('otherMoney')-0
if(discount !== 100) {
let allTaxLastMoney = (discountLastMoney/(1-discount/100)).toFixed(2)-0
let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0
let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0
let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew,
'changeAmount':changeAmountNew,'debt':0})
});
}
},
//其它费用
onKeyUpOtherMoney(e) {
const value = e.target.value-0
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
let changeAmountNew = (discountLastMoney + value).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':changeAmountNew, 'debt':0})
});
},
//改变本次付款
onKeyUpChangeAmount(e) {
const value = e.target.value-0
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
let otherMoney = this.form.getFieldValue('otherMoney')-0
let debtNew = (discountLastMoney + otherMoney - value).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'debt':debtNew})
});
}
}
}

View File

@@ -0,0 +1,173 @@
<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="单据日期">
<j-date v-decorator="['operTime']" :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="[ '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-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "AllocationOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '调入仓库', key: 'anotherDepotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: []},
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("DBCK")
} else {
this.model.operTime = this.model.operTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '出库'
billMain.subType = '调拨'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,184 @@
<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="单据日期">
<j-date v-decorator="['operTime']" :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="[ '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-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "AssembleModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '商品类型',key: 'mType',width:'7%', type: FormTypes.input, readonly: true },
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("ZZD")
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney - this.model.changeAmount).toFixed(2)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '其它'
billMain.subType = '组装单'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
onAdded(event) {
let that = this
const { row, target } = event
if(target.rows.length>=2) {
target.setValues([{rowKey: row.id, values: {mType: '普通子件'}}])
} else {
target.setValues([{rowKey: row.id, values: {mType: '组合件'}}])
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,183 @@
<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="单据日期">
<j-date v-decorator="['operTime']" :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="[ '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-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "DisassembleModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '商品类型',key: 'mType',width:'7%', type: FormTypes.input, readonly: true },
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("CXD")
} else {
this.model.operTime = this.model.operTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '其它'
billMain.subType = '拆卸单'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
onAdded(event) {
let that = this
const { row, target } = event
if(target.rows.length>=2) {
target.setValues([{rowKey: row.id, values: {mType: '普通子件'}}])
} else {
target.setValues([{rowKey: row.id, values: {mType: '组合件'}}])
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,180 @@
<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' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in supList" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "OtherInModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("QTRK")
} else {
this.model.operTime = this.model.operTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '入库'
billMain.subType = '其它'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,180 @@
<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' ]" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "OtherOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("QTCK")
} else {
this.model.operTime = this.model.operTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '出库'
billMain.subType = '其它'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,238 @@
<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 supList" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
</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="[ 'discountMoney' ]" @keyup="onKeyUpDiscountMoney"/>
</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="[ 'discountLastMoney' ]" :readOnly="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="[ 'otherMoney' ]" @keyup="onKeyUpOtherMoney"/>
</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-select placeholder="选择结算账户" v-decorator="[ 'accountId' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in accountList" :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="本次退款">
<a-input placeholder="请输入本次付款" v-decorator.trim="[ 'changeAmount' ]" @keyup="onKeyUpChangeAmount"/>
</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="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "PurchaseBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '含税单价', key: 'taxUnitPrice', width: '6%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率(%)', key: 'taxRate', width: '6%', type: FormTypes.inputNumber},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
organId:{
rules: [
{ required: true, message: '请选择供应商!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("CGTH")
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
if(this.model.accountId == null) {
this.model.accountId = 0
this.manyAccountBtnStatus = true
this.accountIdList = this.model.accountIdList
this.accountMoneyList = this.model.accountMoneyList
} else {
this.manyAccountBtnStatus = false
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '出库'
billMain.subType = '采购退货'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,260 @@
<template>
<a-card :bordered="false" class="card-area">
<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 supList" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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 style="width:185px;" placeholder="请输入优惠率" v-decorator.trim="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
</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="[ 'discountMoney' ]" @keyup="onKeyUpDiscountMoney"/>
</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="[ 'discountLastMoney' ]" :readOnly="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="[ 'otherMoney' ]" @keyup="onKeyUpOtherMoney"/>
</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-select style="width:185px;" placeholder="选择结算账户" v-decorator="[ 'accountId' ]"
:dropdownMatchSelectWidth="false" allowClear @select="selectAccount">
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
<a-tooltip title="多账户明细">
<a-button type="default" icon="folder" style="margin-left: 8px;" size="small" v-show="manyAccountBtnStatus" @click="handleManyAccount"/>
</a-tooltip>
</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="[ 'changeAmount' ]" @keyup="onKeyUpChangeAmount"/>
</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="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "PurchaseInModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '含税单价', key: 'taxUnitPrice', width: '6%', type: FormTypes.inputNumber, readonly: true},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率(%)', key: 'taxRate', width: '6%', type: FormTypes.inputNumber},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, statistics: true , readonly: true},
{ title: '价税合计', key: 'taxLastMoney', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
organId:{
rules: [
{ required: true, message: '请选择供应商!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("CGRK")
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
if(this.model.accountId == null) {
this.model.accountId = 0
this.manyAccountBtnStatus = true
this.accountIdList = this.model.accountIdList
this.accountMoneyList = this.model.accountMoneyList
} else {
this.manyAccountBtnStatus = false
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '入库'
billMain.subType = '采购'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(billMain.accountId === 0) {
billMain.accountId = ''
}
billMain.accountIdList = this.accountIdList.length>0 ? JSON.stringify(this.accountIdList) : ""
billMain.accountMoneyList = this.accountMoneyList.length>0 ? JSON.stringify(this.accountMoneyList) : ""
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
manyAccountModalFormOk(idList, moneyList, allPrice) {
this.accountIdList = idList
this.accountMoneyList = moneyList
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allPrice})
});
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,182 @@
<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 supList" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "PurchaseOrderModal",
mixins: [JEditableTableMixin,BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
supList: [],
depotList: [],
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
tableKeys:['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '12%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '10%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '6%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '6%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '8%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '6%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '6%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '6%', type: FormTypes.inputNumber },
{ title: '金额', key: 'allPrice', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '8%', type: FormTypes.input}
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
organId:{
rules: [
{ required: true, message: '请选择供应商!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("CGDD")
} else {
this.model.operTime = this.model.operTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '其它'
billMain.subType = '采购订单'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,230 @@
<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' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in retailList" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="18" :md="12" :sm="24">
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="6" :sm="6"><br/><br/></a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实付金额">
<a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款金额">
<a-input v-decorator.trim="[ 'getAmount' ]" :style="{color:'red'}" defaultValue="0" @keyup="onKeyUpGetAmount"/>
</a-form-item>
</a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
<a-input v-decorator.trim="[ 'backAmount' ]" :style="{color:'green'}" :readOnly="true" defaultValue="0"/>
</a-form-item>
</a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款账户">
<a-select placeholder="选择付款账户" v-decorator="[ 'accountId' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "RetailBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '10%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '6%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '6%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '8%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '6%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '6%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '8%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '8%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '9%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("LSTH")
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = this.model.discountLastMoney - this.model.changeAmount
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '入库'
billMain.subType = '零售退货'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
//改变实收金额、收款金额的值
autoChangePrice(target) {
let allLastMoney = target.statisticsColumns.allPrice
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allLastMoney,'getAmount':allLastMoney,'backAmount':0})
});
},
//改变收款金额
onKeyUpGetAmount(e) {
const value = e.target.value
let changeAmount = this.form.getFieldValue('changeAmount')-0
let backAmount = (value - changeAmount).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'backAmount':backAmount})
});
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,237 @@
<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' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in retailList" :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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</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="[ 'payType' ]">
<a-select-option value="现付">现付</a-select-option>
<a-select-option value="预付款">预付款</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="18" :md="12" :sm="24">
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="6" :sm="6"><br/><br/></a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实收金额">
<a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款金额">
<a-input v-decorator.trim="[ 'getAmount' ]" :style="{color:'red'}" defaultValue="0" @keyup="onKeyUpGetAmount"/>
</a-form-item>
</a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
<a-input v-decorator.trim="[ 'backAmount' ]" :style="{color:'green'}" :readOnly="true" defaultValue="0"/>
</a-form-item>
</a-col>
<a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款账户">
<a-select placeholder="选择收款账户" v-decorator="[ 'accountId' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "RetailOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '10%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '6%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '6%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '8%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '6%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '6%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '8%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '8%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '9%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
type:{
rules: [
{ required: true, message: '请选择类型!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("LSCK")
} else {
this.model.operTime = this.model.operTimeStr
this.model.getAmount = this.model.changeAmount
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'payType', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','getAmount'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '出库'
billMain.subType = '零售'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
//改变实收金额、收款金额的值
autoChangePrice(target) {
let allLastMoney = target.statisticsColumns.allPrice
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allLastMoney,'getAmount':allLastMoney,'backAmount':0})
});
},
//改变收款金额
onKeyUpGetAmount(e) {
const value = e.target.value
let changeAmount = this.form.getFieldValue('changeAmount')-0
let backAmount = (value - changeAmount).toFixed(2)-0
this.$nextTick(() => {
this.form.setFieldsValue({'backAmount':backAmount})
});
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,238 @@
<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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
</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="[ 'discountMoney' ]" @keyup="onKeyUpDiscountMoney"/>
</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="[ 'discountLastMoney' ]" :readOnly="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="[ 'otherMoney' ]" @keyup="onKeyUpOtherMoney"/>
</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-select placeholder="选择结算账户" v-decorator="[ 'accountId' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in accountList" :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="本次退款">
<a-input placeholder="请输入本次付款" v-decorator.trim="[ 'changeAmount' ]" @keyup="onKeyUpChangeAmount"/>
</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="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "SaleBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '含税单价', key: 'taxUnitPrice', width: '6%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率(%)', key: 'taxRate', width: '6%', type: FormTypes.inputNumber},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
organId:{
rules: [
{ required: true, message: '请选择客户!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("XSTH")
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
if(this.model.accountId == null) {
this.model.accountId = 0
this.manyAccountBtnStatus = true
this.accountIdList = this.model.accountIdList
this.accountMoneyList = this.model.accountMoneyList
} else {
this.manyAccountBtnStatus = false
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '入库'
billMain.subType = '销售退货'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,180 @@
<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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "SaleOrderModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
organId:{
rules: [
{ required: true, message: '请选择客户!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("XSDD")
} else {
this.model.operTime = this.model.operTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '其它'
billMain.subType = '销售订单'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,238 @@
<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="单据日期">
<j-date v-decorator="['operTime']" :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="[ 'number' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24"></a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange"
@deleted="onDeleted" />
<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="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
</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="[ 'discountMoney' ]" @keyup="onKeyUpDiscountMoney"/>
</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="[ 'discountLastMoney' ]" :readOnly="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="[ 'otherMoney' ]" @keyup="onKeyUpOtherMoney"/>
</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-select placeholder="选择结算账户" v-decorator="[ 'accountId' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in accountList" :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="本次收款">
<a-input placeholder="请输入本次付款" v-decorator.trim="[ 'changeAmount' ]" @keyup="onKeyUpChangeAmount"/>
</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="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "SaleOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
JDate
},
data () {
return {
title:"操作",
width: '1450px',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
operTimeStr: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['materialDataTable', ],
activeKey: 'materialDataTable',
materialTable: {
loading: false,
dataSource: [],
columns: [
{ title: '仓库名称', key: 'depotId', width: '8%', type: FormTypes.select, placeholder: '请选择${title}', options: [] },
{ title: '条码', key: 'barCode', width: '10%', type: FormTypes.popupJsh },
{ title: '名称', key: 'name', width: '8%', type: FormTypes.input, readonly: true },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.input, readonly: true },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.input, readonly: true },
{ title: '扩展信息', key: 'materialOther', width: '6%', type: FormTypes.input, readonly: true },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.input, readonly: true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.input, readonly: true },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '含税单价', key: 'taxUnitPrice', width: '6%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率(%)', key: 'taxRate', width: '6%', type: FormTypes.inputNumber},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', width: '6%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '5%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
organId:{
rules: [
{ required: true, message: '请选择客户!' }
]
}
},
url: {
add: '/depotHead/addDepotHeadAndDetail',
edit: '/depotHead/updateDepotHeadAndDetail',
detailList: '/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("XSCK")
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
if(this.model.accountId == null) {
this.model.accountId = 0
this.manyAccountBtnStatus = true
this.accountIdList = this.model.accountIdList
this.accountMoneyList = this.model.accountMoneyList
} else {
this.manyAccountBtnStatus = false
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
});
// 加载子表数据
let params = {
headerId: this.model.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.materialTable);
}
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '出库'
billMain.subType = '销售'
billMain.defaultNumber = billMain.number
for(let item of detailArr){
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.model.id){
billMain.id = this.model.id
}
return {
info: JSON.stringify(billMain),
rows: JSON.stringify(detailArr),
}
},
}
}
</script>
<style scoped>
</style>