commit
3ece7c3baf
@ -1,275 +1,287 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="区域名称">
|
||||
<el-input v-model="query.mName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()" />
|
||||
</el-tooltip>
|
||||
<screenfull isContainer />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column prop="mName" label="区域名称" width="0" align="left" />
|
||||
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
|
||||
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
|
||||
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
|
||||
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="区域名称">
|
||||
<el-input v-model="query.mName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="mName" label="区域名称" width="300" align="center"sortable fixed="left" />
|
||||
<el-table-column prop="creatortime" label="创建时间" width="300" sortablealign="center"/>
|
||||
<el-table-column prop="creatorusername" label="创建人名称" width="300" sortablealign="center"/>
|
||||
<el-table-column prop="lastmodifytime" label="修改时间" width="300" sortablealign="center"/>
|
||||
<el-table-column prop="lastmodifyusername" label="修改人名称" width="300"sortable align="center"/>
|
||||
<el-table-column label="操作" fixed="right" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
JNPFForm,
|
||||
ExportBox,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
mName: undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [{
|
||||
prop: 'mName',
|
||||
label: '区域名称'
|
||||
},
|
||||
{
|
||||
prop: 'creatortime',
|
||||
label: '创建时间'
|
||||
},
|
||||
{
|
||||
prop: 'creatorusername',
|
||||
label: '创建人名称'
|
||||
},
|
||||
{
|
||||
prop: 'lastmodifytime',
|
||||
label: '修改时间'
|
||||
},
|
||||
{
|
||||
prop: 'lastmodifyusername',
|
||||
label: '修改人名称'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({
|
||||
column,
|
||||
prop,
|
||||
order
|
||||
}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
export default {
|
||||
components: {
|
||||
JNPFForm,
|
||||
ExportBox,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
mName: undefined
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [{
|
||||
prop: 'mName',
|
||||
label: '区域名称'
|
||||
},
|
||||
{
|
||||
prop: 'creatortime',
|
||||
label: '创建时间'
|
||||
},
|
||||
{
|
||||
prop: 'creatorusername',
|
||||
label: '创建人名称'
|
||||
},
|
||||
{
|
||||
prop: 'lastmodifytime',
|
||||
label: '修改时间'
|
||||
},
|
||||
{
|
||||
prop: 'lastmodifyusername',
|
||||
label: '修改人名称'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({
|
||||
column,
|
||||
prop,
|
||||
order
|
||||
}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||
10) : '';
|
||||
res.data.list[i].lastmodifytime = res.data.list[i].lastmodifytime ? res.data.list[i].lastmodifytime.substring(0,
|
||||
10) : '';
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {
|
||||
...data,
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {
|
||||
...data,
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/areasetting/Areasetting/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,394 +1,409 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务日期"
|
||||
prop="businessDate">
|
||||
<el-date-picker v-model="dataForm.businessDate"
|
||||
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
|
||||
value-format="timestamp">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户名称"
|
||||
prop="customerName" >
|
||||
<el-input v-model="dataForm.customerName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务日期"
|
||||
prop="businessDate">
|
||||
<el-date-picker v-model="dataForm.businessDate"
|
||||
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
|
||||
value-format="timestamp">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户"
|
||||
prop="customerName">
|
||||
<el-input v-model="dataForm.customerName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="金额"
|
||||
prop="amount" >
|
||||
<el-input v-model="dataForm.amount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额"
|
||||
prop="amount">
|
||||
<el-input v-model="dataForm.amount "
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="数量"
|
||||
prop="quantity" >
|
||||
<el-input v-model="dataForm.quantity"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商品数量"
|
||||
prop="quantity">
|
||||
<el-input v-model="dataForm.quantity"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票数量"
|
||||
prop="invoiceQuantity" >
|
||||
<el-input v-model="dataForm.invoiceQuantity"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票数量"
|
||||
prop="invoiceQuantity">
|
||||
<el-input v-model="dataForm.invoiceQuantity"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户税号"
|
||||
prop="customerTaxNo" >
|
||||
<el-input v-model="dataForm.customerTaxNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户税号"
|
||||
prop="customerTaxNo">
|
||||
<el-input v-model="dataForm.customerTaxNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="客户地址"
|
||||
prop="customerAddress" >
|
||||
<el-input v-model="dataForm.customerAddress"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户地址"
|
||||
prop="customerAddress">
|
||||
<el-input v-model="dataForm.customerAddress"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别 "
|
||||
prop="currency" >
|
||||
<el-select v-model="dataForm.currency"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别 "
|
||||
prop="currency">
|
||||
<el-select v-model="dataForm.currency"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注"
|
||||
prop="remark">
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票金额"
|
||||
prop="invoiceAmount" >
|
||||
<el-input v-model="dataForm.invoiceAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票金额"
|
||||
prop="invoiceAmount">
|
||||
<el-input v-model="dataForm.invoiceAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="销售订单号"
|
||||
prop="salesOrderNo" >
|
||||
<el-input v-model="dataForm.salesOrderNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="销售订单号"
|
||||
prop="salesOrderNo">
|
||||
<el-input v-model="dataForm.salesOrderNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractName" >
|
||||
<el-input v-model="dataForm.contractName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractName">
|
||||
<el-input v-model="dataForm.contractName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据状态 "
|
||||
prop="status" >
|
||||
<el-select v-model="dataForm.status"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据状态 "
|
||||
prop="status">
|
||||
<el-select v-model="dataForm.status"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="制单人"
|
||||
prop="creatorUserName" >
|
||||
<el-input v-model="dataForm.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制单人"
|
||||
prop="creatorUserName">
|
||||
<el-input v-model="dataForm.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activewkrlwe" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="应收明细">
|
||||
</el-tab-pane >
|
||||
<el-tab-pane label="发票明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.arinvoices_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="invoiceCode" label="发票代码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceCode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceNo" label="发票号码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxRate" label="税率 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.taxRate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.taxAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountNotTax" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amountNotTax"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="开票人">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activewkrlwe" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="应收明细">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发票明细">
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.arinvoices_item0List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center"/>
|
||||
<el-table-column prop="invoiceCode" label="发票代码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceCode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceNo" label="发票号码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxRate" label="税率 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.taxRate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taxAmount" label="税额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.taxAmount"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amountNotTax" label="不含税金额">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.amountNotTax"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="开票人">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="remark" label="备注信息">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注信息">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="50" >
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delarinvoices_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addarinvoices_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delarinvoices_item0List(scope.$index)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addarinvoices_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo : '',
|
||||
businessDate : '',
|
||||
customerName : '',
|
||||
amount : '',
|
||||
quantity : '',
|
||||
invoiceQuantity : '',
|
||||
customerTaxNo : '',
|
||||
customerAddress : '',
|
||||
currency : "0",
|
||||
remark : '',
|
||||
invoiceAmount : '',
|
||||
salesOrderNo : '',
|
||||
contractName : '',
|
||||
status : "0",
|
||||
creatorUserName : '',
|
||||
arinvoices_item0List:[],
|
||||
},
|
||||
activewkrlwe:'1',
|
||||
rules:
|
||||
{
|
||||
},
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
|
||||
taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
arinvoices_item0Exist() {
|
||||
let isOk = true;
|
||||
for(let i=0;i<this.dataForm.arinvoices_item0List.length;i++){
|
||||
const e = this.dataForm.arinvoices_item0List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.arinvoices_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addarinvoices_item0List(){
|
||||
let item = {
|
||||
invoiceCode:undefined,
|
||||
invoiceNo:undefined,
|
||||
taxRate:undefined,
|
||||
taxAmount:undefined,
|
||||
amountNotTax:undefined,
|
||||
creatorUserName:undefined,
|
||||
}
|
||||
this.dataForm.arinvoices_item0List.push(item)
|
||||
},
|
||||
delarinvoices_item0List(index) {
|
||||
this.dataForm.arinvoices_item0List.splice(index, 1);
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for(let i=0;i<_data.arinvoices_item0List.length;i++){
|
||||
var _list = _data.arinvoices_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.arinvoices_item0List.length;i++){
|
||||
var _list = _dataAll.arinvoices_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo: '',
|
||||
businessDate: '',
|
||||
customerName: '',
|
||||
amount: '',
|
||||
quantity: '',
|
||||
invoiceQuantity: '',
|
||||
customerTaxNo: '',
|
||||
customerAddress: '',
|
||||
currency: '0',
|
||||
remark: '',
|
||||
invoiceAmount: '',
|
||||
salesOrderNo: '',
|
||||
contractName: '',
|
||||
status: '0',
|
||||
creatorUserName: '',
|
||||
arinvoices_item0List: []
|
||||
},
|
||||
activewkrlwe: '1',
|
||||
rules:
|
||||
{},
|
||||
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||
'fullName': '已审批',
|
||||
'id': '2'
|
||||
}],
|
||||
|
||||
taxRateOptions: [{ 'fullName': '13', 'id': '0' }, { 'fullName': '9', 'id': '1' }, {
|
||||
'fullName': '6',
|
||||
'id': '2'
|
||||
}, { 'fullName': '5', 'id': '3' }, { 'fullName': '3', 'id': '4' }, { 'fullName': '0', 'id': '5' }]
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
arinvoices_item0Exist() {
|
||||
let isOk = true
|
||||
for (let i = 0; i < this.dataForm.arinvoices_item0List.length; i++) {
|
||||
const e = this.dataForm.arinvoices_item0List[i]
|
||||
}
|
||||
return isOk
|
||||
},
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = []
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key])
|
||||
} else {
|
||||
data[key] = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.isDetail = isDetail || false
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.arinvoices_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/arinvoices/Arinvoices/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addarinvoices_item0List() {
|
||||
let item = {
|
||||
invoiceCode: undefined,
|
||||
invoiceNo: undefined,
|
||||
taxRate: undefined,
|
||||
taxAmount: undefined,
|
||||
amountNotTax: undefined,
|
||||
creatorUserName: undefined
|
||||
}
|
||||
this.dataForm.arinvoices_item0List.push(item)
|
||||
},
|
||||
delarinvoices_item0List(index) {
|
||||
this.dataForm.arinvoices_item0List.splice(index, 1)
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
||||
for (let i = 0; i < _data.arinvoices_item0List.length; i++) {
|
||||
var _list = _data.arinvoices_item0List[i]
|
||||
}
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
for (let i = 0; i < _dataAll.arinvoices_item0List.length; i++) {
|
||||
var _list = _dataAll.arinvoices_item0List[i]
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,295 +1,315 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">编辑
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">删除
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">审核
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">弃审
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">提交
|
||||
</el-button>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">编辑
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">删除
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">审核
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">弃审
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-plus" @click="1">提交
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false" @selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="documentNo" label="单据编号" sortable width="200" align="center" fixed="left"
|
||||
/>
|
||||
<el-table-column prop="customerName" label="客户名称" sortable width="150" align="center" fixed="left"
|
||||
/>
|
||||
<el-table-column prop="amount" label="金额" width="120" sortable align="center"
|
||||
/>
|
||||
<el-table-column prop="quantity" label="数量" width="120" sortable align="center"
|
||||
/>
|
||||
<el-table-column label="币别 " width="80" prop="currency" sortable algin="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" sortable width="120" align="center"
|
||||
/>
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量" sortable width="120" align="center"
|
||||
/>
|
||||
<el-table-column prop="salesOrderNo" label="销售订单号" sortable width="200" align="center"
|
||||
/>
|
||||
<el-table-column prop="contractName" label="合同名称" sortable width="200" align="center"
|
||||
/>
|
||||
<el-table-column label="单据状态 " width="120" sortable prop="status" algin="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="制单人" width="120" sortable align="center"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center"/>
|
||||
<el-table-column prop="documentNo" label="单据编号" sortable width="200" align="center" fixed="left"
|
||||
/>
|
||||
<el-table-column prop="customerName" label="客户名称" sortable width="150" align="center" fixed="left"
|
||||
/>
|
||||
<el-table-column prop="amount" label="金额" width="120" sortable align="center"
|
||||
/>
|
||||
<el-table-column prop="quantity" label="数量" width="120" sortable align="center"
|
||||
/>
|
||||
<el-table-column label="币别 " width="80" prop="currency" sortable algin="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" sortable width="120" align="center"
|
||||
/>
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量" sortable width="120" align="center"
|
||||
/>
|
||||
<el-table-column prop="salesOrderNo" label="销售订单号" sortable width="200" align="center"
|
||||
/>
|
||||
<el-table-column prop="contractName" label="合同名称" sortable width="200" align="center"
|
||||
/>
|
||||
<el-table-column label="单据状态 " width="120" sortable prop="status" algin="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="制单人" width="120" sortable align="center"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail">撤回申请
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail">审核
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail">弃审
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail">提交
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'documentNo', label: '单据编号'},
|
||||
{prop: 'customerName', label: '客户名称'},
|
||||
{prop: 'amount', label: '金额'},
|
||||
{prop: 'quantity', label: '数量'},
|
||||
{prop: 'currency', label: '币别 '},
|
||||
{prop: 'invoiceAmount', label: '发票金额'},
|
||||
{prop: 'invoiceQuantity', label: '发票数量'},
|
||||
{prop: 'salesOrderNo', label: '销售订单号'},
|
||||
{prop: 'contractName', label: '合同名称'},
|
||||
{prop: 'status', label: '单据状态 '},
|
||||
{prop: 'creatorUserName', label: '制单人'},
|
||||
],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
currencyProps:{"label":"fullName","value":"id"},
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
statusProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'documentNo', label: '单据编号' },
|
||||
{ prop: 'customerName', label: '客户名称' },
|
||||
{ prop: 'amount', label: '金额' },
|
||||
{ prop: 'quantity', label: '数量' },
|
||||
{ prop: 'currency', label: '币别 ' },
|
||||
{ prop: 'invoiceAmount', label: '发票金额' },
|
||||
{ prop: 'invoiceQuantity', label: '发票数量' },
|
||||
{ prop: 'salesOrderNo', label: '销售订单号' },
|
||||
{ prop: 'contractName', label: '合同名称' },
|
||||
{ prop: 'status', label: '单据状态 ' },
|
||||
{ prop: 'creatorUserName', label: '制单人' }
|
||||
],
|
||||
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||
'fullName': '已审批',
|
||||
'id': '2'
|
||||
}],
|
||||
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/arinvoices/Arinvoices/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,334 +1,342 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户编码">
|
||||
<el-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户名称">
|
||||
<el-input v-model="query.supplierNm" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="纳税编号">
|
||||
<el-input v-model="query.vatRegistrationNum" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="showAll">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="query.contactName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
|
||||
展开
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
||||
收起
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="supplierCd" label="客户编码" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="supplierNm" label="客户名称" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="orgId" label="公司ID" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="vatRegistrationNum" label="纳税编号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="客户等级" width="0" prop="customerLevel" algin="left"
|
||||
sortable="custom" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactName" label="联系人" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="country" label="国家" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="contactPhone" label="电话" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<!-- <el-table-column prop="province" label="省市县" width="0" align="left"-->
|
||||
<!--/>-->
|
||||
<el-table-column prop="bank" label="开户行" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="是否启用" width="0" prop="status" algin="left"
|
||||
sortable="custom" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bankAccount" label="银行账号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="企业性质" width="0" prop="enterprise" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.enterprise | dynamicText(enterpriseOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column label="客户分类" width="0" prop="classification" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.classification | dynamicText(classificationOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户编码">
|
||||
<el-input v-model="query.supplierCd" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户名称">
|
||||
<el-input v-model="query.supplierNm" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="纳税编号">
|
||||
<el-input v-model="query.vatRegistrationNum" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="showAll">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="query.contactName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
|
||||
展开
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
||||
收起
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="supplierCd" label="客户编码" width="200" align="center" sortable fixed="left"
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="supplierNm" label="客户名称" width="200" align="center" sortable fixed="left"
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="orgId" label="公司ID" width="200" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="vatRegistrationNum" label="纳税编号" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="客户等级" width="120" prop="customerLevel" algin="center" sortable
|
||||
sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactName" label="联系人" width="120" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="country" label="国家" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="contactPhone" label="电话" width="150" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<!-- <el-table-column prop="province" label="省市县" width="0" align="left"-->
|
||||
<!--/>-->
|
||||
<el-table-column prop="bank" label="开户行" width="200" align="left" sortable
|
||||
/>
|
||||
<el-table-column label="是否启用" width="120" prop="status" algin="left" sortable
|
||||
sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bankAccount" label="银行账号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="企业性质" width="0" prop="enterprise" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.enterprise | dynamicText(enterpriseOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址" width="0" align="left"
|
||||
sortable="custom"/>
|
||||
<el-table-column label="客户分类" width="0" prop="classification" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.classification | dynamicText(classificationOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
showAll: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
supplierCd:undefined,
|
||||
supplierNm:undefined,
|
||||
vatRegistrationNum:undefined,
|
||||
contactName:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'supplierCd', label: '客户编码'},
|
||||
{prop: 'supplierNm', label: '客户名称'},
|
||||
{prop: 'orgId', label: '公司ID'},
|
||||
{prop: 'vatRegistrationNum', label: '纳税编号'},
|
||||
{prop: 'customerLevel', label: '客户等级'},
|
||||
{prop: 'contactName', label: '联系人'},
|
||||
{prop: 'country', label: '国家'},
|
||||
{prop: 'contactPhone', label: '电话'},
|
||||
{prop: 'province', label: '省市县'},
|
||||
{prop: 'bank', label: '开户行'},
|
||||
{prop: 'status', label: '是否启用'},
|
||||
{prop: 'bankAccount', label: '银行账号'},
|
||||
{prop: 'enterprise', label: '企业性质'},
|
||||
{prop: 'address', label: '地址'},
|
||||
{prop: 'classification', label: '客户分类'},
|
||||
],
|
||||
customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
|
||||
customerLevelProps:{"label":"fullName","value":"id"},
|
||||
statusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}],
|
||||
statusProps:{"label":"fullName","value":"id"},
|
||||
enterpriseOptions:[{"fullName":"民营","id":"0"},{"fullName":"私企","id":"1"}],
|
||||
enterpriseProps:{"label":"fullName","value":"id"},
|
||||
classificationOptions:[{"fullName":"国内","id":"0"},{"fullName":"国外","id":"1"}],
|
||||
classificationProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
showAll: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
supplierCd: undefined,
|
||||
supplierNm: undefined,
|
||||
vatRegistrationNum: undefined,
|
||||
contactName: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/Customer/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'supplierCd', label: '客户编码' },
|
||||
{ prop: 'supplierNm', label: '客户名称' },
|
||||
{ prop: 'orgId', label: '公司ID' },
|
||||
{ prop: 'vatRegistrationNum', label: '纳税编号' },
|
||||
{ prop: 'customerLevel', label: '客户等级' },
|
||||
{ prop: 'contactName', label: '联系人' },
|
||||
{ prop: 'country', label: '国家' },
|
||||
{ prop: 'contactPhone', label: '电话' },
|
||||
{ prop: 'province', label: '省市县' },
|
||||
{ prop: 'bank', label: '开户行' },
|
||||
{ prop: 'status', label: '是否启用' },
|
||||
{ prop: 'bankAccount', label: '银行账号' },
|
||||
{ prop: 'enterprise', label: '企业性质' },
|
||||
{ prop: 'address', label: '地址' },
|
||||
{ prop: 'classification', label: '客户分类' }
|
||||
],
|
||||
customerLevelOptions: [{ 'fullName': '一级', 'id': '1' }, { 'fullName': '二级', 'id': '2' }, {
|
||||
'fullName': '三级',
|
||||
'id': '3'
|
||||
}],
|
||||
customerLevelProps: { 'label': 'fullName', 'value': 'id' },
|
||||
statusOptions: [{ 'fullName': '启用', 'id': '1' }, { 'fullName': '禁用', 'id': '2' }],
|
||||
statusProps: { 'label': 'fullName', 'value': 'id' },
|
||||
enterpriseOptions: [{ 'fullName': '民营', 'id': '0' }, { 'fullName': '私企', 'id': '1' }],
|
||||
enterpriseProps: { 'label': 'fullName', 'value': 'id' },
|
||||
classificationOptions: [{ 'fullName': '国内', 'id': '0' }, { 'fullName': '国外', 'id': '1' }],
|
||||
classificationProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/example/Customer/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Customer/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Customer/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/example/Customer/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Customer/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Customer/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/Customer/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,387 +1,415 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo" >
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据编号"
|
||||
prop="documentNo">
|
||||
<el-input v-model="dataForm.documentNo"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="业务日期"
|
||||
prop="businessDate" >
|
||||
<el-date-picker v-model="dataForm.businessDate"
|
||||
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="业务日期"
|
||||
prop="businessDate">
|
||||
<el-date-picker v-model="dataForm.businessDate"
|
||||
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
|
||||
value-format="timestamp">
|
||||
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="金额"
|
||||
prop="amount" >
|
||||
<el-input v-model="dataForm.amount"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="金额"
|
||||
prop="amount">
|
||||
<el-input v-model="dataForm.amount"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="数量"
|
||||
prop="quantity" >
|
||||
<el-input v-model="dataForm.quantity"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数量"
|
||||
prop="quantity">
|
||||
<el-input v-model="dataForm.quantity"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票类型"
|
||||
prop="invoiceType" >
|
||||
<el-select v-model="dataForm.invoiceType"
|
||||
placeholder="请选择" :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in invoiceTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票类型"
|
||||
prop="invoiceType">
|
||||
<el-select v-model="dataForm.invoiceType"
|
||||
placeholder="请选择" :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in invoiceTypeOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="币别 "
|
||||
prop="currency" >
|
||||
<el-select v-model="dataForm.currency"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币别 "
|
||||
prop="currency">
|
||||
<el-select v-model="dataForm.currency"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注"
|
||||
prop="remark">
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票金额"
|
||||
prop="invoiceAmount" >
|
||||
<el-input v-model="dataForm.invoiceAmount"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票金额"
|
||||
prop="invoiceAmount">
|
||||
<el-input v-model="dataForm.invoiceAmount"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="发票数量"
|
||||
prop="invoiceQuantity" >
|
||||
<el-input v-model="dataForm.invoiceQuantity"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发票数量"
|
||||
prop="invoiceQuantity">
|
||||
<el-input v-model="dataForm.invoiceQuantity"
|
||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="单据状态"
|
||||
prop="status" >
|
||||
<el-select v-model="dataForm.status"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单据状态"
|
||||
prop="status">
|
||||
<el-select v-model="dataForm.status"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled" ></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="制单人"
|
||||
prop="creatorUserName" >
|
||||
<el-input v-model="dataForm.creatorUserName"
|
||||
placeholder="请输入制单人" clearable :style='{"width":"100%"}'>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制单人"
|
||||
prop="creatorUserName">
|
||||
<el-input v-model="dataForm.creatorUserName"
|
||||
placeholder="请输入制单人" clearable :style='{"width":"100%"}' :disabled="true">
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="采购订单号"
|
||||
prop="purchaseorderId" >
|
||||
<popupSelect v-model="dataForm.purchaseorderId"
|
||||
placeholder="请选择" clearable field="purchaseorderId" interfaceId="389673535976550149" :columnOptions="purchaseorderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="采购订单号"
|
||||
prop="purchaseorderId">
|
||||
<popupSelect v-model="dataForm.purchaseorderId"
|
||||
placeholder="请选择" clearable field="purchaseorderId" interfaceId="389673535976550149"
|
||||
:columnOptions="purchaseorderIdcolumnOptions" propsValue="id" relationField="document_no"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractId" >
|
||||
<popupSelect v-model="dataForm.contractId"
|
||||
placeholder="请选择" clearable field="contractId" interfaceId="389673903103979269" :columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称"
|
||||
prop="contractId">
|
||||
<popupSelect v-model="dataForm.contractId"
|
||||
placeholder="请选择" clearable field="contractId" interfaceId="389673903103979269"
|
||||
:columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<el-form-item label="供应商"
|
||||
prop="supplierId" >
|
||||
<popupSelect v-model="dataForm.supplierId"
|
||||
placeholder="请选择" clearable field="supplierId" interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions" propsValue="id" relationField="supplier_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商"
|
||||
prop="supplierId">
|
||||
<popupSelect v-model="dataForm.supplierId"
|
||||
placeholder="请选择" clearable field="supplierId" interfaceId="389674191453990661"
|
||||
:columnOptions="supplierIdcolumnOptions" propsValue="id" relationField="supplier_name"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activebnrhzx" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="应付明细">
|
||||
</el-tab-pane >
|
||||
<el-tab-pane label="发票明细">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.invoices_item0List" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="invoiceCode" label="发票代码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceCode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceNo" label="发票号码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceStatus" label="发票状态 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.invoiceStatus"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="开票人">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoicingDate" label="开票日期">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker v-model="scope.row.invoicingDate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activebnrhzx" tab-position="top" class="mb-20">
|
||||
<el-tab-pane label="应付明细">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发票明细">
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.invoices_item0List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center"/>
|
||||
<el-table-column prop="invoiceCode" label="发票代码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceCode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceNo" label="发票号码">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.invoiceNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceStatus" label="发票状态 ">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.invoiceStatus"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="开票人">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.creatorUserName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoicingDate" label="开票日期">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker v-model="scope.row.invoicingDate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
|
||||
format="yyyy-MM-dd" value-format="timestamp">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="remark" label="备注信息">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注信息">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="50" >
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delinvoices_item0List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addinvoices_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-tab-pane >
|
||||
</el-tabs>
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delinvoices_item0List(scope.$index)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addinvoices_item0List()">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo : '',
|
||||
businessDate : '',
|
||||
amount : '',
|
||||
quantity : '',
|
||||
invoiceType : "1",
|
||||
currency : "",
|
||||
remark : '',
|
||||
invoiceAmount : '',
|
||||
invoiceQuantity : '',
|
||||
status : "0",
|
||||
creatorUserName : '',
|
||||
purchaseorderId : "",
|
||||
contractId : "",
|
||||
supplierId : "",
|
||||
invoices_item0List:[],
|
||||
},
|
||||
activebnrhzx:'1',
|
||||
rules:
|
||||
{
|
||||
},
|
||||
invoiceTypeOptions:[{"fullName":"普通增值税发票","id":"1"},{"fullName":"专用增值税发票","id":"2"},{"fullName":"增值税电子普通发票","id":"3"},{"fullName":"增值税电子发票","id":"4"}],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
purchaseorderIdcolumnOptions:[ {"label":"采购订单号","value":"document_no"},],
|
||||
contractIdcolumnOptions:[ {"label":"ID","value":"id"},{"label":"合同名称","value":"contract_name"},],
|
||||
supplierIdcolumnOptions:[ {"label":"ID","value":"id"},{"label":"供应商名称","value":"supplier_name"},],
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
|
||||
invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
invoices_item0Exist() {
|
||||
let isOk = true;
|
||||
for(let i=0;i<this.dataForm.invoices_item0List.length;i++){
|
||||
const e = this.dataForm.invoices_item0List[i];
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/invoices/Invoices/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.invoices_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/invoices/Invoices',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/invoices/Invoices/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addinvoices_item0List(){
|
||||
let item = {
|
||||
invoiceCode:undefined,
|
||||
invoiceNo:undefined,
|
||||
invoiceStatus:undefined,
|
||||
creatorUserName:undefined,
|
||||
invoicingDate:undefined,
|
||||
}
|
||||
this.dataForm.invoices_item0List.push(item)
|
||||
},
|
||||
delinvoices_item0List(index) {
|
||||
this.dataForm.invoices_item0List.splice(index, 1);
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
for(let i=0;i<_data.invoices_item0List.length;i++){
|
||||
var _list = _data.invoices_item0List[i];
|
||||
}
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
for(let i=0;i<_dataAll.invoices_item0List.length;i++){
|
||||
var _list = _dataAll.invoices_item0List[i];
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
excludeFields: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
documentNo: '',
|
||||
businessDate: '',
|
||||
amount: '',
|
||||
quantity: '',
|
||||
invoiceType: '1',
|
||||
currency: '',
|
||||
remark: '',
|
||||
invoiceAmount: '',
|
||||
invoiceQuantity: '',
|
||||
status: '0',
|
||||
creatorUserName: '',
|
||||
purchaseorderId: '',
|
||||
contractId: '',
|
||||
supplierId: '',
|
||||
invoices_item0List: []
|
||||
},
|
||||
activebnrhzx: '1',
|
||||
rules:
|
||||
{},
|
||||
invoiceTypeOptions: [{ 'fullName': '普通增值税发票', 'id': '1' }, {
|
||||
'fullName': '专用增值税发票',
|
||||
'id': '2'
|
||||
}, { 'fullName': '增值税电子普通发票', 'id': '3' }, { 'fullName': '增值税电子发票', 'id': '4' }],
|
||||
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||
'fullName': '已审批',
|
||||
'id': '2'
|
||||
}],
|
||||
purchaseorderIdcolumnOptions: [{ 'label': '采购订单号', 'value': 'document_no' }],
|
||||
contractIdcolumnOptions: [{ 'label': 'ID', 'value': 'id' }, { 'label': '合同名称', 'value': 'contract_name' }],
|
||||
supplierIdcolumnOptions: [{ 'label': 'ID', 'value': 'id' }, { 'label': '供应商名称', 'value': 'supplier_name' }],
|
||||
|
||||
invoiceStatusOptions: [{ 'fullName': '正常', 'id': '0' }, { 'fullName': '红冲', 'id': '1' }, {
|
||||
'fullName': '作废',
|
||||
'id': '2'
|
||||
}]
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
invoices_item0Exist() {
|
||||
let isOk = true
|
||||
for (let i = 0; i < this.dataForm.invoices_item0List.length; i++) {
|
||||
const e = this.dataForm.invoices_item0List[i]
|
||||
}
|
||||
return isOk
|
||||
},
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = []
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key])
|
||||
} else {
|
||||
data[key] = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.isDetail = isDetail || false
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/invoices/Invoices/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.invoices_item0Exist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/invoices/Invoices',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/invoices/Invoices/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
addinvoices_item0List() {
|
||||
let item = {
|
||||
invoiceCode: undefined,
|
||||
invoiceNo: undefined,
|
||||
invoiceStatus: undefined,
|
||||
creatorUserName: undefined,
|
||||
invoicingDate: undefined
|
||||
}
|
||||
this.dataForm.invoices_item0List.push(item)
|
||||
},
|
||||
delinvoices_item0List(index) {
|
||||
this.dataForm.invoices_item0List.splice(index, 1)
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
||||
for (let i = 0; i < _data.invoices_item0List.length; i++) {
|
||||
var _list = _data.invoices_item0List[i]
|
||||
}
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
for (let i = 0; i < _dataAll.invoices_item0List.length; i++) {
|
||||
var _list = _dataAll.invoices_item0List[i]
|
||||
}
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,286 +1,326 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="businessDate" label="业务日期" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="amount" label="金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="quantity" label="数量" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="币别 " width="0" prop="currency" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="发票类型" width="0" prop="invoiceType" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.invoiceType | dynamicText(invoiceTypeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" width="0" prop="status" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="制单人" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">查看
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">审核
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">弃审
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">提交
|
||||
</el-button>
|
||||
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="businessDate" label="业务日期" width="120" align="center" fixed="left" sortable
|
||||
/>
|
||||
<el-table-column prop="documentNo" label="单据编号" width="200" align="center" fixed="left" sortable
|
||||
/>
|
||||
<el-table-column prop="amount" label="金额" width="150" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="quantity" label="数量" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="币别 " width="120" prop="currency" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" width="150" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="invoiceQuantity" label="发票数量" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="发票类型" width="120" prop="invoiceType" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.invoiceType | dynamicText(invoiceTypeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据状态" width="120" prop="status" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="制单人" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
|
||||
<el-button type="text"
|
||||
@click="">撤回申请
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="">审核
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="">弃审
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="">提交
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'businessDate', label: '业务日期'},
|
||||
{prop: 'documentNo', label: '单据编号'},
|
||||
{prop: 'amount', label: '金额'},
|
||||
{prop: 'quantity', label: '数量'},
|
||||
{prop: 'currency', label: '币别 '},
|
||||
{prop: 'invoiceAmount', label: '发票金额'},
|
||||
{prop: 'invoiceQuantity', label: '发票数量'},
|
||||
{prop: 'invoiceType', label: '发票类型'},
|
||||
{prop: 'status', label: '单据状态'},
|
||||
{prop: 'creatorUserName', label: '制单人'},
|
||||
],
|
||||
invoiceTypeOptions:[{"fullName":"普通增值税发票","id":"1"},{"fullName":"专用增值税发票","id":"2"},{"fullName":"增值税电子普通发票","id":"3"},{"fullName":"增值税电子发票","id":"4"}],
|
||||
invoiceTypeProps:{"label":"fullName","value":"id"},
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
currencyProps:{"label":"fullName","value":"id"},
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
statusProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/invoices/Invoices/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'businessDate', label: '业务日期' },
|
||||
{ prop: 'documentNo', label: '单据编号' },
|
||||
{ prop: 'amount', label: '金额' },
|
||||
{ prop: 'quantity', label: '数量' },
|
||||
{ prop: 'currency', label: '币别 ' },
|
||||
{ prop: 'invoiceAmount', label: '发票金额' },
|
||||
{ prop: 'invoiceQuantity', label: '发票数量' },
|
||||
{ prop: 'invoiceType', label: '发票类型' },
|
||||
{ prop: 'status', label: '单据状态' },
|
||||
{ prop: 'creatorUserName', label: '制单人' }
|
||||
],
|
||||
invoiceTypeOptions: [{ 'fullName': '普通增值税发票', 'id': '1' }, {
|
||||
'fullName': '专用增值税发票',
|
||||
'id': '2'
|
||||
}, { 'fullName': '增值税电子普通发票', 'id': '3' }, { 'fullName': '增值税电子发票', 'id': '4' }],
|
||||
invoiceTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||
'fullName': '已审批',
|
||||
'id': '2'
|
||||
}],
|
||||
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/invoices/Invoices/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/invoices/Invoices/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/invoices/Invoices/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/invoices/Invoices/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||
10) : '';
|
||||
res.data.list[i].businessDate = res.data.list[i].businessDate ? res.data.list[i].businessDate
|
||||
.substring(0, 10) : '';
|
||||
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/invoices/Invoices/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/invoices/Invoices/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/invoices/Invoices/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,285 +1,293 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model="query.mName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="区域">
|
||||
<el-select v-model="query.monitoringId" placeholder="请选择区域"
|
||||
clearable>
|
||||
<el-option v-for="(item, index) in monitoringIdOptions" :key="index"
|
||||
:label="item.m_name" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="mName" label="设备名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="serialnumber" label="设备序列号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="monitoringId" label="区域" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="设备状态:" width="0" prop="mStatus" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.mStatus | dynamicText(mStatusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="channelNumber" label="设备通道号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="是否显示" width="0" prop="isEnable" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isEnable | dynamicText(isEnableOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model="query.mName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="区域">
|
||||
<el-select v-model="query.monitoringId" placeholder="请选择区域"
|
||||
clearable>
|
||||
<el-option v-for="(item, index) in monitoringIdOptions" :key="index"
|
||||
:label="item.m_name" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="mName" label="设备名称" width="300" align="center" sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="serialnumber" label="设备序列号" width="300" align="center" sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="monitoringId" label="区域" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="设备状态:" width="200" prop="mStatus" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.mStatus | dynamicText(mStatusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="channelNumber" label="设备通道号" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="是否显示" width="200" prop="isEnable" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isEnable | dynamicText(isEnableOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
mName:undefined,
|
||||
monitoringId:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'mName', label: '设备名称'},
|
||||
{prop: 'serialnumber', label: '设备序列号'},
|
||||
{prop: 'monitoringId', label: '区域'},
|
||||
{prop: 'mStatus', label: '设备状态:'},
|
||||
{prop: 'channelNumber', label: '设备通道号'},
|
||||
{prop: 'isEnable', label: '是否显示'},
|
||||
],
|
||||
monitoringIdOptions:[],
|
||||
monitoringIdProps:{"label":"m_name","value":"id"},
|
||||
mStatusOptions:[{"fullName":"在线","id":"1"},{"fullName":"不在线","id":"0"}],
|
||||
mStatusProps:{"label":"fullName","value":"id"},
|
||||
isEnableOptions:[{"fullName":"显示","id":"1"},{"fullName":"不显示","id":"0"}],
|
||||
isEnableProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
mName: undefined,
|
||||
monitoringId: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
this.getmonitoringIdOptions();
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
},
|
||||
methods: {
|
||||
getmonitoringIdOptions() {
|
||||
getDataInterfaceRes('370933183241262469').then(res => {
|
||||
let data = res.data.data
|
||||
this.monitoringIdOptions = data
|
||||
})
|
||||
},
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'mName', label: '设备名称' },
|
||||
{ prop: 'serialnumber', label: '设备序列号' },
|
||||
{ prop: 'monitoringId', label: '区域' },
|
||||
{ prop: 'mStatus', label: '设备状态:' },
|
||||
{ prop: 'channelNumber', label: '设备通道号' },
|
||||
{ prop: 'isEnable', label: '是否显示' }
|
||||
],
|
||||
monitoringIdOptions: [],
|
||||
monitoringIdProps: { 'label': 'm_name', 'value': 'id' },
|
||||
mStatusOptions: [{ 'fullName': '在线', 'id': '1' }, { 'fullName': '不在线', 'id': '0' }],
|
||||
mStatusProps: { 'label': 'fullName', 'value': 'id' },
|
||||
isEnableOptions: [{ 'fullName': '显示', 'id': '1' }, { 'fullName': '不显示', 'id': '0' }],
|
||||
isEnableProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
this.getmonitoringIdOptions()
|
||||
},
|
||||
methods: {
|
||||
getmonitoringIdOptions() {
|
||||
getDataInterfaceRes('370933183241262469').then(res => {
|
||||
let data = res.data.data
|
||||
this.monitoringIdOptions = data
|
||||
})
|
||||
},
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0, 10) : '';
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/Monitoringitem/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,195 +1,198 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="600px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label-width="0">
|
||||
<JNPF-Text :style='{"width":"100%"}'
|
||||
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}' value="自然人档案">
|
||||
</JNPF-Text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="姓名"
|
||||
prop="name" >
|
||||
<el-input v-model="dataForm.name"
|
||||
placeholder="请输入姓名" clearable :style='{"width":"100%"}'>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24">
|
||||
<el-form-item label-width="0">
|
||||
<JNPF-Text :style='{"width":"100%"}'
|
||||
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}'
|
||||
value="自然人档案">
|
||||
</JNPF-Text>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名"
|
||||
prop="name">
|
||||
<el-input v-model="dataForm.name"
|
||||
placeholder="请输入姓名" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="地址"
|
||||
prop="adress" >
|
||||
<el-input v-model="dataForm.adress"
|
||||
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="地址"
|
||||
prop="adress">
|
||||
<el-input v-model="dataForm.adress"
|
||||
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="手机号"
|
||||
prop="contact" >
|
||||
<el-input v-model="dataForm.contact"
|
||||
placeholder="请输入手机号" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="手机号"
|
||||
prop="contact">
|
||||
<el-input v-model="dataForm.contact"
|
||||
placeholder="请输入手机号" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="录入人"
|
||||
prop="creatorUserName" >
|
||||
<el-input v-model="dataForm.creatorUserName"
|
||||
placeholder="请输入录入人" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="录入人"-->
|
||||
<!-- prop="creatorUserName">-->
|
||||
<!-- <el-input v-model="dataForm.creatorUserName"-->
|
||||
<!-- placeholder="请输入录入人" clearable :style='{"width":"100%"}'>-->
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="创建时间"
|
||||
prop="creatorTime" >
|
||||
<el-input v-model="dataForm.creatorTime"
|
||||
placeholder="系统自动生成" readonly >
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="创建时间"-->
|
||||
<!-- prop="creatorTime">-->
|
||||
<!-- <el-input v-model="dataForm.creatorTime"-->
|
||||
<!-- placeholder="系统自动生成" readonly>-->
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
name : '',
|
||||
adress : '',
|
||||
contact : '',
|
||||
creatorUserName : '',
|
||||
creatorTime : "",
|
||||
},
|
||||
rules:
|
||||
{
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
},
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Jg_natural/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Jg_natural',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/example/Jg_natural/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
name: '',
|
||||
adress: '',
|
||||
contact: '',
|
||||
creatorUserName: '',
|
||||
creatorTime: ''
|
||||
},
|
||||
rules:
|
||||
{
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = []
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key])
|
||||
} else {
|
||||
data[key] = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.isDetail = isDetail || false
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Jg_natural/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Jg_natural',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/Jg_natural/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,256 +1,261 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="query.contact" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="name" label="姓名" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="adress" label="地址" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="contact" label="手机号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="录入人" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="creatorTime" label="创建时间" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="query.name" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="query.contact" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="name" label="姓名" width="300" align="center" fixed="left" sortable
|
||||
/>
|
||||
<el-table-column prop="adress" label="地址" width="300" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="contact" label="手机号" width="300" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="录入人" width="300" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="creatorTime" label="创建时间" width="300" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
name:undefined,
|
||||
contact:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'name', label: '姓名'},
|
||||
{prop: 'adress', label: '地址'},
|
||||
{prop: 'contact', label: '手机号'},
|
||||
{prop: 'creatorUserName', label: '录入人'},
|
||||
{prop: 'creatorTime', label: '创建时间'},
|
||||
],
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
name: undefined,
|
||||
contact: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/Jg_natural/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'name', label: '姓名' },
|
||||
{ prop: 'adress', label: '地址' },
|
||||
{ prop: 'contact', label: '手机号' },
|
||||
{ prop: 'creatorUserName', label: '录入人' },
|
||||
{ prop: 'creatorTime', label: '创建时间' }
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/example/Jg_natural/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Jg_natural/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Jg_natural/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/example/Jg_natural/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Jg_natural/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Jg_natural/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/Jg_natural/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,343 +1,353 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()" />
|
||||
</el-tooltip>
|
||||
<screenfull isContainer />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left" />
|
||||
<el-table-column prop="jg_purchaseorder.contractName" label="合同名称" width="0" align="left" />
|
||||
<el-table-column prop="jg_purchaseorder.supplierName" label="供应商名称" width="0" align="left" />
|
||||
<el-table-column prop="refundAmount" label="退货金额" width="0" align="left" />
|
||||
<el-table-column prop="actualAmount" label="实退金额" width="0" align="left" />
|
||||
<el-table-column label="币别 " width="0" prop="currency" algin="left">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="refundNum" label="退货数量" width="0" align="left" />
|
||||
<el-table-column label="单据状态 " width="0" prop="status" algin="left">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="创建时间" width="0" align="left" />
|
||||
<el-table-column prop="creatorUserName" label="创建人" width="0" align="left" />
|
||||
<el-table-column prop="remark" label="备注" width="0" align="left" />
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">查看
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="documentNo" label="单据编号" width="200" align="center"sortable fixed="left" />
|
||||
<el-table-column prop="jg_purchaseorder.contractName" label="合同名称" width="200" align="center"sortable/>
|
||||
<el-table-column prop="jg_purchaseorder.supplierName" label="供应商名称" width="200" align="center"sortable/>
|
||||
<el-table-column prop="refundAmount" label="退货金额" width="120" align="center"sortable/>
|
||||
<el-table-column prop="actualAmount" label="实退金额" width="120" align="center"sortable/>
|
||||
<el-table-column label="币别 " width="120" prop="currency" algin="center" sortable>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="refundNum" label="退货数量" width="120" align="center"sortable/>
|
||||
<el-table-column label="单据状态 " width="120" prop="status" algin="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="创建时间" width="120" align="center"sortable/>
|
||||
<el-table-column prop="creatorUserName" label="创建人" width="120" align="center"sortable/>
|
||||
<el-table-column prop="remark" label="备注" width="0" align="center"sortable/>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
JNPFForm,
|
||||
ExportBox,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo: undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [{
|
||||
prop: 'documentNo',
|
||||
label: '单据编号'
|
||||
},
|
||||
{
|
||||
prop: 'jg_purchaseorder.contractName',
|
||||
label: '合同名称'
|
||||
},
|
||||
{
|
||||
prop: 'jg_purchaseorder.supplierName',
|
||||
label: '供应商名称'
|
||||
},
|
||||
{
|
||||
prop: 'refundAmount',
|
||||
label: '退货金额'
|
||||
},
|
||||
{
|
||||
prop: 'actualAmount',
|
||||
label: '实退金额'
|
||||
},
|
||||
{
|
||||
prop: 'currency',
|
||||
label: '币别 '
|
||||
},
|
||||
{
|
||||
prop: 'refundNum',
|
||||
label: '退货数量'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '单据状态 '
|
||||
},
|
||||
{
|
||||
prop: 'creatorTime',
|
||||
label: '创建时间'
|
||||
},
|
||||
{
|
||||
prop: 'creatorUserName',
|
||||
label: '创建人'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
},
|
||||
],
|
||||
currencyOptions: [{
|
||||
"fullName": "人民币",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "美元",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "英镑",
|
||||
"id": "2"
|
||||
}],
|
||||
currencyProps: {
|
||||
"label": "fullName",
|
||||
"value": "id"
|
||||
},
|
||||
statusOptions: [{
|
||||
"fullName": "已保存",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "审批中",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "已审批",
|
||||
"id": "2"
|
||||
}],
|
||||
statusProps: {
|
||||
"label": "fullName",
|
||||
"value": "id"
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({
|
||||
column,
|
||||
prop,
|
||||
order
|
||||
}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
export default {
|
||||
components: {
|
||||
JNPFForm,
|
||||
ExportBox,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo: undefined
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [{
|
||||
prop: 'documentNo',
|
||||
label: '单据编号'
|
||||
},
|
||||
{
|
||||
prop: 'jg_purchaseorder.contractName',
|
||||
label: '合同名称'
|
||||
},
|
||||
{
|
||||
prop: 'jg_purchaseorder.supplierName',
|
||||
label: '供应商名称'
|
||||
},
|
||||
{
|
||||
prop: 'refundAmount',
|
||||
label: '退货金额'
|
||||
},
|
||||
{
|
||||
prop: 'actualAmount',
|
||||
label: '实退金额'
|
||||
},
|
||||
{
|
||||
prop: 'currency',
|
||||
label: '币别 '
|
||||
},
|
||||
{
|
||||
prop: 'refundNum',
|
||||
label: '退货数量'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '单据状态 '
|
||||
},
|
||||
{
|
||||
prop: 'creatorTime',
|
||||
label: '创建时间'
|
||||
},
|
||||
{
|
||||
prop: 'creatorUserName',
|
||||
label: '创建人'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
}
|
||||
],
|
||||
currencyOptions: [{
|
||||
'fullName': '人民币',
|
||||
'id': '0'
|
||||
}, {
|
||||
'fullName': '美元',
|
||||
'id': '1'
|
||||
}, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
currencyProps: {
|
||||
'label': 'fullName',
|
||||
'value': 'id'
|
||||
},
|
||||
statusOptions: [{
|
||||
'fullName': '已保存',
|
||||
'id': '0'
|
||||
}, {
|
||||
'fullName': '审批中',
|
||||
'id': '1'
|
||||
}, {
|
||||
'fullName': '已审批',
|
||||
'id': '2'
|
||||
}],
|
||||
statusProps: {
|
||||
'label': 'fullName',
|
||||
'value': 'id'
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({
|
||||
column,
|
||||
prop,
|
||||
order
|
||||
}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||
10) : '';
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {
|
||||
...data,
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {
|
||||
...data,
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/purchaseback/Purchaseback/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,371 +1,400 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="pigeonhole()">归档
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="paymentApply()">付款申请
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="erpNo" label="ERP订单号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="contractName" label="合同名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="amount" label="金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="num" label="重量" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="币种" width="0" prop="currency" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="payPrice" label="已付款金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="invoiceNum" label="发票数量" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="advanceAmount" label="垫资金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="creatorTime" label="制单时间" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="单据状态 " width="0" prop="status" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="制单人" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">查看
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">开票文件下载
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">发票录入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">入库
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="paymentApply()">付款申请
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" icon="el-icon-plus" @click="pigeonhole()">归档
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">转销售
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="documentNo" label="单据编号" width="200" align="center" fixed="left" sortable
|
||||
/>
|
||||
<el-table-column prop="erpNo" label="ERP订单号" width="200" align="center" fixed="left" sortable
|
||||
/>
|
||||
<el-table-column prop="contractName" label="合同名称" width="120" align="center" fixed="left" sortable
|
||||
/>
|
||||
<el-table-column prop="supplierName" label="供应商名称" width="220" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="amount" label="金额" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="num" label="重量" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="币种" width="80" prop="currency" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="payPrice" label="已付款金额" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="invoiceNum" label="发票数量" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="invoiceAmount" label="发票金额" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="advanceAmount" label="垫资金额" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="creatorTime" label="制单时间" width="120" align="center" sortable sortable="custom"
|
||||
/>
|
||||
<el-table-column label="单据状态 " width="120" prop="status" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope" >
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorUserName" label="制单人" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
<el-button type="text" @click="">发票上传
|
||||
</el-button>
|
||||
<el-button type="text" @click="">退货
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import pament from '@/views/scm/basicInformation/paymentdoc/Form'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import pament from '@/views/scm/basicInformation/paymentdoc/Form'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
// routes:[
|
||||
// {
|
||||
// path:'/paymentdoc',
|
||||
// name:'payment',
|
||||
// component:pament
|
||||
// }
|
||||
// ],
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'documentNo', label: '单据编号'},
|
||||
{prop: 'erpNo', label: 'ERP订单号'},
|
||||
{prop: 'contractName', label: '合同名称'},
|
||||
{prop: 'supplierName', label: '供应商名称'},
|
||||
{prop: 'amount', label: '金额'},
|
||||
{prop: 'num', label: '重量'},
|
||||
{prop: 'currency', label: '币种'},
|
||||
{prop: 'payPrice', label: '已付款金额'},
|
||||
{prop: 'invoiceNum', label: '发票数量'},
|
||||
{prop: 'invoiceAmount', label: '发票金额'},
|
||||
{prop: 'advanceAmount', label: '垫资金额'},
|
||||
{prop: 'creatorTime', label: '制单时间'},
|
||||
{prop: 'status', label: '单据状态 '},
|
||||
{prop: 'creatorUserName', label: '制单人'},
|
||||
],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
currencyProps:{"label":"fullName","value":"id"},
|
||||
statusOptions:[{"fullName":"待开票","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款中","id":"2"},{"fullName":"归档","id":"3"}],
|
||||
statusProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
// routes:[
|
||||
// {
|
||||
// path:'/paymentdoc',
|
||||
// name:'payment',
|
||||
// component:pament
|
||||
// }
|
||||
// ],
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'documentNo', label: '单据编号' },
|
||||
{ prop: 'erpNo', label: 'ERP订单号' },
|
||||
{ prop: 'contractName', label: '合同名称' },
|
||||
{ prop: 'supplierName', label: '供应商名称' },
|
||||
{ prop: 'amount', label: '金额' },
|
||||
{ prop: 'num', label: '重量' },
|
||||
{ prop: 'currency', label: '币种' },
|
||||
{ prop: 'payPrice', label: '已付款金额' },
|
||||
{ prop: 'invoiceNum', label: '发票数量' },
|
||||
{ prop: 'invoiceAmount', label: '发票金额' },
|
||||
{ prop: 'advanceAmount', label: '垫资金额' },
|
||||
{ prop: 'creatorTime', label: '制单时间' },
|
||||
{ prop: 'status', label: '单据状态 ' },
|
||||
{ prop: 'creatorUserName', label: '制单人' }
|
||||
],
|
||||
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||
statusOptions: [{ 'fullName': '待开票', 'id': '0' }, { 'fullName': '开票中', 'id': '1' }, {
|
||||
'fullName': '付款中',
|
||||
'id': '2'
|
||||
}, { 'fullName': '归档', 'id': '3' }],
|
||||
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||
10) : '';
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
pigeonhole(){
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
let id = this.multipleSelection.join()
|
||||
let param ={};
|
||||
param = this.list.find(function(param) {
|
||||
return param.id == id;
|
||||
})
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/pigeonhole`,
|
||||
method: 'POST',
|
||||
data: param
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
paymentApply(){
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
let ids = this.multipleSelection.join()
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/paymentapply/${ids}`,
|
||||
method: 'put',
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
/* if (info.amount != info.invoiceAmount){
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请先开具发票',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}else{
|
||||
debugger
|
||||
// window.navigator("views/scm/basicInformation/paymentdoc/index.vue");
|
||||
// window.location.href="views/scm/basicInformation/paymentdoc/index.vue";
|
||||
// this.formVisible = true
|
||||
// this.$nextTick((id,isDetail) => {
|
||||
// this.$refs.JNPFForm.init(id, isDetail)
|
||||
// })
|
||||
this.$router.push({path:'/paymentdoc'})
|
||||
}*/
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
pigeonhole() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
let id = this.multipleSelection.join()
|
||||
let param = {}
|
||||
param = this.list.find(function(param) {
|
||||
return param.id == id
|
||||
})
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/pigeonhole`,
|
||||
method: 'POST',
|
||||
data: param
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
paymentApply() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
let ids = this.multipleSelection.join()
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/paymentapply/${ids}`,
|
||||
method: 'put'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
/* if (info.amount != info.invoiceAmount){
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请先开具发票',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}else{
|
||||
debugger
|
||||
// window.navigator("views/scm/basicInformation/paymentdoc/index.vue");
|
||||
// window.location.href="views/scm/basicInformation/paymentdoc/index.vue";
|
||||
// this.formVisible = true
|
||||
// this.$nextTick((id,isDetail) => {
|
||||
// this.$refs.JNPFForm.init(id, isDetail)
|
||||
// })
|
||||
this.$router.push({path:'/paymentdoc'})
|
||||
}*/
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/purchaseorder/Purchaseorder/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,215 +1,237 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="600px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="库区编码"
|
||||
prop="areacode" >
|
||||
<el-input v-model="dataForm.areacode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="库区编码"
|
||||
prop="areacode">
|
||||
<el-input v-model="dataForm.areacode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="库区名称"
|
||||
prop="areaname" >
|
||||
<el-input v-model="dataForm.areaname"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="库区名称"
|
||||
prop="areaname">
|
||||
<el-input v-model="dataForm.areaname"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="最高库存"
|
||||
prop="maximum" >
|
||||
<el-input-number v-model="dataForm.maximum"
|
||||
placeholder="数字文本" :step="1" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="最高库存"
|
||||
prop="maximum">
|
||||
<el-input-number v-model="dataForm.maximum"
|
||||
placeholder="数字文本" :step="1">
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="安全库存"
|
||||
prop="safety" >
|
||||
<el-input-number v-model="dataForm.safety"
|
||||
placeholder="数字文本" :step="1" >
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="安全库存"
|
||||
prop="safety">
|
||||
<el-input-number v-model="dataForm.safety"
|
||||
placeholder="数字文本" :step="1">
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="最低库存"
|
||||
prop="minimum" >
|
||||
<el-input-number v-model="dataForm.minimum"
|
||||
placeholder="数字文本" :step="1" >
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="最低库存"
|
||||
prop="minimum">
|
||||
<el-input-number v-model="dataForm.minimum"
|
||||
placeholder="数字文本" :step="1">
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="计量单位"
|
||||
prop="unit" >
|
||||
<el-select v-model="dataForm.unit"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="计量单位"
|
||||
prop="unit">
|
||||
<el-select v-model="dataForm.unit"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="仓库"
|
||||
prop="warehouseId" >
|
||||
<popupSelect v-model="dataForm.warehouseId"
|
||||
placeholder="请选择" field="warehouseId" interfaceId="394860934465658373" :columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="NAME" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="仓库"
|
||||
prop="warehouseId">
|
||||
<popupSelect v-model="dataForm.warehouseId"
|
||||
placeholder="请选择" field="warehouseId" interfaceId="394860934465658373"
|
||||
:columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="NAME"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
areacode : '',
|
||||
areaname : '',
|
||||
maximum : 1,
|
||||
safety : 1,
|
||||
minimum : 1,
|
||||
unit : "",
|
||||
warehouseId : "",
|
||||
creatorTime : "",
|
||||
lastModifyTime : "",
|
||||
},
|
||||
rules:
|
||||
{
|
||||
warehouseId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
warehouseIdcolumnOptions:[ {"label":"仓库名称","value":"NAME"}, {"label":"ERP库存组织名称","value":"inventory_org_name"}, {"label":"ERP库存组织详情名称","value":"inventory_org_detail_name"},],
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Reservoirarea/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Reservoirarea',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/example/Reservoirarea/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
areacode: '',
|
||||
areaname: '',
|
||||
maximum: 1,
|
||||
safety: 1,
|
||||
minimum: 1,
|
||||
unit: '',
|
||||
warehouseId: '',
|
||||
creatorTime: '',
|
||||
lastModifyTime: ''
|
||||
},
|
||||
rules:
|
||||
{
|
||||
areacode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择库区编码',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
areaname: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择库区名称',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
warehouseId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择仓库',
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
unitOptions: [{ 'fullName': '吨', 'id': '0' }, { 'fullName': '千克', 'id': '1' }],
|
||||
warehouseIdcolumnOptions: [{ 'label': '仓库名称', 'value': 'NAME' }, {
|
||||
'label': 'ERP库存组织名称',
|
||||
'value': 'inventory_org_name'
|
||||
}, { 'label': 'ERP库存组织详情名称', 'value': 'inventory_org_detail_name' }]
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = []
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key])
|
||||
} else {
|
||||
data[key] = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.isDetail = isDetail || false
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Reservoirarea/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Reservoirarea',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/Reservoirarea/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,268 +1,276 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="库区编码">
|
||||
<el-input v-model="query.areacode" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="库区名称">
|
||||
<el-input v-model="query.areaname" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="areacode" label="库区编码" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="areaname" label="库区名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="maximum" label="最高库存" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="safety" label="安全库存" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="minimum" label="最低库存" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="计量单位" width="0" prop="unit" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.unit | dynamicText(unitOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseId" label="仓库" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="库区编码">
|
||||
<el-input v-model="query.areacode" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="库区名称">
|
||||
<el-input v-model="query.areaname" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="areacode" label="库区编码" width="200" align="center" sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="areaname" label="库区名称" width="200" align="center" sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="maximum" label="最高库存" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="safety" label="安全库存" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="minimum" label="最低库存" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="计量单位" width="200" prop="unit" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.unit | dynamicText(unitOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseId" label="仓库" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
areacode:undefined,
|
||||
areaname:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'areacode', label: '库区编码'},
|
||||
{prop: 'areaname', label: '库区名称'},
|
||||
{prop: 'maximum', label: '最高库存'},
|
||||
{prop: 'safety', label: '安全库存'},
|
||||
{prop: 'minimum', label: '最低库存'},
|
||||
{prop: 'unit', label: '计量单位'},
|
||||
{prop: 'warehouseId', label: '仓库'},
|
||||
],
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
unitProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
areacode: undefined,
|
||||
areaname: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'areacode', label: '库区编码' },
|
||||
{ prop: 'areaname', label: '库区名称' },
|
||||
{ prop: 'maximum', label: '最高库存' },
|
||||
{ prop: 'safety', label: '安全库存' },
|
||||
{ prop: 'minimum', label: '最低库存' },
|
||||
{ prop: 'unit', label: '计量单位' },
|
||||
{ prop: 'warehouseId', label: '仓库' }
|
||||
],
|
||||
unitOptions: [{ 'fullName': '吨', 'id': '0' }, { 'fullName': '千克', 'id': '1' }],
|
||||
unitProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0, 10) : '';
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/Reservoirarea/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,286 +1,297 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="salesOrderId" label="销售订单" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="jg_salesorder.contractName" label="合同名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="jg_salesorder.costomerName" label="客户名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="refundAmount" label="退款金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="actualAmount" label="实退金额" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="币别" width="0" prop="currency" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="refundNum" label="退货数量" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="单据状态 " width="0" prop="status" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="创建时间" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="创建人" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="remark" label="备注" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="documentNo" label="单据编号" width="200" align="center" sortablefixed="left"
|
||||
/>
|
||||
<el-table-column prop="salesOrderId" label="销售订单" width="200" align="center"sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="jg_salesorder.contractName" label="合同名称" width="120"sortable align="center"
|
||||
/>
|
||||
<el-table-column prop="jg_salesorder.costomerName" label="客户名称" width="200" sortable align="center"
|
||||
/>
|
||||
<el-table-column prop="refundAmount" label="退款金额" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="actualAmount" label="实退金额" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="币别" width="120" prop="currency" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="refundNum" label="退货数量" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="单据状态 " width="120" prop="status" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creatorTime" label="创建时间" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="创建人" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="remark" label="备注" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'documentNo', label: '单据编号'},
|
||||
{prop: 'salesOrderId', label: '销售订单'},
|
||||
{prop: 'jg_salesorder.contractName', label: '合同名称'},
|
||||
{prop: 'jg_salesorder.costomerName', label: '客户名称'},
|
||||
{prop: 'refundAmount', label: '退款金额'},
|
||||
{prop: 'actualAmount', label: '实退金额'},
|
||||
{prop: 'currency', label: '币别'},
|
||||
{prop: 'refundNum', label: '退货数量'},
|
||||
{prop: 'status', label: '单据状态 '},
|
||||
{prop: 'creatorTime', label: '创建时间'},
|
||||
{prop: 'creatorUserName', label: '创建人'},
|
||||
{prop: 'remark', label: '备注'},
|
||||
],
|
||||
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
|
||||
currencyProps:{"label":"fullName","value":"id"},
|
||||
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
|
||||
statusProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
documentNo: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/saleback/Saleback/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'documentNo', label: '单据编号' },
|
||||
{ prop: 'salesOrderId', label: '销售订单' },
|
||||
{ prop: 'jg_salesorder.contractName', label: '合同名称' },
|
||||
{ prop: 'jg_salesorder.costomerName', label: '客户名称' },
|
||||
{ prop: 'refundAmount', label: '退款金额' },
|
||||
{ prop: 'actualAmount', label: '实退金额' },
|
||||
{ prop: 'currency', label: '币别' },
|
||||
{ prop: 'refundNum', label: '退货数量' },
|
||||
{ prop: 'status', label: '单据状态 ' },
|
||||
{ prop: 'creatorTime', label: '创建时间' },
|
||||
{ prop: 'creatorUserName', label: '创建人' },
|
||||
{ prop: 'remark', label: '备注' }
|
||||
],
|
||||
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||
'fullName': '英镑',
|
||||
'id': '2'
|
||||
}],
|
||||
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||
'fullName': '已审批',
|
||||
'id': '2'
|
||||
}],
|
||||
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/saleback/Saleback/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||
10) : '';
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/saleback/Saleback/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/saleback/Saleback/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/saleback/Saleback/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/saleback/Saleback/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/saleback/Saleback/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/saleback/Saleback/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,376 +1,387 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="query.supplierName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="query.contactName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="showAll">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="query.contactPhone" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商地点">
|
||||
<el-input v-model="query.supplierSiteCode" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
|
||||
展开
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
||||
收起
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="supplierCode" label="供应商编码" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="companyId" label="所属公司" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column prop="country" label="国家" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="supply" label="供货指标" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="province" label="省" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="contactName" label="联系人" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left"
|
||||
sortable="custom" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactPhone" label="联系电话" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column label="供应商性质" width="0" prop="enterprise" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.enterprise | dynamicText(enterpriseOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column label="供应商类型" width="0" prop="classification" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.classification | dynamicText(classificationOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bank" label="开户行" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="vatRegistrationNum" label="纳税编号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="bankAccount" label="银行账户" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="默认税码" width="0" prop="taxCode" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.taxCode | dynamicText(taxCodeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="payable" label="应付科目" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="是否采购" width="0" prop="isPurchase" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isPurchase | dynamicText(isPurchaseOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="prepaid" label="预付科目" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="是否付款" width="0" prop="isPayment" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isPayment | dynamicText(isPaymentOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" width="0" prop="status" algin="left"
|
||||
sortable="custom" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierSiteCode" label="供应商地点" width="0" align="left"
|
||||
sortable="custom" />
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input v-model="query.supplierCode" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="query.supplierName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="query.contactName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="showAll">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系电话">
|
||||
<el-input v-model="query.contactPhone" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商地点">
|
||||
<el-input v-model="query.supplierSiteCode" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
|
||||
展开
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
||||
收起
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="supplierCode" label="供应商编码" width="200" align="center" fixed="left" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="companyId" label="所属公司" width="200" align="center" fixed="left" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="supplierName" label="供应商名称" width="200" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column prop="country" label="国家" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="supply" label="供货指标" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="province" label="省" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="contactName" label="联系人" width="120" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column label="供应商等级" width="120" prop="supplierLevel" algin="center" sortable
|
||||
sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactPhone" label="联系电话" width="200" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column label="供应商性质" width="120" prop="enterprise" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.enterprise | dynamicText(enterpriseOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="地址" width="200" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column label="供应商类型" width="120" prop="classification" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.classification | dynamicText(classificationOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bank" label="开户行" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="vatRegistrationNum" label="纳税编号" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="bankAccount" label="银行账户" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="默认税码" width="120" prop="taxCode" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.taxCode | dynamicText(taxCodeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="payable" label="应付科目" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="是否采购" width="120" prop="isPurchase" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isPurchase | dynamicText(isPurchaseOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="prepaid" label="预付科目" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="是否付款" width="120" prop="isPayment" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.isPayment | dynamicText(isPaymentOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" width="120" prop="status" algin="center" sortable
|
||||
sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierSiteCode" label="供应商地点" width="120" align="center" sortable
|
||||
sortable="custom"/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
showAll: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
supplierCode:undefined,
|
||||
supplierName:undefined,
|
||||
contactName:undefined,
|
||||
contactPhone:undefined,
|
||||
supplierSiteCode:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'supplierCode', label: '供应商编码'},
|
||||
{prop: 'companyId', label: '所属公司'},
|
||||
{prop: 'supplierName', label: '供应商名称'},
|
||||
{prop: 'country', label: '国家'},
|
||||
{prop: 'supply', label: '供货指标'},
|
||||
{prop: 'province', label: '省'},
|
||||
{prop: 'contactName', label: '联系人'},
|
||||
{prop: 'supplierLevel', label: '供应商等级'},
|
||||
{prop: 'contactPhone', label: '联系电话'},
|
||||
{prop: 'enterprise', label: '供应商性质'},
|
||||
{prop: 'address', label: '地址'},
|
||||
{prop: 'classification', label: '供应商类型'},
|
||||
{prop: 'bank', label: '开户行'},
|
||||
{prop: 'vatRegistrationNum', label: '纳税编号'},
|
||||
{prop: 'bankAccount', label: '银行账户'},
|
||||
{prop: 'taxCode', label: '默认税码'},
|
||||
{prop: 'payable', label: '应付科目'},
|
||||
{prop: 'isPurchase', label: '是否采购'},
|
||||
{prop: 'prepaid', label: '预付科目'},
|
||||
{prop: 'isPayment', label: '是否付款'},
|
||||
{prop: 'status', label: '是否启用'},
|
||||
{prop: 'supplierSiteCode', label: '供应商地点'},
|
||||
],
|
||||
supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
|
||||
supplierLevelProps:{"label":"fullName","value":"id"},
|
||||
enterpriseOptions:[{"fullName":"民营","id":"0"},{"fullName":"私营","id":"1"}],
|
||||
enterpriseProps:{"label":"fullName","value":"id"},
|
||||
classificationOptions:[{"fullName":"国内","id":"0"},{"fullName":"国外","id":"1"}],
|
||||
classificationProps:{"label":"fullName","value":"id"},
|
||||
taxCodeOptions:[{"fullName":"13个点","id":"0"},{"fullName":"9个点","id":"1"},{"fullName":"6个点","id":"2"},{"fullName":"5个点","id":"3"}],
|
||||
taxCodeProps:{"label":"fullName","value":"id"},
|
||||
isPurchaseOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||
isPurchaseProps:{"label":"fullName","value":"id"},
|
||||
isPaymentOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||
isPaymentProps:{"label":"fullName","value":"id"},
|
||||
statusOptions:[{"fullName":"启用","id":"1"},{"fullName":"停用","id":"2"}],
|
||||
statusProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
showAll: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
supplierCode: undefined,
|
||||
supplierName: undefined,
|
||||
contactName: undefined,
|
||||
contactPhone: undefined,
|
||||
supplierSiteCode: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/Supplier/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'supplierCode', label: '供应商编码' },
|
||||
{ prop: 'companyId', label: '所属公司' },
|
||||
{ prop: 'supplierName', label: '供应商名称' },
|
||||
{ prop: 'country', label: '国家' },
|
||||
{ prop: 'supply', label: '供货指标' },
|
||||
{ prop: 'province', label: '省' },
|
||||
{ prop: 'contactName', label: '联系人' },
|
||||
{ prop: 'supplierLevel', label: '供应商等级' },
|
||||
{ prop: 'contactPhone', label: '联系电话' },
|
||||
{ prop: 'enterprise', label: '供应商性质' },
|
||||
{ prop: 'address', label: '地址' },
|
||||
{ prop: 'classification', label: '供应商类型' },
|
||||
{ prop: 'bank', label: '开户行' },
|
||||
{ prop: 'vatRegistrationNum', label: '纳税编号' },
|
||||
{ prop: 'bankAccount', label: '银行账户' },
|
||||
{ prop: 'taxCode', label: '默认税码' },
|
||||
{ prop: 'payable', label: '应付科目' },
|
||||
{ prop: 'isPurchase', label: '是否采购' },
|
||||
{ prop: 'prepaid', label: '预付科目' },
|
||||
{ prop: 'isPayment', label: '是否付款' },
|
||||
{ prop: 'status', label: '是否启用' },
|
||||
{ prop: 'supplierSiteCode', label: '供应商地点' }
|
||||
],
|
||||
supplierLevelOptions: [{ 'fullName': '一级', 'id': '1' }, { 'fullName': '二级', 'id': '2' }, {
|
||||
'fullName': '三级',
|
||||
'id': '3'
|
||||
}, { 'fullName': '四级', 'id': '4' }],
|
||||
supplierLevelProps: { 'label': 'fullName', 'value': 'id' },
|
||||
enterpriseOptions: [{ 'fullName': '民营', 'id': '0' }, { 'fullName': '私营', 'id': '1' }],
|
||||
enterpriseProps: { 'label': 'fullName', 'value': 'id' },
|
||||
classificationOptions: [{ 'fullName': '国内', 'id': '0' }, { 'fullName': '国外', 'id': '1' }],
|
||||
classificationProps: { 'label': 'fullName', 'value': 'id' },
|
||||
taxCodeOptions: [{ 'fullName': '13个点', 'id': '0' }, { 'fullName': '9个点', 'id': '1' }, {
|
||||
'fullName': '6个点',
|
||||
'id': '2'
|
||||
}, { 'fullName': '5个点', 'id': '3' }],
|
||||
taxCodeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
isPurchaseOptions: [{ 'fullName': '否', 'id': '0' }, { 'fullName': '是', 'id': '1' }],
|
||||
isPurchaseProps: { 'label': 'fullName', 'value': 'id' },
|
||||
isPaymentOptions: [{ 'fullName': '否', 'id': '0' }, { 'fullName': '是', 'id': '1' }],
|
||||
isPaymentProps: { 'label': 'fullName', 'value': 'id' },
|
||||
statusOptions: [{ 'fullName': '启用', 'id': '1' }, { 'fullName': '停用', 'id': '2' }],
|
||||
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/example/Supplier/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Supplier/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Supplier/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/example/Supplier/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Supplier/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Supplier/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/Supplier/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,417 +1,467 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料编码"
|
||||
prop="materialCode" >
|
||||
<popupSelect v-model="dataForm.materialCode"
|
||||
placeholder="请选择" clearable field="materialCode" interfaceId="381037852907038533" :columnOptions="materialCodecolumnOptions" propsValue="item_code" relationField="item_code" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px">
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="磅单上传"
|
||||
prop="poundPictures" >
|
||||
<JNPF-UploadImg v-model="dataForm.poundPictures"
|
||||
:fileSize="500" sizeUnit="MB" :limit="9" buttonText="点击上传" >
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料名称"
|
||||
prop="materialName" >
|
||||
<el-input v-model="dataForm.materialName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</JNPF-UploadImg>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料名称"
|
||||
prop="materialId" >
|
||||
<popupSelect v-model="dataForm.materialId"
|
||||
placeholder="请选择物料编码" clearable field="materialId" interfaceId="381037852907038533" :columnOptions="materialIdcolumnOptions" propsValue="id" relationField="description" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" >
|
||||
<el-form-item label="物料名称"
|
||||
>
|
||||
<popupAttr
|
||||
relationField="materialCode" showField="description" >
|
||||
v-model="dataForm.materialCode"
|
||||
</popupAttr>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售合同" prop="salesName">
|
||||
<popupSelect v-model="dataForm.salesName" placeholder="请选择" clearable field="salesName"
|
||||
interfaceId="381038993740949317" :columnOptions="salesNamecolumnOptions" propsValue="contract_name" relationField="contract_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px">
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="dataForm.customerName" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="客户名称"
|
||||
prop="customerId" >
|
||||
<popupSelect v-model="dataForm.customerId"
|
||||
placeholder="请选择客户" clearable field="customerId" interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否垫资" prop="advance">
|
||||
<el-select v-model="dataForm.advance" placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="销售合同"
|
||||
prop="salesId" >
|
||||
<popupSelect v-model="dataForm.salesId"
|
||||
placeholder="请选择合同" clearable field="salesId" interfaceId="381037852907038533" :columnOptions="salesIdcolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售价格" prop="salesPrice">
|
||||
<el-input-number v-model="dataForm.salesPrice" placeholder="数字文本" :step="1">
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="车牌号"
|
||||
prop="vehicleId" >
|
||||
<popupSelect v-model="dataForm.vehicleId"
|
||||
placeholder="请选择车辆" clearable field="vehicleId" interfaceId="381432451370615173" :columnOptions="vehicleIdcolumnOptions" propsValue="id" relationField="ticketno" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运输方式" prop="transportType">
|
||||
<el-select v-model="dataForm.transportType" placeholder="请选择" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in transportTypeOptions" :key="index"
|
||||
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="车辆图片"
|
||||
prop="vehiclePictures" >
|
||||
<JNPF-UploadImg v-model="dataForm.vehiclePictures"
|
||||
:fileSize="500" sizeUnit="MB" :limit="9" >
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运费" prop="departmentId">
|
||||
<el-input-number v-model="dataForm.departmentId" placeholder="数字文本" :step="1">
|
||||
</JNPF-UploadImg>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="磅单时间"
|
||||
prop="poundDate" >
|
||||
<el-date-picker v-model="dataForm.poundDate"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="车号" prop="licenseNo">
|
||||
<popupSelect v-model="dataForm.licenseNo" placeholder="请选择" clearable field="licenseNo"
|
||||
interfaceId="381432451370615173" :columnOptions="licenseNocolumnOptions" propsValue="ticketno" relationField="ticketno" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="磅单号"
|
||||
prop="poundlistNo" >
|
||||
<el-input v-model="dataForm.poundlistNo"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="业务员名称" prop="businessName">
|
||||
<el-input v-model="dataForm.businessName" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="皮重"
|
||||
prop="tareWeight" >
|
||||
<el-input v-model="dataForm.tareWeight"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="磅单图片" prop="poundPictures">
|
||||
<JNPF-UploadImg v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="9">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="毛重"
|
||||
prop="grossWeight" >
|
||||
<el-input v-model="dataForm.grossWeight"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</JNPF-UploadImg>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="皮重" prop="tareWeight">
|
||||
<el-input-number v-model="dataForm.tareWeight" placeholder="数字文本" :step="1">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="扣重"
|
||||
prop="buckleWeight" >
|
||||
<el-input v-model="dataForm.buckleWeight"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="毛重" prop="grossWeight">
|
||||
<el-input-number v-model="dataForm.grossWeight" placeholder="数字文本" :step="1">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="净重"
|
||||
prop="netWeight" >
|
||||
<el-input v-model="dataForm.netWeight"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="扣重" prop="buckleWeight">
|
||||
<el-input-number v-model="dataForm.buckleWeight" placeholder="数字文本" :step="1">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="单位 "
|
||||
prop="unit" >
|
||||
<el-select v-model="dataForm.unit"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="净重" prop="netWeight">
|
||||
<el-input-number v-model="dataForm.netWeight" placeholder="数字文本" :step="1">
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="运输类型"
|
||||
prop="transportType" >
|
||||
<el-select v-model="dataForm.transportType"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="是否垫资"
|
||||
prop="advance" >
|
||||
<el-select v-model="dataForm.advance"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="司机名称" prop="driverName">
|
||||
<el-input v-model="dataForm.driverName" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="运费"
|
||||
prop="transportPrice" >
|
||||
<el-input v-model="dataForm.transportPrice"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="车辆图片" prop="vehiclePictures">
|
||||
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="销售价格"
|
||||
prop="salesPrice" >
|
||||
<el-input v-model="dataForm.salesPrice"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</JNPF-UploadImg>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="制单人" prop="creatorusername">
|
||||
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="业务员"
|
||||
prop="creatorUserName" >
|
||||
<popupSelect v-model="dataForm.creatorUserName"
|
||||
placeholder="请选择业务员" clearable field="creatorUserName" interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="creatorUserNamecolumnOptions" propsValue="F_RealName" relationField="F_RealName" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="自然人"
|
||||
prop="naturalId" >
|
||||
<popupSelect v-model="dataForm.naturalId"
|
||||
placeholder="请选择自然人" clearable field="naturalId" interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
hasPage :pageSize="20" >
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入备注信息" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="磅单日期"
|
||||
prop="creatorTime" >
|
||||
<el-input v-model="dataForm.creatorTime"
|
||||
placeholder="系统自动生成" readonly >
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
materialCode: "",
|
||||
materialName: '',
|
||||
salesName: "",
|
||||
customerName: '',
|
||||
advance: "",
|
||||
salesPrice: '',
|
||||
transportType: "",
|
||||
departmentId: 11.225,
|
||||
licenseNo: "",
|
||||
businessName: '',
|
||||
poundPictures: [],
|
||||
tareWeight: '',
|
||||
grossWeight: '',
|
||||
buckleWeight: '',
|
||||
netWeight: '',
|
||||
remark: '',
|
||||
driverName: '',
|
||||
vehiclePictures: [],
|
||||
creatorusername: '',
|
||||
},
|
||||
rules: {
|
||||
materialCode: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
salesName: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
licenseNo: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
// poundPictures: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请至少选择一个',
|
||||
// trigger: 'click'
|
||||
// },
|
||||
// ],
|
||||
tareWeight: [{
|
||||
required: true,
|
||||
message: '数字文本',
|
||||
trigger: ["blur", "change"]
|
||||
}, ],
|
||||
grossWeight: [{
|
||||
required: true,
|
||||
message: '数字文本',
|
||||
trigger: ["blur", "change"]
|
||||
}, ],
|
||||
buckleWeight: [{
|
||||
required: true,
|
||||
message: '数字文本',
|
||||
trigger: ["blur", "change"]
|
||||
}, ],
|
||||
netWeight: [{
|
||||
required: true,
|
||||
message: '数字文本',
|
||||
trigger: ["blur", "change"]
|
||||
}, ],
|
||||
},
|
||||
materialCodecolumnOptions:[ {"label":"物料编码","value":"item_code"},
|
||||
{"label":"物料名称","value":"description"},
|
||||
{"label":"库存组织","value":"organization_id"},
|
||||
{"label":"默认库区","value":"areaname"},],
|
||||
salesNamecolumnOptions: [{
|
||||
"label": "合同编码",
|
||||
"value": "contract_code"
|
||||
},
|
||||
{
|
||||
"label": "合同名称",
|
||||
"value": "contract_name"
|
||||
},
|
||||
{
|
||||
"label": "合同类型",
|
||||
"value": "contract_type"
|
||||
},
|
||||
{
|
||||
"label": "供应商/客户名称",
|
||||
"value": "name"
|
||||
},],
|
||||
advanceOptions: [{
|
||||
"fullName": "是",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "否",
|
||||
"id": "0"
|
||||
}],
|
||||
transportTypeOptions: [{
|
||||
"fullName": "汽运",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "船运",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "火车",
|
||||
"id": "2"
|
||||
}],
|
||||
licenseNocolumnOptions: [{
|
||||
"label": "车牌号",
|
||||
"value": "ticketno"
|
||||
},
|
||||
{
|
||||
"label": "司机",
|
||||
"value": "drivername"
|
||||
},
|
||||
{
|
||||
"label": "车辆照片",
|
||||
"value": "vehiclephotos"
|
||||
},
|
||||
{
|
||||
"label": "手机号",
|
||||
"value": "contact"
|
||||
},
|
||||
{
|
||||
"label": "创建人",
|
||||
"value": "f_creatorusername"
|
||||
},
|
||||
{
|
||||
"label": "创建时间",
|
||||
"value": "f_creatortime"
|
||||
},],
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
poundPictures : [],
|
||||
materialId : "",
|
||||
customerId : "",
|
||||
salesId : "",
|
||||
vehicleId : "",
|
||||
vehiclePictures : [],
|
||||
poundDate : '',
|
||||
poundlistNo : '',
|
||||
tareWeight : 0,
|
||||
grossWeight : 0,
|
||||
buckleWeight : 0,
|
||||
netWeight : 0,
|
||||
unit : "0",
|
||||
transportType : "0",
|
||||
advance : "0",
|
||||
transportPrice : 0,
|
||||
salesPrice : '',
|
||||
creatorUserName : "",
|
||||
naturalId : "",
|
||||
remark : '',
|
||||
creatorTime : "",
|
||||
},
|
||||
rules:
|
||||
{
|
||||
poundPictures: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'click'
|
||||
},
|
||||
],
|
||||
materialId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择物料编码',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
customerId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择客户',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
salesId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择合同',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
vehicleId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择车辆',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
vehiclePictures: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'click'
|
||||
},
|
||||
],
|
||||
poundDate: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
poundlistNo: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
tareWeight: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
grossWeight: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
buckleWeight: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
netWeight: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
salesPrice: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
creatorUserName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择业务员',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"description"}, {"label":"默认库区","value":"areaname"}, {"label":"库存组织","value":"organization_id"},],
|
||||
customerIdcolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"地址","value":"address"}, {"label":"银行账号","value":"bank_account"},],
|
||||
salesIdcolumnOptions:[ {"label":"合同编码","value":"contract_code"}, {"label":"合同名称","value":"contract_name"}, {"label":"合同类型","value":"contract_type"}, {"label":"供应商/客户名称","value":"name"},],
|
||||
vehicleIdcolumnOptions:[ {"label":"车牌号","value":"ticketno"}, {"label":"司机","value":"drivername"}, {"label":"车辆照片","value":"vehiclephotos"}, {"label":"手机号","value":"contact"},],
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
|
||||
advanceOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||
creatorUserNamecolumnOptions:[ {"label":"人员名称","value":"F_RealName"}, {"label":"人员职位","value":"F_FullName"},],
|
||||
naturalIdcolumnOptions:[ {"label":"自然人名称","value":"name"}, {"label":"自然人手机号","value":"contact"}, {"label":"自然人地址","value":"adress"},],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
_data.poundPictures = JSON.stringify(_data.poundPictures)
|
||||
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
_dataAll.poundPictures = JSON.parse( _dataAll.poundPictures)
|
||||
_dataAll.vehiclePictures = JSON.parse( _dataAll.vehiclePictures)
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
_data.poundPictures = JSON.stringify(_data.poundPictures)
|
||||
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
|
||||
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,394 +1,306 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="物料名称">
|
||||
<el-input v-model="query.materialName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="text" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()" />
|
||||
</el-tooltip>
|
||||
<screenfull isContainer />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="licenseNo" label="车号" fixed="left" sortable width="120" align="center" />
|
||||
<el-table-column prop="materialName" label="物料名称" fixed="left" sortable sortable width="150" align="center" />
|
||||
<el-table-column prop="grossWeight" label="毛重" width="100" sortable align="center" />
|
||||
<el-table-column prop="tareWeight" label="皮重" width="100" sortable align="center" />
|
||||
<el-table-column prop="buckleWeight" label="扣重" width="100" sortable align="center" />
|
||||
<el-table-column prop="netWeight" label="净重" width="100" sortable align="center" />
|
||||
<el-table-column prop="driverName" label="司机名称" width="120" sortable align="center" />
|
||||
<el-table-column prop="customerName" label="客户名称" width="150" sortable align="center" />
|
||||
<el-table-column prop="salesName" label="销售合同" width="150" sortable align="center" />
|
||||
<el-table-column prop="advance" label="是否垫资" width="120" sortable align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.advance | dynamicText(advanceOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="transportType" label="运输方式" sortable width="100" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.transportType | dynamicText(transportTypeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="departmentId" label="运费" sortable width="100" align="center" />
|
||||
<el-table-column prop="salesPrice" label="销售价格" sortable width="100" align="center" />
|
||||
<el-table-column prop="creatorusername" label="制单人" sortable width="150" align="center" />
|
||||
<el-table-column prop="businessName" label="业务员" sortable width="150" align="center" />
|
||||
<el-table-column prop="remark" label="备注" sortable width="150" align="center" />
|
||||
<el-table-column prop="poundPictures" label="磅单图片" width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item,index) in JSON.parse(scope.row.poundPictures)" :key="index">
|
||||
<el-popover placement="bottom" trigger="click" width="1000">
|
||||
<img :src="`/dev${item.url}`" width="100%" />
|
||||
<img
|
||||
slot="reference"
|
||||
:src="`/dev${item.url}`"
|
||||
:alt="`/dev${item.url}`"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px"
|
||||
/>
|
||||
</el-popover>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehiclePictures" label="车辆图片" width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item,index) in JSON.parse(scope.row.vehiclePictures)" :key="index">
|
||||
<el-popover placement="bottom" trigger="click" width="1000">
|
||||
<img :src="`/dev${item.url}`" width="100%" />
|
||||
<img
|
||||
slot="reference"
|
||||
:src="`/dev${item.url}`"
|
||||
:alt="`/dev${item.url}`"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px"
|
||||
/>
|
||||
</el-popover>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单时间">
|
||||
<el-date-picker v-model="query.poundDate" type="daterange"
|
||||
value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" >
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单号">
|
||||
<el-input v-model="query.poundlistNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="creatorTime" label="磅单日期" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="vehicleId" label="车牌号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="materialId" label="物料名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="grossWeight" label="毛重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="tareWeight" label="皮重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="buckleWeight" label="扣重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="netWeight" label="净重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="customerId" label="客户名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="salesId" label="销售合同" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="是否垫资" width="0" prop="advance" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.advance | dynamicText(advanceOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运输类型" width="0" prop="transportType" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.transportType | dynamicText(transportTypeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="transportPrice" label="运费" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="salesPrice" label="销售价格" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="业务员" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="remark" label="备注" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
JNPFForm,
|
||||
ExportBox,
|
||||
Detail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
materialName: undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [{
|
||||
prop: 'licenseNo',
|
||||
label: '车号'
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '物料名称'
|
||||
},
|
||||
{
|
||||
prop: 'grossWeight',
|
||||
label: '毛重'
|
||||
},
|
||||
{
|
||||
prop: 'tareWeight',
|
||||
label: '皮重'
|
||||
},
|
||||
{
|
||||
prop: 'buckleWeight',
|
||||
label: '扣重'
|
||||
},
|
||||
{
|
||||
prop: 'netWeight',
|
||||
label: '净重'
|
||||
},
|
||||
{
|
||||
prop: 'driverName',
|
||||
label: '司机名称'
|
||||
},
|
||||
{
|
||||
prop: 'customerName',
|
||||
label: '客户名称'
|
||||
},
|
||||
{
|
||||
prop: 'salesName',
|
||||
label: '销售合同'
|
||||
},
|
||||
{
|
||||
prop: 'advance',
|
||||
label: '是否垫资'
|
||||
},
|
||||
{
|
||||
prop: 'transportType',
|
||||
label: '运输方式'
|
||||
},
|
||||
{
|
||||
prop: 'departmentId',
|
||||
label: '运费'
|
||||
},
|
||||
{
|
||||
prop: 'salesPrice',
|
||||
label: '销售价格'
|
||||
},
|
||||
{
|
||||
prop: 'creatorusername',
|
||||
label: '制单人'
|
||||
},
|
||||
{
|
||||
prop: 'businessName',
|
||||
label: '业务员名称'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
},
|
||||
],
|
||||
advanceOptions: [{
|
||||
"fullName": "是",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "否",
|
||||
"id": "0"
|
||||
}],
|
||||
advanceProps: {
|
||||
"label": "fullName",
|
||||
"value": "id"
|
||||
},
|
||||
transportTypeOptions: [{
|
||||
"fullName": "汽运",
|
||||
"id": "0"
|
||||
}, {
|
||||
"fullName": "船运",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "火车",
|
||||
"id": "2"
|
||||
}],
|
||||
transportTypeProps: {
|
||||
"label": "fullName",
|
||||
"value": "id"
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({
|
||||
column,
|
||||
prop,
|
||||
order
|
||||
}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
poundDate:undefined,
|
||||
poundlistNo:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'creatorTime', label: '磅单日期'},
|
||||
{prop: 'vehicleId', label: '车牌号'},
|
||||
{prop: 'materialId', label: '物料名称'},
|
||||
{prop: 'grossWeight', label: '毛重'},
|
||||
{prop: 'tareWeight', label: '皮重'},
|
||||
{prop: 'buckleWeight', label: '扣重'},
|
||||
{prop: 'netWeight', label: '净重'},
|
||||
{prop: 'customerId', label: '客户名称'},
|
||||
{prop: 'salesId', label: '销售合同'},
|
||||
{prop: 'advance', label: '是否垫资'},
|
||||
{prop: 'transportType', label: '运输类型'},
|
||||
{prop: 'transportPrice', label: '运费'},
|
||||
{prop: 'salesPrice', label: '销售价格'},
|
||||
{prop: 'creatorUserName', label: '业务员'},
|
||||
{prop: 'remark', label: '备注'},
|
||||
],
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
unitProps:{"label":"fullName","value":"id"},
|
||||
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
|
||||
transportTypeProps:{"label":"fullName","value":"id"},
|
||||
advanceOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||
advanceProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {
|
||||
...data,
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,229 +1,281 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="仓库编码"
|
||||
prop="code" >
|
||||
<el-input v-model="dataForm.code"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1500px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="仓库编码"
|
||||
prop="code">
|
||||
<el-input v-model="dataForm.code"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="仓库名称"
|
||||
prop="name" >
|
||||
<el-input v-model="dataForm.name"
|
||||
placeholder="请输入仓库名称" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="仓库名称"
|
||||
prop="name">
|
||||
<el-input v-model="dataForm.name"
|
||||
placeholder="请输入仓库名称" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="公司"
|
||||
prop="companyCode" >
|
||||
<popupSelect v-model="dataForm.companyCode"
|
||||
placeholder="请选择公司" clearable field="companyCode" interfaceId="394016341591396805" :columnOptions="companyCodecolumnOptions" propsValue="F_Id" relationField="F_FullName" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="公司"
|
||||
prop="companyCode">
|
||||
<popupSelect v-model="dataForm.companyCode"
|
||||
placeholder="请选择公司" clearable field="companyCode" interfaceId="394016341591396805"
|
||||
:columnOptions="companyCodecolumnOptions" propsValue="F_Id" relationField="F_FullName"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="仓库位置"
|
||||
prop="location" >
|
||||
<el-input v-model="dataForm.location"
|
||||
placeholder="请输入仓库位置" clearable :style='{"width":"100%"}'>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="仓库位置"
|
||||
prop="location">
|
||||
<el-input v-model="dataForm.location"
|
||||
placeholder="请输入仓库位置" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="仓库类型"
|
||||
prop="type" >
|
||||
<el-select v-model="dataForm.type"
|
||||
placeholder="请选择仓库类型" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="仓库类型"
|
||||
prop="type">
|
||||
<el-select v-model="dataForm.type"
|
||||
placeholder="请选择仓库类型" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="ERP子库"
|
||||
prop="sublibrary" >
|
||||
<popupSelect v-model="dataForm.sublibrary"
|
||||
placeholder="请选择子库" clearable field="sublibrary" interfaceId="394818245032483845" :columnOptions="sublibrarycolumnOptions" propsValue="id" relationField="inventory_org_detail_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="ERP子库"
|
||||
prop="sublibrary">
|
||||
<popupSelect v-model="dataForm.sublibrary"
|
||||
placeholder="请选择子库" clearable field="sublibrary" interfaceId="394818245032483845"
|
||||
:columnOptions="sublibrarycolumnOptions" propsValue="id"
|
||||
relationField="inventory_org_detail_name" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="激活状态 "
|
||||
prop="activestate" >
|
||||
<el-radio-group v-model="dataForm.activestate"
|
||||
size="small" >
|
||||
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id" :disabled="item.disabled" >
|
||||
{{item.fullName}}
|
||||
</el-radio>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="激活状态 "
|
||||
prop="activestate">
|
||||
<el-radio-group v-model="dataForm.activestate"
|
||||
size="small">
|
||||
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id"
|
||||
:disabled="item.disabled">
|
||||
{{item.fullName}}
|
||||
</el-radio>
|
||||
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="备注"
|
||||
prop="remark" >
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入备注" clearable :style='{"width":"100%"}'>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注"
|
||||
prop="remark">
|
||||
<el-input v-model="dataForm.remark"
|
||||
placeholder="请输入备注" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
code : '',
|
||||
name : '',
|
||||
companyCode : "",
|
||||
location : '',
|
||||
type : "",
|
||||
sublibrary : "",
|
||||
activestate : "2",
|
||||
remark : '',
|
||||
creatorUserName : "",
|
||||
creatorTime : "",
|
||||
lastModifyUserName : "",
|
||||
lastModifyTime : "",
|
||||
orgId : "",
|
||||
departmentId : "",
|
||||
},
|
||||
rules:
|
||||
{
|
||||
},
|
||||
companyCodecolumnOptions:[ {"label":"公司名称","value":"F_FullName"}, {"label":"公司编码","value":"F_EnCode"},],
|
||||
typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
|
||||
sublibrarycolumnOptions:[ {"label":"编码","value":"inventory_org_detail_code"}, {"label":"库存组织详细名称","value":"inventory_org_detail_name"}, {"label":"库存组织名称","value":"inventory_org_name"},],
|
||||
activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/WareHouse/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/WareHouse',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/example/WareHouse/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
code: '',
|
||||
name: '',
|
||||
companyCode: '',
|
||||
location: '',
|
||||
type: '',
|
||||
sublibrary: '',
|
||||
activestate: '2',
|
||||
remark: '',
|
||||
creatorUserName: '',
|
||||
creatorTime: '',
|
||||
lastModifyUserName: '',
|
||||
lastModifyTime: '',
|
||||
orgId: '',
|
||||
departmentId: ''
|
||||
},
|
||||
rules:
|
||||
{
|
||||
code: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入仓库编码',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择公司名称',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入库房类型',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
sublibrary: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入ERP库存组织',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
|
||||
},
|
||||
companyCodecolumnOptions: [{ 'label': '公司名称', 'value': 'F_FullName' }, {
|
||||
'label': '公司编码',
|
||||
'value': 'F_EnCode'
|
||||
}],
|
||||
typeOptions: [{ 'fullName': '原料库', 'id': '0' }, { 'fullName': '中间库', 'id': '1' }, {
|
||||
'fullName': '成品库',
|
||||
'id': '2'
|
||||
}, { 'fullName': '副产品库', 'id': '3' }, { 'fullName': '废次品库', 'id': '4' }, {
|
||||
'fullName': '备件辅材库',
|
||||
'id': '5'
|
||||
}, { 'fullName': '贸易虚拟库', 'id': '6' }, { 'fullName': '仓储库', 'id': '7' }, {
|
||||
'fullName': '能源库',
|
||||
'id': '8'
|
||||
}, { 'fullName': '其他库', 'id': '9' }, { 'fullName': '帐外库', 'id': '10' }],
|
||||
sublibrarycolumnOptions: [{ 'label': '编码', 'value': 'inventory_org_detail_code' }, {
|
||||
'label': '库存组织详细名称',
|
||||
'value': 'inventory_org_detail_name'
|
||||
}, { 'label': '库存组织名称', 'value': 'inventory_org_name' }],
|
||||
activestateOptions: [{ 'fullName': '激活', 'id': '1' }, { 'fullName': '未激活', 'id': '0' }]
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = []
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key])
|
||||
} else {
|
||||
data[key] = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.isDetail = isDetail || false
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/WareHouse/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/WareHouse',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/WareHouse/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,277 +1,291 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="仓库编码">
|
||||
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="仓库名称">
|
||||
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="code" label="仓库编码" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="name" label="仓库名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="companyCode" label="公司" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="location" label="仓库位置" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="仓库类型" width="0" prop="type" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.type | dynamicText(typeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sublibrary" label="ERP子库" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="激活状态 " width="0" prop="activestate" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.activestate | dynamicText(activestateOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="仓库编码">
|
||||
<el-input v-model="query.code" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="仓库名称">
|
||||
<el-input v-model="query.name" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="code" label="仓库编码" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="name" label="仓库名称" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="companyCode" label="公司" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="location" label="仓库位置" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="仓库类型" width="120" prop="type" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.type | dynamicText(typeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sublibrary" label="ERP子库" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="激活状态 " width="120" prop="activestate" algin="center" sortable
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.activestate | dynamicText(activestateOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" width="0" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
code:undefined,
|
||||
name:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'code', label: '仓库编码'},
|
||||
{prop: 'name', label: '仓库名称'},
|
||||
{prop: 'companyCode', label: '公司'},
|
||||
{prop: 'location', label: '仓库位置'},
|
||||
{prop: 'type', label: '仓库类型'},
|
||||
{prop: 'sublibrary', label: 'ERP子库'},
|
||||
{prop: 'activestate', label: '激活状态 '},
|
||||
{prop: 'remark', label: '备注'},
|
||||
],
|
||||
typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
|
||||
typeProps:{"label":"fullName","value":"id"},
|
||||
activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
|
||||
activestateProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
code: undefined,
|
||||
name: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/WareHouse/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'code', label: '仓库编码' },
|
||||
{ prop: 'name', label: '仓库名称' },
|
||||
{ prop: 'companyCode', label: '公司' },
|
||||
{ prop: 'location', label: '仓库位置' },
|
||||
{ prop: 'type', label: '仓库类型' },
|
||||
{ prop: 'sublibrary', label: 'ERP子库' },
|
||||
{ prop: 'activestate', label: '激活状态 ' },
|
||||
{ prop: 'remark', label: '备注' }
|
||||
],
|
||||
typeOptions: [{ 'fullName': '原料库', 'id': '0' }, { 'fullName': '中间库', 'id': '1' }, {
|
||||
'fullName': '成品库',
|
||||
'id': '2'
|
||||
}, { 'fullName': '副产品库', 'id': '3' }, { 'fullName': '废次品库', 'id': '4' }, {
|
||||
'fullName': '备件辅材库',
|
||||
'id': '5'
|
||||
}, { 'fullName': '贸易虚拟库', 'id': '6' }, { 'fullName': '仓储库', 'id': '7' }, {
|
||||
'fullName': '能源库',
|
||||
'id': '8'
|
||||
}, { 'fullName': '其他库', 'id': '9' }, { 'fullName': '帐外库', 'id': '10' }],
|
||||
typeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
activestateOptions: [{ 'fullName': '激活', 'id': '1' }, { 'fullName': '未激活', 'id': '0' }],
|
||||
activestateProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/example/WareHouse/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/WareHouse/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/WareHouse/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/example/WareHouse/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/WareHouse/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/WareHouse/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/WareHouse/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: 'creatorTime'
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in new issue