删除进销存代码

This commit is contained in:
2022-06-24 19:54:36 +08:00
parent db2ae748f3
commit 19013e205d
543 changed files with 20185 additions and 253205 deletions
+2 -10
View File
@@ -1,20 +1,12 @@
<template>
<a-config-provider :locale="locale">
<div id="app">
<div id="app">
<router-view />
</div>
</a-config-provider>
</div>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default {
name: 'App',
data () {
return {
locale: zhCN,
}
},
metaInfo() {
return {
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
-4
View File
@@ -16,17 +16,14 @@ import plugins from './plugins' // plugins
// 权限指令
import permission from './components/Permission'
import Antd from 'ant-design-vue'
import JeecgComponents from '@/components/jeecg/index'
// import Viser from 'viser-vue'
import 'ant-design-vue/dist/antd.less'; // or 'ant-design-vue/dist/antd.less'
import '@/assets/less/JAreaLinkage.less'
import VueAreaLinkage from 'vue-area-linkage'
import './assets/icons' // icon
import './permission' // permission control
// import './tongji' // 百度统计
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/infra/config";
import { parseTime, resetForm, addDateRange, addBeginAndEndTime, handleTree} from "@/utils/ruoyi";
@@ -68,7 +65,6 @@ import DocAlert from '@/components/DocAlert'
// 头部标签插件
import VueMeta from 'vue-meta'
Vue.use(Antd)
Vue.use(VueAreaLinkage);
Vue.use(directive)
Vue.use(plugins)
-21
View File
@@ -1,21 +0,0 @@
// Baidu 统计 integration
import router from './router'
window._hmt = window._hmt || []; // 用于 router push
const HM_ID = process.env.VUE_APP_BAIDU_CODE || ''; // 有值的时候,才开启
(function() {
if (!HM_ID) {
return;
}
const hm = document.createElement("script")
hm.src = "https://hm.baidu.com/hm.js?" + HM_ID
const s = document.getElementsByTagName("script")[0]
s.parentNode.insertBefore(hm, s)
})()
router.afterEach(function (to) {
if (!HM_ID) {
return;
}
_hmt.push(['_trackPageview', to.fullPath])
})
-216
View File
@@ -1,216 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于两个仓库之间的商品调拨,调拨单会影响库存。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '调拨出库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<allocation-out-modal ref="modalForm" @ok="modalFormOk"></allocation-out-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!--power by jishenghua-->
<script>
import AllocationOutModal from './modules/AllocationOutModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AllocationOutList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
AllocationOutModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "出库",
subType: "调拨",
roleType: Vue.ls.get('roleType'),
depotId: "",
creator: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '单据编号', dataIndex: 'number',width:160, align: 'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align: 'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align: 'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align: 'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align: 'center',},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created() {
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-216
View File
@@ -1,216 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于将多种商品合并成一个商品,被合并的商品库存减少,合并后的商品库存增加。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '组装单')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<assemble-modal ref="modalForm" @ok="modalFormOk"></assemble-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!--power by ji sheng hua-->
<script>
import AssembleModal from './modules/AssembleModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AssembleList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
AssembleModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "其它",
subType: "组装单",
roleType: Vue.ls.get('roleType'),
depotId: "",
creator: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center',},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created() {
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-216
View File
@@ -1,216 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于将一个商品拆分成多种商品,被拆分的商品库存增加,拆分后的商品库存减少。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '拆卸单')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<disassemble-modal ref="modalForm" @ok="modalFormOk"></disassemble-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!--power by jisheng hua-->
<script>
import DisassembleModal from './modules/DisassembleModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "DisassembleList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
DisassembleModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "其它",
subType: "拆卸单",
roleType: Vue.ls.get('roleType'),
depotId: "",
creator: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ 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, ellipsis:true},
{ 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: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created() {
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-224
View File
@@ -1,224 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联单据" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="可以进行库存初始化,生产管理模块的成品入库。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '其它入库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<inventory-review-modal ref="modalForm" @ok="modalFormOk"></inventory-review-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!--power by ji shenghua-->
<script>
import InventoryReviewModal from './modules/InventoryReviewModal.vue'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "OtherInList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
InventoryReviewModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "其它",
subType: "盘点复盘",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center',},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initSupplier()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-234
View File
@@ -1,234 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联单据" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="可以进行库存初始化,生产管理模块的成品入库。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '其它入库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<other-in-modal ref="modalForm" @ok="modalFormOk"></other-in-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!--power by ji shenghua-->
<script>
import OtherInModal from './modules/OtherInModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "OtherInList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
OtherInModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "入库",
subType: "其它",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '供应商', dataIndex: 'organName',width:120, align:'center', ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center',},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initSupplier()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-234
View File
@@ -1,234 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联单据" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="可以进行库存初始化,生产管理模块的领料出库。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '其它出库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<other-out-modal ref="modalForm" @ok="modalFormOk"></other-out-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!--power by j i s h e n g h u a-->
<script>
import OtherOutModal from './modules/OtherOutModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "OtherOutList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
OtherOutModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "出库",
subType: "其它",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '客户', dataIndex: 'organName',width:120, align:'center', ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center',},
{ title: '状态', dataIndex: 'status', width: 80, align:'center', align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created() {
this.initCustomer()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-246
View File
@@ -1,246 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联单据" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于采购入库单据的退货。采购退货单可以由采购出库单转过来,也可以单独创建。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '采购退货出库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<purchase-back-modal ref="modalForm" @ok="modalFormOk"></purchase-back-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!-- by jisheng hua-->
<script>
import PurchaseBackModal from './modules/PurchaseBackModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "PurchaseBackList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
PurchaseBackModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "出库",
subType: "采购退货",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '供应商', dataIndex: 'organName',width:120, ellipsis:true,align:'center',},
{ title: '单据编号', dataIndex: 'number',width:160,align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220,align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145,align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80,align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80,align:'center',},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,align:'center',
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '待退金额', dataIndex: 'needBackMoney',width:80,align:'center',
customRender:function (text,record,index) {
let needBackMoney = record.discountLastMoney + record.otherMoney
return needBackMoney? needBackMoney.toFixed(2):''
}
},
{ title: '退款', dataIndex: 'changeAmount',width:50,align:'center',},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 160,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initSupplier()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-255
View File
@@ -1,255 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联订单" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联订单" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="采购入库单可以由采购订单转过来,也可以单独创建。
采购入库单据中的仓库列表只显示当前用户有权限的仓库。采购入库单可以使用多账户付款。
勾选单据之后可以进行批量操作(删除、审核、反审核)" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '采购入库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<purchase-in-modal ref="modalForm" @ok="modalFormOk"></purchase-in-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!-- by ji sheng hua-->
<script>
import PurchaseInModal from './modules/PurchaseInModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "PurchaseInList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
PurchaseInModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "入库",
subType: "采购",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '供应商', dataIndex: 'organName',width:120, ellipsis:true, align:'center',},
{ title: '单据编号', dataIndex: 'number',width:160,align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[订]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, ellipsis:true,align:'center',
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145,align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true,align:'center',},
{ title: '金额合计', dataIndex: 'totalPrice',width:80,align:'center',},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,align:'center',
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '待付金额', dataIndex: 'needInMoney',width:80,align:'center',
customRender:function (text,record,index) {
let needInMoney = record.discountLastMoney + record.otherMoney
return needInMoney? needInMoney.toFixed(2):''
}
},
{ title: '付款', dataIndex: 'changeAmount',width:60,align:'center',},
{ title: '欠款', dataIndex: 'debt',width:60,align:'center',
customRender:function (text,record,index) {
let debt = record.discountLastMoney + record.otherMoney - record.changeAmount
return debt? debt.toFixed(2):''
}
},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",align:'center',
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 180,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initSupplier()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import "~@assets/less/common.less";
</style>
-230
View File
@@ -1,230 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="采购订单不涉及付款金额,采购订单可以转采购入库单,但需要先对采购订单进行审核。
勾选单据之后可以进行批量操作(删除、审核、反审核)" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '采购订单')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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="cyan">完成采购</a-tag>
<a-tag v-if="status == '3'" color="blue">部分采购</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<purchase-order-modal ref="modalForm" @ok="modalFormOk"></purchase-order-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!-- by ji sheng hua-->
<script>
import PurchaseOrderModal from './modules/PurchaseOrderModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "PurchaseOrderList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
PurchaseOrderModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "其它",
subType: "采购订单",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '供应商', dataIndex: 'organName',width:120, align:'center', ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145,align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true,align:'center',},
{ title: '金额合计', dataIndex: 'totalPrice',width:80,align:'center',},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80,align:'center',
customRender:function (text,record,index) {
if(record.discountLastMoney) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
} else {
return record.totalPrice;
}
}
},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",align:'center',
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
created() {
this.initSupplier()
this.initUser()
},
computed: {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-244
View File
@@ -1,244 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="会员卡号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择会员卡号" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联单据" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于零售出库单据的退货。零售退货单可以由零售出库单转过来,也可以单独创建。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '零售退货入库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<retail-back-modal ref="modalForm" @ok="modalFormOk"></retail-back-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!-- by jisheng h u a-->
<script>
import RetailBackModal from './modules/RetailBackModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "RetailBackList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
RetailBackModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "入库",
subType: "零售退货",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '会员', dataIndex: 'organName',width:120, ellipsis:true, align:'center'},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
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(",","");
}
}, align:'center'
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center'},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true, align:'center'},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center'},
{ title: '付款金额', dataIndex: 'getAmount',width:80, align:'center',
customRender:function (text,record,index) {
if(record.backAmount) {
return record.changeAmount + record.backAmount
} else {
return record.changeAmount
}
}
},
{ title: '找零', dataIndex: 'backAmount',width:50, align:'center'},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initRetail()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-238
View File
@@ -1,238 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="会员卡号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择会员卡号" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于非会员和会员的单据录入,主要是用于散户使用,不能欠款。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '零售出库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<retail-out-modal ref="modalForm" @ok="modalFormOk"></retail-out-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<!-- create ji sheng hua-->
<script>
import RetailOutModal from './modules/RetailOutModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "RetailOutList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
RetailOutModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "出库",
subType: "零售",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '会员', dataIndex: 'organName',width:120, ellipsis:true, align:'center'},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, ellipsis:true, align:'center',
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center'},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true, align:'center'},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center'},
{ title: '收款金额', dataIndex: 'getAmount',width:80, align:'center',
customRender:function (text,record,index) {
if(record.backAmount) {
return record.changeAmount + record.backAmount
} else {
return record.changeAmount
}
}
},
{ title: '找零', dataIndex: 'backAmount',width:50, align:'center'},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }, align:'center'
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initRetail()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-246
View File
@@ -1,246 +0,0 @@
<!-- create ji sheng hua-->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入条码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联单据" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="用于销售出库单据的退货。销售退货单可以由销售出库单转过来,也可以单独创建。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '销售退货入库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sale-back-modal ref="modalForm" @ok="modalFormOk"></sale-back-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import SaleBackModal from './modules/SaleBackModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "SaleBackList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
SaleBackModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "入库",
subType: "销售退货",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '客户', dataIndex: 'organName',width:120, align:"center", ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:160, align:"center",
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:"center", ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:"center", },
{ title: '操作员', dataIndex: 'userName',width:80, align:"center", ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:"center", },
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80, align:"center",
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '待退金额', dataIndex: 'needBackMoney',width:80, align:"center",
customRender:function (text,record,index) {
let needBackMoney = record.discountLastMoney + record.otherMoney
return needBackMoney? needBackMoney.toFixed(2):''
}
},
{ title: '退款', dataIndex: 'changeAmount',width:50, align:"center", },
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 160,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initCustomer()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-245
View File
@@ -1,245 +0,0 @@
<!-- create jishenghua-->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="销售订单不涉及收款金额,销售订单可以转销售出库单,但需要先对销售订单进行审核。
勾选单据之后可以进行批量操作(删除、审核、反审核)" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '销售订单')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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="cyan">完成销售</a-tag>
<a-tag v-if="status == '3'" color="blue">部分销售</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sale-order-modal ref="modalForm" @ok="modalFormOk"></sale-order-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import SaleOrderModal from './modules/SaleOrderModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "SaleOrderList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
SaleOrderModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "其它",
subType: "销售订单",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '客户', dataIndex: 'organName',width:120, align:'center', ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[转]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center',},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80, align:'center',
customRender:function (text,record,index) {
if(record.discountLastMoney) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
} else {
return record.totalPrice;
}
}
},
{ title: '状态', dataIndex: 'status', width: 70, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
created() {
this.initCustomer()
this.initUser()
},
computed: {
},
methods: {
myHandleEdit(record) {
if(record.status === '0') {
this.$refs.modalForm.action = "edit";
this.handleEdit(record);
} else {
this.$message.warning("抱歉,只有未审核的单据才能编辑!")
}
},
myHandleDelete(record) {
if(record.status === '0') {
this.handleDelete(record.id)
} else {
this.$message.warning("抱歉,只有未审核的单据才能删除!")
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-254
View File
@@ -1,254 +0,0 @@
<!-- create j i s h e n g h u a -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码、名称、规格、型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="关联订单" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入关联订单" v-model="queryParam.linkNumber"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="销售出库单可以由销售订单转过来,也可以单独创建。
销售出库单据中的仓库列表只显示当前用户有权限的仓库。销售出库单可以使用多账户收款。
勾选单据之后可以进行批量操作(删除、审核、反审核)" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '销售出库')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleCopyAdd(record)">复制</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sale-out-modal ref="modalForm" @ok="modalFormOk"></sale-out-modal>
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import SaleOutModal from './modules/SaleOutModal'
import BillDetail from './dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "SaleOutList",
mixins:[JeecgListMixin,BillListMixin,tableDragResizeMixin],
components: {
SaleOutModal,
BillDetail,
JDate,
ListColumnsSetter
},
data () {
return {
// 查询条件
queryParam: {
number: "",
materialParam: "",
type: "出库",
subType: "销售",
roleType: Vue.ls.get('roleType'),
organId: "",
depotId: "",
creator: "",
linkNumber: ""
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 表头
columns: [
{ title: '客户', dataIndex: 'organName',width:120, align:'center', ellipsis:true},
{ title: '单据编号', dataIndex: 'number',width:160, align:'center',
customRender:function (text,record,index) {
if(record.linkNumber) {
return text + "[订]";
} else {
return text;
}
}
},
{ title: '商品信息', dataIndex: 'materialsList',width:220, align:'center', ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145, align:'center',},
{ title: '操作员', dataIndex: 'userName',width:80, align:'center', ellipsis:true},
{ title: '金额合计', dataIndex: 'totalPrice',width:80, align:'center',},
{ title: '含税合计', dataIndex: 'totalTaxLastMoney',width:80, align:'center',
customRender:function (text,record,index) {
return (record.discountMoney + record.discountLastMoney).toFixed(2);
}
},
{ title: '待收金额', dataIndex: 'needOutMoney',width:80, align:'center',
customRender:function (text,record,index) {
let needOutMoney = record.discountLastMoney + record.otherMoney
return needOutMoney? needOutMoney.toFixed(2):''
}
},
{ title: '收款', dataIndex: 'changeAmount',width:60, align:'center',},
{ title: '欠款', dataIndex: 'debt',width:60, align:'center',
customRender:function (text,record,index) {
let debt = record.discountLastMoney + record.otherMoney - record.changeAmount
return debt? debt.toFixed(2):''
}
},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
align:"center", width: 180,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depotHead/list",
delete: "/erp/depotHead/delete",
deleteBatch: "/erp/depotHead/deleteBatch",
batchSetStatusUrl: "/erp/depotHead/batchSetStatus"
}
}
},
computed: {
},
created() {
this.initCustomer()
this.getDepotData()
this.initUser()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-112
View File
@@ -1,112 +0,0 @@
<template>
<a-modal
:title="title"
:width="500"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:30%;height: 35%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
关闭
</a-button>
</template>
<a-spin :spinning="confirmLoading">
<a-form :form="form" id="batchSetDepot">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库名称">
<a-select placeholder="请选择仓库" v-decorator="[ 'depotId', validatorRules.depotId ]" showSearch optionFilterProp="children">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { getAction } from '@/api/manage'
export default {
name: "BatchSetDepot",
data () {
return {
title:"操作",
visible: false,
model: {},
depotList: [],
isReadOnly: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
depotId:{
rules: [
{ required: true, message: '请选择仓库!' }
]
}
},
}
},
created () {
},
methods: {
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
add () {
this.edit({});
this.getDepotData()
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'depotId'))
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
let depotId = formData.depotId
that.$emit('ok', depotId);
that.confirmLoading = false;
that.close();
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
File diff suppressed because it is too large Load Diff
@@ -1,71 +0,0 @@
<template>
<a-modal
:title="title"
:width="width"
:visible="visible"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" @click="handleCancel">取消</a-button>
</template>
<a-form :form="form">
<template>
<iframe :src="billPrintUrl" width="100%" :height="height" frameborder="0" scrolling="no"></iframe>
</template>
<template>
<a-row>
<a-col>
<a-form-item>
<a-input v-decorator="['id']" hidden/>
</a-form-item>
</a-col>
</a-row>
</template>
</a-form>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
export default {
name: 'BillPrintIframe',
data () {
return {
title: "三联打印预览",
width: '1550px',
visible: false,
billPrintUrl: '',
height: "",
model: {},
form: this.$form.createForm(this),
loading: false
}
},
created () {
},
methods: {
show(record, billPrintUrl, billPrintHeight) {
this.height = billPrintHeight
this.billPrintUrl = billPrintUrl
this.visible = true;
this.model = Object.assign({}, record);
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'id'))
});
},
handleCancel() {
this.close()
},
close() {
this.$emit('close');
this.visible = false;
}
}
}
</script>
<style scoped>
</style>
-159
View File
@@ -1,159 +0,0 @@
<template>
<a-modal
:title="title"
:width="1250"
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<!-- table区域-begin -->
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType}"
:customRow="rowAction"
@change="handleTableChange">
<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' && queryParam.subType === '采购订单'" color="cyan">完成采购</a-tag>
<a-tag v-if="status === '2' && queryParam.subType === '销售订单'" color="cyan">完成销售</a-tag>
<a-tag v-if="status === '3' && queryParam.subType === '采购订单'" color="blue">部分采购</a-tag>
<a-tag v-if="status === '3' && queryParam.subType === '销售订单'" color="blue">部分销售</a-tag>
</template>
</a-table>
<!-- table区域-end -->
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'LinkBillList',
mixins:[JeecgListMixin],
data () {
return {
title: "操作",
visible: false,
disableMixinCreated: true,
selectedRowKeys: [],
selectionRows: [],
selectBillRows: [],
selectBillIds: '',
queryParam: {
number: "",
searchMaterial: "",
type: "",
subType: "",
status: ""
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '', dataIndex: 'organName',width:120},
{ title: '单据编号', dataIndex: 'number',width:150},
{ title: '商品信息', dataIndex: 'materialsList',width:280, ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:145},
{ title: '操作员', dataIndex: 'userName',width:70},
{ title: '金额合计', dataIndex: 'totalPrice',width:70},
{ title: '状态', dataIndex: 'status', width: 70, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
}
],
url: {
list: "/erp/depotHead/list"
}
}
},
computed: {
getType: function () {
return 'radio';
}
},
created() {
},
methods: {
show(type, subType, organType, status) {
this.queryParam.type = type
this.queryParam.subType = subType
this.queryParam.status = status
this.columns[1].title = organType
this.model = Object.assign({}, {});
this.visible = true;
this.loadData(1)
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
handleOk () {
this.getSelectBillRows();
this.$emit('ok', this.selectBillRows);
this.close();
},
getSelectBillRows() {
let dataSource = this.dataSource;
let billIds = "";
this.selectBillRows = [];
for (let i = 0, len = dataSource.length; i < len; i++) {
if (this.selectedRowKeys.includes(dataSource[i].id)) {
this.selectBillRows.push(dataSource[i]);
billIds = billIds + "," + dataSource[i].id
}
}
this.selectBillIds = billIds.substring(1);
},
rowAction(record, index) {
return {
on: {
click: () => {
let arr = []
arr.push(record.id)
this.selectedRowKeys = arr
},
dblclick: () => {
let arr = []
arr.push(record.id)
this.selectedRowKeys = arr
this.handleOk()
}
}
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,188 +0,0 @@
<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 () {
},
methods: {
edit (idStr, moneyStr) {
this.initAccount()
this.form.resetFields();
this.model = Object.assign({}, {});
let idList = [], moneyList = []
if(idStr && idStr.indexOf(',')>-1) {
idList = idStr.split(",")
moneyList = moneyStr.split(",")
} else {
idList = idStr
moneyList = moneyStr
}
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}
if(moneyList[0]) {this.model.oneAccountPrice = Math.abs(moneyList[0])}
if(moneyList[1]) {this.model.twoAccountPrice = Math.abs(moneyList[1])}
if(moneyList[2]) {this.model.threeAccountPrice = Math.abs(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;
that.accountIdList = []
that.accountMoneyList = []
let formData = Object.assign(this.model, values);
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
}
if(that.accountIdList.length<2 || that.accountMoneyList.length<2) {
this.$message.warning('抱歉多账户结算必须选择两个以上账户和金额');
that.confirmLoading = false;
return;
}
if((formData.oneAccountId && !formData.oneAccountPrice)||
(formData.twoAccountId && !formData.twoAccountPrice)||
(formData.threeAccountId && !formData.threeAccountPrice)) {
this.$message.warning('抱歉请填写结算金额');
that.confirmLoading = false;
return;
}
that.$emit('ok', that.accountIdList, that.accountMoneyList, allPrice);
that.confirmLoading = false;
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>
-133
View File
@@ -1,133 +0,0 @@
import Vue from 'vue'
import {getAction } from '@/api/manage'
import {findBySelectSup, findBySelectCus, findBySelectRetail, getUserList } from '@/api/api'
export const BillListMixin = {
data () {
return {
supList: [],
cusList: [],
retailList: [],
userList: []
}
},
computed: {
importExcelUrl: function(){
return `${process.env.VUE_APP_BASE_API}/${this.url.importExcelUrl}`;
},
isBatchDelEnabled: function () {
for (let i = 0; i < this.selectedRowKeys.length; i++) {
if (!this.selectionRows[i].actionsEnabled.delete) {
return false;
}
}
return true;
}
},
created() {
this.removeStatusColumn()
},
methods: {
myHandleAdd() {
this.$refs.modalForm.action = "add";
this.handleAdd();
},
myHandleCopyAdd(record) {
this.$refs.modalForm.action = "copyAdd";
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "复制新增";
this.$refs.modalForm.disableSubmit = false;
},
myHandleEdit(record) {
if(record.status === '0') {
this.$refs.modalForm.action = "edit";
this.handleEdit(record);
} else {
this.$message.warning("抱歉,只有未审核的单据才能编辑!")
}
},
myHandleDelete(record) {
if(record.status === '0') {
this.handleDelete(record.id)
} else {
this.$message.warning("抱歉,只有未审核的单据才能删除!")
}
},
myHandleDetail(record, type) {
this.handleDetail(record, type);
},
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);
},
removeStatusColumn() {
//没有审核反审核权限的时候直接移除状态列
if(this.btnEnableList.indexOf(2)===-1 && this.btnEnableList.indexOf(7)===-1) {
let statusIndex = 0
for(let i=0; i<this.columns.length; i++){
if(this.columns[i].dataIndex === 'status') {
statusIndex = i
}
}
//移除状态列
this.columns.splice(statusIndex,1)
}
},
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;
}
});
},
getDepotData() {
getAction('erp/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
initUser() {
getUserList({}).then((res)=>{
if(res) {
this.userList = res;
}
});
}
}
}
-748
View File
@@ -1,748 +0,0 @@
import { FormTypes, getListData } from '@/utils/JEditableTableUtil'
import {findBySelectSup,findBySelectCus,findBySelectRetail,getMaterialByBarCode,findStockByDepotAndBarCode,getAccount,
getPersonByNumType, getBatchNumberList} 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: [],
personList: {
options: [],
value: ''
},
depotList: [],
accountList: [],
accountIdList: [],
accountMoneyList: [],
billUnitPirce: '',
scanBarCode: '',
scanStatus: true,
isTenant: false,
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.isTenant = userInfo.id === userInfo.tenantId? true:false
this.isTenant = true;
var that = this
document.onkeydown = function (e) {
var key = window.event.keyCode
if (key === 13) {
that.handleOk() // 触发事件
}
}
},
computed: {
readOnly: function() {
return this.action !== "add" && this.action !== "edit";
}
},
methods: {
addInit(amountNum) {
getAction('/erp/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': Number(item.id)})
}
}
}
})
})
this.accountIdList = []
this.accountMoneyList = []
this.manyAccountBtnStatus = false
},
copyAddInit(amountNum) {
getAction('/erp/sequence/buildNumber').then((res) => {
if (res && res.code === 200) {
this.form.setFieldsValue({'number':amountNum + res.data.defaultNumber})
}
})
this.$nextTick(() => {
this.form.setFieldsValue({'operTime':getNowFormatDateTime()})
})
},
/** 查询某个tab的数据 */
requestSubTableData(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
tab.dataSource = res.data.rows
for(let i=0; i<tab.dataSource.length; i++){
let info = tab.dataSource[i]
this.changeColumnShow(info)
}
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
},
//改变字段的状态,1-显示 0-隐藏
changeFormTypes(columns, key, type) {
for(let i=0; i<columns.length; i++){
if(columns[i].key === key) {
if(type){
if(key === 'snList' || key === 'batchNumber') {
if(this.prefixNo === 'LSCK' || this.prefixNo === 'CGTH' || this.prefixNo === 'XSCK' || this.prefixNo === 'QTCK') {
columns[i].type = FormTypes.popupJsh //显示
} else {
columns[i].type = FormTypes.input //显示
}
} else if(key === 'expirationDate') {
if(this.prefixNo === 'LSTH' || this.prefixNo === 'CGRK' || this.prefixNo === 'XSTH' || this.prefixNo === 'QTRK') {
columns[i].type = FormTypes.date //显示
} else {
columns[i].type = FormTypes.normal //显示
}
} else {
columns[i].type = FormTypes.normal //显示
}
} else {
columns[i].type = FormTypes.hidden //隐藏
}
}
}
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
// this.form.setFieldsValue({'organId': Number(that.supList[0].id)})
}
});
},
initCustomer() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.cusList = res;
}
});
},
initRetail() {
let that = this;
findBySelectRetail({}).then((res)=>{
if(res) {
that.retailList = res;
}
});
},
initSalesman() {
let that = this;
getPersonByNumType({type:1}).then((res)=>{
if(res) {
that.personList.options = res;
}
});
},
initDepot() {
let that = this;
getAction('/erp/depot/findDepotByCurrentUser').then((res) => {
if(res.code === 200){
let arr = res.data
for(let item of that.materialTable.columns){
if(item.key == 'depotId' || item.key == 'anotherDepotId') {
item.options = []
for(let i=0; i<arr.length; i++) {
let depotInfo = {};
depotInfo.value = arr[i].id + '' //注意-此处value必须为字符串格式
depotInfo.text = arr[i].depotName
depotInfo.title = arr[i].depotName
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
}
},
manyAccountModalFormOk(idList, moneyList, allPrice) {
this.accountIdList = idList
this.accountMoneyList = moneyList
let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0
let otherMoney = this.form.getFieldValue('otherMoney')-0
let debt = (discountLastMoney + otherMoney - allPrice).toFixed(2)
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allPrice, 'debt':debt})
});
},
addSupplier() {
this.$refs.vendorModalForm.add();
this.$refs.vendorModalForm.title = "新增供应商";
this.$refs.vendorModalForm.disableSubmit = false;
},
addCustomer() {
this.$refs.customerModalForm.add();
this.$refs.customerModalForm.title = "新增客户(提醒:如果找不到新添加的客户,请到用户管理检查是否分配了该客户权限)";
this.$refs.customerModalForm.disableSubmit = false;
},
addMember() {
this.$refs.memberModalForm.add();
this.$refs.memberModalForm.title = "新增会员";
this.$refs.memberModalForm.disableSubmit = false;
},
handleBatchSetDepot() {
this.$refs.batchSetDepotModalForm.add();
this.$refs.batchSetDepotModalForm.title = "批量设置仓库";
this.$refs.batchSetDepotModalForm.disableSubmit = false;
},
addDepot() {
this.$refs.depotModalForm.add();
this.$refs.depotModalForm.title = "新增仓库";
this.$refs.depotModalForm.disableSubmit = false;
},
addAccount() {
this.$refs.accountModalForm.add();
this.$refs.accountModalForm.title = "新增结算账户";
this.$refs.accountModalForm.disableSubmit = false;
},
vendorModalFormOk() {
this.initSupplier()
},
customerModalFormOk() {
this.initCustomer()
},
memberModalFormOk() {
this.initRetail()
},
batchSetDepotModalFormOk(depotId) {
this.getAllTable().then(tables => {
return getListData(this.form, tables)
}).then(allValues => {
//获取单据明细列表信息
let detailArr = allValues.tablesValue[0].values
let barCodes = ''
for(let detail of detailArr){
barCodes += detail.barCode + ','
}
if(barCodes) {
barCodes = barCodes.substring(0, barCodes.length-1)
}
let param = {
barCode: barCodes,
depotId: depotId,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
prefixNo: this.prefixNo
}
getMaterialByBarCode(param).then((res) => {
if (res && res.code === 200) {
let mList = res.data
//构造新的列表数组,用于存放单据明细信息
let newDetailArr = []
if(mList && mList.length) {
for (let i = 0; i < detailArr.length; i++) {
let item = detailArr[i]
item.depotId = depotId
item.stock = mList[i] ? (mList[i].stock ? mList[i].stock : 0) : 0
newDetailArr.push(item)
}
} else {
for (let i = 0; i < detailArr.length; i++) {
let item = detailArr[i]
item.depotId = depotId
newDetailArr.push(item)
}
}
this.materialTable.dataSource = newDetailArr
}
})
})
},
depotModalFormOk() {
this.initDepot()
},
accountModalFormOk() {
this.initAccount()
},
onAdded(event) {
const { row, target } = event
getAction('/erp/depot/findDepotByCurrentUser').then((res) => {
if (res.code === 200) {
let arr = res.data
for (let i = 0; i < arr.length; i++) {
if(arr[i].isDefault){
target.setValues([{rowKey: row.id, values: {depotId: arr[i].id+''}}])
}
}
}
})
},
//单元值改变一个字符就触发一次
onValueChange(event) {
let that = this
const { type, row, column, value, target } = event
let param,snList,batchNumber,operNumber,unitPrice,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')), //扩展属性
prefixNo: this.prefixNo
}
getMaterialByBarCode(param).then((res) => {
if (res && res.code === 200) {
let mList = res.data
if (value.indexOf(',') > -1) {
//多个物料编码
this.$refs.materialDataTable.getValues((error, values) => {
values.pop() //移除最后一行数据
let mArr = values
for (let i = 0; i < mList.length; i++) {
let mInfo = mList[i]
this.changeColumnShow(mInfo)
let mObj = this.parseInfoToObj(mInfo)
mObj.depotId = mInfo.depotId
mObj.stock = mInfo.stock
mObj.barCode = mInfo.mBarCode
mArr.push(mObj)
}
let taxLastMoneyTotal = 0
for (let j = 0; j < mArr.length; j++) {
taxLastMoneyTotal += mArr[j].taxLastMoney-0
//组合和拆分单据给商品类型进行重新赋值
if(j===0) {
mArr[0].mType = '组合件'
} else {
mArr[j].mType = '普通子件'
}
}
this.materialTable.dataSource = mArr
target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
that.autoChangePrice(target)
})
} else {
//单个物料编码
findStockByDepotAndBarCode({ depotId: row.depotId, barCode: row.barCode }).then((res) => {
if (res && res.code === 200) {
let mArr = []
let mInfo = mList[0]
this.changeColumnShow(mInfo)
let mInfoEx = this.parseInfoToObj(mInfo)
mInfoEx.stock = res.data.stock
mInfoEx.barCode = row.barCode
let mObj = {
rowKey: row.id,
values: mInfoEx
}
mArr.push(mObj)
target.setValues(mArr);
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
target.autoSelectBySpecialKey('operNumber')
}
})
}
}
});
break;
case "snList":
snList = value
if(snList) {
let snArr = snList.split(',')
operNumber = snArr.length
taxRate = row.taxRate-0 //税率
unitPrice = row.unitPrice-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: {operNumber: operNumber, allPrice: allPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
}
break;
case "batchNumber":
batchNumber = value
getBatchNumberList({name:'', depotId: row.depotId, barCode: row.barCode, batchNumber: batchNumber}).then((res) => {
if (res && res.code === 200) {
if(res.data && res.data.rows) {
let info = res.data.rows[0]
operNumber = info.totalNum
taxRate = row.taxRate-0 //税率
unitPrice = row.unitPrice-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: {expirationDate: info.expirationDateStr, operNumber: operNumber,
allPrice: allPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
}
}
})
break;
case "operNumber":
operNumber = value-0
taxRate = row.taxRate-0 //税率
unitPrice = row.unitPrice-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 //税率
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 "allPrice":
operNumber = row.operNumber-0 //数量
taxRate = row.taxRate-0 //税率
allPrice = value-0
unitPrice = (allPrice/operNumber).toFixed(6)-0 //单价
taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0
taxLastMoney = (allPrice + taxMoney).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {unitPrice: unitPrice, 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 //税率
taxMoney =((taxRate*0.01)*allPrice).toFixed(2)-0
taxLastMoney = (allPrice + taxMoney).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
case "taxLastMoney":
operNumber = row.operNumber-0 //数量
taxLastMoney = value-0
taxRate = row.taxRate-0 //税率
unitPrice = (taxLastMoney/operNumber/(1+taxRate*0.01)).toFixed(6)-0
allPrice = (unitPrice*operNumber).toFixed(2)-0
taxMoney =(taxLastMoney-allPrice).toFixed(2)-0
target.setValues([{rowKey: row.id, values: {unitPrice: unitPrice, allPrice: allPrice, taxMoney: taxMoney}}])
target.recalcAllStatisticsColumns()
that.autoChangePrice(target)
break;
case "currentStock" :
target.setValues([{rowKey: row.id, values: {operNumber: Number(value) - Number(row.stock)}}])
break
}
if(value.split(',').length > 1) {
this.clearKh()
}
},
//转为商品对象
parseInfoToObj(mInfo) {
return {
barCode: mInfo.mBarCode,
name: mInfo.name,
standard: mInfo.standard,
model: mInfo.model,
color: mInfo.color,
materialOther: mInfo.materialOther,
unit: mInfo.commodityUnit,
sku: mInfo.sku,
operNumber: 1,
unitPrice: mInfo.billPrice,
allPrice: mInfo.billPrice,
taxRate: 0,
taxMoney: 0,
taxLastMoney: mInfo.billPrice
}
},
//使得型号、颜色、扩展信息、sku等为隐藏
changeColumnHide() {
this.changeFormTypes(this.materialTable.columns, 'model', 0)
this.changeFormTypes(this.materialTable.columns, 'color', 0)
this.changeFormTypes(this.materialTable.columns, 'materialOther', 0)
this.changeFormTypes(this.materialTable.columns, 'sku', 0)
},
//使得sku、序列号、批号、到期日等为显示
changeColumnShow(info) {
if(info.model) {
this.changeFormTypes(this.materialTable.columns, 'model', 1)
}
if(info.color) {
this.changeFormTypes(this.materialTable.columns, 'color', 1)
}
if(info.materialOther) {
this.changeFormTypes(this.materialTable.columns, 'materialOther', 1)
}
if(info.sku) {
this.changeFormTypes(this.materialTable.columns, 'sku', 1)
}
if(info.enableSerialNumber === "1") {
this.changeFormTypes(this.materialTable.columns, 'snList', 1)
}
if(info.enableBatchNumber === "1") {
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 1)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 1)
}
},
//删除一行或多行的时候触发
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) {
console.log(res.data.stock,'res.data.stock')
target.setValues([{rowKey: row.id, values: {stock: res.data.stock}}])
target.recalcAllStatisticsColumns()
}
})
},
//改变优惠、本次付款、欠款的值
autoChangePrice(target) {
let allTaxLastMoney = target.statisticsColumns.taxLastMoney-0
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})
});
},
scanEnter() {
this.scanStatus = false
this.$nextTick(() => {
this.$refs.scanBarCode.focus()
})
},
//扫码之后回车
scanPressEnter() {
if(this.scanBarCode) {
this.getAllTable().then(tables => {
return getListData(this.form, tables)
}).then(allValues => {
let param = {
barCode: this.scanBarCode,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
prefixNo: this.prefixNo
}
getMaterialByBarCode(param).then((res) => {
if (res && res.code === 200) {
let hasFinished = false
let allLastMoney = 0
let allTaxLastMoney = 0
//获取单据明细列表信息
let detailArr = allValues.tablesValue[0].values
//构造新的列表数组,用于存放单据明细信息
let newDetailArr = []
for(let detail of detailArr){
if(detail.barCode) {
//如果物料编码重复,就在给原来的数量加1
if(detail.barCode === this.scanBarCode) {
detail.operNumber = (detail.operNumber-0)+1
//由于改变了商品数量,需要同时更新相关金额和价税合计
let taxRate = detail.taxRate-0 //税率
let unitPrice = detail.unitPrice-0 //单价
detail.allPrice = (unitPrice*detail.operNumber).toFixed(2)-0
detail.taxMoney = ((taxRate*0.01)*detail.allPrice).toFixed(2)-0
detail.taxLastMoney = (detail.allPrice + detail.taxMoney).toFixed(2)-0
hasFinished = true
}
newDetailArr.push(detail)
}
}
if(!hasFinished) {
//将扫码的物料编码对应的商品加入列表
let item = {}
item.barCode = this.scanBarCode
let mList = res.data
if(mList && mList.length>0) {
let mInfo = mList[0]
this.changeColumnShow(mInfo)
item.depotId = mInfo.depotId
item.name = mInfo.name
item.standard = mInfo.standard
item.model = mInfo.model
item.color = mInfo.color
item.materialOther = mInfo.materialOther
item.stock = mInfo.stock
item.unit = mInfo.commodityUnit
item.sku = mInfo.sku
item.operNumber = 1
item.unitPrice = mInfo.billPrice
item.allPrice = mInfo.billPrice
item.taxRate = 0
item.taxMoney = 0
item.taxLastMoney = mInfo.billPrice
newDetailArr.push(item)
} else {
this.$message.warning('抱歉,此物料编码不存在商品信息!');
}
}
//组合和拆分单据给商品类型进行重新赋值
for(let i=0; i< newDetailArr.length; i++) {
if(i===0) {
newDetailArr[0].mType = '组合件'
} else {
newDetailArr[i].mType = '普通子件'
}
}
this.materialTable.dataSource = newDetailArr
//更新优惠后金额、本次付款等信息
for(let newDetail of newDetailArr){
allLastMoney = allLastMoney + (newDetail.allPrice-0)
allTaxLastMoney = allTaxLastMoney + (newDetail.taxLastMoney-0)
}
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
if(this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allLastMoney,'getAmount':allLastMoney,'backAmount':0})
});
} else {
this.$nextTick(() => {
this.form.setFieldsValue({'discount':discount,'discountMoney':discountMoney,'discountLastMoney':discountLastMoney,
'changeAmount':changeAmountNew,'debt':0})
});
}
//置空扫码的内容
this.scanBarCode = ''
this.$refs.scanBarCode.focus()
}
})
})
}
},
stopScan() {
this.scanStatus = true
this.scanBarCode = ''
},
//清空空行
clearKh() {
this.getAllTable().then(tables => {
let inputValues = tables[0].inputValues
let ids = []
inputValues.forEach((item) => {
if(!item.barCode && !item.operNumber) {
ids.push(item.id)
}
})
tables[0].removeRows(ids)
})
}
}
}
@@ -1,239 +0,0 @@
<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', validatorRules.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 id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品条码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import DepotModal from '../../system/modules/DepotModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "AllocationOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
DepotModal,
BatchSetDepot,
JUpload,
JDate
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'DBCK',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '调入仓库', key: 'anotherDepotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [], allowSearch:true},
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.fileList = this.model.fileName
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initDepot()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
}
}
</script>
<style scoped>
</style>
@@ -1,258 +0,0 @@
<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', validatorRules.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 id="billModal"
: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">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品条码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import DepotModal from '../../system/modules/DepotModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getAction } from '@/api/manage'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "AssembleModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
DepotModal,
BatchSetDepot,
JUpload,
JDate
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'ZZD',
fileList:[],
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.normal },
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true},
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney - this.model.changeAmount).toFixed(2)
this.fileList = this.model.fileName
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initDepot()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
onAdded(event) {
const { row, target } = event
getAction('/depot/findDepotByCurrentUser').then((res) => {
if (res.code === 200) {
let arr = res.data
for (let i = 0; i < arr.length; i++) {
if(arr[i].isDefault){
target.setValues([{rowKey: row.id, values: {depotId: arr[i].id+''}}])
}
}
}
})
if(target.rows.length>=2) {
target.setValues([{rowKey: row.id, values: {mType: '普通子件'}}])
} else {
target.setValues([{rowKey: row.id, values: {mType: '组合件'}}])
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,257 +0,0 @@
<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', validatorRules.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 id="billModal"
: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">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品条码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import DepotModal from '../../system/modules/DepotModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getAction } from '@/api/manage'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "DisassembleModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
DepotModal,
BatchSetDepot,
JUpload,
JDate
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'CXD',
fileList:[],
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.normal },
{ title: '仓库名称', key: 'depotId', width: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true},
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.fileList = this.model.fileName
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initDepot()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
onAdded(event) {
const { row, target } = event
getAction('/depot/findDepotByCurrentUser').then((res) => {
if (res.code === 200) {
let arr = res.data
for (let i = 0; i < arr.length; i++) {
if(arr[i].isDefault){
target.setValues([{rowKey: row.id, values: {depotId: arr[i].id+''}}])
}
}
}
})
if(target.rows.length>=2) {
target.setValues([{rowKey: row.id, values: {mType: '普通子件'}}])
} else {
target.setValues([{rowKey: row.id, values: {mType: '组合件'}}])
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,287 +0,0 @@
<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', validatorRules.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-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import LinkBillList from '../dialog/LinkBillList'
import VendorModal from '../../system/modules/VendorModal'
import DepotModal from '../../system/modules/DepotModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "OtherInModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
VendorModal,
DepotModal,
BatchSetDepot,
JUpload,
JDate,
LinkBillList,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'QTRK',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '实存', key: 'currentStock', width: '4%', type: FormTypes.inputNumber},
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.input, placeholder: '多个序列号请用逗号隔开',
validateRules: [{ pattern: /^\S{1,100}$/, message: '请小于100位字符' }]
},
{ title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.date },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber,readonly:true, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'linkNumber', '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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initSupplier()
this.initDepot()
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('复盘', '盘点')
this.$refs.linkBillList.title = "请选择盘点复盘"
},
linkBillListOk(selectBillRows) {
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'linkNumber': record.linkNumber,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, 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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
}
}
</script>
<style scoped>
</style>
-269
View File
@@ -1,269 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="Number(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', validatorRules.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 id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import VendorModal from '../../system/modules/VendorModal'
import DepotModal from '../../system/modules/DepotModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "OtherInModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
VendorModal,
DepotModal,
BatchSetDepot,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'QTRK',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true},
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.input, placeholder: '多个序列号请用逗号隔开',
validateRules: [{ pattern: /^\S{1,100}$/, message: '请小于100位字符' }]
},
{ title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.date },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.fileList = this.model.fileName
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initSupplier()
this.initDepot()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
}
}
</script>
<style scoped>
</style>
@@ -1,267 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<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', validatorRules.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 id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品条码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import CustomerModal from '../../system/modules/CustomerModal'
import DepotModal from '../../system/modules/DepotModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "OtherOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
CustomerModal,
DepotModal,
BatchSetDepot,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'QTCK',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
{ title: '有效期', key: 'expirationDate',width: '6%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.fileList = this.model.fileName
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initCustomer()
this.initDepot()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
}
}
</script>
<style scoped>
</style>
@@ -1,404 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="Number(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', validatorRules.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-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品条码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品条码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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" :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="[ 'debt' ]" :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="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import VendorModal from '../../system/modules/VendorModal'
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort} from "@/utils/util"
import { getAction } from '@/api/manage'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "PurchaseBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
LinkBillList,
VendorModal,
DepotModal,
AccountModal,
BatchSetDepot,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'CGTH',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
{ title: '有效期', key: 'expirationDate',width: '6%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber,placeholder: '%'},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, readonly: true, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', 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: '请选择供应商!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择结算账户!' }
]
}
},
url: {
add: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} 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.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', '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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initSupplier()
this.initDepot()
this.initAccount()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('入库', '采购', '供应商', "1")
this.$refs.linkBillList.title = "选择采购入库"
},
linkBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
for(let j=0; j<list.length; j++){
let info = list[j];
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
this.changeColumnShow(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}
</script>
<style scoped>
</style>
@@ -1,564 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
:id="prefixNo"
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="供应商"
data-step="1"
data-title="供应商"
data-intro="供应商必须选择如果发现需要选择的供应商尚未录入可以在下拉框中点击新增供应商进行录入"
>
<a-select
placeholder="选择供应商"
v-decorator="['organId', validatorRules.organId]"
:dropdownMatchSelectWidth="false"
showSearch
>
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0" />
<div
v-if="isTenant"
style="padding: 4px 8px; cursor: pointer"
@mousedown="(e) => e.preventDefault()"
@click="addSupplier"
>
<a-icon type="plus" /> 新增供应商
</div>
</div>
<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', validatorRules.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="单据编号"
data-step="2"
data-title="单据编号"
data-intro="单据编号自动生成自动累加开头是单据类型的首字母缩写累加的规则是每次打开页面会自动占用一个新的编号"
>
<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="关联订单"
data-step="3"
data-title="关联订单"
data-intro="采购入库单据可以通过关联订单来选择已录入的订单选择之后会自动加载订单的内容然后继续录入仓库等信息完成单据的提交
提交之后原来的采购订单会对应的改变单据状态另外本系统支持订单多次入库只需选择订单之后修改对应的商品数量即可"
>
<a-input-search
placeholder="请选择关联订单"
v-decorator="['linkNumber']"
@search="onSearchLinkNumber"
:readOnly="true"
/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted"
>
<template #buttonAfter>
<a-row
:gutter="24"
style="float: left"
data-step="4"
data-title="扫码录入"
data-intro="此功能支持扫码枪扫描商品物料编码进行录入"
>
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input
placeholder="请扫码商品物料编码并回车"
v-model="scanBarCode"
@pressEnter="scanPressEnter"
ref="scanBarCode"
/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float: left">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting" />批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus" />新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left: 10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="优惠率"
data-step="5"
data-title="优惠率"
data-intro="针对单据明细中商品总金额进行优惠的比例"
>
<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="付款优惠"
data-step="6"
data-title="付款优惠"
data-intro="针对单据明细中商品总金额进行优惠的金额"
>
<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="优惠后金额"
data-step="7"
data-title="优惠后金额"
data-intro="针对单据明细中商品总金额进行优惠后的金额"
>
<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="其它费用"
data-step="8"
data-title="其它费用"
data-intro="比如快递费油费过路费"
>
<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="结算账户"
data-step="9"
data-title="结算账户"
data-intro="如果在下拉框中选择多账户则可以通过多个结算账户进行结算"
>
<a-select
style="width: 185px"
placeholder="选择结算账户"
v-decorator="['accountId']"
:dropdownMatchSelectWidth="false"
allowClear
@select="selectAccount"
>
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0" />
<div
v-if="isTenant"
style="padding: 4px 8px; cursor: pointer"
@mousedown="(e) => e.preventDefault()"
@click="addAccount"
>
<a-icon type="plus" /> 新增结算账户
</div>
</div>
<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="本次欠款"
data-step="10"
data-title="本次欠款"
data-intro="欠款产生的费用后续可以在付款单进行支付"
>
<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-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="附件"
data-step="11"
data-title="附件"
data-intro="可以上传与单据相关的图片文档支持多个文件"
>
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import VendorModal from '../../system/modules/VendorModal'
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort, changeListFmtMinus } from "@/utils/util"
import { getAction } from '@/api/manage'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "PurchaseInModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
LinkBillList,
VendorModal,
DepotModal,
AccountModal,
BatchSetDepot,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'CGRK',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.input, placeholder: '多个序列号请用逗号隔开',
validateRules: [{ pattern: /^\S{1,100}$/, message: '请小于100位字符' }]
},
{ title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.date },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
{ title: '已入库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '4%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '4%', type: FormTypes.inputNumber, validateRules: [{ required: true, message: '${title}不能为空' }]},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率', key: 'taxRate', width: '3%', type: FormTypes.inputNumber,placeholder: '%'},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, readonly: true, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', 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: '请选择供应商!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择结算账户!' }
]
}
},
url: {
add: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} 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.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', '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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initSupplier()
this.initDepot()
this.initAccount()
},
//提交单据时整理成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 = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(billMain.accountId === 0) {
billMain.accountId = ''
}
this.accountMoneyList = changeListFmtMinus(this.accountMoneyList)
billMain.accountIdList = this.accountIdList.length>0 ? JSON.stringify(this.accountIdList) : ""
billMain.accountMoneyList = this.accountMoneyList.length>0 ? JSON.stringify(this.accountMoneyList) : ""
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1,3")
this.$refs.linkBillList.title = "选择采购订单"
},
linkBillListOk(selectBillRows) {
console.log(selectBillRows,'selectBillRows')
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice,
'operTime': record.operTimeStr
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
let discountLastMoney = 0
for(let j=0; j<list.length; j++){
let info = list[j];
if(info.preNumber) {
info.operNumber = info.preNumber - info.finishNumber
// info.allPrice = info.allPrice;
// info.allPrice = info.operNumber * info.unitPrice-0;
discountLastMoney += info.allPrice
}
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
this.changeColumnShow(info)
}
tab.dataSource = listEx
//给优惠后金额重新赋值
if(discountLastMoney) {
this.$nextTick(() => {
this.form.setFieldsValue({
'discountLastMoney': discountLastMoney,
'changeAmount': discountLastMoney
})
});
}
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}
</script>
<style scoped>
</style>
@@ -1,274 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
:id="prefixNo"
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="供应商" data-step="1" data-title="供应商"
data-intro="供应商必须选择如果发现需要选择的供应商尚未录入可以在下拉框中点击新增供应商进行录入">
<a-select placeholder="选择供应商" v-decorator="[ 'organId', validatorRules.organId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="Number(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', validatorRules.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="单据编号" data-step="2" data-title="单据编号"
data-intro="单据编号自动生成自动累加开头是单据类型的首字母缩写累加的规则是每次打开页面会自动占用一个新的编号">
<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 id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="3" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="优惠率" data-step="5" data-title="优惠率"
data-intro="针对单据明细中商品总金额进行优惠的比例">
<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="付款优惠" data-step="6" data-title="付款优惠"
data-intro="针对单据明细中商品总金额进行优惠的金额">
<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="优惠后金额" data-step="7" data-title="优惠后金额"
data-intro="针对单据明细中商品总金额进行优惠后的金额">
<a-input placeholder="请输入优惠后金额" v-decorator.trim="[ 'discountLastMoney' ]" :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="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件" data-step="4" data-title="附件" data-intro="可以上传与单据相关的图片文档支持多个文件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import VendorModal from '../../system/modules/VendorModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "PurchaseOrderModal",
mixins: [JEditableTableMixin,BillModalMixin],
components: {
VendorModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
supList: [],
depotList: [],
operTimeStr: '',
prefixNo: 'CGDD',
fileList:[],
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: '7%', type: FormTypes.hidden },
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true},
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber },
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率', key: 'taxRate', width: '3%', type: FormTypes.inputNumber,placeholder: '%'},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, readonly: true, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney'))
});
// 加载子表数据
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initSupplier()
},
/** 整理成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){
item.depotId = '' //订单不需要仓库
totalPrice += item.allPrice-0
}
billMain.totalPrice = 0-totalPrice
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,409 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addMember"><a-icon type="plus" /> 新增会员</div>
</div>
<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', validatorRules.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-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</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 id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:minWidth="400"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-row class="form-row" :gutter="24">
<a-col >
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
<span slot="label" style="font-size: 20px;line-height:20px">单据金额</span>
<a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col >
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
<span slot="label" style="font-size: 20px;line-height:20px">付款金额</span>
<a-input v-decorator.trim="[ 'getAmount' ]" :style="{color:'red'}" defaultValue="0" @keyup="onKeyUpGetAmount"/>
</a-form-item>
</a-col>
<a-col >
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
<span slot="label" style="font-size: 20px;line-height:20px">找零</span>
<a-input v-decorator.trim="[ 'backAmount' ]" :style="{color:'green'}" :readOnly="true" defaultValue="0"/>
</a-form-item>
</a-col>
<a-col>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
<span slot="label" style="font-size: 20px;line-height:20px">付款账户</span>
<a-select placeholder="选择付款账户" style="font-size:20px;" v-decorator="[ 'accountId']" :dropdownMatchSelectWidth="false">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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-form>
</a-spin>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<member-modal ref="memberModalForm" @ok="memberModalFormOk"></member-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import LinkBillList from '../dialog/LinkBillList'
import MemberModal from '../../system/modules/MemberModal'
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import { getAccount } from '@/api/api'
import { getAction } from '@/api/manage'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "RetailBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
LinkBillList,
MemberModal,
DepotModal,
AccountModal,
BatchSetDepot,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'LSTH',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '6%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '6%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '7%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.input, placeholder: '多个序列号请用逗号隔开',
validateRules: [{ pattern: /^\S{1,100}$/, message: '请小于100位字符' }]
},
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '9%', type: FormTypes.date },
{ title: '多属性', key: 'sku', width: '5%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '7%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择结算账户!' }
]
}
},
url: {
add: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
this.$nextTick(() => {
this.form.setFieldsValue({'getAmount':0, 'backAmount':0})
})
} else {
this.model.operTime = this.model.operTimeStr
if(this.model.backAmount) {
this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
} else {
this.model.getAmount = this.model.changeAmount
}
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','getAmount','backAmount'))
});
// 加载子表数据
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initRetail()
this.initDepot()
this.initAccount()
},
//提交单据时整理成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 = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
initAccount(){
getAccount({}).then((res)=>{
if(res && res.code === 200) {
this.accountList = res.data.accountList
}
})
},
//改变实收金额、收款金额的值
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})
});
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('出库', '零售', '会员', "1")
this.$refs.linkBillList.title = "选择零售出库"
},
linkBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'getAmount': record.totalPrice,
'changeAmount': record.totalPrice,
'backAmount': 0
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
for(let j=0; j<list.length; j++){
let info = list[j];
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}
</script>
<style scoped>
.ant-input{
font-size: 30px;
font-weight:bolder;
text-align:center;
border-left-width:0px!important;
border-top-width:0px!important;
border-right-width:0px!important;
}
</style>
@@ -1,404 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
:id="prefixNo"
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="会员卡号" data-step="1" data-title="会员卡号"
data-intro="如果发现需要选择的会员卡号尚未录入可以在下拉框中点击新增会员信息进行录入">
<a-select placeholder="选择会员卡号" v-decorator="[ 'organId' ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children" @change="onChangeOrgan">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addMember"><a-icon type="plus" /> 新增会员</div>
</div>
<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', validatorRules.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="单据编号" data-step="2" data-title="单据编号"
data-intro="单据编号自动生成自动累加开头是单据类型的首字母缩写累加的规则是每次打开页面会自动占用一个新的编号">
<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="收款类型" data-step="3" data-title="收款类型"
data-intro="收款类型可以有现付和预付款两种类型当选择了会员之后如果该会员有预付款在此处会显示具体预付款的金额而且系统会优先默认选中预付款">
<a-select placeholder="请选择付款类型" v-decorator="[ 'payType' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in payTypeList" :key="index" :value="item.value">
{{ item.text }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="16" :md="12" :sm="24">
<j-editable-table id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:minWidth="400"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="附件" data-step="9" data-title="附件"
data-intro="可以上传与单据相关的图片文档支持多个文件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :lg="8" :md="12" :sm="24">
<a-row class="form-row" :gutter="24">
<a-col>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" data-step="5" data-title="单据金额"
data-intro="单据金额等于左侧商品的总金额">
<span slot="label" style="font-size: 24px;line-height:24px">单据金额</span>
<a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col >
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" data-step="6" data-title="收款金额"
data-intro="收款金额为收银员收取用户的实际金额">
<span slot="label" style="font-size: 24px;line-height:24px">收款金额</span>
<a-input v-decorator.trim="[ 'getAmount' ]" :style="{color:'red'}" @keyup="onKeyUpGetAmount"/>
</a-form-item>
</a-col>
<a-col >
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" data-step="7" data-title="找零"
data-intro="找零等于收款金额减去实收金额">
<span slot="label" style="font-size: 24px;line-height:24px">找零</span>
<a-input v-decorator.trim="[ 'backAmount' ]" :style="{color:'green'}" :readOnly="true" />
</a-form-item> -->
</a-col>
<a-col >
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" data-step="8" data-title="收款账户"
data-intro="收款账户的信息来自基本资料菜单下的结算账户">
<span slot="label" style="font-size: 24px;line-height:24px">收款账户</span>
<a-select placeholder="选择收款账户" style="font-size:20px;" v-decorator="[ 'accountId']" :dropdownMatchSelectWidth="false">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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-form>
</a-spin>
<member-modal ref="memberModalForm" @ok="memberModalFormOk"></member-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import MemberModal from '../../system/modules/MemberModal'
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes} from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import { getAccount } from '@/api/api'
import { getAction } from '@/api/manage'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "RetailOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
MemberModal,
DepotModal,
AccountModal,
BatchSetDepot,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'LSCK',
fileList:[],
payTypeList: [],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '12%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '6%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '7%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '5%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '备注', key: 'remark', width: '7%', type: FormTypes.input }
]
},
confirmLoading: false,
validatorRules:{
operTime:{
rules: [
{ required: true, message: '请输入单据日期!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择结算账户!' }
]
}
},
url: {
add: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
this.initPayTypeList()
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.fileList = []
this.$nextTick(() => {
this.form.setFieldsValue({'payType': '现付', 'getAmount':0, 'backAmount':0})
})
} else {
this.model.operTime = this.model.operTimeStr
if(this.model.backAmount) {
this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
} else {
this.model.getAmount = this.model.changeAmount
}
this.fileList = this.model.fileName
if(this.model.payType === '预付款'){
this.payTypeList = []
this.payTypeList.push({"value":"预付款", "text":"预付款"})
this.payTypeList.push({"value":"现付", "text":"现付"})
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'payType', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','getAmount','backAmount'))
});
// 加载子表数据
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initRetail()
this.initDepot()
this.initAccount()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
//加载收款类型
initPayTypeList() {
this.payTypeList.push({"value":"现付", "text":"现付"})
},
initAccount(){
getAccount({}).then((res)=>{
if(res && res.code === 200) {
this.accountList = res.data.accountList
}
})
},
//选择会员的触发事件
onChangeOrgan(value) {
getAction("/supplier/info", {id: value}).then(res=>{
if(res && res.code === 200){
this.payTypeList = []
let info = res.data.info
if(info.advanceIn) {
this.payTypeList.push({"value":"预付款", "text":"预付款(" + info.advanceIn + ""})
this.payTypeList.push({"value":"现付", "text":"现付"})
this.$nextTick(() => {
this.form.setFieldsValue({'payType': '预付款'})
})
} else {
this.payTypeList.push({"value":"现付", "text":"现付"})
}
}
})
},
//改变实收金额、收款金额的值
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>
.ant-input{
font-size: 30px;
font-weight:bolder;
text-align:center;
border-left-width:0px!important;
border-top-width:0px!important;
border-right-width:0px!important;
}
</style>
@@ -1,417 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<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', validatorRules.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-input-search placeholder="请选择关联单据" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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" :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="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员">
<j-select-multiple placeholder="请选择销售人员" v-model="personList.value" :options="personList.options"/>
</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="附件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import CustomerModal from '../../system/modules/CustomerModal'
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort,changeListFmtMinus } from "@/utils/util"
import { getAction } from '@/api/manage'
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "SaleBackModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
LinkBillList,
CustomerModal,
DepotModal,
AccountModal,
BatchSetDepot,
JUpload,
JDate,
JSelectMultiple,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'XSTH',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.input, placeholder: '多个序列号请用逗号隔开',
validateRules: [{ pattern: /^\S{1,100}$/, message: '请小于100位字符' }]
},
{ title: '批号', key: 'batchNumber', width: '5%', type: FormTypes.input },
{ title: '有效期', key: 'expirationDate',width: '7%', type: FormTypes.date },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率', key: 'taxRate', width: '3%', type: FormTypes.inputNumber,placeholder: '%'},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, readonly: true, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', 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: '请选择客户!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择结算账户!' }
]
}
},
url: {
add: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.personList.value = ''
this.fileList = []
} 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.model.accountId = 0
this.manyAccountBtnStatus = true
this.accountIdList = this.model.accountIdList
this.accountMoneyList = this.model.accountMoneyList
} else {
this.manyAccountBtnStatus = false
}
this.personList.value = this.model.salesMan
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt','salesMan'))
});
// 加载子表数据
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initCustomer()
this.initSalesman()
this.initDepot()
this.initAccount()
},
//提交单据时整理成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 = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(billMain.accountId === 0) {
billMain.accountId = ''
}
this.accountMoneyList = changeListFmtMinus(this.accountMoneyList)
billMain.accountIdList = this.accountIdList.length>0 ? JSON.stringify(this.accountIdList) : ""
billMain.accountMoneyList = this.accountMoneyList.length>0 ? JSON.stringify(this.accountMoneyList) : ""
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
billMain.salesMan = this.personList.value
return {
info: billMain,
rows: detailArr,
}
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('出库', '销售', '客户', "1")
this.$refs.linkBillList.title = "选择销售出库"
},
linkBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
for(let j=0; j<list.length; j++){
let info = list[j];
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
this.changeColumnShow(info)
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}
</script>
<style scoped>
</style>
@@ -1,283 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
:id="prefixNo"
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="客户" data-step="1" data-title="客户"
data-intro="客户必须选择如果发现需要选择的客户尚未录入可以在下拉框中点击新增客户进行录入
特别注意客户如果录入之后在下拉框中不显示请检查是否给当前用户分配对应的客户权限">
<a-select placeholder="选择客户" v-decorator="[ 'organId', validatorRules.organId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<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', validatorRules.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="单据编号" data-step="2" data-title="单据编号"
data-intro="单据编号自动生成自动累加开头是单据类型的首字母缩写累加的规则是每次打开页面会自动占用一个新的编号">
<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="销售人员" data-step="3" data-title="销售人员"
data-intro="销售人员的数据来自经手人管理菜单中的业务员">
<j-select-multiple placeholder="请选择销售人员" v-model="personList.value" :options="personList.options"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="优惠率" data-step="5" data-title="优惠率"
data-intro="针对单据明细中商品总金额进行优惠的比例">
<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="收款优惠" data-step="6" data-title="收款优惠"
data-intro="针对单据明细中商品总金额进行优惠的金额">
<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="优惠后金额" data-step="7" data-title="优惠后金额"
data-intro="针对单据明细中商品总金额进行优惠后的金额">
<a-input placeholder="请输入优惠后金额" v-decorator.trim="[ 'discountLastMoney' ]" :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="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件" data-step="5" data-title="附件" data-intro="可以上传与单据相关的图片文档支持多个文件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import CustomerModal from '../../system/modules/CustomerModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "SaleOrderModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
CustomerModal,
JUpload,
JDate,
JSelectMultiple,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'XSDD',
fileList:[],
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: '7%', type: FormTypes.hidden },
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '5%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率', key: 'taxRate', width: '3%', type: FormTypes.inputNumber,placeholder: '%'},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, readonly: true, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', 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: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.personList.value = ''
this.fileList = []
} else {
this.model.operTime = this.model.operTimeStr
this.personList.value = this.model.salesMan
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','salesMan'))
});
// 加载子表数据
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initCustomer()
this.initSalesman()
},
//提交单据时整理成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){
item.depotId = '' //订单不需要仓库
totalPrice += item.allPrice-0
}
billMain.totalPrice = totalPrice
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
billMain.salesMan = this.personList.value
return {
info: billMain,
rows: detailArr,
}
},
}
}
</script>
<style scoped>
</style>
-450
View File
@@ -1,450 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
:id="prefixNo"
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="客户" data-step="1" data-title="客户"
data-intro="客户必须选择如果发现需要选择的客户尚未录入可以在下拉框中点击新增客户进行录入
特别注意客户如果录入之后在下拉框中不显示请检查是否给当前用户分配对应的客户权限">
<a-select placeholder="选择客户" v-decorator="[ 'organId', validatorRules.organId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<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', validatorRules.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="单据编号" data-step="2" data-title="单据编号"
data-intro="单据编号自动生成自动累加开头是单据类型的首字母缩写累加的规则是每次打开页面会自动占用一个新的编号">
<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="关联订单" data-step="3" data-title="关联订单"
data-intro="销售出库单据可以通过关联订单来选择已录入的订单选择之后会自动加载订单的内容然后继续录入仓库等信息完成单据的提交
提交之后原来的销售订单会对应的改变单据状态另外本系统支持订单多次出库只需选择订单之后修改对应的商品数量即可">
<a-input-search placeholder="请选择关联订单" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table id="billModal"
:ref="refKeys[0]"
:loading="materialTable.loading"
:columns="materialTable.columns"
:dataSource="materialTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
:dragSort="true"
@valueChange="onValueChange"
@added="onAdded"
@deleted="onDeleted">
<template #buttonAfter>
<a-row :gutter="24" style="float:left;" data-step="4" data-title="扫码录入" data-intro="此功能支持扫码枪扫描商品物料编码进行录入">
<a-col v-if="scanStatus" :md="6" :sm="24">
<a-button @click="scanEnter">扫码录入</a-button>
</a-col>
<a-col v-if="!scanStatus" :md="16" :sm="24" style="padding: 0 6px 0 12px">
<a-input placeholder="请扫码商品物料编码并回车" v-model="scanBarCode" @pressEnter="scanPressEnter" ref="scanBarCode"/>
</a-col>
<a-col v-if="!scanStatus" :md="6" :sm="24" style="padding: 0px">
<a-button @click="stopScan">收起扫码</a-button>
</a-col>
</a-row>
<a-row :gutter="24" style="float:left;">
<a-col :md="24" :sm="24">
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="handleBatchSetDepot"><a-icon type="setting"/>批量设置</a-menu-item>
<a-menu-item v-if="isTenant" key="2" @click="addDepot"><a-icon type="plus"/>新增仓库</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">仓库操作 <a-icon type="down" /></a-button>
</a-dropdown>
</a-col>
</a-row>
<a-button type="primary" @click="clearKh" style="margin-left:10px">清空空行</a-button>
</template>
</j-editable-table>
<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="1" 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="优惠率" data-step="5" data-title="优惠率"
data-intro="针对单据明细中商品总金额进行优惠的比例">
<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="收款优惠" data-step="6" data-title="收款优惠"
data-intro="针对单据明细中商品总金额进行优惠的金额">
<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="优惠后金额" data-step="7" data-title="优惠后金额"
data-intro="针对单据明细中商品总金额进行优惠后的金额">
<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="其它费用" data-step="8" data-title="其它费用"
data-intro="比如快递费油费过路费">
<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="结算账户" data-step="9" data-title="结算账户"
data-intro="如果在下拉框中选择多账户则可以通过多个结算账户进行结算">
<a-select style="width:185px;" placeholder="选择结算账户" v-decorator="[ 'accountId']"
:dropdownMatchSelectWidth="false" allowClear @select="selectAccount">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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="本次欠款" data-step="10" data-title="本次欠款"
data-intro="欠款产生的费用后续可以在收款单进行收取">
<a-input placeholder="请输入本次欠款" v-decorator.trim="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员" data-step="11" data-title="销售人员"
data-intro="销售人员的数据来自经手人管理菜单中的业务员">
<j-select-multiple placeholder="请选择销售人员" v-model="personList.value" :options="personList.options"/>
</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="附件" data-step="12" data-title="附件"
data-intro="可以上传与单据相关的图片文档支持多个文件">
<j-upload v-model="fileList" bizPath="bill"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
<depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<batch-set-depot ref="batchSetDepotModalForm" @ok="batchSetDepotModalFormOk"></batch-set-depot>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import ManyAccountModal from '../dialog/ManyAccountModal'
import LinkBillList from '../dialog/LinkBillList'
import CustomerModal from '../../system/modules/CustomerModal'
import DepotModal from '../../system/modules/DepotModal'
import AccountModal from '../../system/modules/AccountModal'
import BatchSetDepot from '../dialog/BatchSetDepot'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { BillModalMixin } from '../mixins/BillModalMixin'
import { getMpListShort } from "@/utils/util"
import { getAction } from '@/api/manage'
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
name: "SaleOutModal",
mixins: [JEditableTableMixin, BillModalMixin],
components: {
ManyAccountModal,
LinkBillList,
CustomerModal,
DepotModal,
AccountModal,
BatchSetDepot,
JUpload,
JDate,
JSelectMultiple,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 10,
visible: false,
operTimeStr: '',
prefixNo: 'XSCK',
fileList:[],
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: '7%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '物料编码', key: 'barCode', width: '8%', type: FormTypes.popupJsh, kind: 'material', multi: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '名称', key: 'name', width: '20%', type: FormTypes.normal },
{ title: '规格', key: 'standard', width: '5%', type: FormTypes.normal },
{ title: '型号', key: 'model', width: '5%', type: FormTypes.normal },
{ title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
{ title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
{ title: '库存', key: 'stock', width: '5%', type: FormTypes.inputNumber, readonly:true },
{ title: '单位', key: 'unit', width: '4%', type: FormTypes.normal },
{ title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
{ title: '批号', key: 'batchNumber', width: '7%', type: FormTypes.popupJsh, kind: 'batch', multi: false },
{ title: '有效期', key: 'expirationDate',width: '5%', type: FormTypes.normal },
{ title: '多属性', key: 'sku', width: '4%', type: FormTypes.normal },
{ title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
{ title: '已入库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
{ title: '数量', key: 'operNumber', width: '4%', type: FormTypes.inputNumber, statistics: true,
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '单价', key: 'unitPrice', width: '4%', type: FormTypes.inputNumber},
{ title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
{ title: '税率', key: 'taxRate', width: '3%', type: FormTypes.inputNumber,placeholder: '%'},
{ title: '税额', key: 'taxMoney', width: '5%', type: FormTypes.inputNumber, readonly: true, statistics: true },
{ title: '价税合计', key: 'taxLastMoney', 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: '请选择客户!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择结算账户!' }
]
}
},
url: {
add: '/erp/depotHead/addDepotHeadAndDetail',
edit: '/erp/depotHead/updateDepotHeadAndDetail',
detailList: '/erp/depotItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
this.changeColumnHide()
this.changeFormTypes(this.materialTable.columns, 'snList', 0)
this.changeFormTypes(this.materialTable.columns, 'batchNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'expirationDate', 0)
this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
if (this.action === 'add') {
this.addInit(this.prefixNo)
this.personList.value = ''
this.fileList = []
} 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.personList.value = this.model.salesMan
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt','salesMan'))
});
// 加载子表数据
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);
}
//复制新增单据-初始化单号和日期
if(this.action === 'copyAdd') {
this.model.id = ''
this.model.tenantId = ''
this.copyAddInit(this.prefixNo)
}
this.initCustomer()
this.initSalesman()
this.initDepot()
this.initAccount()
},
//提交单据时整理成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.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
billMain.salesMan = this.personList.value
return {
info: billMain,
rows: detailArr,
}
},
onSearchLinkNumber() {
this.$refs.linkBillList.show('其它', '销售订单', '客户', "1,3")
this.$refs.linkBillList.title = "选择销售订单"
},
linkBillListOk(selectBillRows) {
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
if(selectBillRows && selectBillRows.length>0) {
let record = selectBillRows[0]
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': record.organId,
'linkNumber': record.number,
'remark': record.remark,
'discountLastMoney': record.totalPrice,
'changeAmount': record.totalPrice
})
});
// 加载子表数据
let params = {
headerId: record.id,
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
}
this.requestSubTableDataEx(this.url.detailList, params, this.materialTable);
}
},
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
requestSubTableDataEx(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
let list = res.data.rows
let listEx = []
let discountLastMoney = 0
for(let j=0; j<list.length; j++){
let info = list[j];
if(info.preNumber) {
info.operNumber = info.preNumber - info.finishNumber
// info.allPrice = info.operNumber * info.unitPrice-0;
discountLastMoney += info.allPrice
}
info.taxMoney = 0
info.taxLastMoney = info.allPrice
listEx.push(info)
this.changeColumnShow(info)
}
tab.dataSource = listEx
//给优惠后金额重新赋值
if(discountLastMoney) {
this.$nextTick(() => {
this.form.setFieldsValue({
'discountLastMoney': discountLastMoney,
'changeAmount': discountLastMoney
})
});
}
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
tab.loading = false
})
}
}
}
</script>
<style scoped>
</style>
-200
View File
@@ -1,200 +0,0 @@
<!-- by j i s h e n g h u a -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.billNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="付款会员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择付款会员" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="财务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择财务人员" showSearch optionFilterProp="children" v-model="queryParam.handsPersonId">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="针对会员模块,对会员收取预付款。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '收预付款')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<advance-in-modal ref="modalForm" @ok="modalFormOk"></advance-in-modal>
<financial-detail ref="modalDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import AdvanceInModal from './modules/AdvanceInModal'
import FinancialDetail from './dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { FinancialListMixin } from './mixins/FinancialListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AdvanceInList",
mixins:[JeecgListMixin, FinancialListMixin,tableDragResizeMixin],
components: {
AdvanceInModal,
FinancialDetail,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
billNo: "",
searchMaterial: "",
type: "收预付款",
organId: "",
creator: "",
handsPersonId: ""
},
// 表头
columns: [
{ title: '付款会员', dataIndex: 'organName',width:140, ellipsis:true},
{ title: '财务人员', dataIndex: 'handsPersonName',width:140},
{ title: '单据编号', dataIndex: 'billNo',width:160},
{ title: '单据日期 ', dataIndex: 'billTimeStr',width:160},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true},
{ title: '合计金额', dataIndex: 'totalPrice',width:80},
{ title: '收款金额', dataIndex: 'changeAmount',width:80},
{ title: '备注', dataIndex: 'remark',width:200},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
width:200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/accountHead/list",
delete: "/erp/accountHead/delete",
deleteBatch: "/erp/accountHead/deleteBatch",
batchSetStatusUrl: "/erp/accountHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initRetail()
this.initUser()
this.initPerson()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-187
View File
@@ -1,187 +0,0 @@
<!-- by j i sheng h u a -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.billNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="财务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择财务人员" showSearch optionFilterProp="children" v-model="queryParam.handsPersonId">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="转账:本系统的转账是指从一个银行存款账户转入到另一个银行存款账户。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '转账')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<giro-modal ref="modalForm" @ok="modalFormOk"></giro-modal>
<financial-detail ref="modalDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import GiroModal from './modules/GiroModal'
import FinancialDetail from './dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { FinancialListMixin } from './mixins/FinancialListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "GiroList",
mixins:[JeecgListMixin, FinancialListMixin,tableDragResizeMixin],
components: {
GiroModal,
FinancialDetail,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
billNo: "",
searchMaterial: "",
type: "转账",
creator: "",
handsPersonId: ""
},
// 表头
columns: [
{ title: '财务人员', dataIndex: 'handsPersonName',width:140},
{ title: '单据编号', dataIndex: 'billNo',width:160},
{ title: '单据日期 ', dataIndex: 'billTimeStr',width:160},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true},
{ title: '实付金额', dataIndex: 'changeAmount',width:80},
{ title: '备注', dataIndex: 'remark',width:200},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
width:200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/accountHead/list",
delete: "/erp/accountHead/delete",
deleteBatch: "/erp/accountHead/deleteBatch",
batchSetStatusUrl: "/erp/accountHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initUser()
this.initPerson()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-200
View File
@@ -1,200 +0,0 @@
<!-- by j i s h e n g hua -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.billNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择往来单位" showSearch optionFilterProp="children" v-model="queryParam.organId">
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="财务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择财务人员" showSearch optionFilterProp="children" v-model="queryParam.handsPersonId">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1"@click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="收入单主要处理一些销售收入以外的收入如维修服务收入、利息收入、调账收入等。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '收入')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<item-in-modal ref="modalForm" @ok="modalFormOk"></item-in-modal>
<financial-detail ref="modalDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import ItemInModal from './modules/ItemInModal'
import FinancialDetail from './dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { FinancialListMixin } from './mixins/FinancialListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "ItemInList",
mixins:[JeecgListMixin, FinancialListMixin,tableDragResizeMixin],
components: {
ItemInModal,
FinancialDetail,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
billNo: "",
searchMaterial: "",
type: "收入",
organId: "",
creator: "",
handsPersonId: ""
},
// 表头
columns: [
{ title: '往来单位', dataIndex: 'organName',width:140, ellipsis:true},
{ title: '财务人员', dataIndex: 'handsPersonName',width:140},
{ title: '单据编号', dataIndex: 'billNo',width:160},
{ title: '单据日期 ', dataIndex: 'billTimeStr',width:160},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true},
{ title: '收入金额', dataIndex: 'changeAmount',width:80},
{ title: '备注', dataIndex: 'remark',width:200},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
width:200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/accountHead/list",
delete: "/erp/accountHead/delete",
deleteBatch: "/erp/accountHead/deleteBatch",
batchSetStatusUrl: "/erp/accountHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initOrgan()
this.initUser()
this.initPerson()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-199
View File
@@ -1,199 +0,0 @@
<!-- by 752718920 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.billNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择往来单位" showSearch optionFilterProp="children" v-model="queryParam.organId">
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="财务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择财务人员" showSearch optionFilterProp="children" v-model="queryParam.handsPersonId">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="支出单主要处理一些进货支出以外的支出如水电支出、房租支出等。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '支出')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<item-out-modal ref="modalForm" @ok="modalFormOk"></item-out-modal>
<financial-detail ref="modalDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import ItemOutModal from './modules/ItemOutModal'
import FinancialDetail from './dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { FinancialListMixin } from './mixins/FinancialListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "ItemOutList",
mixins:[JeecgListMixin, FinancialListMixin,tableDragResizeMixin],
components: {
ItemOutModal,
FinancialDetail,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
billNo: "",
searchMaterial: "",
type: "支出",
organId: "",
creator: "",
handsPersonId: ""
},
// 表头
columns: [
{ title: '往来单位', dataIndex: 'organName',width:140, ellipsis:true},
{ title: '财务人员', dataIndex: 'handsPersonName',width:140},
{ title: '单据编号', dataIndex: 'billNo',width:160},
{ title: '单据日期 ', dataIndex: 'billTimeStr',width:160},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true},
{ title: '支出金额', dataIndex: 'changeAmount',width:80},
{ title: '备注', dataIndex: 'remark',width:200},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
width:200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/accountHead/list",
delete: "/erp/accountHead/delete",
deleteBatch: "/erp/accountHead/deleteBatch",
batchSetStatusUrl: "/erp/accountHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initOrgan()
this.initUser()
this.initPerson()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-203
View File
@@ -1,203 +0,0 @@
<!-- by 7527 18920 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.billNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="财务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择财务人员" showSearch optionFilterProp="children" v-model="queryParam.handsPersonId">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="收款单所收金额只对付款单位的应收应付产生影响,可以在回款统计中进行查看。
收款单的优惠金额会对利润产生影响,但不影响付款单位的应收应付。优惠金额计入收入类的收款优惠中。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '收款')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<money-in-modal ref="modalForm" @ok="modalFormOk"></money-in-modal>
<financial-detail ref="modalDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import MoneyInModal from './modules/MoneyInModal'
import FinancialDetail from './dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { FinancialListMixin } from './mixins/FinancialListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MoneyInList",
mixins:[JeecgListMixin, FinancialListMixin,tableDragResizeMixin],
components: {
MoneyInModal,
FinancialDetail,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
billNo: "",
searchMaterial: "",
type: "收款",
organId: "",
creator: "",
handsPersonId: ""
},
// 表头
columns: [
{ title: '客户', dataIndex: 'organName',width:140, ellipsis:true},
{ title: '财务人员', dataIndex: 'handsPersonName',width:140},
{ title: '单据编号', dataIndex: 'billNo',width:160},
{ title: '单据日期 ', dataIndex: 'billTimeStr',width:160},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true},
{ title: '合计收款', dataIndex: 'totalPrice',width:80},
{ title: '优惠金额', dataIndex: 'discountMoney',width:80},
{ title: '实际收款', dataIndex: 'changeAmount',width:80},
{ title: '备注', dataIndex: 'remark',width:200},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
width:200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/accountHead/list",
delete: "/erp/accountHead/delete",
deleteBatch: "/erp/accountHead/deleteBatch",
batchSetStatusUrl: "/erp/accountHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initCustomer()
this.initUser()
this.initPerson()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-203
View File
@@ -1,203 +0,0 @@
<!-- by 75 27 18 920 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.billNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width:100%"
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" showSearch optionFilterProp="children" v-model="queryParam.organId">
<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 :md="6" :sm="24">
<a-form-item label="财务人员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择财务人员" showSearch optionFilterProp="children" v-model="queryParam.handsPersonId">
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择操作员" showSearch optionFilterProp="children" v-model="queryParam.creator">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(2)>-1" @click="batchSetStatus(1)"><a-icon type="check"/>审核</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(7)>-1" @click="batchSetStatus(0)"><a-icon type="stop"/>反审核</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
<a-tooltip placement="left" title="付款单的要素和录入原则与“收款单”相同。
付款单中优惠金额计入支出类中的付款优惠中,为负值 (因优惠意味着实际少付款)。" slot="action">
<a-icon v-if="btnEnableList.indexOf(1)>-1" type="question-circle" style="font-size:20px;float:right;" />
</a-tooltip>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="myHandleDetail(record, '付款')">查看</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1" @click="myHandleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => myHandleDelete(record)">
<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>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<money-out-modal ref="modalForm" @ok="modalFormOk"></money-out-modal>
<financial-detail ref="modalDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import MoneyOutModal from './modules/MoneyOutModal'
import FinancialDetail from './dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { FinancialListMixin } from './mixins/FinancialListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MoneyOutList",
mixins:[JeecgListMixin, FinancialListMixin,tableDragResizeMixin],
components: {
MoneyOutModal,
FinancialDetail,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
billNo: "",
searchMaterial: "",
type: "付款",
organId: "",
creator: "",
handsPersonId: ""
},
// 表头
columns: [
{ title: '供应商', dataIndex: 'organName',width:140, ellipsis:true},
{ title: '财务人员', dataIndex: 'handsPersonName',width:140},
{ title: '单据编号', dataIndex: 'billNo',width:160},
{ title: '单据日期 ', dataIndex: 'billTimeStr',width:160},
{ title: '操作员', dataIndex: 'userName',width:80, ellipsis:true},
{ title: '合计付款', dataIndex: 'totalPrice',width:80},
{ title: '优惠金额', dataIndex: 'discountMoney',width:80},
{ title: '实际付款', dataIndex: 'changeAmount',width:80},
{ title: '备注', dataIndex: 'remark',width:200},
{ title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' }
},
{
title: '操作',
dataIndex: 'action',
width:200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/accountHead/list",
delete: "/erp/accountHead/delete",
deleteBatch: "/erp/accountHead/deleteBatch",
batchSetStatusUrl: "/erp/accountHead/batchSetStatus"
}
}
},
computed: {
},
created () {
this.initSupplier()
this.initUser()
this.initPerson()
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
@@ -1,231 +0,0 @@
<template>
<a-modal
:title="title"
:width="1250"
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<!-- 查询区域 -->
<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="7" :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>
<!-- table区域-begin -->
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType}"
:customRow="rowAction"
@change="handleTableChange">
</a-table>
<!-- table区域-end -->
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
import Vue from 'vue'
export default {
name: 'DebtBillList',
mixins:[JeecgListMixin,tableDragResizeMixin],
data () {
return {
title: "操作",
visible: false,
disableMixinCreated: true,
selectedRowKeys: [],
selectionRows: [],
selectBillRows: [],
selectBillIds: '',
queryParam: {
organId: "",
materialParam: "",
number: "",
type: "",
subType: "",
roleType: Vue.ls.get('roleType'),
status: ""
},
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '', dataIndex: 'organName',width:120},
{ title: '单据编号', dataIndex: 'number',width:120},
{ title: '商品信息', dataIndex: 'materialsList',width:200, ellipsis:true,
customRender:function (text,record,index) {
if(text) {
return text.replace(",","");
}
}
},
{ title: '单据日期', dataIndex: 'operTimeStr',width:130},
{ title: '操作员', dataIndex: 'userName',width:60},
{ title: '欠款', dataIndex: 'needDebt',width:70,
customRender:function (text,record,index) {
return (record.discountLastMoney + record.otherMoney - record.changeAmount).toFixed(2);
}
},
{ title: '已收欠款', dataIndex: 'finishDebt',width:70 },
{ title: '待收欠款', dataIndex: 'debt',width:70,
customRender:function (text,record,index) {
return (record.discountLastMoney + record.otherMoney - record.changeAmount - record.finishDebt).toFixed(2);
}
}
],
url: {
list: "/erp/depotHead/debtList"
}
}
},
computed: {
getType: function () {
return 'checkbox';
}
},
created() {
},
methods: {
show(organId, type, subType, organType, status) {
this.queryParam.organId = organId
this.queryParam.type = type
this.queryParam.subType = subType
this.queryParam.status = status
this.columns[1].title = organType
if(type === '入库') {
this.columns[7].title = '已付欠款'
this.columns[8].title = '待付欠款'
} else if(type === '出库') {
this.columns[7].title = '已收欠款'
this.columns[8].title = '待收欠款'
}
this.model = Object.assign({}, {});
this.visible = true;
this.ipagination.pageSize = 100
this.ipagination.pageSizeOptions = ['100', '200', '300']
this.loadData(1)
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
handleOk () {
this.getSelectBillRows();
this.$emit('ok', this.selectBillRows);
this.close();
},
onDateChange: function (value, dateString) {
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
onDateOk(value) {
console.log(value);
},
searchReset() {
this.queryParam = {
type: this.queryParam.type,
subType: this.queryParam.subType
}
this.loadData(1);
},
getSelectBillRows() {
let dataSource = this.dataSource;
let billIds = "";
this.selectBillRows = [];
for (let i = 0, len = dataSource.length; i < len; i++) {
if (this.selectedRowKeys.includes(dataSource[i].id)) {
this.selectBillRows.push(dataSource[i]);
billIds = billIds + "," + dataSource[i].id
}
}
this.selectBillIds = billIds.substring(1);
},
rowAction(record, index) {
return {
on: {
click: () => {
let arr = []
arr.push(record.id)
this.selectedRowKeys = arr
},
dblclick: () => {
let arr = []
arr.push(record.id)
this.selectedRowKeys = arr
this.handleOk()
}
}
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,525 +0,0 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:maskClosable="false"
:keyboard="false"
:forceRender="true"
@cancel="handleCancel"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<template slot="footer">
<!--此处为解决缓存问题-->
<a-button v-if="financialType === '收预付款'" v-print="'#advanceInPrint'" ghost type="primary">打印</a-button>
<a-button v-if="financialType === '转账'" v-print="'#giroPrint'" ghost type="primary">打印</a-button>
<a-button v-if="financialType === '收入'" v-print="'#itemInPrint'" ghost type="primary">打印</a-button>
<a-button v-if="financialType === '支出'" v-print="'#itemOutPrint'" ghost type="primary">打印</a-button>
<a-button v-if="financialType === '收款'" v-print="'#moneyInPrint'" ghost type="primary">打印</a-button>
<a-button v-if="financialType === '付款'" v-print="'#moneyOutPrint'" ghost type="primary">打印</a-button>
<a-button key="back" @click="handleCancel">取消</a-button>
</template>
<a-form :form="form">
<!--收预付款-->
<template v-if="financialType === '收预付款'">
<section ref="print" id="advanceInPrint">
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款会员">
<a-input v-decorator="['id']" hidden/>
{{model.organName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
{{model.handsPersonName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
{{model.billTimeStr}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
{{model.billNo}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:pagination="false"
:columns="advanceInColumns"
:dataSource="dataSource">
</a-table>
<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="" style="padding:20px 10px;">
{{model.remark}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="合计金额">
{{model.totalPrice}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款金额">
{{model.changeAmount}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6"></a-col>
<a-col :span="6"></a-col>
</a-row>
</section>
</template>
<!--转账-->
<template v-if="financialType === '转账'">
<section ref="print" id="giroPrint">
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
<a-input v-decorator="['id']" hidden/>
{{model.handsPersonName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
{{model.billTimeStr}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
{{model.billNo}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
</a-row>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:pagination="false"
:columns="giroColumns"
:dataSource="dataSource">
</a-table>
<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="" style="padding:20px 10px;">
{{model.remark}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款账户">
{{model.accountName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实付金额">
{{model.changeAmount}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6"></a-col>
</a-row>
</section>
</template>
<!--收入-->
<template v-if="financialType === '收入'">
<section ref="print" id="itemInPrint">
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
<a-input v-decorator="['id']" hidden/>
{{model.organName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
{{model.handsPersonName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
{{model.billTimeStr}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
{{model.billNo}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:pagination="false"
:columns="itemInColumns"
:dataSource="dataSource">
</a-table>
<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="" style="padding:20px 10px;">
{{model.remark}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收入账户">
{{model.accountName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收入金额">
{{model.changeAmount}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6"></a-col>
</a-row>
</section>
</template>
<!--支出-->
<template v-if="financialType === '支出'">
<section ref="print" id="itemOutPrint">
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
<a-input v-decorator="['id']" hidden/>
{{model.organName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
{{model.handsPersonName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
{{model.billTimeStr}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
{{model.billNo}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:pagination="false"
:columns="itemOutColumns"
:dataSource="dataSource">
</a-table>
<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="" style="padding:20px 10px;">
{{model.remark}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="支出账户">
{{model.accountName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="支出金额">
{{model.changeAmount}}
</a-form-item>
</a-col>
<a-col :span="6"></a-col>
<a-col :span="6"></a-col>
</a-row>
</section>
</template>
<!--收款-->
<template v-if="financialType === '收款'">
<section ref="print" id="moneyInPrint">
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
<a-input v-decorator="['id']" hidden/>
{{model.organName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
{{model.handsPersonName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
{{model.billTimeStr}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
{{model.billNo}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:pagination="false"
:columns="moneyInColumns"
:dataSource="dataSource">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.billNumber}}</a>
</span>
</a-table>
<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="" style="padding:20px 10px;">
{{model.remark}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款账户">
{{model.accountName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="合计收款">
{{model.totalPrice}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠金额">
{{model.discountMoney}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实际收款">
{{model.changeAmount}}
</a-form-item>
</a-col>
</a-row>
</section>
</template>
<!--付款-->
<template v-if="financialType === '付款'">
<section ref="print" id="moneyOutPrint">
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
<a-input v-decorator="['id']" hidden/>
{{model.organName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
{{model.handsPersonName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
{{model.billTimeStr}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
{{model.billNo}}
</a-form-item>
</a-col>
</a-row>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:pagination="false"
:columns="moneyOutColumns"
:dataSource="dataSource">
</a-table>
<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="" style="padding:20px 10px;">
{{model.remark}}
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款账户">
{{model.accountName}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="合计付款">
{{model.totalPrice}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠金额">
{{model.discountMoney}}
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实际付款">
{{model.changeAmount}}
</a-form-item>
</a-col>
</a-row>
</section>
</template>
<template v-if="fileList && fileList.length>0">
<a-row class="form-row" :gutter="24">
<a-col :span="12">
<a-form-item :labelCol="{xs: { span: 24 },sm: { span: 3 }}" :wrapperCol="{xs: { span: 24 },sm: { span: 21 }}" label="附件">
<j-upload v-model="fileList" bizPath="bill" :disabled="true" :buttonVisible="false"></j-upload>
</a-form-item>
</a-col>
<a-col :span="12"></a-col>
</a-row>
</template>
</a-form>
<!-- 表单区域 -->
<bill-detail ref="modalDetail"></bill-detail>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import BillDetail from '../../bill/dialog/BillDetail'
import { getAction } from '@/api/manage'
import { findBillDetailByNumber} from '@/api/api'
import JUpload from '@/components/jeecg/JUpload'
export default {
name: 'FinancialDetail',
components: {
BillDetail,
JUpload
},
data () {
return {
title: "详情",
width: '100%',
visible: false,
model: {},
financialType: '',
fileList: [],
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
form: this.$form.createForm(this),
loading: false,
dataSource: [],
url: {
detailList: '/accountItem/getDetailList'
},
advanceInColumns: [
{ title: '账户名称',dataIndex: 'accountName',width: '30%'},
{ title: '金额',dataIndex: 'eachAmount', width: '30%'},
{ title: '备注',dataIndex: 'remark', width: '30%'}
],
giroColumns: [
{ title: '账户名称',dataIndex: 'accountName',width: '30%'},
{ title: '金额',dataIndex: 'eachAmount', width: '30%'},
{ title: '备注',dataIndex: 'remark', width: '30%'}
],
itemInColumns: [
{ title: '收入项目',dataIndex: 'inOutItemName',width: '30%'},
{ title: '金额',dataIndex: 'eachAmount', width: '30%'},
{ title: '备注',dataIndex: 'remark', width: '30%'}
],
itemOutColumns: [
{ title: '支出项目',dataIndex: 'inOutItemName',width: '30%'},
{ title: '金额',dataIndex: 'eachAmount', width: '30%'},
{ title: '备注',dataIndex: 'remark', width: '30%'}
],
moneyInColumns: [
{
title: '销售单据编号', dataIndex: 'billNumber', width: '20%',
scopedSlots: { customRender: 'numberCustomRender' },
},
{ title: '应收欠款',dataIndex: 'needDebt', width: '10%'},
{ title: '已收欠款',dataIndex: 'finishDebt', width: '10%'},
{ title: '本次收款',dataIndex: 'eachAmount', width: '10%'},
{ title: '备注',dataIndex: 'remark', width: '20%'}
],
moneyOutColumns: [
{ title: '采购单据编号',dataIndex: 'billNumber',width: '20%'},
{ title: '应付欠款',dataIndex: 'needDebt', width: '10%'},
{ title: '已付欠款',dataIndex: 'finishDebt', width: '10%'},
{ title: '本次付款',dataIndex: 'eachAmount', width: '10%'},
{ title: '备注',dataIndex: 'remark', width: '20%'}
],
}
},
created () {
},
methods: {
show(record, type) {
this.financialType = type
//附件下载
this.fileList = record.fileName
this.visible = true;
this.model = Object.assign({}, record);
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'id'))
});
let params = {
headerId: this.model.id,
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params);
},
requestSubTableData(url, params, success) {
this.loading = true
getAction(url, params).then(res => {
if(res && res.code === 200){
this.dataSource = res.data.rows
typeof success === 'function' ? success(res) : ''
}
}).finally(() => {
this.loading = false
})
},
handleCancel() {
this.close()
},
close() {
this.$emit('close');
this.visible = false;
},
myHandleDetail(record) {
findBillDetailByNumber({ number: record.billNumber }).then((res) => {
if (res && res.code === 200) {
this.$refs.modalDetail.show(res.data, res.data.subType + res.data.type);
this.$refs.modalDetail.title= res.data.subType + res.data.type + "-详情";
}
})
}
}
}
</script>
<style scoped>
</style>
@@ -1,133 +0,0 @@
import {findBySelectSup, findBySelectCus, findBySelectOrgan, findBySelectRetail, getUserList, getPersonByType } from '@/api/api'
export const FinancialListMixin = {
data () {
return {
supList: [],
cusList: [],
organList: [],
retailList: [],
userList: [],
personList: []
}
},
computed: {
importExcelUrl: function(){
return `${process.env.VUE_APP_BASE_API}/${this.url.importExcelUrl}`;
},
isBatchDelEnabled: function () {
for (let i = 0; i < this.selectedRowKeys.length; i++) {
if (!this.selectionRows[i].actionsEnabled.delete) {
return false;
}
}
return true;
}
},
created() {
this.removeStatusColumn()
},
methods: {
myHandleAdd() {
this.$refs.modalForm.action = "add";
this.handleAdd();
},
myHandleEdit(record) {
if(record.status === '0') {
this.$refs.modalForm.action = "edit";
this.handleEdit(record);
} else {
this.$message.warning("抱歉,只有未审核的单据才能编辑!")
}
},
myHandleDelete(record) {
if(record.status === '0') {
this.handleDelete(record.id)
} else {
this.$message.warning("抱歉,只有未审核的单据才能删除!")
}
},
myHandleDetail(record, type) {
this.handleDetail(record, type);
},
handleApprove(record) {
this.$refs.modalForm.action = "approve";
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "审核";
},
searchReset() {
this.queryParam = {
type: this.queryParam.type
}
this.loadData(1);
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
initCustomer() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.cusList = res;
}
});
},
initOrgan() {
let that = this;
findBySelectOrgan({}).then((res)=>{
if(res) {
that.organList = res;
}
});
},
initRetail() {
let that = this;
findBySelectRetail({}).then((res)=>{
if(res) {
that.retailList = res;
}
});
},
initUser() {
getUserList({}).then((res)=>{
if(res) {
this.userList = res;
}
});
},
initPerson() {
let that = this;
getPersonByType({type:'财务员'}).then((res)=>{
if(res && res.code === 200) {
that.personList = res.data.personList;
}
})
},
onDateChange: function (value, dateString) {
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
onDateOk(value) {
console.log(value);
},
removeStatusColumn() {
//没有审核反审核权限的时候直接移除状态列
if(this.btnEnableList.indexOf(2)===-1 && this.btnEnableList.indexOf(7)===-1) {
let statusIndex = 0
for(let i=0; i<this.columns.length; i++){
if(this.columns[i].dataIndex === 'status') {
statusIndex = i
}
}
//移除状态列
this.columns.splice(statusIndex,1)
}
}
}
}
@@ -1,245 +0,0 @@
import { VALIDATE_NO_PASSED, validateFormAndTables } from '@/utils/JEditableTableUtil'
import {findBySelectSup,findBySelectCus,findBySelectRetail,findBySelectOrgan,findStockByDepotAndBarCode,getAccount,getPersonByType,findInOutItemByParam} from '@/api/api'
import { getAction,putAction } from '@/api/manage'
import { getMpListShort, getNowFormatDateTime } from "@/utils/util"
import Vue from 'vue'
export const FinancialModalMixin = {
data() {
return {
action: '',
supList: [],
cusList: [],
retailList: [],
organList: [],
personList: [],
accountList: [],
isTenant: false,
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.isTenant = true;
},
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({'billNo':amountNum + res.data.defaultNumber})
}
})
this.$nextTick(() => {
this.form.setFieldsValue({'billTime':getNowFormatDateTime(), 'totalPrice': 0, 'discountMoney': 0, 'changeAmount': 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})
}
}
}
})
})
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
initCustomer() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.cusList = res;
}
});
},
initOrgan() {
let that = this;
findBySelectOrgan({}).then((res)=>{
if(res) {
that.organList = res;
}
});
},
initRetail() {
let that = this;
findBySelectRetail({}).then((res)=>{
if(res) {
that.retailList = res;
}
});
},
initPerson() {
let that = this;
getPersonByType({type:'财务员'}).then((res)=>{
if(res && res.code === 200) {
that.personList = res.data.personList;
}
})
},
initInOutItem(type) {
let that = this;
findInOutItemByParam({type:type}).then((res)=>{
if(res) {
for(let item of that.accountTable.columns){
if(item.key == 'inOutItemId') {
item.options = []
for(let i=0; i<res.length; i++) {
let inOutItemInfo = {};
inOutItemInfo.value = res[i].id + '' //注意-此处value必须为字符串格式
inOutItemInfo.text = res[i].name
inOutItemInfo.title = res[i].name
item.options.push(inOutItemInfo)
}
}
}
}
})
},
//账户-用于主表
initAccount(){
let that = this;
getAccount({}).then((res)=>{
if(res && res.code === 200) {
that.accountList = res.data.accountList;
}
})
},
//账户-用于明细
initDetailAccount(){
let that = this;
getAccount({}).then((res)=>{
if(res && res.code === 200) {
let list = res.data.accountList;
for(let item of that.accountTable.columns){
if(item.key == 'accountId') {
item.options = []
for(let i=0; i<list.length; i++) {
let accountInfo = {};
accountInfo.value = list[i].id + '' //注意-此处value必须为字符串格式
accountInfo.text = list[i].name
accountInfo.title = list[i].name
item.options.push(accountInfo)
}
}
}
}
})
},
addSupplier() {
this.$refs.vendorModalForm.add();
this.$refs.vendorModalForm.title = "新增";
this.$refs.vendorModalForm.disableSubmit = false;
},
addCustomer() {
this.$refs.customerModalForm.add();
this.$refs.customerModalForm.title = "新增客户(提醒:如果找不到新添加的客户,请到用户管理检查是否分配了该客户权限)";
this.$refs.customerModalForm.disableSubmit = false;
},
addAccount() {
this.$refs.accountModalForm.add();
this.$refs.accountModalForm.title = "新增结算账户";
this.$refs.accountModalForm.disableSubmit = false;
},
addPerson() {
this.$refs.personModalForm.add();
this.$refs.personModalForm.title = "新增经手人";
this.$refs.personModalForm.disableSubmit = false;
},
vendorModalFormOk() {
this.initSupplier()
},
customerModalFormOk() {
this.initCustomer()
},
accountModalFormOk() {
this.initAccount()
},
personModalFormOk() {
this.initPerson()
},
//单元值改变一个字符就触发一次
onValueChange(event) {
let that = this
const { type, row, column, value, target } = event
switch(column.key) {
case "eachAmount":
target.recalcAllStatisticsColumns()
that.autoChangeAmount(target)
break;
}
},
//改变本次欠款的值
autoChangeAmount(target) {
let allEachAmount = target.statisticsColumns.eachAmount-0
let discountMoney = this.form.getFieldValue('discountMoney')-0
if(!discountMoney) {
discountMoney = 0
}
let changeAmount = (allEachAmount-discountMoney).toFixed(2)
this.$nextTick(() => {
this.form.setFieldsValue({'totalPrice':allEachAmount, 'changeAmount':changeAmount})
});
},
//改变优惠金额
onKeyUpDiscountMoney(e) {
const value = e.target.value-0
let totalPrice = this.form.getFieldValue('totalPrice')-0
let changeAmount = (totalPrice-value).toFixed(2)
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':changeAmount})
});
},
//选择欠款单据
debtBillListOk(selectBillRows) {
if(selectBillRows && selectBillRows.length>0) {
this.requestSubTableDataEx(selectBillRows, this.accountTable);
}
},
/** 查询某个tab的数据,给明细里面的金额赋值 */
requestSubTableDataEx(selectBillRows, tab, success) {
tab.loading = true
let listEx = []
let changeAmount = 0
for(let i=0; i<selectBillRows.length; i++){
let info = selectBillRows[i]
info.billNumber = info.number
info.needDebt = (info.discountLastMoney + info.otherMoney - info.changeAmount).toFixed(2)
info.eachAmount = (info.discountLastMoney + info.otherMoney - info.changeAmount - info.finishDebt).toFixed(2);
if(info.eachAmount != 0) {
changeAmount += info.eachAmount-0
listEx.push(info)
}
}
tab.dataSource = listEx
this.$nextTick(() => {
this.form.setFieldsValue({'totalPrice':changeAmount, 'changeAmount':changeAmount})
});
typeof success === 'function' ? success(res) : ''
tab.loading = false
}
}
}
@@ -1,230 +0,0 @@
<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" showSearch optionFilterProp="children">
<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="财务人员">
<a-select placeholder="选择财务人员" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addPerson"><a-icon type="plus" /> 新增经手人</div>
</div>
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange" />
<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="[ 'totalPrice' ]" :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="[ 'changeAmount' ]" :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>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<person-modal ref="personModalForm" @ok="personModalFormOk"></person-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import PersonModal from '../../system/modules/PersonModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
export default {
name: "AdvanceInModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
PersonModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['accountDataTable', ],
activeKey: 'accountDataTable',
accountTable: {
loading: false,
dataSource: [],
columns: [
{ title: '账户名称',key: 'accountId',width: '20%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '金额',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '30%', type: FormTypes.input, placeholder: '请选择${title}'}
]
},
confirmLoading: false,
validatorRules:{
organId:{
rules: [
{ required: true, message: '请选择付款会员!' }
]
},
handsPersonId:{
rules: [
{ required: true, message: '请选择财务人员!' }
]
},
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
}
},
url: {
add: '/erp/accountHead/addAccountHeadAndDetail',
edit: '/erp/accountHead/updateAccountHeadAndDetail',
detailList: '/erp/accountItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("SYF")
this.fileList = []
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'totalPrice', 'changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.accountTable);
}
this.initRetail()
this.initPerson()
this.initDetailAccount()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '收预付款'
for(let item of detailArr){
totalPrice += item.eachAmount-0
}
billMain.totalPrice = totalPrice
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,249 +0,0 @@
<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="[ 'handsPersonId', validatorRules.handsPersonId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addPerson"><a-icon type="plus" /> 新增经手人</div>
</div>
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange" />
<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-select placeholder="选择付款账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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', validatorRules.changeAmount ]" />
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<person-modal ref="personModalForm" @ok="personModalFormOk"></person-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import AccountModal from '../../system/modules/AccountModal'
import PersonModal from '../../system/modules/PersonModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
export default {
name: "GiroModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
AccountModal,
PersonModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['accountDataTable', ],
activeKey: 'accountDataTable',
accountTable: {
loading: false,
dataSource: [],
columns: [
{ title: '账户名称',key: 'accountId',width: '20%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '金额',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '30%', type: FormTypes.input, placeholder: '请选择${title}'}
]
},
confirmLoading: false,
validatorRules:{
handsPersonId:{
rules: [
{ required: true, message: '请选择财务人员!' }
]
},
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择付款账户!' }
]
},
changeAmount:{
rules: [
{ required: true, message: '请输入实付金额!' }
]
}
},
url: {
add: '/erp/accountHead/addAccountHeadAndDetail',
edit: '/erp/accountHead/updateAccountHeadAndDetail',
detailList: '/erp/accountItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("ZZ")
this.fileList = []
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'accountId', 'changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.accountTable);
}
this.initPerson()
this.initAccount()
this.initDetailAccount()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '转账'
for(let item of detailArr){
totalPrice += item.eachAmount-0
}
billMain.totalPrice = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
//改变本次欠款的值
autoChangeAmount(target) {
let allEachAmount = target.statisticsColumns.eachAmount-0
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allEachAmount})
});
}
}
}
</script>
<style scoped>
</style>
@@ -1,262 +0,0 @@
<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" showSearch optionFilterProp="children">
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
<a-select placeholder="选择财务人员" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addPerson"><a-icon type="plus" /> 新增经手人</div>
</div>
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime', validatorRules.billTime ]" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange" />
<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-select placeholder="选择收入账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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', validatorRules.changeAmount ]" :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>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<person-modal ref="personModalForm" @ok="personModalFormOk"></person-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import AccountModal from '../../system/modules/AccountModal'
import PersonModal from '../../system/modules/PersonModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
export default {
name: "ItemInModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
AccountModal,
PersonModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['accountDataTable', ],
activeKey: 'accountDataTable',
accountTable: {
loading: false,
dataSource: [],
columns: [
{ title: '收入项目',key: 'inOutItemId',width: '20%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '金额',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '30%', type: FormTypes.input, placeholder: '请选择${title}'}
]
},
confirmLoading: false,
validatorRules:{
organId:{
rules: [
{ required: true, message: '请选择客户!' }
]
},
handsPersonId:{
rules: [
{ required: true, message: '请选择财务人员!' }
]
},
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择收入账户!' }
]
},
changeAmount:{
rules: [
{ required: true, message: '请输入收入金额!' }
]
}
},
url: {
add: '/erp/accountHead/addAccountHeadAndDetail',
edit: '/erp/accountHead/updateAccountHeadAndDetail',
detailList: '/erp/accountItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("SR")
this.fileList = []
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'accountId','changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.accountTable);
}
this.initOrgan()
this.initPerson()
this.initInOutItem('in')
this.initAccount()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '收入'
for(let item of detailArr){
totalPrice += item.eachAmount-0
}
billMain.totalPrice = totalPrice
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
//改变本次欠款的值
autoChangeAmount(target) {
let allEachAmount = target.statisticsColumns.eachAmount-0
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allEachAmount})
});
}
}
}
</script>
<style scoped>
</style>
@@ -1,263 +0,0 @@
<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" showSearch optionFilterProp="children">
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
<a-select placeholder="选择财务人员" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addPerson"><a-icon type="plus" /> 新增经手人</div>
</div>
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="true"
:actionButton="true"
@valueChange="onValueChange" />
<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-select placeholder="选择支出账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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', validatorRules.changeAmount ]" :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>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<person-modal ref="personModalForm" @ok="personModalFormOk"></person-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import AccountModal from '../../system/modules/AccountModal'
import PersonModal from '../../system/modules/PersonModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
export default {
name: "ItemOutModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
AccountModal,
PersonModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['accountDataTable', ],
activeKey: 'accountDataTable',
accountTable: {
loading: false,
dataSource: [],
columns: [
{ title: '支出项目',key: 'inOutItemId',width: '20%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
allowSearch:true, validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '金额',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '30%', type: FormTypes.input, placeholder: '请选择${title}'}
]
},
confirmLoading: false,
validatorRules:{
organId:{
rules: [
{ required: true, message: '请选择供应商!' }
]
},
handsPersonId:{
rules: [
{ required: true, message: '请选择财务人员!' }
]
},
billTime:{
rules: [
{ required: true, message: '请选择单据日期!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择支出账户!' }
]
},
changeAmount:{
rules: [
{ required: true, message: '请输入支出金额!' }
]
}
},
url: {
add: '/erp/accountHead/addAccountHeadAndDetail',
edit: '/erp/accountHead/updateAccountHeadAndDetail',
detailList: '/erp/accountItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("ZC")
this.fileList = []
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'accountId','changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.accountTable);
}
this.initOrgan()
this.initPerson()
this.initInOutItem('out')
this.initAccount()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '支出'
for(let item of detailArr){
totalPrice += item.eachAmount-0
}
billMain.totalPrice = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
//改变本次欠款的值
autoChangeAmount(target) {
let allEachAmount = target.statisticsColumns.eachAmount-0
this.$nextTick(() => {
this.form.setFieldsValue({'changeAmount':allEachAmount})
});
}
}
}
</script>
<style scoped>
</style>
@@ -1,293 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addCustomer"><a-icon type="plus" /> 新增客户</div>
</div>
<a-select-option v-for="(item,index) in cusList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="财务人员">
<a-select placeholder="选择财务人员" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addPerson"><a-icon type="plus" /> 新增经手人</div>
</div>
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<!-- 操作按钮 -->
<div class="action-button">
<a-button type="primary" icon="plus" @click="handleClickAdd">新增</a-button>
<span class="gap"></span>
<a-button type="primary" icon="minus" @click="handleClear">清空</a-button>
</div>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="24">
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="false"
:actionButton="false"
@valueChange="onValueChange" />
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="24" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" style="margin-top:8px;"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款账户">
<a-select placeholder="选择收款账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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="[ 'totalPrice' ]" :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="[ 'discountMoney', validatorRules.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="[ 'changeAmount' ]" :readOnly="true"/>
</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="附件">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<debt-bill-list ref="debtBillList" @ok="debtBillListOk"></debt-bill-list>
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<person-modal ref="personModalForm" @ok="personModalFormOk"></person-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import DebtBillList from '../dialog/DebtBillList'
import CustomerModal from '../../system/modules/CustomerModal'
import AccountModal from '../../system/modules/AccountModal'
import PersonModal from '../../system/modules/PersonModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
export default {
name: "MoneyInModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
DebtBillList,
CustomerModal,
AccountModal,
PersonModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 0,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['accountDataTable', ],
activeKey: 'accountDataTable',
accountTable: {
loading: false,
dataSource: [],
columns: [
{ title: '销售单据编号',key: 'billNumber',width: '20%', type: FormTypes.input, readonly: true },
{ title: '应收欠款',key: 'needDebt', width: '10%', type: FormTypes.inputNumber, statistics: true, readonly: true },
{ title: '已收欠款', key: 'finishDebt', width: '10%', type: FormTypes.inputNumber, statistics: true, readonly: true },
{ title: '本次收款',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请输入${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '20%', type: FormTypes.input, placeholder: '请输入${title}'}
]
},
confirmLoading: false,
validatorRules:{
organId:{
rules: [{ required: true, message: '请选择客户!' }]
},
handsPersonId:{
rules: [{ required: true, message: '请选择财务人员!' }]
},
billTime:{
rules: [{ required: true, message: '请选择单据日期!' }]
},
accountId:{
rules: [{ required: true, message: '请选择收款账户!' }]
},
discountMoney:{
rules: [{ required: true, message: '请输入优惠金额!' }]
}
},
url: {
add: '/erp/accountHead/addAccountHeadAndDetail',
edit: '/erp/accountHead/updateAccountHeadAndDetail',
detailList: '/erp/accountItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("SK")
this.fileList = []
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'accountId', 'totalPrice', 'discountMoney', 'changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.accountTable);
}
this.initCustomer()
this.initPerson()
this.initAccount()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '收款'
for(let item of detailArr){
totalPrice += item.eachAmount-0
}
billMain.totalPrice = totalPrice
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
handleClickAdd() {
let organId = this.form.getFieldValue('organId')
if(organId){
this.$refs.debtBillList.show(organId, '出库', '销售', '客户', "")
this.$refs.debtBillList.title = "选择销售出库欠款单据"
} else {
this.$message.warning('请选择客户!');
}
},
handleClear() {
this.accountTable.dataSource = []
}
}
}
</script>
<style scoped>
.action-button {
margin-bottom: 8px;
}
.gap {
padding-left: 8px;
}
</style>
@@ -1,297 +0,0 @@
<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" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addSupplier"><a-icon type="plus" /> 新增供应商</div>
</div>
<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="财务人员">
<a-select placeholder="选择财务人员" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addPerson"><a-icon type="plus" /> 新增经手人</div>
</div>
<a-select-option v-for="(item,index) in personList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
<j-date v-decorator="['billTime', validatorRules.billTime]" :show-time="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
<a-input placeholder="请输入单据编号" v-decorator.trim="[ 'billNo' ]" :readOnly="true"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<!-- 操作按钮 -->
<div class="action-button">
<a-button type="primary" icon="plus" @click="handleClickAdd">新增</a-button>
<span class="gap"></span>
<a-button type="primary" icon="minus" @click="handleClear">清空</a-button>
</div>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :span="24">
<j-editable-table
:ref="refKeys[0]"
:loading="accountTable.loading"
:columns="accountTable.columns"
:dataSource="accountTable.dataSource"
:maxHeight="300"
:rowNumber="false"
:rowSelection="false"
:actionButton="false"
@valueChange="onValueChange" />
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="24" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" style="margin-top:8px;"/>
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款账户">
<a-select placeholder="选择付款账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
</div>
<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="[ 'totalPrice' ]" :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="[ 'discountMoney', validatorRules.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="[ 'changeAmount' ]" :readOnly="true"/>
</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="附件">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<debt-bill-list ref="debtBillList" @ok="debtBillListOk"></debt-bill-list>
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
<person-modal ref="personModalForm" @ok="personModalFormOk"></person-modal>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import DebtBillList from '../dialog/DebtBillList'
import VendorModal from '../../system/modules/VendorModal'
import AccountModal from '../../system/modules/AccountModal'
import PersonModal from '../../system/modules/PersonModal'
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JDate from '@/components/jeecg/JDate'
export default {
name: "MoneyInModal",
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
DebtBillList,
VendorModal,
AccountModal,
PersonModal,
JUpload,
JDate,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title:"操作",
width: '100%',
moreStatus: false,
// 新增时子表默认添加几行空数据
addDefaultRowNum: 0,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
refKeys: ['accountDataTable', ],
activeKey: 'accountDataTable',
accountTable: {
loading: false,
dataSource: [],
columns: [
{ title: '采购单据编号',key: 'billNumber',width: '20%', type: FormTypes.input, readonly: true },
{ title: '应付欠款',key: 'needDebt', width: '10%', type: FormTypes.inputNumber, statistics: true, readonly: true },
{ title: '已付欠款', key: 'finishDebt', width: '10%', type: FormTypes.inputNumber, statistics: true, readonly: true },
{ title: '本次付款',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请输入${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '20%', type: FormTypes.input, placeholder: '请输入${title}'}
]
},
confirmLoading: false,
validatorRules:{
organId:{
rules: [{ required: true, message: '请选择供应商!' }]
},
handsPersonId:{
rules: [{ required: true, message: '请选择财务人员!' }]
},
billTime:{
rules: [{ required: true, message: '请选择单据日期!' }]
},
accountId:{
rules: [{ required: true, message: '请选择付款账户!' }]
},
discountMoney:{
rules: [{ required: true, message: '请输入优惠金额!' }]
},
changeAmount:{
rules: [{ required: true, message: '请输入收款金额!' }]
}
},
url: {
add: '/erp/accountHead/addAccountHeadAndDetail',
edit: '/erp/accountHead/updateAccountHeadAndDetail',
detailList: '/erp/accountItem/getDetailList'
}
}
},
created () {
},
methods: {
//调用完edit()方法之后会自动调用此方法
editAfter() {
if (this.action === 'add') {
this.addInit("FK")
this.fileList = []
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'accountId', 'totalPrice', 'discountMoney', 'changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
}
let url = this.readOnly ? this.url.detailList : this.url.detailList;
this.requestSubTableData(url, params, this.accountTable);
}
this.initSupplier()
this.initPerson()
this.initAccount()
},
//提交单据时整理成formData
classifyIntoFormData(allValues) {
let totalPrice = 0
let billMain = Object.assign(this.model, allValues.formValue)
let detailArr = allValues.tablesValue[0].values
billMain.type = '付款'
for(let item of detailArr){
totalPrice += item.eachAmount-0
}
billMain.totalPrice = 0-totalPrice
billMain.changeAmount = 0-billMain.changeAmount
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
return {
info: billMain,
rows: detailArr,
}
},
handleClickAdd() {
let organId = this.form.getFieldValue('organId')
if(organId){
this.$refs.debtBillList.show(organId, '入库', '采购', '供应商', "")
this.$refs.debtBillList.title = "选择采购入库欠款单据"
} else {
this.$message.warning('请选择供应商!');
}
},
handleClear() {
this.accountTable.dataSource = []
}
}
}
</script>
<style scoped>
.action-button {
margin-bottom: 8px;
}
.gap {
padding-left: 8px;
}
</style>
@@ -1,94 +0,0 @@
<!-- by 7527_18920 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<material-attribute-modal ref="modalForm" @ok="modalFormOk"></material-attribute-modal>
</a-card>
</a-col>
</a-row>
</template>
<script>
import MaterialAttributeModal from './modules/MaterialAttributeModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MaterialAttributeList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
MaterialAttributeModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {attributeField:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '属性名', dataIndex: 'attributeName', width: 100},
{title: '属性值(用竖线隔开)', dataIndex: 'attributeValue', width: 400},
{
title: '操作',
dataIndex: 'action',
width: 100,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/materialAttribute/list",
delete: "/erp/materialAttribute/delete",
deleteBatch: "/erp/materialAttribute/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
@@ -1,508 +0,0 @@
<!-- by 7527_18_920 -->
<template>
<a-row :gutter="10">
<a-col :md="12" :sm="24">
<a-card :bordered="false">
<!-- 按钮操作区域 -->
<a-row style="margin-left: 14px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd()" type="primary">添加类别</a-button>
<a-button v-if="btnEnableList.indexOf(1)>-1" title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>
<a-button @click="refresh" type="default" icon="reload">刷新</a-button>
</a-row>
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-alert type="info" :showIcon="true">
<div slot="message">
当前选择<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
</div>
</a-alert>
<!-- -->
<a-col :md="10" :sm="24">
<template>
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">
<span style="user-select: none">
<a-tree
checkable
multiple
@select="onSelect"
@check="onCheck"
@rightClick="rightHandle"
:selectedKeys="selectedKeys"
:checkedKeys="checkedKeys"
:treeData="categoryTree"
:checkStrictly="checkStrictly"
:expandedKeys="iExpandedKeys"
:autoExpandParent="true"
@expand="onExpand"/>
</span>
</a-dropdown>
</template>
</a-col>
</div>
</a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button">
<a-dropdown :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
</div>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col>
<a-col :md="12" :sm="24">
<a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
<a-input placeholder="请输入名称" v-decorator="['name', validatorRules.name ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
<a-input placeholder="请输入编号" v-decorator="['serialNo', validatorRules.serialNo ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级目录">
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
allow-clear :treeDefaultExpandAll="true"
:treeData="treeData" v-model="model.parentId" placeholder="请选择上级目录">
</a-tree-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input-number v-decorator="[ 'sort' ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
<a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="[ 'remark' ]" />
</a-form-item>
</a-form>
<div class="anty-form-btn">
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
</div>
</a-card>
<a-card v-else >
<a-empty>
<span slot="description"> 请先选择一个类别! </span>
</a-empty>
</a-card>
</a-col>
<material-category-modal ref="materialCategoryModal" @ok="loadTree"></material-category-modal>
</a-row>
</template>
<script>
import MaterialCategoryModal from '../material/modules/MaterialCategoryModal'
import pick from 'lodash.pick'
import {queryMaterialCategoryTreeList,queryMaterialCategoryById,checkMaterialCategory} from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
name: 'MaterialCategoryList',
mixins: [JeecgListMixin],
components: {
MaterialCategoryModal
},
data() {
return {
iExpandedKeys: [],
loading: false,
currFlowId: '',
currFlowName: '',
disable: true,
treeData: [],
visible: false,
categoryTree: [],
rightClickSelectedKey: '',
rightClickSelectedOrgCode: '',
hiding: true,
model: {},
dropTrigger: '',
category: {},
disableSubmit: false,
checkedKeys: [],
selectedKeys: [],
autoIncr: 1,
currSelected: {},
allTreeKeys:[],
checkStrictly: true,
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16}
},
graphDatasource: {
nodes: [],
edges: []
},
validatorRules:{
name: {
rules: [
{required: true, message: '请输入名称!'},
{ validator: this.validateName}
]
},
serialNo: {rules: [{required: true, message: '请输入编号!'}]}
},
url: {
delete: '/materialCategory/delete',
edit: '/materialCategory/update',
deleteBatch: '/materialCategory/deleteBatch'
},
orgCategoryDisabled:false,
}
},
computed: {
importExcelUrl: function () {
return `${process.env.VUE_APP_BASE_API}/${this.url.importExcelUrl}`;
}
},
methods: {
loadData() {
this.refresh();
},
loadTree() {
var that = this
that.treeData = []
that.categoryTree = []
let params = {};
params.id=0;
queryMaterialCategoryTreeList(params).then((res) => {
if (res) {
//类别全选后,再添加类别,选中数量增多
this.allTreeKeys = [];
for (let i = 0; i < res.length; i++) {
let temp = res[i]
that.treeData.push(temp)
that.categoryTree.push(temp)
that.setThisExpandedKeys(temp)
that.getAllKeys(temp);
// console.log(temp.id)
}
this.loading = false
}
})
},
setThisExpandedKeys(node) {
if (node.children && node.children.length > 0) {
this.iExpandedKeys.push(node.key)
for (let a = 0; a < node.children.length; a++) {
this.setThisExpandedKeys(node.children[a])
}
}
},
refresh() {
this.loading = true
this.loadTree()
},
// 右键操作方法
rightHandle(node) {
this.dropTrigger = 'contextmenu'
console.log(node.node.eventKey)
this.rightClickSelectedKey = node.node.eventKey
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys)
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.iExpandedKeys = expandedKeys
},
backFlowList() {
this.$router.back(-1)
},
// 右键点击下拉框改变事件
dropStatus(visible) {
if (visible == false) {
this.dropTrigger = ''
}
},
// 右键店家下拉关闭下拉框
closeDrop() {
this.dropTrigger = ''
},
addRootNode() {
this.$refs.nodeModal.add(this.currFlowId, '')
},
batchDel: function () {
console.log(this.checkedKeys)
if (this.checkedKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
} else {
var ids = ''
for (var a = 0; a < this.checkedKeys.length; a++) {
ids += this.checkedKeys[a] + ','
}
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据吗?',
onOk: function () {
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.code == 200) {
that.$message.success(res.msg)
that.loadTree()
that.onClearSelected()
} else {
that.$message.warning(res.msg)
}
})
}
})
}
},
nodeModalOk() {
this.loadTree()
},
nodeModalClose() {
},
hide() {
this.visible = false
},
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
this.hiding = false
//this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
if(this.checkStrictly){
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e)
this.hiding = false
let record = e.node.dataRef
let params = {};
params.id=record.id;
queryMaterialCategoryById(params).then((res) => {
if (res && res.code == 200) {
if(res.data){
record.name = res.data.name;
record.serialNo = res.data.serialNo;
record.parentId = res.data.parentId;
record.sort = res.data.sort;
record.remark = res.data.remark;
console.log('onSelect-record', record)
this.currSelected = Object.assign({}, record)
this.model = this.currSelected
this.selectedKeys = [record.key]
this.model.parentId = record.parentId
this.setValuesToForm(record)
}
}
});
},
// 触发onSelect事件时,为类别树右侧的form表单赋值
setValuesToForm(record) {
this.$nextTick(() => {
this.form.setFieldsValue(pick(record, 'name','serialNo', 'parentId', 'sort', 'remark'))
})
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
},
onClearSelected() {
this.hiding = true
this.checkedKeys = []
this.currSelected = {}
this.form.resetFields()
this.selectedKeys = []
},
handleNodeTypeChange(val) {
this.currSelected.nodeType = val
},
notifyTriggerTypeChange(value) {
this.currSelected.notifyTriggerType = value
},
receiptTriggerTypeChange(value) {
this.currSelected.receiptTriggerType = value
},
submitCurrForm() {
this.form.validateFields((err, values) => {
if (!err) {
if (!this.currSelected.id) {
this.$message.warning('请点击选择要修改类别!')
return
}
let formData = Object.assign(this.currSelected, values)
console.log('Received values of form: ', formData)
httpAction(this.url.edit, formData, 'put').then((res) => {
if (res.code == 200) {
this.$message.success('保存成功!')
this.loadTree()
} else {
this.$message.error(res.message)
}
})
}
})
},
emptyCurrForm() {
this.form.resetFields()
},
nodeSettingFormSubmit() {
this.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values)
}
})
},
openSelect() {
this.$refs.sysDirectiveModal.show()
},
validateName(rule, value, callback){
let params = {
name: value,
id: this.model.id?this.model.id:0
};
checkMaterialCategory(params).then((res)=>{
if(res && res.code===200) {
if(!res.data.status){
callback();
} else {
callback("名称已经存在");
}
} else {
callback(res.data);
}
});
},
handleAdd() {
this.$refs.materialCategoryModal.add()
this.$refs.materialCategoryModal.title = '新增'
},
selectDirectiveOk(record) {
console.log('选中指令数据', record)
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode})
this.currSelected.sysCode = record.sysCode
},
getFlowGraphData(node) {
this.graphDatasource.nodes.push({
id: node.id,
text: node.flowNodeName
})
if (node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
let temp = node.children[a]
this.graphDatasource.edges.push({
source: node.id,
target: temp.id
})
this.getFlowGraphData(temp)
}
}
},
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () {
this.iExpandedKeys = this.allTreeKeys
},
closeAll () {
this.iExpandedKeys = []
},
checkALL () {
this.checkStriccheckStrictlytly = false
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
getAllKeys(node) {
// console.log('node',node);
this.allTreeKeys.push(node.key)
if (node.children && node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
this.getAllKeys(node.children[a])
}
}
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
created() {
this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name
// this.loadTree()
},
}
</script>
<style scoped>
.ant-card-body .table-operator {
margin: 15px;
}
.anty-form-btn {
width: 100%;
text-align: center;
}
.anty-form-btn button {
margin: 0 5px;
}
.anty-node-layout .ant-layout-header {
padding-right: 0
}
.header {
padding: 0 8px;
}
.header button {
margin: 0 3px
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
#app .desktop {
height: auto !important;
}
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.drawer-bootom-button {
/*position: absolute;*/
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: left;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
-294
View File
@@ -1,294 +0,0 @@
<!-- by 7527189 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" allow-clear
:treeData="categoryTree" v-model="queryParam.categoryId" placeholder="请选择类别">
</a-tree-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入物料编码查询" v-model="queryParam.barCode"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入规格查询" v-model="queryParam.standard"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入型号查询" v-model="queryParam.model"></a-input>
</a-form-item>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-popover title="表格模板">
<template slot="content">
<p><a target="_blank" href="/doc/goods_template.xls"><b>商品Excel模板下载</b></a></p>
</template>
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('商品信息')">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
<a-menu-item key="4" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetMaterialCurrentStock()"><a-icon type="stock"/>修正库存</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
:components="drag(columns)"
>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<template slot="customRenderEnabled" slot-scope="enabled">
<a-tag v-if="enabled" color="green">启用</a-tag>
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
</template>
<template slot="customRenderEnableSerialNumber" slot-scope="enableSerialNumber">
<a-tag v-if="enableSerialNumber==1" color="green"></a-tag>
<a-tag v-if="enableSerialNumber==0" color="orange"></a-tag>
</template>
<template slot="customRenderEnableBatchNumber" slot-scope="enableBatchNumber">
<a-tag v-if="enableBatchNumber==1" color="green"></a-tag>
<a-tag v-if="enableBatchNumber==0" color="orange"></a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<material-modal ref="modalForm" @ok="modalFormOk"></material-modal>
</a-card>
</a-col>
</a-row>
</template>
<script>
import MaterialModal from './modules/MaterialModal'
import {queryMaterialCategoryTreeList} from '@/api/api'
import { postAction } from '@/api/manage'
import { getMpListShort } from "@/utils/util"
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResize from '@/mixins/tableDragResizeMixin'
export default {
name: "MaterialList",
mixins:[JeecgListMixin,tableDragResize],
components: {
MaterialModal,
JDate,
ListColumnsSetter
},
data () {
return {
categoryTree:[],
mPropertyListShort: '',
model: {},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
categoryId:'',
barCode:'',
name:'',
standard:'',
model:'',
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
},
// 表头
columns: [
{title: '物料编码', dataIndex: 'mBarCode' , width: 100, align: 'center' },
{title: '名称', dataIndex: 'name' , width: 80 , ellipsis:true, align: 'center'},
{title: '规格', dataIndex: 'standard' , width: 80 , ellipsis:true, align: 'center'},
{title: '型号', dataIndex: 'model', ellipsis:true, align: 'center', width: 80},
{title: '颜色', dataIndex: 'color', ellipsis:true, align: 'center', width: 80},
{title: '类别', dataIndex: 'categoryName', ellipsis:true,align: 'center', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', ellipsis:true, align: 'center', width: 80},
{title: '单位', dataIndex: 'unit', ellipsis:true, align: 'center', width: 80,
customRender:function (t,r,index) {
if (r) {
let name = t?t:r.unitName
if(r.sku) {
return name + '[SKU]';
} else {
return name;
}
}
}
},
{title: '保质期', dataIndex: 'expiryNum', align: 'center', width: 80},
{title: '库存', dataIndex: 'stock', align: 'center', width: 80},
{title: '采购价', dataIndex: 'purchaseDecimal', align: 'center', width: 80},
{title: '零售价', dataIndex: 'commodityDecimal', align: 'center', width: 80},
{title: '销售价', dataIndex: 'wholesaleDecimal', align: 'center', width: 80},
{title: '最低售价', dataIndex: 'lowDecimal', align: 'center', width: 80},
{title: '状态', dataIndex: 'enabled', align: "center", align: 'center', width: 80,
scopedSlots: { customRender: 'customRenderEnabled' }
},
{title: '序列号', dataIndex: 'enableSerialNumber', align: "center", width: 80,
scopedSlots: { customRender: 'customRenderEnableSerialNumber' }
},
{title: '批号', dataIndex: 'enableBatchNumber', align: "center", width: 80,
scopedSlots: { customRender: 'customRenderEnableBatchNumber' }
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width: 80,
scopedSlots: { customRender: 'action' },
}
],
defColumns: [
{title: '型号', dataIndex: 'model', ellipsis:true, align: 'center', width: 80},
{title: '颜色', dataIndex: 'color', ellipsis:true, align: 'center', width: 80},
{title: '类别', dataIndex: 'categoryName', ellipsis:true,align: 'center', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', ellipsis:true, align: 'center', width: 80},
{title: '零售价', dataIndex: 'commodityDecimal', align: 'center', width: 80},
{title: '最低售价', dataIndex: 'lowDecimal', align: 'center', width: 80}
],
url: {
list: "/erp/material/list",
delete: "/erp/material/delete",
deleteBatch: "/erp/material/deleteBatch",
importExcelUrl: "/erp/material/importExcel",
exportXlsUrl: "/erp/material/exportExcel",
batchSetStatusUrl: "/erp/material/batchSetStatus",
batchSetMaterialCurrentStockUrl: "/erp/material/batchSetMaterialCurrentStock"
}
}
},
created() {
this.model = Object.assign({}, {});
this.loadTreeData();
},
computed: {
importExcelUrl: function () {
return `${process.env.VUE_APP_BASE_API}${this.url.importExcelUrl}`;
}
},
methods: {
loadTreeData(){
let that = this;
let params = {};
params.id='';
queryMaterialCategoryTreeList(params).then((res)=>{
if(res){
that.categoryTree = [];
for (let i = 0; i < res.length; i++) {
let temp = res[i];
that.categoryTree.push(temp);
}
}
})
},
batchSetMaterialCurrentStock: function () {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
} else {
let ids = "";
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
let that = this;
this.$confirm({
title: "确认操作",
content: "是否操作选中数据?",
onOk: function () {
that.loading = true;
postAction(that.url.batchSetMaterialCurrentStockUrl, {ids: ids}).then((res) => {
if(res.code === 200){
that.$message.info('修正库存成功!');
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.msg);
}
}).finally(() => {
that.loading = false;
});
}
});
}
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
@@ -1,123 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<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.name"></a-input>
</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>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="enabled">
<a-tag v-if="enabled==1" color="green">启用</a-tag>
<a-tag v-if="enabled==0" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<material-property-modal ref="modalForm" @ok="modalFormOk"></material-property-modal>
</a-card>
</a-col>
</a-row>
</template>
<script>
import MaterialPropertyModal from './modules/MaterialPropertyModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MaterialPropertyList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
MaterialPropertyModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',type:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '名称', dataIndex: 'nativeName', width: 100},
{
title: '是否启用', dataIndex: 'enabled', width: 100, align: "center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{title: '排序', dataIndex: 'sort', width: 100},
{title: '别名', dataIndex: 'anotherName', width: 100},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/materialProperty/list",
delete: "/erp/materialProperty/delete",
deleteBatch: "/erp/materialProperty/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
@@ -1,94 +0,0 @@
<template>
<a-modal
:title="title"
:width="500"
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:35%;height: 30%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
关闭
</a-button>
</template>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="请输入价格">
<a-input placeholder="请输入价格" v-decorator.trim="[ 'price', validatorRules.price]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
export default {
name: 'BatchSetPriceModal',
data () {
return {
title:"批量设置",
visible: false,
isReadOnly: false,
batchType: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
price:{
rules: [
{ required: true, message: '请输入价格!' }
]}
}
}
},
created () {
},
methods: {
add (type) {
this.batchType = type
if(type === 'purchase') {
this.title = '采购价-批量设置'
} else if(type === 'commodity') {
this.title = '零售价-批量设置'
} else if(type === 'wholesale') {
this.title = '销售价-批量设置'
} else if(type === 'low') {
this.title = '最低售价-批量设置'
}
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
let price = this.form.getFieldValue('price')
this.$emit('ok', price, this.batchType);
this.visible = false
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
@@ -1,92 +0,0 @@
<template>
<a-modal
:title="title"
:width="500"
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:35%;height: 30%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
关闭
</a-button>
</template>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="请输入数量">
<a-input placeholder="请输入数量" v-decorator.trim="[ 'number', validatorRules.number]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
export default {
name: 'BatchSetStockModal',
data () {
return {
title:"批量设置",
visible: false,
isReadOnly: false,
batchType: '',
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
number:{
rules: [
{ required: true, message: '请输入数量!' }
]}
}
}
},
created () {
},
methods: {
add (type) {
this.batchType = type
if(type === 'initStock') {
this.title = '期初库存-批量设置'
} else if(type === 'lowSafeStock') {
this.title = '最低安全库存-批量设置'
} else if(type === 'highSafeStock') {
this.title = '最高安全库存-批量设置'
}
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
let number = this.form.getFieldValue('number')
this.$emit('ok', number, this.batchType);
this.visible = false
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
@@ -1,137 +0,0 @@
<template>
<a-modal
:title="title"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:20%;height: 50%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
关闭
</a-button>
</template>
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="属性名">
<a-input placeholder="请输入属性名" v-decorator.trim="[ 'attributeName', validatorRules.attributeName]" />
</a-form-item>
</a-form>
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="属性值">
<a-textarea :rows="2" placeholder="请输入属性值(用竖线隔开)" v-decorator.trim="[ 'attributeValue', validatorRules.attributeValue]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import {addMaterialAttribute,editMaterialAttribute,checkMaterialAttribute } from '@/api/api'
export default {
name: "MaterialAttributeModal",
data () {
return {
title:"操作",
visible: false,
model: {},
isReadOnly: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
attributeName:{
rules: [
{ required: true, message: '请输入属性名!' },
{ min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' },
{ validator: this.validateAttributeName}
]
},
attributeValue:{
rules: [
{ required: true, message: '请输入属性值(用竖线隔开)!' }
]
}
}
}
},
created () {
},
methods: {
add () {
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'attributeName', 'attributeValue'))
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
let obj;
if(!this.model.id){
obj=addMaterialAttribute(formData);
}else{
obj=editMaterialAttribute(formData);
}
obj.then((res)=>{
if(res.code === 200){
that.$emit('ok');
}else{
that.$message.warning(res.msg);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
validateAttributeName(rule, value, callback){
let params = {
name: value,
id: this.model.id?this.model.id:0
};
checkMaterialAttribute(params).then((res)=>{
if(res && res.code===200) {
if(!res.data.status){
callback();
} else {
callback("名称已经存在");
}
} else {
callback(res.data);
}
});
}
}
}
</script>
<style scoped>
</style>
@@ -1,167 +0,0 @@
<template>
<a-modal
:title="title"
:width="800"
:ok=false
:visible="visible"
:confirmLoading="confirmLoading"
:okButtonProps="{ props: {disabled: disableSubmit} }"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
<a-input placeholder="请输入名称" v-decorator="['name', validatorRules.name ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
<a-input placeholder="请输入编号" v-decorator="['serialNo', validatorRules.serialNo ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级目录">
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
allow-clear :treeDefaultExpandAll="true"
:treeData="categoryTree" v-model="model.parentId" placeholder="请选择上级目录">
</a-tree-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input-number v-decorator="[ 'sort' ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
<a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="[ 'remark' ]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { queryMaterialCategoryTreeList, checkMaterialCategory } from '@/api/api'
import pick from 'lodash.pick'
import ATextarea from 'ant-design-vue/es/input/TextArea'
export default {
name: "MaterialCategoryModal",
components: { ATextarea },
data () {
return {
categoryTree:[],
orgTypeData:[],
phoneWarning:'',
departName:"",
title:"操作",
visible: false,
disableSubmit:false,
model: {},
menuhidden:false,
menuusing:true,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
name: {
rules: [
{required: true, message: '请输入名称!'},
{ validator: this.validateName}
]
},
serialNo: {rules: [{required: true, message: '请输入编号!'}]}
},
url: {
add: "/erp/materialCategory/add",
}
}
},
created () {
},
methods: {
loadTreeData(){
var that = this;
let params = {};
params.id='';
queryMaterialCategoryTreeList(params).then((res)=>{
if(res){
that.categoryTree = [];
for (let i = 0; i < res.length; i++) {
let temp = res[i];
that.categoryTree.push(temp);
}
}
})
},
add () {
this.edit();
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, {});
this.visible = true;
this.loadTreeData();
this.$nextTick(() => {
this.form.setFieldsValue(pick(record, 'name','serialNo', 'parentId', 'sort', 'remark'))
});
},
close () {
this.$emit('close');
this.disableSubmit = false;
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
//时间格式化
console.log(formData)
httpAction(this.url.add,formData,"post").then((res)=>{
if(res.code == 200){
that.$message.success(res.msg);
that.loadTreeData();
that.$emit('ok');
}else{
that.$message.warning(res.msg);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
validateName(rule, value, callback){
let params = {
name: value,
id: this.model.id?this.model.id:0
};
checkMaterialCategory(params).then((res)=>{
if(res && res.code===200) {
if(!res.data.status){
callback();
} else {
callback("名称已经存在");
}
} else {
callback(res.data);
}
});
}
}
}
</script>
<style scoped>
</style>
File diff suppressed because it is too large Load Diff
@@ -1,117 +0,0 @@
<template>
<a-modal
:title="title"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:20%;height: 70%;overflow-y: hidden">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
<a-input placeholder="请输入名称" v-decorator.trim="[ 'nativeName' ]" :readOnly="model.id"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="是否启用">
<a-switch checked-children="启用" un-checked-children="禁用" v-model="enabledSwitch" @change="onChange"></a-switch>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input placeholder="请输入排序" v-decorator.trim="[ 'sort', validatorRules.sort]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="别名">
<a-input placeholder="请输入别名" v-decorator.trim="[ 'anotherName' ]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import {editMaterialProperty } from '@/api/api'
export default {
name: "MaterialPropertyModal",
data () {
return {
title:"操作",
visible: false,
model: {},
enabledSwitch: true, //是否启用
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
name:{
rules: [
{ required: true, message: '请输入名称!' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
]
}
},
}
},
created () {
},
methods: {
onChange(checked) {
this.model.enabled = checked
},
add () {
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
if(record.enabled!=null){
this.enabledSwitch = record.enabled?true:false;
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'nativeName', 'enabled', 'sort', 'anotherName'))
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
let obj;
if(this.model.id){
obj=editMaterialProperty(formData);
}
obj.then((res)=>{
if(res.code === 200){
that.$emit('ok');
}else{
that.$message.warning(res.msg);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
-181
View File
@@ -1,181 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称" v-model="queryParam.search.name"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入编号" v-model="queryParam.search.serialNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item>
<span>本月发生总额{{allMonthAmount}}当前总余额{{allCurrentAmount}}</span>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="showAccountInOutList(record)">{{record.id?'流水':''}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<account-in-out-list ref="accountInOutList" @ok="modalFormOk"></account-in-out-list>
</a-card>
</a-col>
</a-row>
</template>
<script>
import AccountInOutList from './modules/AccountInOutList'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JEllipsis from '@/components/jeecg/JEllipsis'
import {getAction} from '@/api/manage'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AccountReport",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
AccountInOutList,
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
search: {
name:'',
serialNo:''
}
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
allMonthAmount: '',
allCurrentAmount: '',
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:60, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{ title: '名称', dataIndex: 'name', width: 100},
{ title: '编号', dataIndex: 'serialNo', width: 150},
{ title: '期初金额', dataIndex: 'initialAmount', sorter: (a, b) => a.initialAmount - b.initialAmount, width: 100},
{ title: '本月发生额', dataIndex: 'thisMonthAmount', sorter: (a, b) => a.thisMonthAmount - b.thisMonthAmount, width: 100},
{ title: '当前余额', dataIndex: 'currentAmount', sorter: (a, b) => a.currentAmount - b.currentAmount, width: 100},
{ title: '账户流水', dataIndex: 'action', align:"center", width: 200,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/erp/account/list",
getStatistics: "/erp/account/getStatistics"
}
}
},
created () {
this.getAccountStatistics()
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
getAccountStatistics() {
getAction(this.url.getStatistics, this.queryParam.search).then((res)=>{
if(res && res.code === 200) {
if(res.data){
this.allMonthAmount = res.data.allMonthAmount
this.allCurrentAmount = res.data.allCurrentAmount
}
}
})
},
searchQuery() {
this.loadData(1);
this.getAccountStatistics();
},
showAccountInOutList(record) {
this.$refs.accountInOutList.show(record);
this.$refs.accountInOutList.title = "查看账户流水";
this.$refs.accountInOutList.disableSubmit = false;
},
exportExcel() {
let aoa = [['名称', '编号', '期初金额', '本月发生额', '账户流水']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.name, ds.serialNo, ds.initialAmount, ds.thisMonthAmount, ds.currentAmount]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '账户统计')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-258
View File
@@ -1,258 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<!-- 用的InDetail修改 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域
projectId 调出仓库
projectIdto 调入仓库
-->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="3" :sm="24">
<a-form-item label="调出仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
:dropdownMatchSelectWidth="false"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotIdF">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="3" :sm="24">
<a-form-item label="调入仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
:dropdownMatchSelectWidth="false"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import BillDetail from '../bill/dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import {getAction} from '@/api/manage'
import {findBySelectSup, findBillDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AllocationDetail",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
organId: '',
number: '',
materialParam:'',
depotId: '',
depotIdF: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
subType: "调拨"
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{
title: '单据编号', dataIndex: 'number', width: 100,
scopedSlots: { customRender: 'numberCustomRender' },
},
{title: '物料编码', dataIndex: 'barCode', width: 80},
{title: '名称', dataIndex: 'mname', width: 120},
{title: '规格', dataIndex: 'standard', width: 60},
{title: '型号', dataIndex: 'model', width: 60},
{title: '单位', dataIndex: 'mUnit', width: 60},
{title: '数量', dataIndex: 'operNumber', sorter: (a, b) => a.operNumber - b.operNumber, width: 60},
{title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60},
{title: '金额', dataIndex: 'allPrice', sorter: (a, b) => a.allPrice - b.allPrice, width: 60},
{title: '调出仓库', dataIndex: 'dname', width: 80},
{title: '调入仓库', dataIndex: 'sname', width: 80},
{title: '调拨日期', dataIndex: 'operTime', width: 80},
{title: '备注', dataIndex: 'newRemark', width: 100}
],
url: {
list: "/erp/depotHead/findAllocationDetail",
}
}
},
created () {
this.getDepotData()
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
myHandleDetail(record) {
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
this.handleDetail(res.data, record.newType);
}
})
},
searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['单据编号', '物料编码', '名称', '规格', '型号', '单位', '数量', '单价', '金额', '调出仓库', '调入仓库', '调拨日期', '备注']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber,
ds.unitPrice, ds.allPrice, ds.dname, ds.sname, ds.operTime, ds.newRemark]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '调拨明细')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-164
View File
@@ -1,164 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="月份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-month-picker placeholder="请选择月份" :default-value="moment(currentMonth, monthFormat)"
style="width:100%" :format="monthFormat" @change="onChange"/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getMpListShort, openDownloadDialog, sheet2blob} from "@/utils/util"
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import Vue from 'vue'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "BuyInReport",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
// 查询条件
currentMonth: moment().format('YYYY-MM'),
monthFormat: 'YYYY-MM',
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
queryParam: {
monthTime: moment().format('YYYY-MM'),
materialParam:'',
mpList: getMpListShort(Vue.ls.get('materialPropertyList'))
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '物料编码', dataIndex: 'barCode', width: 160},
{title: '名称', dataIndex: 'materialName', width: 160},
{title: '规格', dataIndex: 'materialStandard', width: 80},
{title: '型号', dataIndex: 'materialModel', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', width: 150},
{title: '单位', dataIndex: 'materialUnit', width: 80},
{title: '采购数量', dataIndex: 'inSum', sorter: (a, b) => a.inSum - b.inSum, width: 80},
{title: '采购金额', dataIndex: 'inSumPrice', sorter: (a, b) => a.inSumPrice - b.inSumPrice, width: 80},
{title: '退货数量', dataIndex: 'outSum', sorter: (a, b) => a.outSum - b.outSum, width: 80},
{title: '退货金额', dataIndex: 'outSumPrice', sorter: (a, b) => a.outSumPrice - b.outSumPrice, width: 80},
{title: '实际采购金额', dataIndex: 'inOutSumPrice', sorter: (a, b) => a.inOutSumPrice - b.inOutSumPrice, width: 100}
],
url: {
list: "/erp/depotItem/buyIn"
}
}
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.monthTime = this.queryParam.monthTime;
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onChange: function (value, dateString) {
this.queryParam.monthTime=dateString;
},
searchQuery() {
if(this.queryParam.monthTime == ''){
this.$message.warning('请选择月份!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['物料编码', '名称', '规格', '型号', '扩展信息', '单位', '进货数量', '进货金额', '退货数量', '退货金额', '实际采购金额']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit,
ds.inSum, ds.inSumPrice, ds.outSum, ds.outSumPrice, ds.inOutSumPrice]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '进货统计')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-246
View File
@@ -1,246 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children">
<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 :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item>
{{firstTotal}} {{lastTotal}}
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalBillDetail"></bill-detail>
<financial-detail ref="modalFinancialDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import BillDetail from '../bill/dialog/BillDetail'
import FinancialDetail from '../financial/dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import { getAction } from '@/api/manage'
import {findBySelectCus, findBillDetailByNumber, findFinancialDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "CustomerAccount",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
FinancialDetail,
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
supType: "客户",
organId: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
firstTotal: '',
lastTotal: '',
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{
title: '单据编号', dataIndex: 'number', width: 140,
scopedSlots: { customRender: 'numberCustomRender' },
},
{title: '类型', dataIndex: 'type', width: 100},
{title: '单位名称', dataIndex: 'supplierName', width: 200},
{title: '单据金额', dataIndex: 'billMoney', width: 80},
{title: '实际支付', dataIndex: 'changeAmount', width: 80},
{title: '本期变化', dataIndex: 'allPrice', width: 80},
{title: '单据日期', dataIndex: 'oTime', width: 160}
],
url: {
list: "/erp/depotHead/findStatementAccount",
}
}
},
created () {
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
initSupplier() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
myHandleDetail(record) {
if(record.type === '收入' || record.type === '收款') {
findFinancialDetailByNumber({ billNo: record.number }).then((res) => {
if (res && res.code === 200) {
this.$refs.modalFinancialDetail.show(res.data, record.type);
this.$refs.modalFinancialDetail.title="详情";
}
})
} else {
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
this.$refs.modalBillDetail.show(res.data, record.type);
this.$refs.modalBillDetail.title="详情";
}
})
}
},
loadData(arg) {
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
let params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.code===200) {
this.dataSource = res.data.rows;
this.ipagination.total = res.data.total;
this.tableAddTotalRow(this.columns, this.dataSource)
if(this.queryParam.organId) {
this.firstTotal = '期初应收:' + res.data.firstMoney + ""
this.lastTotal = '期末应收:' + res.data.lastMoney
}
}
if(res.code===510){
this.$message.warning(res.data)
}
this.loading = false;
})
},
searchQuery() {
if(this.queryParam.beginTime === '' || this.queryParam.endTime === ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['单据编号', '类型', '单位名称', '单据金额', '实际支付', '本期变化', '单据日期']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.number, ds.type, ds.supplierName, ds.billMoney, ds.changeAmount, ds.allPrice, ds.oTime]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '客户对账')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-250
View File
@@ -1,250 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="3" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children">
<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 :md="3" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
:dropdownMatchSelectWidth="false"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import BillDetail from '../bill/dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import {getAction} from '@/api/manage'
import {findBySelectSup, findBillDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "InDetail",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
organId: '',
number: '',
materialParam:'',
depotId: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
type: "入库"
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{
title: '单据编号', dataIndex: 'number', width: 100,
scopedSlots: { customRender: 'numberCustomRender' },
},
{title: '物料编码', dataIndex: 'barCode', width: 80},
{title: '名称', dataIndex: 'mname', width: 120},
{title: '规格', dataIndex: 'standard', width: 60},
{title: '型号', dataIndex: 'model', width: 60},
{title: '单位', dataIndex: 'mUnit', width: 60},
{title: '数量', dataIndex: 'operNumber', sorter: (a, b) => a.operNumber - b.operNumber, width: 60},
{title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60},
{title: '金额', dataIndex: 'allPrice', sorter: (a, b) => a.allPrice - b.allPrice, width: 60},
{title: '供应商', dataIndex: 'sname', width: 80},
{title: '仓库', dataIndex: 'dname', width: 80},
{title: '入库日期', dataIndex: 'operTime', width: 80},
{title: '备注', dataIndex: 'newRemark', width: 100}
],
url: {
list: "/erp/depotHead/findInDetail",
}
}
},
created () {
this.getDepotData()
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
myHandleDetail(record) {
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
this.handleDetail(res.data, record.newType);
}
})
},
searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['单据编号', '物料编码', '名称', '规格', '型号', '单位', '数量', '单价', '金额', '供应商', '仓库', '入库日期', '备注']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber, ds.unitPrice,
ds.allPrice, ds.sname, ds.dname, ds.operTime, ds.newRemark]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '入库明细')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-220
View File
@@ -1,220 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children">
<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 :md="4" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import {getAction} from '@/api/manage'
import {findBySelectSup} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "InMaterialCount",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
organId: '',
materialParam:'',
depotId: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
type: "入库"
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '物料编码', dataIndex: 'barCode', width: 120},
{title: '名称', dataIndex: 'mName', width: 120},
{title: '规格', dataIndex: 'standard', width: 100},
{title: '型号', dataIndex: 'model', width: 100},
{title: '类型', dataIndex: 'categoryName', width: 120},
{title: '单位', dataIndex: 'materialUnit', width: 120},
{title: '入库数量', dataIndex: 'numSum', sorter: (a, b) => a.numSum - b.numSum, width: 120},
{title: '入库金额', dataIndex: 'priceSum', sorter: (a, b) => a.priceSum - b.priceSum, width: 120}
],
url: {
list: "/erp/depotHead/findInOutMaterialCount",
}
}
},
created () {
this.getDepotData()
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['物料编码', '名称', '规格', '型号', '类型', '单位', '入库数量', '入库金额']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.barCode, ds.mName, ds.standard, ds.model, ds.categoryName, ds.materialUnit, ds.numSum, ds.priceSum]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '入库汇总')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-226
View File
@@ -1,226 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
mode="multiple" :maxTagCount="1"
optionFilterProp="children"
showSearch style="width: 100%"
placeholder="请选择仓库"
v-model="depotSelected">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="月份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-month-picker placeholder="请选择月份" :default-value="moment(currentMonth, monthFormat)"
style="width:100%" :format="monthFormat" @change="onChange"/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item>
<span>总结存金额{{totalCountMoneyStr}}</span>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@/api/manage'
import { getMpListShort, openDownloadDialog, sheet2blob} from "@/utils/util"
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import Vue from 'vue'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "InOutStockReport",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
// 查询条件
currentMonth: moment().format('YYYY-MM'),
monthFormat: 'YYYY-MM',
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
queryParam: {
depotId:'',
monthTime: moment().format('YYYY-MM'),
materialParam:'',
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
depotSelected:[],
depotList: [],
totalCountMoneyStr: '0元',
disableMixinCreated: true,
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '物料编码', dataIndex: 'barCode', width: 100},
{title: '名称', dataIndex: 'materialName', width: 120},
{title: '规格', dataIndex: 'materialStandard', width: 80},
{title: '型号', dataIndex: 'materialModel', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', width: 80},
{title: '单位', dataIndex: 'unitName', width: 60},
{title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60},
{title: '上月结存数量', dataIndex: 'prevSum', sorter: (a, b) => a.prevSum - b.prevSum, width: 80},
{title: '入库数量', dataIndex: 'inSum', sorter: (a, b) => a.inSum - b.inSum, width: 60},
{title: '出库数量', dataIndex: 'outSum', sorter: (a, b) => a.outSum - b.outSum, width: 60},
{title: '本月结存数量', dataIndex: 'thisSum', sorter: (a, b) => a.thisSum - b.thisSum, width: 80},
{title: '结存金额', dataIndex: 'thisAllPrice', sorter: (a, b) => a.thisAllPrice - b.thisAllPrice, width: 60}
],
url: {
list: "/erp/depotItem/findByAll",
totalCountMoney: "/erp/depotItem/totalCountMoney",
exportXlsUrl: "/erp/depotItem/exportExcel"
}
}
},
created() {
this.getDepotData()
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
if(this.depotSelected && this.depotSelected.length>0) {
param.depotIds = this.depotSelected.join()
}
param.monthTime = this.queryParam.monthTime;
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
getTotalCountMoney(){
let param = Object.assign({}, this.queryParam, this.isorter);
if(this.depotSelected && this.depotSelected.length>0) {
param.depotIds = this.depotSelected.join()
}
param.monthTime = this.queryParam.monthTime;
getAction(this.url.totalCountMoney, param).then((res)=>{
if(res && res.code === 200) {
let count = res.data.totalCount.toString();
if (count.lastIndexOf('.') > -1) {
count = count.substring(0, count.lastIndexOf('.') + 3);
}
this.totalCountMoneyStr = count + "";
}
})
},
onChange: function (value, dateString) {
console.log(dateString);
this.queryParam.monthTime=dateString;
},
searchQuery() {
if(this.depotSelected.length===0){
this.$message.warning('请选择仓库!')
} else if(this.queryParam.monthTime == ''){
this.$message.warning('请选择月份!')
} else {
this.loadData(1);
this.getTotalCountMoney();
}
},
exportExcel() {
let aoa = [['物料编码', '名称', '规格', '型号', '扩展信息', '单位', '单价', '上月结存数量', '入库数量', '出库数量', '本月结存数量', '结存金额']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.unitName, ds.unitPrice,
ds.prevSum, ds.inSum, ds.outSum, ds.thisSum, ds.thisAllPrice]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '进销存统计')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-271
View File
@@ -1,271 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
mode="multiple" :maxTagCount="1"
optionFilterProp="children"
showSearch style="width: 100%"
placeholder="请选择仓库"
v-model="depotSelected">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="3" :sm="24">
<a-form-item label="类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" allow-clear
:treeData="categoryTree" v-model="queryParam.categoryId" placeholder="请选择类别">
</a-tree-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="3" :sm="24">
<a-form-item label="零库存" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.zeroStock">
<a-select-option value="0">隐藏</a-select-option>
<a-select-option value="1">显示</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item>
<span>总库存{{currentStock}}总库存金额{{currentStockPrice}}</span>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :md="2.5" :sm="24">
<list-columns-setter v-model="columns" :def-columns="columns" style="float: right;"/>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange"
:components="drag(columns)"
>
<span slot="action" slot-scope="text, record">
<a @click="showMaterialInOutList(record)">{{record.id?'流水':''}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<material-in-out-list ref="materialInOutList" @ok="modalFormOk"></material-in-out-list>
</a-card>
</a-col>
</a-row>
</template>
<script>
import MaterialInOutList from './modules/MaterialInOutList'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@/api/manage'
import {queryMaterialCategoryTreeList} from '@/api/api'
import { getMpListShort, openDownloadDialog, sheet2blob} from "@/utils/util"
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import Vue from 'vue'
import ListColumnsSetter from '@/components/ListColumnsSetter'
import tableDragResize from '@/mixins/tableDragResizeMixin'
export default {
name: "MaterialStock",
mixins:[JeecgListMixin, tableDragResize],
components: {
MaterialInOutList,
JEllipsis,
ListColumnsSetter
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
categoryId:'',
materialParam:'',
zeroStock: '0',
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
depotSelected:[],
depotList: [],
categoryTree:[],
currentStock: '',
currentStockPrice: '',
// 表头
columns: [
// {
// title: '#', dataIndex: 'rowIndex', width:40, align:"center",
// customRender:function (t,r,index) {
// return (t !== '合计') ? (parseInt(index) + 1) : t
// }
// },
{title: '编号', dataIndex: 'id', sorter: (b, a) => b.id - a.id,defaultSortOrder: 'descend', width: 50, align: 'center'},
{title: '物料编码', dataIndex: 'mBarCode', width: 80, align: 'center'},
{title: '名称', dataIndex: 'name', width: 140, align: 'center'},
{title: '规格', dataIndex: 'standard', width: 80, align: 'center'},
{title: '型号', dataIndex: 'model', width: 80, align: 'center'},
{title: '颜色', dataIndex: 'color', width: 80, align: 'center'},
{title: '类别', dataIndex: 'categoryName', width: 80, align: 'center'},
{title: '单位', dataIndex: 'unitName', width: 60, align: 'center'},
{title: '加权单价', dataIndex: 'weightPrice', width: 60, align: 'center'},
{title: '采购价', dataIndex: 'purchaseDecimal', width: 60, align: 'center'},
{title: '期初库存', dataIndex: 'initialStock', width: 60, align: 'center'},
{title: '期初金额',dataIndex:'initialPrice',align: 'center', width: 60},
{title:'入库金额' ,dataIndex:'intoPrice',align: 'center', width: 60},
{title:'入库数量' ,dataIndex:'intoStock',align: 'center', width: 60},
{title:'出库金额' ,dataIndex:'outPrice',align: 'center', width: 60},
{title:'出库数量' ,dataIndex:'outStock',align: 'center', width: 60},
{title: '库存', dataIndex: 'currentStock', width: 60, align: 'center'},
{title: '库存金额', dataIndex: 'currentStockPrice', sorter: (a, b) => a.currentStockPrice - b.currentStockPrice, width: 80, align: 'center'},
{ title: '库存流水', dataIndex: 'action', align:"center", width: 100, align: 'center',
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/erp/material/getListWithStock"
}
}
},
created() {
this.getDepotData()
this.loadTreeData()
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
if(this.depotSelected && this.depotSelected.length>0) {
param.depotIds = this.depotSelected.join()
}
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
loadTreeData(){
let that = this;
let params = {};
params.id='';
queryMaterialCategoryTreeList(params).then((res)=>{
if(res){
that.categoryTree = [];
for (let i = 0; i < res.length; i++) {
let temp = res[i];
that.categoryTree.push(temp);
}
}
})
},
searchQuery() {
this.loadData(1);
},
loadData(arg) {
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
let params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.code===200) {
this.dataSource = res.data.rows;
this.ipagination.total = res.data.total;
this.tableAddTotalRow(this.columns, this.dataSource)
this.currentStock = res.data.currentStock;
this.currentStockPrice = res.data.currentStockPrice;
}else{
this.$message.warning(res.msg)
}
this.loading = false;
})
},
showMaterialInOutList(record) {
this.$refs.materialInOutList.show(record);
this.$refs.materialInOutList.title = "查看商品库存流水全部仓库";
this.$refs.materialInOutList.disableSubmit = false;
},
exportExcel() {
let aoa = [['物料编码', '名称', '规格', '型号', '颜色', '类别', '单位', '加权单价', '单价', '初始库存','初始金额','入库金额','入库数量','出库金额','出库数量','库存', '库存金额']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.mBarCode, ds.name, ds.standard, ds.model, ds.color, ds.categoryName, ds.unitName, ds.weightPrice,
ds.purchaseDecimal, ds.initialStock,
ds.initialPrice,ds.intoPrice,ds.intoStock,ds.outPrice,ds.outStock,
ds.currentStock, ds.currentStockPrice]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '商品库存')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-250
View File
@@ -1,250 +0,0 @@
<!-- from 7 5 2 71 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="3" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children">
<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 :md="3" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
:dropdownMatchSelectWidth="false"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalDetail"></bill-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import BillDetail from '../bill/dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import {getAction} from '@/api/manage'
import {findBySelectCus, findBillDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "OutDetail",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
organId: '',
number: '',
materialParam:'',
depotId: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
type: "出库"
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{
title: '单据编号', dataIndex: 'number', width: 100,
scopedSlots: { customRender: 'numberCustomRender' },
},
{title: '物料编码', dataIndex: 'barCode', width: 80},
{title: '名称', dataIndex: 'mname', width: 120},
{title: '规格', dataIndex: 'standard', width: 60},
{title: '型号', dataIndex: 'model', width: 60},
{title: '单位', dataIndex: 'mUnit', width: 60},
{title: '数量', dataIndex: 'operNumber', sorter: (a, b) => a.operNumber - b.operNumber, width: 60},
{title: '单价', dataIndex: 'unitPrice', sorter: (a, b) => a.operNumber - b.operNumber, width: 60},
{title: '金额', dataIndex: 'allPrice', sorter: (a, b) => a.operNumber - b.operNumber, width: 60},
{title: '客户', dataIndex: 'sname', width: 80},
{title: '仓库', dataIndex: 'dname', width: 80},
{title: '出库日期', dataIndex: 'operTime', width: 80},
{title: '备注', dataIndex: 'newRemark', width: 100}
],
url: {
list: "/erp/depotHead/findInDetail",
}
}
},
created () {
this.getDepotData()
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
initSupplier() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
myHandleDetail(record) {
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
this.handleDetail(res.data, record.newType);
}
})
},
searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['单据编号', '物料编码', '名称', '规格', '型号', '单位', '数量', '单价', '金额', '客户', '仓库', '出库日期', '备注']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.number, ds.barCode, ds.mname, ds.standard, ds.model, ds.mUnit, ds.operNumber, ds.unitPrice,
ds.allPrice, ds.sname, ds.dname, ds.operTime, ds.newRemark]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '出库明细')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-220
View File
@@ -1,220 +0,0 @@
<!-- from 7 5 2 7 18920 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择客户" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children">
<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 :md="4" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import {getAction} from '@/api/manage'
import {findBySelectCus} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "OutMaterialCount",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
organId: '',
materialParam:'',
depotId: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
type: "出库"
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '物料编码', dataIndex: 'barCode', width: 120},
{title: '名称', dataIndex: 'mName', width: 120},
{title: '规格', dataIndex: 'standard', width: 100},
{title: '型号', dataIndex: 'model', width: 100},
{title: '类型', dataIndex: 'categoryName', width: 120},
{title: '单位', dataIndex: 'materialUnit', width: 120},
{title: '出库数量', dataIndex: 'numSum', sorter: (a, b) => a.numSum - b.numSum, width: 120},
{title: '出库金额', dataIndex: 'priceSum', sorter: (a, b) => a.priceSum - b.priceSum, width: 120}
],
url: {
list: "/erp/depotHead/findInOutMaterialCount",
}
}
},
created () {
this.getDepotData()
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
moment,
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
initSupplier() {
let that = this;
findBySelectCus({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
searchQuery() {
if(this.queryParam.beginTime == '' || this.queryParam.endTime == ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['物料编码', '名称', '规格', '型号', '类型', '单位', '出库数量', '出库金额']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.barCode, ds.mName, ds.standard, ds.model, ds.categoryName, ds.materialUnit, ds.numSum, ds.priceSum]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '出库汇总')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-172
View File
@@ -1,172 +0,0 @@
<!-- from 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="月份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-month-picker placeholder="请选择月份" :default-value="moment(currentMonth, monthFormat)"
style="width:100%" :format="monthFormat" @change="onChange"/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item>
本报表包含零售和销售数据
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getMpListShort, openDownloadDialog, sheet2blob} from "@/utils/util"
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import Vue from 'vue'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "SaleOutReport",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
// 查询条件
currentMonth: moment().format('YYYY-MM'),
monthFormat: 'YYYY-MM',
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
queryParam: {
monthTime: moment().format('YYYY-MM'),
materialParam:'',
mpList: getMpListShort(Vue.ls.get('materialPropertyList'))
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:60, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '物料编码', dataIndex: 'barCode', width: 160},
{title: '名称', dataIndex: 'materialName', width: 160},
{title: '规格', dataIndex: 'materialStandard', width: 80},
{title: '型号', dataIndex: 'materialModel', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', width: 150},
{title: '单位', dataIndex: 'materialUnit', width: 80},
{title: '销售数量', dataIndex: 'outSum', sorter: (a, b) => a.outSum - b.outSum, width: 80},
{title: '销售金额', dataIndex: 'outSumPrice', sorter: (a, b) => a.outSumPrice - b.outSumPrice, width: 80},
{title: '退货数量', dataIndex: 'inSum', sorter: (a, b) => a.inSum - b.inSum, width: 80},
{title: '退货金额', dataIndex: 'inSumPrice', sorter: (a, b) => a.inSumPrice - b.inSumPrice, width: 80},
{title: '实际销售金额', dataIndex: 'outInSumPrice', sorter: (a, b) => a.outInSumPrice - b.outInSumPrice, width: 100}
],
url: {
list: "/erp/depotItem/saleOut"
}
}
},
methods: {
moment,
create(){
},
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.monthTime = this.queryParam.monthTime;
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
onChange: function (value, dateString) {
console.log(dateString);
this.queryParam.monthTime=dateString;
},
searchQuery() {
if(this.queryParam.monthTime == ''){
this.$message.warning('请选择月份!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['物料编码', '名称', '规格', '型号', '扩展信息', '单位', '销售数量', '销售金额', '退货数量', '退货金额', '实际销售金额']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.barCode, ds.materialName, ds.materialStandard, ds.materialModel, ds.materialOther, ds.materialUnit, ds.outSum,
ds.outSumPrice, ds.inSum, ds.inSumPrice, ds.outInSumPrice]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '销售统计')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-171
View File
@@ -1,171 +0,0 @@
<!-- gitee 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="物料编码/名称/规格/型号" v-model="queryParam.materialParam"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import {getAction} from '@/api/manage'
import { getMpListShort, openDownloadDialog, sheet2blob} from "@/utils/util"
import Vue from 'vue'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "StockWarningReport",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
materialParam:'',
depotId: '',
mpList: getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '仓库', dataIndex: 'depotName', width: 100},
{title: '物料编码', dataIndex: 'barCode', width: 100},
{title: '名称', dataIndex: 'mname', width: 100},
{title: '规格', dataIndex: 'mstandard', width: 80},
{title: '型号', dataIndex: 'mmodel', width: 80},
{title: '扩展信息', dataIndex: 'materialOther', width: 100},
{title: '单位', dataIndex: 'materialUnit', width: 60},
{title: '库存', dataIndex: 'currentNumber', sorter: (a, b) => a.currentNumber - b.currentNumber, width: 80},
{title: '最低安全库存', dataIndex: 'lowSafeStock', sorter: (a, b) => a.lowSafeStock - b.lowSafeStock, width: 100},
{title: '最高安全库存', dataIndex: 'highSafeStock', sorter: (a, b) => a.highSafeStock - b.highSafeStock, width: 100},
{title: '建议入库量', dataIndex: 'lowCritical', sorter: (a, b) => a.lowCritical - b.lowCritical, width: 80},
{title: '建议出库量', dataIndex: 'highCritical', sorter: (a, b) => a.highCritical - b.highCritical, width: 80}
],
url: {
list: "/erp/depotItem/findStockWarningCount"
}
}
},
created () {
this.getDepotData()
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
exportExcel() {
let aoa = [['仓库', '物料编码', '名称', '规格', '型号', '扩展信息', '单位', '库存', '最低安全库存', '最高安全库存', '建议入库量', '建议出库量']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.depotName, ds.barCode, ds.mname, ds.mstandard, ds.mmodel, ds.materialOther, ds.materialUnit,
ds.currentNumber, ds.lowSafeStock, ds.highSafeStock, ds.lowCritical, ds.highCritical]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '库存预警')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-247
View File
@@ -1,247 +0,0 @@
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="4" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="选择供应商" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children">
<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 :md="5" :sm="24">
<a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
style="width: 210px"
v-model="queryParam.createTimeRange"
:default-value="defaultTimeStr"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item>
{{firstTotal}} {{lastTotal}}
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="modalBillDetail"></bill-detail>
<financial-detail ref="modalFinancialDetail"></financial-detail>
</a-card>
</a-col>
</a-row>
</template>
<script>
import BillDetail from '../bill/dialog/BillDetail'
import FinancialDetail from '../financial/dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getNowFormatMonth, openDownloadDialog, sheet2blob} from "@/utils/util"
import { getAction } from '@/api/manage'
import {findBySelectSup, findBillDetailByNumber,findFinancialDetailByNumber} from '@/api/api'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "VendorAccount",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
FinancialDetail,
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
supType: "供应商",
organId: '',
beginTime: getNowFormatMonth() + '-01',
endTime: moment().format('YYYY-MM-DD'),
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
dateFormat: 'YYYY-MM-DD',
currentDay: moment().format('YYYY-MM-DD'),
defaultTimeStr: '',
supList: [],
firstTotal: '',
lastTotal: '',
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{
title: '单据编号', dataIndex: 'number', width: 140,
scopedSlots: { customRender: 'numberCustomRender' },
},
{title: '类型', dataIndex: 'type', width: 100},
{title: '单位名称', dataIndex: 'supplierName', width: 200},
{title: '单据金额', dataIndex: 'billMoney', width: 80},
{title: '实际支付', dataIndex: 'changeAmount', width: 80},
{title: '本期变化', dataIndex: 'allPrice', width: 80},
{title: '单据日期', dataIndex: 'oTime', width: 160}
],
url: {
list: "/erp/depotHead/findStatementAccount",
}
}
},
created () {
this.initSupplier()
this.defaultTimeStr = [moment(getNowFormatMonth() + '-01', this.dateFormat), moment(this.currentDay, this.dateFormat)]
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
initSupplier() {
let that = this;
findBySelectSup({}).then((res)=>{
if(res) {
that.supList = res;
}
});
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
myHandleDetail(record) {
if(record.type === '支出' || record.type === '付款') {
findFinancialDetailByNumber({ billNo: record.number }).then((res) => {
if (res && res.code === 200) {
this.$refs.modalFinancialDetail.show(res.data, record.type);
this.$refs.modalFinancialDetail.title="详情";
}
})
} else {
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
this.$refs.modalBillDetail.show(res.data, record.type);
this.$refs.modalBillDetail.title="详情";
}
})
}
},
loadData(arg) {
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
let params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.code===200) {
this.dataSource = res.data.rows;
this.ipagination.total = res.data.total;
this.tableAddTotalRow(this.columns, this.dataSource)
if(this.queryParam.organId) {
this.firstTotal = '期初应付:' + res.data.firstMoney + ""
this.lastTotal = '期末应付:' + res.data.lastMoney
}
}
if(res.code===510){
this.$message.warning(res.data)
}
this.loading = false;
})
},
searchQuery() {
if(this.queryParam.beginTime === '' || this.queryParam.endTime === ''){
this.$message.warning('请选择单据日期!')
} else {
this.loadData(1);
}
},
exportExcel() {
let aoa = [['单据编号', '类型', '单位名称', '单据金额', '实际支付', '本期变化', '单据日期']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.number, ds.type, ds.supplierName, ds.billMoney, ds.changeAmount, ds.allPrice, ds.oTime]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '供应商对账')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-173
View File
@@ -1,173 +0,0 @@
<!-- gitee 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
optionFilterProp="children"
showSearch allow-clear style="width: 100%"
placeholder="请选择仓库"
v-model="queryParam.depotId">
<a-select-option v-for="(depot,index) in depotList" :key="index" :value="depot.id">
{{ depot.depotName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="批号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入批号查询" v-model="queryParam.batchNumber"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="条码/名称/规格/型号" v-model="queryParam.materialInfo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" v-print="'#reportPrint'" icon="printer">打印</a-button>
<a-button style="margin-left: 8px" @click="exportExcel" icon="download">导出</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<section ref="print" id="reportPrint">
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="false"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
</a-table>
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
<a-col :md="24" :sm="24">
<a-pagination @change="paginationChange" @showSizeChange="paginationShowSizeChange"
size="small"
show-size-changer
:showQuickJumper="true"
:current="ipagination.current"
:page-size="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
:total="ipagination.total"
:show-total="(total, range) => `${total-Math.ceil(total/ipagination.pageSize)}`">
<template slot="buildOptionText" slot-scope="props">
<span>{{ props.value-1 }}条/页</span>
</template>
</a-pagination>
</a-col>
</a-row>
</section>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import {getAction} from '@/api/manage'
import { getMpListShort, openDownloadDialog, sheet2blob} from "@/utils/util"
import Vue from 'vue'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "batchStock",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
materialInfo: '',
batchNumber: '',
depotId: ''
},
ipagination:{
pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201']
},
depotList: [],
tabKey: "1",
// 表头
columns: [
{
title: '#', dataIndex: 'rowIndex', width:40, align:"center",
customRender:function (t,r,index) {
return (t !== '合计') ? (parseInt(index) + 1) : t
}
},
{title: '仓库', dataIndex: 'depotName', width: 100},
{title: '批号', dataIndex: 'batchNumber', width: 100},
{title: '条码', dataIndex: 'materialId', width: 100},
{title: '名称', dataIndex: 'materialName', width: 100},
{title: '规格', dataIndex: 'standard', width: 80},
{title: '型号', dataIndex: 'model', width: 80},
{title: '单位', dataIndex: 'materialUnit', width: 60},
{title: '有效期', dataIndex: 'expirationDate', width: 100},
{title: '库存', dataIndex: 'stock', width: 80}
],
url: {
list: "/erp/depotItem/batchStock"
}
}
},
created () {
this.getDepotData()
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize-1;
return param;
},
getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){
this.depotList = res.data;
}else{
this.$message.info(res.data);
}
})
},
exportExcel() {
let aoa = [['仓库', '批号', '条码', '名称', '规格', '型号', '单位', '有效期', '库存']]
for (let i = 0; i < this.dataSource.length; i++) {
let ds = this.dataSource[i]
let item = [ds.depotName, ds.batchNumber, ds.materialId, ds.materialName,
ds.standard, ds.model, ds.materialUnit, ds.expirationDate, ds.stock]
aoa.push(item)
}
openDownloadDialog(sheet2blob(aoa), '批次库存')
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
@@ -1,163 +0,0 @@
<template>
<a-modal
:title="title"
:width="1000"
:visible="visible"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" @click="handleCancel">取消</a-button>
</template>
<!-- table区域-begin -->
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="billDetail"></bill-detail>
<financial-detail ref="financialDetail"></financial-detail>
</a-modal>
</template>
<script>
import BillDetail from '../../bill/dialog/BillDetail'
import FinancialDetail from '../../financial/dialog/FinancialDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import {findBillDetailByNumber, findFinancialDetailByNumber} from '@/api/api'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AccountInOutList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
FinancialDetail,
JEllipsis
},
data () {
return {
title:"操作",
visible: false,
disableMixinCreated: false,
toFromType: '',
// 查询条件
queryParam: {
accountId:'',
initialAmount:''
},
tabKey: "1",
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '单据编号', dataIndex: 'number', width: 150,
scopedSlots: { customRender: 'numberCustomRender' },
},
{ title: '类型', dataIndex: 'type', width: 100},
{ title: '单位信息', dataIndex: 'supplierName', width: 150},
{ title: '金额', dataIndex: 'changeAmount', width: 80,
customRender:function (t,r,index) {
if (r.aList && r.amList) {
let aListArr = r.aList.toString().split(",");
let amListArr = r.amList.toString().split(",");
let res = "";
for (let i = 0; i < aListArr.length; i++) {
if (aListArr[i] == r.accountId) {
res = amListArr[i];
}
}
return res + "[多账户]";
}
else {
return r.changeAmount;
}
}
},
{ title: '余额', dataIndex: 'balance', width: 80},
{ title: '单据日期', dataIndex: 'operTime', width: 180}
],
labelCol: {
xs: { span: 1 },
sm: { span: 2 },
},
wrapperCol: {
xs: { span: 10 },
sm: { span: 16 },
},
url: {
list: "/erp/account/findAccountInOutList"
}
}
},
created() {
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return param;
},
show(record) {
this.model = Object.assign({}, record);
this.visible = true;
this.queryParam.accountId = record.id
this.queryParam.initialAmount = record.initialAmount
this.loadData(1)
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
},
myHandleDetail(record) {
let that = this
this.toFromType = record.fromType
if(record.fromType === 'bill') {
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
that.$refs.billDetail.show(res.data, record.type);
that.$refs.billDetail.title="详情";
}
})
} else if(record.fromType === 'financial') {
findFinancialDetailByNumber({ billNo: record.number }).then((res) => {
if (res && res.code === 200) {
that.$refs.financialDetail.show(res.data, record.type);
that.$refs.financialDetail.title="详情";
}
})
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
@@ -1,133 +0,0 @@
<template>
<a-modal
:title="title"
:width="1250"
:visible="visible"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 100%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" @click="handleCancel">取消</a-button>
</template>
<!-- table区域-begin -->
<a-table
bordered
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="numberCustomRender" slot-scope="text, record">
<a @click="myHandleDetail(record)">{{record.number}}</a>
</span>
</a-table>
<!-- table区域-end -->
<!-- 表单区域 -->
<bill-detail ref="billDetail"></bill-detail>
</a-modal>
</template>
<script>
import BillDetail from '../../bill/dialog/BillDetail'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import {findBillDetailByNumber, findFinancialDetailByNumber} from '@/api/api'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MaterialInOutList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
BillDetail,
JEllipsis
},
data () {
return {
title:"操作",
visible: false,
disableMixinCreated: false,
toFromType: '',
// 查询条件
queryParam: {
materialId:''
},
tabKey: "1",
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '单据编号', dataIndex: 'number', width: 100, align: 'center',
scopedSlots: { customRender: 'numberCustomRender' },
},
{ title: '类型', dataIndex: 'type', width: 50, align: 'center',},
{ title: '物料编码', dataIndex: 'barCode', width: 60, align: 'center',},
{ title: '名称', dataIndex: 'materialName', width: 60, align: 'center',},
{ title: '仓库名称', dataIndex: 'depotName', width: 80, align: 'center',},
{ title: '数量', dataIndex: 'basicNumber', width: 80, align: 'center',},
{ title: '日期', dataIndex: 'operTime', width: 100, align: 'center',}
],
labelCol: {
xs: { span: 1 },
sm: { span: 2 },
},
wrapperCol: {
xs: { span: 10 },
sm: { span: 16 },
},
url: {
list: "/erp/depotItem/findDetailByTypeAndMaterialId"
}
}
},
created() {
},
methods: {
getQueryParams() {
let param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return param;
},
show(record) {
this.model = Object.assign({}, record);
this.visible = true;
this.queryParam.materialId = record.id
this.loadData(1)
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
},
myHandleDetail(record) {
let that = this
this.toFromType = record.fromType
findBillDetailByNumber({ number: record.number }).then((res) => {
if (res && res.code === 200) {
that.$refs.billDetail.show(res.data, record.type);
that.$refs.billDetail.title="详情";
}
})
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-180
View File
@@ -1,180 +0,0 @@
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入编号查询" v-model="queryParam.serialNo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定设为默认吗?" @confirm="() => handleSetDefault(record.id)">
<a>设为默认</a>
</a-popconfirm>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="isDefault">
<a-tag v-if="isDefault" color="green"></a-tag>
<a-tag v-if="!isDefault" color="orange"></a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<account-modal ref="modalForm" @ok="modalFormOk"></account-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- BY cao_yu_li -->
<script>
import AccountModal from './modules/AccountModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import { postAction } from '@/api/manage'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "AccountList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
AccountModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',serialNo:'',remark:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '名称', dataIndex: 'name', width: 100},
{title: '编号', dataIndex: 'serialNo', width: 150, align: "center"},
{title: '期初金额', dataIndex: 'initialAmount', width: 100, align: "center"},
{title: '当前余额', dataIndex: 'currentAmount', width: 100, align: "center"},
{ title: '是否默认',dataIndex: 'isDefault',width:100,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{title: '备注', dataIndex: 'remark', width: 100},
{
title: '操作',
dataIndex: 'action',
width: 150,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/account/list",
delete: "/erp/account/delete",
deleteBatch: "/erp/account/deleteBatch",
setDefault: "/erp/account/updateIsDefault"
}
}
},
computed: {
},
methods: {
handleSetDefault: function (id) {
if(!this.url.setDefault){
this.$message.error("请设置url.delete属性!")
return
}
let that = this;
postAction(that.url.setDefault, {id: id}).then((res) => {
if(res.code === 200){
that.loadData();
} else {
that.$message.warning(res.msg);
}
});
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-194
View File
@@ -1,194 +0,0 @@
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.supplier"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入手机号码查询" v-model="queryParam.telephone"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入联系电话查询" v-model="queryParam.phonenum"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-popover title="导入注意点">
<template slot="content">
<p><a target="_blank" href="/doc/customer_template.xls"><b>客户Excel模板下载</b></a></p>
</template>
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('客户信息')">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="enabled">
<a-tag v-if="enabled" color="green">启用</a-tag>
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<customer-modal ref="modalForm" @ok="modalFormOk"></customer-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- BY cao_yu_li -->
<script>
import CustomerModal from './modules/CustomerModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "CustomerList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
CustomerModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
supplier:'',
type:'客户',
telephone:'',
phonenum:''
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '名称',dataIndex: 'supplier',width:150},
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
{ title: '期初应收',dataIndex: 'beginNeedGet',width:80,align:"center"},
{ title: '期末应收',dataIndex: 'allNeedGet',width:80,align:"center"},
{ title: '税率(%)', dataIndex: 'taxRate',width:80,align:"center"},
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/supplier/list",
delete: "/erp/supplier/delete",
deleteBatch: "/erp/supplier/deleteBatch",
importExcelUrl: "/erp/supplier/importCustomer",
exportXlsUrl: "/erp/supplier/exportExcel",
batchSetStatusUrl: "/erp/supplier/batchSetStatus"
}
}
},
computed: {
importExcelUrl: function () {
return `${process.env.VUE_APP_BASE_API}${this.url.importExcelUrl}`;
}
},
methods: {
searchReset() {
this.queryParam = {
type:'客户',
}
this.loadData(1);
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-177
View File
@@ -1,177 +0,0 @@
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入仓库名称查询" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入描述查询" v-model="queryParam.remark"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定设为默认吗?" @confirm="() => handleSetDefault(record.id)">
<a>设为默认</a>
</a-popconfirm>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="isDefault">
<a-tag v-if="isDefault" color="green"></a-tag>
<a-tag v-if="!isDefault" color="orange"></a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<depot-modal ref="modalForm" @ok="modalFormOk"></depot-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- BY cao_yu_li -->
<script>
import DepotModal from './modules/DepotModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import { postAction } from '@/api/manage'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "DepotList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
DepotModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',remark:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '仓库名称', dataIndex: 'name', width: 200},
{title: '仓库地址', dataIndex: 'address', width: 200},
{title: '仓储费', dataIndex: 'warehousing', width: 80},
{title: '搬运费', dataIndex: 'truckage', width: 80},
{title: '负责人', dataIndex: 'principalName', width: 80},
{title: '排序', dataIndex: 'sort', width: 80},
{title: '是否默认',dataIndex: 'isDefault',width:100,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{title: '备注', dataIndex: 'remark', width: 120},
{
title: '操作',
dataIndex: 'action',
align:"center",
width: 200,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/depot/list",
delete: "/erp/depot/delete",
deleteBatch: "/erp/depot/deleteBatch",
setDefault: "/erp/depot/updateIsDefault"
}
}
},
computed: {
},
methods: {
handleSetDefault: function (id) {
if(!this.url.setDefault){
this.$message.error("请设置url.delete属性!")
return
}
let that = this;
postAction(that.url.setDefault, {id: id}).then((res) => {
if(res.code === 200){
that.loadData();
} else {
that.$message.warning(res.msg);
}
});
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-145
View File
@@ -1,145 +0,0 @@
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
</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="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="enabled">
<a-tag v-if="enabled==1" color="green">启用</a-tag>
<a-tag v-if="enabled==0" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<function-modal ref="modalForm" @ok="modalFormOk"></function-modal>
</a-card>
</a-col>
</a-row>
</template>
<script>
import FunctionModal from './modules/FunctionModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "FunctionList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
FunctionModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',type:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '编号 ', dataIndex: 'number', width: 80},
{title: '名称', dataIndex: 'name', width: 100},
{title: '上级编号', dataIndex: 'parentNumber', width: 80},
{title: '链接', dataIndex: 'url', width: 250},
{title: '组件', dataIndex: 'component', width: 250},
{title: '排序', dataIndex: 'sort', width: 80},
{
title: '是否启用', dataIndex: 'enabled', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{title: '图标', dataIndex: 'icon', width: 110},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/function/list",
delete: "/erp/function/delete",
deleteBatch: "/erp/function/deleteBatch"
}
}
},
computed: {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-158
View File
@@ -1,158 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.type" placeholder="请选择类型">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="收入">收入</a-select-option>
<a-select-option value="支出">支出</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入备注查询" v-model="queryParam.remark"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="isDefault">
<a-tag v-if="isDefault" color="green"></a-tag>
<a-tag v-if="!isDefault" color="orange"></a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<inOutItem-modal ref="modalForm" @ok="modalFormOk"></inOutItem-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import InOutItemModal from './modules/InOutItemModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "InOutItemList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
InOutItemModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',type:'',remark:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '名称', dataIndex: 'name', width: 200},
{title: '类型', dataIndex: 'type', width: 100},
{title: '备注', dataIndex: 'remark', width: 200},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/inOutItem/list",
delete: "/erp/inOutItem/delete",
deleteBatch: "/erp/inOutItem/deleteBatch"
}
}
},
computed: {
},
methods: {
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-188
View File
@@ -1,188 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="操作模块" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入操作模块" v-model="queryParam.operation"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作详情" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入操作详情" v-model="queryParam.content"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
v-model="queryParam.createTimeRange"
format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']"
@change="onDateChange"
@ok="onDateOk"
/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="24">
<a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入操作员账号或姓名" v-model="queryParam.userInfo"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作IP" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入操作IP" v-model="queryParam.clientIp"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="操作状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.status" placeholder="请选择操作状态">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="0">成功</a-select-option>
<a-select-option value="1">失败</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="24" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<a-table
ref="table"
bordered
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<!-- 字符串超长截取省略号显示-->
<span slot="content" slot-scope="text, record">
<j-ellipsis :value="text" :length="40"/>
</span>
</a-table>
<!-- table区域-end -->
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "LogList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
JEllipsis
},
data () {
return {
// 查询条件
queryParam: {
operation:'',
content:'',
createTimeRange:[],
userInfo: '',
clientIp:'',
status:''
},
tabKey: "1",
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '操作模块', dataIndex: 'operation', width: 120},
{title: '操作详情', align:"left", dataIndex: 'content', scopedSlots: { customRender: 'content' }, width: 350 },
{title: '操作员账号', dataIndex: 'loginName', width: 80, align: "center"},
{title: '操作员姓名', dataIndex: 'userName', width: 80, align: "center"},
{
title: '操作状态', dataIndex: 'status',width:80, align:"center",
customRender:function (text) {
if(text){
return "失败";
}else {
return "成功";
}
}
},
{title: '操作IP', dataIndex: 'clientIp', width: 110, align: "center"},
{title: '操作时间', dataIndex: 'createTimeStr', width: 120, align: "center"}
],
operateColumn:
{
title: '操作类型',
dataIndex: 'operateType_dictText',
align:"center",
},
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
url: {
list: "/erp/log/list",
}
}
},
methods: {
// 日志类型
callback(key){
// 动态添加操作类型列
if (key == 2) {
this.tabKey = '2';
this.columns.splice(7, 0, this.operateColumn);
}else if(this.columns.length == 9)
{
this.tabKey = '1';
this.columns.splice(7,1);
}
let that=this;
that.queryParam.logType=key;
that.loadData();
},
onDateChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.beginTime=dateString[0];
this.queryParam.endTime=dateString[1];
},
onDateOk(value) {
console.log(value);
},
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-190
View File
@@ -1,190 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.supplier"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入手机号码查询" v-model="queryParam.telephone"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入联系电话查询" v-model="queryParam.phonenum"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-popover title="导入注意点">
<template slot="content">
<p><a target="_blank" href="/doc/member_template.xls"><b>会员Excel模板下载</b></a></p>
</template>
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('会员信息')">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="enabled">
<a-tag v-if="enabled" color="green">启用</a-tag>
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<member-modal ref="modalForm" @ok="modalFormOk"></member-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import MemberModal from './modules/MemberModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MemberList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
MemberModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
supplier:'',
type:'会员',
telephone:'',
phonenum:''
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '名称',dataIndex: 'supplier',width:150},
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
{ title: '预付款',dataIndex: 'advanceIn',width:70,align:"center"},
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/supplier/list",
delete: "/erp/supplier/delete",
deleteBatch: "/erp/supplier/deleteBatch",
importExcelUrl: "/erp/supplier/importMember",
exportXlsUrl: "/erp/supplier/exportExcel",
batchSetStatusUrl: "/erp/supplier/batchSetStatus"
}
}
},
computed: {
importExcelUrl: function () {
return `${process.env.VUE_APP_BASE_API}${this.url.importExcelUrl}`;
}
},
methods: {
searchReset() {
this.queryParam = {
type:'会员',
}
this.loadData(1);
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-175
View File
@@ -1,175 +0,0 @@
<template>
<a-modal
:title="title"
:width="modalWidth"
:visible="visible"
:confirmLoading="confirmLoading"
@cancel="handleCancel"
cancelText="关闭"
style="top:15%;height: 70%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" @click="handleCancel">
关闭
</a-button>
</template>
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="标题">
<a-input placeholder="请输入标题" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :span="12" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button @click="searchReset" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div class="table-operator">
<a-button type="primary" @click="readAll" icon="book">全部标注已读</a-button>
</div>
<div style="margin-top: 5px">
<a-table
ref="table"
size="default"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<template slot="customRenderTitle" slot-scope="text, record">
<span v-if="record.status =='1'" style="font-weight: bold">{{text}}</span>
<span v-if="record.status =='2'">{{text}}</span>
</template>
<span slot="action" slot-scope="text, record">
<a @click="showAnnouncement(record)">查看</a>
</span>
</a-table>
</div>
<show-announcement ref="ShowAnnouncement"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
</a-modal>
</template>
<script>
import { postAction } from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import DynamicNotice from '@/components/tools/DynamicNotice'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "MsgList",
mixins: [JeecgListMixin,tableDragResizeMixin],
components: {
DynamicNotice,
ShowAnnouncement
},
data () {
return {
title:"通知",
modalWidth:800,
visible: false,
confirmLoading: false,
queryParam: {
name: ''
},
ipagination:{
pageSize: 5,
pageSizeOptions: ['5','10', '20', '30']
},
columns: [{
title: '标题',
dataIndex: 'msgTitle',
scopedSlots: { customRender: 'customRenderTitle' },
width: 200
},
{
title: '消息类型',
dataIndex: 'type',
width: 80
},
{
title: '时间',
dataIndex: 'createTimeStr',
width: 90
},
{
title: '操作',
dataIndex: 'action',
align:"center",
scopedSlots: { customRender: 'action' },
width: 50
}],
url: {
list: "/erp/msg/list",
batchUpdateStatus:"/erp/msg/batchUpdateStatus",
readAllMsg:"/erp/msg/readAllMsg",
},
loading:false,
openPath:'',
formData:''
}
},
methods: {
handleDetail: function(){
this.visible = true
},
showAnnouncement(record){
postAction(this.url.batchUpdateStatus,{ids:record.id, status: '2'}).then((res)=>{
if(res && res.code === 200){
this.loadData();
}
});
if(record.openType==='component'){
this.openPath = record.openPage;
this.formData = {id:record.busId};
this.$refs.showDynamNotice.detail();
}else{
this.$refs.ShowAnnouncement.detail(record);
}
},
readAll(){
let that = this;
that.$confirm({
title:"确认操作",
content:"是否全部标注已读?",
onOk: function(){
postAction(that.url.readAllMsg).then((res)=>{
if(res && res.code === 200){
that.$message.success(res.data);
that.loadData();
}
});
}
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}z
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
</style>
-535
View File
@@ -1,535 +0,0 @@
<template xmlns:background-color="http://www.w3.org/1999/xhtml">
<a-row :gutter="10">
<a-col :md="12" :sm="24">
<a-card :bordered="false">
<!-- 按钮操作区域 -->
<a-row style="margin-left: 14px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd()" type="primary">添加机构</a-button>
<a-button v-if="btnEnableList.indexOf(1)>-1" title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>
<a-button @click="refresh" type="default" icon="reload">刷新</a-button>
</a-row>
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-alert type="info" :showIcon="true">
<div slot="message">
当前选择<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
</div>
</a-alert>
<!-- -->
<a-col :md="10" :sm="24">
<template>
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">
<span style="user-select: none">
<a-tree
checkable
multiple
@select="onSelect"
@check="onCheck"
@rightClick="rightHandle"
:selectedKeys="selectedKeys"
:checkedKeys="checkedKeys"
:treeData="departTree"
:checkStrictly="checkStrictly"
:expandedKeys="iExpandedKeys"
:autoExpandParent="true"
@expand="onExpand"/>
</span>
</a-dropdown>
</template>
</a-col>
</div>
</a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button">
<a-dropdown :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
</div>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col>
<a-col :md="12" :sm="24">
<a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
<a-input placeholder="请输入名称" v-decorator="['orgAbr', validatorRules.orgAbr ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
<a-input placeholder="请输入编号" v-decorator="['orgNo', validatorRules.orgNo ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级机构">
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
allow-clear treeDefaultExpandAll="true"
:treeData="treeData" v-model="model.parentId" placeholder="请选择上级机构">
</a-tree-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input-number v-decorator="[ 'sort' ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
<a-textarea placeholder="请输入备注" :rows="2" v-decorator.trim="[ 'remark' ]" />
</a-form-item>
</a-form>
<div class="anty-form-btn">
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
</div>
</a-card>
<a-card v-else >
<a-empty>
<span slot="description"> 请先选择一个机构! </span>
</a-empty>
</a-card>
</a-col>
<organization-modal ref="organizationModal" @ok="loadTree"></organization-modal>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import OrganizationModal from './modules/OrganizationModal'
import pick from 'lodash.pick'
import {queryOrganizationTreeList,queryOrganizationById, checkOrganization, deleteByDepartId} from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
name: 'OrganizationList',
mixins: [JeecgListMixin],
components: {
OrganizationModal
},
data() {
return {
iExpandedKeys: [],
loading: false,
currFlowId: '',
currFlowName: '',
disable: true,
treeData: [],
visible: false,
departTree: [],
rightClickSelectedKey: '',
rightClickSelectedOrgCode: '',
hiding: true,
model: {},
dropTrigger: '',
depart: {},
disableSubmit: false,
checkedKeys: [],
selectedKeys: [],
autoIncr: 1,
currSelected: {},
allTreeKeys:[],
checkStrictly: true,
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16}
},
graphDatasource: {
nodes: [],
edges: []
},
validatorRules: {
orgAbr: {
rules: [
{ required: true, message: '请输入名称!'},
{ validator: this.validateName}
]
},
orgNo: {rules: [{required: true, message: '请输入编码!'}]}
},
url: {
delete: '/organization/delete',
edit: '/organization/update',
deleteBatch: '/organization/deleteBatch'
},
orgCategoryDisabled:false,
}
},
computed: {
importExcelUrl: function () {
return `${process.env.VUE_APP_BASE_API}/${this.url.importExcelUrl}`;
}
},
methods: {
loadData() {
this.refresh();
},
loadTree() {
var that = this
that.treeData = []
that.departTree = []
let params = {};
params.id='';
queryOrganizationTreeList(params).then((res) => {
if (res) {
//机构全选后,再添加机构,选中数量增多
this.allTreeKeys = [];
for (let i = 0; i < res.length; i++) {
let temp = res[i]
that.treeData.push(temp)
that.departTree.push(temp)
that.setThisExpandedKeys(temp)
that.getAllKeys(temp);
// console.log(temp.id)
}
this.loading = false
}
})
},
setThisExpandedKeys(node) {
if (node.children && node.children.length > 0) {
this.iExpandedKeys.push(node.key)
for (let a = 0; a < node.children.length; a++) {
this.setThisExpandedKeys(node.children[a])
}
}
},
refresh() {
this.loading = true
this.loadTree()
},
// 右键操作方法
rightHandle(node) {
this.dropTrigger = 'contextmenu'
console.log(node.node.eventKey)
this.rightClickSelectedKey = node.node.eventKey
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys)
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.iExpandedKeys = expandedKeys
},
backFlowList() {
this.$router.back(-1)
},
// 右键点击下拉框改变事件
dropStatus(visible) {
if (visible == false) {
this.dropTrigger = ''
}
},
// 右键店家下拉关闭下拉框
closeDrop() {
this.dropTrigger = ''
},
addRootNode() {
this.$refs.nodeModal.add(this.currFlowId, '')
},
batchDel: function () {
console.log(this.checkedKeys)
if (this.checkedKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
} else {
var ids = ''
for (var a = 0; a < this.checkedKeys.length; a++) {
ids += this.checkedKeys[a] + ','
}
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据?',
onOk: function () {
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.code == 200) {
that.$message.success(res.msg)
that.loadTree()
that.onClearSelected()
} else {
that.$message.warning(res.msg)
}
})
}
})
}
},
nodeModalOk() {
this.loadTree()
},
nodeModalClose() {
},
hide() {
console.log(111)
this.visible = false
},
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
this.hiding = false
//this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
if(this.checkStrictly){
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e)
this.hiding = false
let record = e.node.dataRef
let params = {};
params.id=record.id;
queryOrganizationById(params).then((res) => {
if (res && res.code == 200) {
if(res.data){
record.orgAbr = res.data.orgAbr;
record.orgNo = res.data.orgNo;
record.parentId = res.data.parentId;
record.sort = res.data.sort;
record.remark = res.data.remark;
console.log('onSelect-record', record)
this.currSelected = Object.assign({}, record)
this.model = this.currSelected
this.selectedKeys = [record.key]
this.model.parentId = record.parentId
this.setValuesToForm(record)
}
}
});
},
// 触发onSelect事件时,为机构树右侧的form表单赋值
setValuesToForm(record) {
this.$nextTick(() => {
this.form.setFieldsValue(pick(record, 'orgAbr', 'orgNo', 'parentId', 'sort', 'remark'))
})
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
},
onClearSelected() {
this.hiding = true
this.checkedKeys = []
this.currSelected = {}
this.form.resetFields()
this.selectedKeys = []
this.$refs.departAuth.departId = ''
},
handleNodeTypeChange(val) {
this.currSelected.nodeType = val
},
notifyTriggerTypeChange(value) {
this.currSelected.notifyTriggerType = value
},
receiptTriggerTypeChange(value) {
this.currSelected.receiptTriggerType = value
},
submitCurrForm() {
this.form.validateFields((err, values) => {
if (!err) {
if (!this.currSelected.id) {
this.$message.warning('请点击选择要修改机构!')
return
}
let formData = Object.assign(this.currSelected, values)
console.log('Received values of form: ', formData)
httpAction(this.url.edit, formData, 'put').then((res) => {
if (res.code == 200) {
this.$message.success('保存成功!')
this.loadTree()
} else {
this.$message.error(res.message)
}
})
}
})
},
emptyCurrForm() {
this.form.resetFields()
},
nodeSettingFormSubmit() {
this.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values)
}
})
},
openSelect() {
this.$refs.sysDirectiveModal.show()
},
validateName(rule, value, callback){
let params = {
name: value,
id: this.model.id?this.model.id:0
};
checkOrganization(params).then((res)=>{
if(res && res.code===200) {
if(!res.data.status){
callback();
} else {
callback("名称已经存在");
}
} else {
callback(res.data);
}
});
},
handleAdd() {
this.$refs.organizationModal.add()
this.$refs.organizationModal.title = '新增'
},
handleDelete() {
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除此机构吗?',
onOk: function () {
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => {
if (resp.success) {
//删除成功后,去除已选中中的数据
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
that.$message.success('删除成功!')
that.loadTree()
//删除后同步清空右侧基本信息内容
let orgCode=that.form.getFieldValue("orgCode");
if(orgCode && orgCode === that.rightClickSelectedOrgCode){
that.onClearSelected()
}
} else {
that.$message.warning('删除失败!')
}
})
}
})
},
selectDirectiveOk(record) {
console.log('选中指令数据', record)
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode})
this.currSelected.sysCode = record.sysCode
},
getFlowGraphData(node) {
this.graphDatasource.nodes.push({
id: node.id,
text: node.flowNodeName
})
if (node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
let temp = node.children[a]
this.graphDatasource.edges.push({
source: node.id,
target: temp.id
})
this.getFlowGraphData(temp)
}
}
},
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () {
this.iExpandedKeys = this.allTreeKeys
},
closeAll () {
this.iExpandedKeys = []
},
checkALL () {
this.checkStriccheckStrictlytly = false
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
getAllKeys(node) {
// console.log('node',node);
this.allTreeKeys.push(node.key)
if (node.children && node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
this.getAllKeys(node.children[a])
}
}
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
created() {
this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name
// this.loadTree()
},
}
</script>
<style scoped>
.ant-card-body .table-operator {
margin: 15px;
}
.anty-form-btn {
width: 100%;
text-align: center;
}
.anty-form-btn button {
margin: 0 5px;
}
.anty-node-layout .ant-layout-header {
padding-right: 0
}
.header {
padding: 0 8px;
}
.header button {
margin: 0 3px
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
#app .desktop {
height: auto !important;
}
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.drawer-bootom-button {
/*position: absolute;*/
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: left;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
-158
View File
@@ -1,158 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入姓名查询" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.type" placeholder="请选择类型">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="业务员">业务员</a-select-option>
<a-select-option value="仓管员">仓管员</a-select-option>
<a-select-option value="财务员">财务员</a-select-option>
</a-select>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<person-modal ref="modalForm" @ok="modalFormOk"></person-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import PersonModal from './modules/PersonModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "PersonList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
PersonModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',type:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '姓名',
align:"center",
dataIndex: 'name',
width: 100,
},
{
title: '类型',
align:"center",
dataIndex: 'type',
width: 100,
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/person/list",
delete: "/erp/person/delete",
deleteBatch: "/erp/person/deleteBatch"
}
}
},
computed: {
},
methods: {
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-106
View File
@@ -1,106 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<platform-config-modal ref="modalForm" @ok="modalFormOk"></platform-config-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import PlatformConfigModal from './modules/PlatformConfigModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "PlatformConfigList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
PlatformConfigModal
},
data () {
return {
currentRoleId: '',
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {platformKey:'',},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '配置名称',
dataIndex: 'platformKeyInfo',
width: 100
},
{
title: '配置值',
dataIndex: 'platformValue',
width: 500
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width: 100,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/platformConfig/list",
delete: "/erp/platformConfig/delete",
deleteBatch: "/erp/platformConfig/deleteBatch"
},
}
},
methods: {
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-252
View File
@@ -1,252 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.name"></a-input>
</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-button type="primary" style="margin-left: 8px" @click="writeCode">填写激活码</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importUrl" @change="handleImportJar">
<a-popover title="导入注意点">
<template slot="content">
<p>请选择需要导入的插件jar包</p>
</template>
<a-button type="primary" icon="import">上传插件包</a-button>
</a-popover>
</a-upload>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="uploadTemplate(record)" >上传页面</a>
<a-divider type="vertical" />
<a-popconfirm title="确定要开启该插件吗?" @confirm="() => startPlugin(record.pluginDescriptor.pluginId)">
<a>开启</a>
</a-popconfirm>
<a-divider type="vertical" />
<a-popconfirm title="确定要停止该插件吗?" @confirm="() => stopPlugin(record.pluginDescriptor.pluginId)">
<a>停止</a>
</a-popconfirm>
<a-divider type="vertical" />
<a-popconfirm title="确定要卸载该插件吗?" @confirm="() => uninstallPlugin(record.pluginDescriptor.pluginId)">
<a>卸载</a>
</a-popconfirm>
</span>
<span slot="linkInfo" slot-scope="text, record">
<a @click="linkTo(record)" target='_blank'>链接跳转</a>
</span>
<template slot="customRenderFlag" slot-scope="pluginState">
<a-tag v-if="pluginState=='STARTED'" color="green">启用</a-tag>
<a-tag v-if="pluginState=='STOPPED'" color="orange">停止</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<plugin-modal ref="modalForm" @ok="modalFormOk"></plugin-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import PluginModal from './modules/PluginModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {postAction} from '@/api/manage';
import JDate from '@/components/jeecg/JDate'
import { filterObj } from '@/utils/util'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "PluginList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
PluginModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{title: '名称', dataIndex: '', width: 120,
customRender:function (t,r,index) {
if (r) {
var desc = r.pluginDescriptor.pluginDescription;
if(desc.indexOf("|")){
var arr = desc.split("|");
return arr[0];
}
}
}
},
{title: '标识', dataIndex: '', width: 180,
customRender:function (t,r,index) {
if (r) {
return r.pluginDescriptor.pluginId;
}
}
},
{title: '版本', dataIndex: '', width: 120,
customRender:function (t,r,index) {
if (r) {
return r.pluginDescriptor.version;
}
}
},
{title: '作者', dataIndex: '', width: 100,
customRender:function (t,r,index) {
if (r) {
return r.pluginDescriptor.provider;
}
}
},
{title: '页面链接', dataIndex: '', width: 250,
scopedSlots: { customRender: 'linkInfo' }
},
{title: '状态', dataIndex: 'pluginState', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/plugin/list",
delete: "/erp/plugin/delete",
deleteBatch: "/erp/plugin/deleteBatch",
importJarUrl: "/erp/plugin/uploadInstallPluginJar",
}
}
},
computed: {
importUrl: function () {
return `${process.env.VUE_APP_BASE_API}${this.url.importJarUrl}`;
}
},
methods: {
getQueryParams() {
//获取查询条件
let sqp = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
let param = {};
param.name = this.queryParam.name;
param.currentPage = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
writeCode() {
this.$refs.modalForm.edit();
this.$refs.modalForm.title = "填写激活码";
this.$refs.modalForm.disableSubmit = false;
},
linkTo(record) {
let desc = record.pluginDescriptor.pluginDescription;
if(desc.indexOf("|")){
let arr = desc.split("|");
window.location.href = arr[1]
}
},
uploadTemplate(record) {
var rootPath = record.path.substring(0, record.path.indexOf("plugins"));
this.$message.info('请将页面上传到服务器目录:' + " /前端根目录/plugins/");
},
startPlugin(pluginId) {
postAction('/plugin/start/' + pluginId).then((res)=>{
if(res && res.code == 200) {
this.loadData();
}
})
},
stopPlugin(pluginId) {
postAction('/plugin/stop/' + pluginId).then((res)=>{
if(res && res.code == 200) {
this.loadData();
}
})
},
uninstallPlugin(pluginId) {
postAction('/plugin/uninstall/' + pluginId).then((res)=>{
if(res && res.code == 200) {
this.loadData();
}
})
},
handleImportJar(info){
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
if (info.file.response) {
if (info.file.response.code === 200) {
this.$message.success(info.file.response.data)
this.loadData()
}
} else {
this.$message.error(info.file.response.data);
}
} else if (info.file.status === 'error') {
this.$message.error(`文件上传失败: ${info.file.msg} `);
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-194
View File
@@ -1,194 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="角色名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入角色名称查询" v-model="queryParam.name"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleSetFunction(record)">分配功能</a>
<a-divider type="vertical" />
<a @click="handleSetPushBtn(record.id)">分配按钮</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<role-modal ref="modalForm" @ok="modalFormOk"></role-modal>
<role-function-modal ref="roleFunctionModal" @ok="roleFunctionModalFormOk"></role-function-modal>
<role-push-btn-modal ref="rolePushBtnModal" @ok="modalFormOk"></role-push-btn-modal>
<a-modal v-model="roleFunctionModalVisible" title="操作提示" @ok="handleTipOk">
<p>分配功能已经操作成功现在继续<b>分配按钮</b></p>
</a-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- f r o m 7 5 2 7 1 8 9 2 0 -->
<script>
import RoleModal from './modules/RoleModal'
import RoleFunctionModal from './modules/RoleFunctionModal'
import RolePushBtnModal from './modules/RolePushBtnModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "RoleList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
RoleModal,
RoleFunctionModal,
RolePushBtnModal,
JDate
},
data () {
return {
description: '角色管理页面',
roleFunctionModalVisible: false,
currentRoleId: '',
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title: '角色名称',
align:"center",
dataIndex: 'name',
width: 100
},
{
title: '数据类型',
align:"center",
dataIndex: 'type',
width: 100
},
{
title: '描述',
align:"center",
dataIndex: 'description',
width: 100
},
{
title: '操作',
dataIndex: 'action',
align:"center",
width: 150,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/role/list",
delete: "/erp/role/delete",
deleteBatch: "/erp/role/deleteBatch"
},
}
},
computed: {
importExcelUrl: function(){
return `${process.env.VUE_APP_BASE_API}/${this.url.importExcelUrl}`;
}
},
methods: {
handleSetFunction(record) {
this.$refs.roleFunctionModal.edit(record);
this.$refs.roleFunctionModal.title = "分配功能【分配之后请继续分配按钮】";
this.$refs.roleFunctionModal.disableSubmit = false;
},
handleSetPushBtn(roleId) {
this.$refs.rolePushBtnModal.edit(roleId);
this.$refs.rolePushBtnModal.title = "分配按钮";
this.$refs.rolePushBtnModal.disableSubmit = false;
},
roleFunctionModalFormOk(id) {
//重载列表
this.loadData();
this.roleFunctionModalVisible = true;
this.currentRoleId = id
},
handleTipOk() {
if(this.currentRoleId) {
this.roleFunctionModalVisible = false;
this.handleSetPushBtn(this.currentRoleId)
}
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-174
View File
@@ -1,174 +0,0 @@
<template>
<a-card :style="cardStyle" :bordered="false">
<a-row :gutter="24">
<a-col :md="12">
<a-spin :spinning="confirmLoading">
<a-form :form="form" id="systemConfigModal">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司名称">
<a-input placeholder="请输入公司名称" v-decorator.trim="[ 'companyName', validatorRules.companyName]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人">
<a-input placeholder="请输入联系人" v-decorator.trim="[ 'companyContacts' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司地址">
<a-input placeholder="请输入公司地址" v-decorator.trim="[ 'companyAddress' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司电话">
<a-input placeholder="请输入公司电话" v-decorator.trim="[ 'companyTel' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司传真">
<a-input placeholder="请输入公司传真" v-decorator.trim="[ 'companyFax' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公司邮编">
<a-input placeholder="请输入公司邮编" v-decorator.trim="[ 'companyPostCode' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库权限">
<a-switch checked-children="启用" un-checked-children="关闭" v-model="depotFlagSwitch" @change="onDepotChange"></a-switch>
如果启用则需要到<b>用户管理</b>进行<b>分配仓库</b>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户权限">
<a-switch checked-children="启用" un-checked-children="关闭" v-model="customerFlagSwitch" @change="onCustomerChange"></a-switch>
如果启用则需要到<b>用户管理</b>进行<b>分配客户</b>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="负库存">
<a-switch checked-children="启用" un-checked-children="关闭" v-model="minusStockFlagSwitch" @change="onMinusStockChange"></a-switch>
如果启用则单据支持负库存批次商品除外
</a-form-item>
</a-form>
</a-spin>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :md="12" align="middle">
<a-button type="primary" @click="handleOk">保存</a-button>
<a-button style="margin-left:20px" @click="handleReset">重置</a-button>
</a-col>
</a-row>
</a-card>
</template>
<!-- b y 7 5 2 7 1 8 9 2 0 -->
<script>
import pick from 'lodash.pick'
import {addSystemConfig,editSystemConfig,checkSystemConfig } from '@/api/api'
import {autoJumpNextInput} from "@/utils/util"
import {getAction } from '@/api/manage'
export default {
name: "SystemConfigList",
// mixins: [mixinDevice],
data () {
return {
title:"操作",
cardStyle: '',
visible: true,
model: {},
depotFlagSwitch: false, //仓库权限状态
customerFlagSwitch: false, //客户权限状态
minusStockFlagSwitch: false, //负库存状态
isReadOnly: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
companyName:{
rules: [
{ required: true, message: '请输入公司名称!' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
]
}
}
}
},
created () {
this.init()
if(this.isDesktop()) {
this.cardStyle = 'height:' + (document.documentElement.clientHeight-125) + 'px'
}
},
methods: {
onDepotChange(checked) {
this.model.depotFlag = checked?'1':'0'
},
onCustomerChange(checked) {
this.model.customerFlag = checked?'1':'0'
},
onMinusStockChange(checked) {
this.model.minusStockFlag = checked?'1':'0'
},
init () {
let param = {
search: {"companyName":""},
currentPage: 1,
pageSize: 10
}
getAction('/systemConfig/list', param).then((res)=>{
if(res.code === 200){
let record = res.data.rows[0]
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'companyName', 'companyContacts', 'companyAddress',
'companyTel', 'companyFax', 'companyPostCode', 'depotFlag', 'customerFlag', 'minusStockFlag'))
autoJumpNextInput('systemConfigModal')
});
if(record.id) {
if (record.depotFlag != null) {
this.depotFlagSwitch = record.depotFlag == '1' ? true : false;
}
if (record.customerFlag != null) {
this.customerFlagSwitch = record.customerFlag == '1' ? true : false;
}
if (record.minusStockFlag != null) {
this.minusStockFlagSwitch = record.minusStockFlag == '1' ? true : false;
}
}
} else {
this.$message.info(res.data);
}
})
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
let obj;
if(!this.model.id){
obj=addSystemConfig(formData);
}else{
obj=editSystemConfig(formData);
}
obj.then((res)=>{
if(res.code === 200){
this.init()
that.$message.info('保存成功!');
}else{
that.$message.warning(res.msg);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
handleReset () {
this.form.resetFields();
this.depotFlagSwitch = false
this.customerFlagSwitch = false
this.minusStockFlagSwitch = false
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-160
View File
@@ -1,160 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="输入登录名称模糊查询" v-model="queryParam.loginName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="租户类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.type" placeholder="请选择租户类型">
<a-select-option value="0">免费租户</a-select-option>
<a-select-option value="1">付费租户</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="租户状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="queryParam.enabled" placeholder="请选择操作状态">
<a-select-option value="1">启用</a-select-option>
<a-select-option value="0">禁用</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchSetStatus(1)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="2" @click="batchSetStatus(0)"><a-icon type="close-square"/>禁用</a-menu-item>
</a-menu>
<a-button>
批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
bordered
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderType" slot-scope="type">
<a-tag v-if="type==0">免费租户</a-tag>
<a-tag v-if="type==1" color="green">付费租户</a-tag>
</template>
<template slot="customRenderEnabled" slot-scope="enabled">
<a-tag v-if="enabled" color="green">启用</a-tag>
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<tenant-modal ref="modalForm" @ok="modalFormOk"></tenant-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- b y 7 5 2 7 1 8 9 2 0 -->
<script>
import TenantModal from './modules/TenantModal'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import JInput from '@/components/jeecg/JInput'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "TenantList",
mixins: [JeecgListMixin,tableDragResizeMixin],
components: {
TenantModal,
JInput
},
data() {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
queryParam: {
loginName: '',
type: '',
enabled: ''
},
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '登录名称', dataIndex: 'loginName', width: 100, align: "center"},
{ title: '用户数量限制', dataIndex: 'userNumLimit', width: 100, align: "center"},
{ title: '租户类型',dataIndex: 'type',width:70,align:"center",
scopedSlots: { customRender: 'customRenderType' }
},
{ title: '租户状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderEnabled' }
},
{ title: '创建时间', dataIndex: 'createTimeStr', width: 100, align: "center"},
{ title: '到期时间', dataIndex: 'expireTimeStr', width: 100, align: "center"},
{ title: '描述', dataIndex: 'remark', width: 200, align: "center", ellipsis:true},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 100
}
],
url: {
list: "/erp/tenant/list",
batchSetStatusUrl: "/erp/tenant/batchSetStatus"
},
}
},
created () {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-163
View File
@@ -1,163 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入计量单位查询" v-model="queryParam.name"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<unit-modal ref="modalForm" @ok="modalFormOk"></unit-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- b y 7 5 2 7 1 8 9 2 0 -->
<script>
import UnitModal from './modules/UnitModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "UnitList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
UnitModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {name:'',type:''},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '计量单位', align:"center", dataIndex: 'name', width:150 },
{ title: '基本单位', align:"center", dataIndex: 'basicUnit', width:100 },
{ title: '副单位', align:"center", dataIndex: 'otherUnit', width:100,
// customRender:function (t,r,index) {
// if (r) {
// return r.otherUnit + '=' + r.ratio + r.basicUnit;
// }
// }
},
{ title: '副单位2', align:"center", dataIndex: 'otherUnitTwo', width:100,
customRender:function (t,r,index) {
if (r) {
if(r.otherUnitTwo) {
return r.otherUnitTwo + '=' + r.ratioTwo + r.basicUnit;
}
}
}
},
{ title: '副单位3', align:"center", dataIndex: 'otherUnitThree', width:100,
customRender:function (t,r,index) {
if (r) {
if(r.otherUnitThree) {
return r.otherUnitThree + '=' + r.ratioThree + r.basicUnit;
}
}
}
},
{
title: '操作',
dataIndex: 'action',
width:150,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/unit/list",
delete: "/erp/unit/delete",
deleteBatch: "/erp/unit/deleteBatch"
}
}
},
computed: {
},
methods: {
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-213
View File
@@ -1,213 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="输入登录名称模糊查询" v-model="queryParam.loginName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="输入用户姓名模糊查询" v-model="queryParam.userName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px">
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(0)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(2)"><a-icon type="close-square"/>禁用</a-menu-item>
</a-menu>
<a-button>
批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
bordered
size="middle"
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a v-if="btnEnableList.indexOf(1)>-1 && depotFlag === '1' " @click="btnSetDepot(record)">分配仓库</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1 && depotFlag === '1'" type="vertical" />
<a v-if="btnEnableList.indexOf(1)>-1 && customerFlag === '1'" @click="btnSetCustomer(record)">分配客户</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1 && customerFlag === '1'" type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical"/>
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical"/>
<a-popconfirm title="确定重置密码为123456吗?" @confirm="() => handleReset(record.id)">
<a>重置密码</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="status">
<a-tag v-if="status===0" color="green">启用</a-tag>
<a-tag v-if="status===2" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
<user-depot-modal ref="userDepotModal" @ok="modalFormOk"></user-depot-modal>
<user-customer-modal ref="userCustomerModal" @ok="modalFormOk"></user-customer-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- b y 7 5 2 7 1 8 9 2 0 -->
<script>
import UserModal from './modules/UserModal'
import UserDepotModal from './modules/UserDepotModal'
import UserCustomerModal from './modules/UserCustomerModal'
import {postAction} from '@/api/manage';
import {getCurrentSystemConfig} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import JInput from '@/components/jeecg/JInput'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "UserList",
mixins: [JeecgListMixin,tableDragResizeMixin],
components: {
UserModal,
UserDepotModal,
UserCustomerModal,
JInput
},
data() {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
queryParam: {},
depotFlag: '0',
customerFlag: '0',
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:40,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '登录名称', dataIndex: 'loginName', width: 100, align: "center"},
{ title: '用户姓名', dataIndex: 'username', width: 100, align: "center"},
{ title: '用户类型', dataIndex: 'userType', width: 80, align: "center" },
{ title: '角色', dataIndex: 'roleName', width: 100, align: "center"},
{ title: '机构', dataIndex: 'orgAbr', width: 115, align: "center"},
{ title: '电话号码', dataIndex: 'phonenum', width: 120, align: "center"},
{ title: '排序', dataIndex: 'userBlngOrgaDsplSeq', width: 60, align: "center"},
{ title: '状态',dataIndex: 'status',width:70,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 260
}
],
url: {
list: "/erp/user/list",
delete: "/erp/user/delete",
deleteBatch: "/erp/user/deleteBatch",
resetPwd: "/erp/user/resetPwd",
batchSetStatusUrl: "/erp/user/batchSetStatus"
},
}
},
created () {
this.getSystemConfig()
},
methods: {
getSystemConfig() {
getCurrentSystemConfig().then((res) => {
if(res.code === 200 && res.data){
this.depotFlag = res.data.depotFlag
this.customerFlag = res.data.customerFlag
}
})
},
searchQuery() {
this.loadData(1);
this.getSystemConfig();
},
searchReset() {
this.queryParam = {}
this.loadData(1);
this.getSystemConfig();
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
},
handleReset(id) {
let that = this;
postAction(that.url.resetPwd, {id: id}).then((res) => {
if(res.code === 200){
that.$message.info('重置密码成功!');
that.loadData();
} else {
that.$message.warning(res.msg);
}
})
},
btnSetDepot(record) {
this.$refs.userDepotModal.edit(record);
this.$refs.userDepotModal.title = "分配仓库";
this.$refs.userDepotModal.disableSubmit = false;
},
btnSetCustomer(record) {
this.$refs.userCustomerModal.edit(record);
this.$refs.userCustomerModal.title = "分配客户";
this.$refs.userCustomerModal.disableSubmit = false;
},
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-193
View File
@@ -1,193 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :style="cardStyle" :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入名称查询" v-model="queryParam.supplier"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入手机号码查询" v-model="queryParam.telephone"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入联系电话查询" v-model="queryParam.phonenum"></a-input>
</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 v-if="btnEnableList.indexOf(1)>-1" type="primary" icon="plus" @click="handleAdd">新增</a-button>
<a-upload v-if="btnEnableList.indexOf(1)>-1" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-popover title="导入注意点">
<template slot="content">
<p><a target="_blank" href="/doc/vendor_template.xls"><b>供应商Excel模板下载</b></a></p>
</template>
<a-button type="primary" icon="import">导入</a-button>
</a-popover>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('供应商信息')">导出</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1" v-if="btnEnableList.indexOf(1)>-1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="2" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(true)"><a-icon type="check-square"/>启用</a-menu-item>
<a-menu-item key="3" v-if="btnEnableList.indexOf(1)>-1" @click="batchSetStatus(false)"><a-icon type="close-square"/>禁用</a-menu-item>
</a-menu>
<a-button>
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:components="drag(columns)"
:dataSource="dataSource"
:pagination="ipagination"
:scroll="scroll"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider v-if="btnEnableList.indexOf(1)>-1" type="vertical" />
<a-popconfirm v-if="btnEnableList.indexOf(1)>-1" title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderFlag" slot-scope="enabled">
<a-tag v-if="enabled" color="green">启用</a-tag>
<a-tag v-if="!enabled" color="orange">禁用</a-tag>
</template>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<vendor-modal ref="modalForm" @ok="modalFormOk"></vendor-modal>
</a-card>
</a-col>
</a-row>
</template>
<!-- b y 7 5 2 7 1 8 9 2 0 -->
<script>
import VendorModal from './modules/VendorModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { openDownloadDialog, sheet2blob} from "@/utils/util"
import JDate from '@/components/jeecg/JDate'
import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: "VendorList",
mixins:[JeecgListMixin,tableDragResizeMixin],
components: {
VendorModal,
JDate
},
data () {
return {
labelCol: {
span: 5
},
wrapperCol: {
span: 18,
offset: 1
},
// 查询条件
queryParam: {
supplier:'',
type:'供应商',
telephone:'',
phonenum:''
},
ipagination:{
pageSizeOptions: ['10', '20', '30', '100', '200']
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{ title: '名称',dataIndex: 'supplier',width:150},
{ title: '联系人', dataIndex: 'contacts',width:70,align:"center"},
{ title: '手机号码', dataIndex: 'telephone',width:100,align:"center"},
{ title: '联系电话', dataIndex: 'phoneNum',width:100,align:"center"},
{ title: '电子邮箱', dataIndex: 'email',width:150,align:"center"},
{ title: '期初应付',dataIndex: 'beginNeedPay',width:80,align:"center"},
{ title: '期末应付',dataIndex: 'allNeedPay',width:80,align:"center"},
{ title: '税率(%)', dataIndex: 'taxRate',width:80,align:"center"},
{ title: '状态',dataIndex: 'enabled',width:70,align:"center",
scopedSlots: { customRender: 'customRenderFlag' }
},
{
title: '操作',
dataIndex: 'action',
width: 200,
align:"center",
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/erp/supplier/list",
delete: "/erp/supplier/delete",
deleteBatch: "/erp/supplier/deleteBatch",
importExcelUrl: "/erp/supplier/importVendor",
exportXlsUrl: "/erp/supplier/exportExcel",
batchSetStatusUrl: "/erp/supplier/batchSetStatus"
}
}
},
computed: {
importExcelUrl: function () {
return `${process.env.VUE_APP_BASE_API}${this.url.importExcelUrl}`;
}
},
methods: {
searchReset() {
this.queryParam = {
type:'供应商',
}
this.loadData(1);
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
if(this.btnEnableList.indexOf(1)===-1) {
this.$refs.modalForm.isReadOnly = true
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
</style>
-174
View File
@@ -1,174 +0,0 @@
<template>
<a-row :gutter="24">
<a-col :md="24">
<a-card :bordered="false">
<div style="width: 50%; margin: 0 auto">
<!-- 本期明细 -->
<div class="table-page-search-wrapper">
<div class="detailed">本期明细</div>
</div>
<!-- 本期开始时间 -->
<div class="table-operator font-size" style="margin: 20px 0px">
<p>本期开始时间:2020-20-20 00:00:00</p>
</div>
<!-- 金额||总计 -->
<div class="Statistics font-size">
<p>财务营收统计:{{RevenueStatistics}}</p>
<p>财务应付统计:{{PayableStatistics}}</p>
</div>
<div class="Statistics font-size">
<p>出库金额总计:{{DeliveryAmount}}</p>
<p>入库金额总计:{{ReceiptAmount}}</p>
</div>
<div class="Statistics font-size">
<p>物料金额总计:{{MaterialAmount}}</p>
</div>
<div class="button">
<a-button type="primary" @click="CarryForward">立即结转</a-button>
</div>
</div>
<a-modal v-model="CarryForwardMessage" title="操作提示" @ok="handleTipOk">
<p>确定结转嘛</p>
</a-modal>
</a-card>
</a-col>
</a-row>
</template>
<!--power by ji shenghua-->
<script>
// import InventoryReviewModal from './modules/InventoryReviewModal.vue'
// import BillDetail from './dialog/BillDetail'
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
// import { BillListMixin } from './mixins/BillListMixin'
// import JDate from '@/components/jeecg/JDate'
// import Vue from 'vue'
// import ListColumnsSetter from '@/components/ListColumnsSetter'
// import tableDragResizeMixin from '@/mixins/tableDragResizeMixin'
export default {
name: 'InventorySeason',
// mixins: [JeecgListMixin],
components: {
// InventoryReviewModal,
// BillDetail,
// JDate,
// ListColumnsSetter,
},
data() {
return {
CarryForwardMessage: false,
RevenueStatistics:0.00,
PayableStatistics:0.00,
DeliveryAmount:0.00,
ReceiptAmount:33.33,
MaterialAmount:11111.11
// 查询条件
// queryParam: {
// number: '',
// materialParam: '',
// type: '其它',
// subType: '盘点复盘',
// roleType: Vue.ls.get('roleType'),
// organId: '',
// depotId: '',
// creator: '',
// linkNumber: '',
// },
// labelCol: {
// span: 5,
// },
// wrapperCol: {
// span: 18,
// offset: 1,
// },
// // 表头
// columns: [
// {
// title: '单据编号',
// dataIndex: 'number',
// width: 160,
// align: 'center',
// customRender: function (text, record, index) {
// if (record.linkNumber) {
// return text + '[转]'
// } else {
// return text
// }
// },
// },
// {
// title: '商品信息',
// dataIndex: 'materialsList',
// width: 220,
// align: 'center',
// ellipsis: true,
// customRender: function (text, record, index) {
// if (text) {
// return text.replace(',', '')
// }
// },
// },
// { title: '单据日期', dataIndex: 'operTimeStr', width: 145, align: 'center' },
// { title: '操作员', dataIndex: 'userName', width: 80, align: 'center', ellipsis: true },
// { title: '金额合计', dataIndex: 'totalPrice', width: 80, align: 'center' },
// {
// 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: {},
created() {
// this.initSupplier()
// this.getDepotData()
// this.initUser()
},
methods: {
CarryForward() {
this.CarryForwardMessage = true
},
handleTipOk() {
this.CarryForwardMessage = false
},
},
}
</script>
<style scoped>
/* @import '~@assets/less/common.less'; */
.detailed {
font-size: 30px;
font-weight: bold;
}
.Statistics {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.font-size {
font-size: 15px;
}
.ant-btn {
width: 140px;
height: 40px;
}
.button {
text-align: center;
}
</style>
@@ -1,146 +0,0 @@
<template>
<a-modal
:title="title"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:20%;height: 60%;overflow-y: hidden">
<template slot="footer">
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
关闭
</a-button>
</template>
<a-spin :spinning="confirmLoading">
<a-form :form="form" id="accountModal">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="名称">
<a-input placeholder="请输入名称" v-decorator.trim="[ 'name', validatorRules.name]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="编号">
<a-input placeholder="请输入编号" v-decorator.trim="[ 'serialNo', validatorRules.serialNo]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="期初金额">
<a-input placeholder="请输入期初金额" v-decorator.trim="[ 'initialAmount' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="当前余额">
<a-input placeholder="请输入当前余额" :read-only="true" v-decorator.trim="[ 'currentAmount' ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import {addAccount,editAccount,checkAccount } from '@/api/api'
import {autoJumpNextInput} from "@/utils/util"
export default {
name: "AccountModal",
data () {
return {
title:"操作",
visible: false,
model: {},
isReadOnly: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
name:{
rules: [
{ required: true, message: '请输入名称!' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
{ validator: this.validateAccountName}
]},
serialNo:{
rules: [
{ required: true, message: '请输入编号!' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
]
}
},
}
},
created () {
},
methods: {
add () {
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'name', 'serialNo', 'initialAmount', 'currentAmount', 'remark'))
autoJumpNextInput('accountModal')
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
let obj;
if(!this.model.id){
obj=addAccount(formData);
}else{
obj=editAccount(formData);
}
obj.then((res)=>{
if(res.code === 200){
that.$emit('ok');
}else{
that.$message.warning(res.msg);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
validateAccountName(rule, value, callback){
let params = {
name: value,
id: this.model.id?this.model.id:0
};
checkAccount(params).then((res)=>{
if(res && res.code===200) {
if(!res.data.status){
callback();
} else {
callback("名称已经存在");
}
} else {
callback(res.data);
}
});
}
}
}
</script>
<style scoped>
</style>

Some files were not shown because too many files have changed in this diff Show More