commit
3ece7c3baf
@ -1,275 +1,287 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="区域名称">
|
<el-form-item label="区域名称">
|
||||||
<el-input v-model="query.mName" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.mName" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()" />
|
</div>
|
||||||
</el-tooltip>
|
<div class="JNPF-common-head-right">
|
||||||
<screenfull isContainer />
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</div>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
</div>
|
@click="reset()"/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
</el-tooltip>
|
||||||
@selection-change="handleSelectionChange">
|
<screenfull isContainer/>
|
||||||
<el-table-column prop="mName" label="区域名称" width="0" align="left" />
|
</div>
|
||||||
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
|
</div>
|
||||||
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
|
@selection-change="handleSelectionChange" border>
|
||||||
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
|
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||||
<el-table-column label="操作" fixed="right" width="100">
|
<el-table-column prop="mName" label="区域名称" width="300" align="center"sortable fixed="left" />
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="creatortime" label="创建时间" width="300" sortablealign="center"/>
|
||||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
<el-table-column prop="creatorusername" label="创建人名称" width="300" sortablealign="center"/>
|
||||||
</el-button>
|
<el-table-column prop="lastmodifytime" label="修改时间" width="300" sortablealign="center"/>
|
||||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
<el-table-column prop="lastmodifyusername" label="修改人名称" width="300"sortable align="center"/>
|
||||||
</el-button>
|
<el-table-column label="操作" fixed="right" width="100">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||||
</JNPF-table>
|
</el-button>
|
||||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||||
@pagination="initData" />
|
</el-button>
|
||||||
</div>
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
</JNPF-table>
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
@pagination="initData"/>
|
||||||
</div>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import {
|
||||||
getDictionaryDataSelector
|
getDictionaryDataSelector
|
||||||
} from '@/api/systemData/dictionary'
|
} from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {
|
import {
|
||||||
getDataInterfaceRes
|
getDataInterfaceRes
|
||||||
} from '@/api/systemData/dataInterface'
|
} from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
JNPFForm,
|
JNPFForm,
|
||||||
ExportBox,
|
ExportBox,
|
||||||
Detail
|
Detail
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
mName: undefined,
|
mName: undefined
|
||||||
},
|
},
|
||||||
treeProps: {
|
treeProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'fullName',
|
label: 'fullName',
|
||||||
value: 'id'
|
value: 'id'
|
||||||
},
|
},
|
||||||
list: [],
|
list: [],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
sort: "desc",
|
sort: 'desc',
|
||||||
sidx: "",
|
sidx: ''
|
||||||
},
|
},
|
||||||
formVisible: false,
|
formVisible: false,
|
||||||
exportBoxVisible: false,
|
exportBoxVisible: false,
|
||||||
columnList: [{
|
columnList: [{
|
||||||
prop: 'mName',
|
prop: 'mName',
|
||||||
label: '区域名称'
|
label: '区域名称'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'creatortime',
|
prop: 'creatortime',
|
||||||
label: '创建时间'
|
label: '创建时间'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'creatorusername',
|
prop: 'creatorusername',
|
||||||
label: '创建人名称'
|
label: '创建人名称'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'lastmodifytime',
|
prop: 'lastmodifytime',
|
||||||
label: '修改时间'
|
label: '修改时间'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'lastmodifyusername',
|
prop: 'lastmodifyusername',
|
||||||
label: '修改人名称'
|
label: '修改人名称'
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
menuId() {
|
menuId() {
|
||||||
return this.$route.meta.modelId || ''
|
return this.$route.meta.modelId || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initData()
|
this.initData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goDetail(id) {
|
goDetail(id) {
|
||||||
this.detailVisible = true
|
this.detailVisible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.Detail.init(id)
|
this.$refs.Detail.init(id)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
sortChange({
|
sortChange({
|
||||||
column,
|
column,
|
||||||
prop,
|
prop,
|
||||||
order
|
order
|
||||||
}) {
|
}) {
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
this.initData()
|
this.initData()
|
||||||
},
|
},
|
||||||
initData() {
|
initData() {
|
||||||
this.listLoading = true;
|
this.listLoading = true
|
||||||
let _query = {
|
let _query = {
|
||||||
...this.listQuery,
|
...this.listQuery,
|
||||||
...this.query,
|
...this.query,
|
||||||
menuId: this.menuId
|
menuId: this.menuId
|
||||||
};
|
}
|
||||||
request({
|
request({
|
||||||
url: `/api/areasetting/Areasetting/getList`,
|
url: `/api/areasetting/Areasetting/getList`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: _query
|
data: _query
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
var _list = [];
|
var _list = []
|
||||||
for (let i = 0; i < res.data.list.length; i++) {
|
for (let i = 0; i < res.data.list.length; i++) {
|
||||||
let _data = res.data.list[i];
|
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||||
_list.push(_data)
|
10) : '';
|
||||||
}
|
res.data.list[i].lastmodifytime = res.data.list[i].lastmodifytime ? res.data.list[i].lastmodifytime.substring(0,
|
||||||
this.list = _list
|
10) : '';
|
||||||
this.total = res.data.pagination.total
|
|
||||||
|
|
||||||
this.listLoading = false
|
let _data = res.data.list[i]
|
||||||
})
|
_list.push(_data)
|
||||||
},
|
}
|
||||||
handleDel(id) {
|
this.list = _list
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.total = res.data.pagination.total
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
this.listLoading = false
|
||||||
request({
|
})
|
||||||
url: `/api/areasetting/Areasetting/${id}`,
|
},
|
||||||
method: 'DELETE'
|
handleDel(id) {
|
||||||
}).then(res => {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
this.$message({
|
type: 'warning'
|
||||||
type: 'success',
|
}).then(() => {
|
||||||
message: res.msg,
|
request({
|
||||||
onClose: () => {
|
url: `/api/areasetting/Areasetting/${id}`,
|
||||||
this.initData()
|
method: 'DELETE'
|
||||||
}
|
}).then(res => {
|
||||||
});
|
this.$message({
|
||||||
})
|
type: 'success',
|
||||||
}).catch(() => {});
|
message: res.msg,
|
||||||
},
|
onClose: () => {
|
||||||
handleSelectionChange(val) {
|
this.initData()
|
||||||
const res = val.map(item => item.id)
|
}
|
||||||
this.multipleSelection = res
|
})
|
||||||
},
|
})
|
||||||
handleBatchRemoveDel() {
|
}).catch(() => {
|
||||||
if (!this.multipleSelection.length) {
|
})
|
||||||
this.$message({
|
},
|
||||||
type: 'error',
|
handleSelectionChange(val) {
|
||||||
message: '请选择一条数据',
|
const res = val.map(item => item.id)
|
||||||
duration: 1500,
|
this.multipleSelection = res
|
||||||
})
|
},
|
||||||
return
|
handleBatchRemoveDel() {
|
||||||
}
|
if (!this.multipleSelection.length) {
|
||||||
const ids = this.multipleSelection.join()
|
this.$message({
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
type: 'error',
|
||||||
type: 'warning'
|
message: '请选择一条数据',
|
||||||
}).then(() => {
|
duration: 1500
|
||||||
request({
|
})
|
||||||
url: `/api/areasetting/Areasetting/batchRemove/${ids}`,
|
return
|
||||||
method: 'DELETE'
|
}
|
||||||
}).then(res => {
|
const ids = this.multipleSelection.join()
|
||||||
this.$message({
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
type: 'success',
|
type: 'warning'
|
||||||
message: res.msg,
|
}).then(() => {
|
||||||
onClose: () => {
|
request({
|
||||||
this.initData()
|
url: `/api/areasetting/Areasetting/batchRemove/${ids}`,
|
||||||
}
|
method: 'DELETE'
|
||||||
});
|
}).then(res => {
|
||||||
})
|
this.$message({
|
||||||
}).catch(() => {})
|
type: 'success',
|
||||||
},
|
message: res.msg,
|
||||||
addOrUpdateHandle(id, isDetail) {
|
onClose: () => {
|
||||||
this.formVisible = true
|
this.initData()
|
||||||
this.$nextTick(() => {
|
}
|
||||||
this.$refs.JNPFForm.init(id, isDetail)
|
})
|
||||||
})
|
})
|
||||||
},
|
}).catch(() => {
|
||||||
exportData() {
|
})
|
||||||
this.exportBoxVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
this.formVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.JNPFForm.init(id, isDetail)
|
||||||
download(data) {
|
})
|
||||||
let query = {
|
},
|
||||||
...data,
|
exportData() {
|
||||||
...this.listQuery,
|
this.exportBoxVisible = true
|
||||||
...this.query,
|
this.$nextTick(() => {
|
||||||
menuId: this.menuId
|
this.$refs.ExportBox.init(this.columnList)
|
||||||
}
|
})
|
||||||
request({
|
},
|
||||||
url: `/api/areasetting/Areasetting/Actions/Export`,
|
download(data) {
|
||||||
method: 'GET',
|
let query = {
|
||||||
data: query
|
...data,
|
||||||
}).then(res => {
|
...this.listQuery,
|
||||||
if (!res.data.url) return
|
...this.query,
|
||||||
this.jnpf.downloadFile(res.data.url)
|
menuId: this.menuId
|
||||||
this.$refs.ExportBox.visible = false
|
}
|
||||||
this.exportBoxVisible = false
|
request({
|
||||||
})
|
url: `/api/areasetting/Areasetting/Actions/Export`,
|
||||||
},
|
method: 'GET',
|
||||||
search() {
|
data: query
|
||||||
this.listQuery = {
|
}).then(res => {
|
||||||
currentPage: 1,
|
if (!res.data.url) return
|
||||||
pageSize: 20,
|
this.jnpf.downloadFile(res.data.url)
|
||||||
sort: "desc",
|
this.$refs.ExportBox.visible = false
|
||||||
sidx: "",
|
this.exportBoxVisible = false
|
||||||
}
|
})
|
||||||
this.initData()
|
},
|
||||||
},
|
search() {
|
||||||
refresh(isrRefresh) {
|
this.listQuery = {
|
||||||
this.formVisible = false
|
currentPage: 1,
|
||||||
if (isrRefresh) this.reset()
|
pageSize: 20,
|
||||||
},
|
sort: 'desc',
|
||||||
reset() {
|
sidx: ''
|
||||||
for (let key in this.query) {
|
}
|
||||||
this.query[key] = undefined
|
this.initData()
|
||||||
}
|
},
|
||||||
this.search()
|
refresh(isrRefresh) {
|
||||||
}
|
this.formVisible = false
|
||||||
}
|
if (isrRefresh) this.reset()
|
||||||
}
|
},
|
||||||
|
reset() {
|
||||||
|
for (let key in this.query) {
|
||||||
|
this.query[key] = undefined
|
||||||
|
}
|
||||||
|
this.search()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,394 +1,409 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:close-on-click-modal="false" append-to-body
|
:close-on-click-modal="false" append-to-body
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
width="800px">
|
width="1500px">
|
||||||
<el-row :gutter="15" class="">
|
<el-row :gutter="15" class="">
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="单据编号"
|
<el-form-item label="单据编号"
|
||||||
prop="documentNo" >
|
prop="documentNo">
|
||||||
<el-input v-model="dataForm.documentNo"
|
<el-input v-model="dataForm.documentNo"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="业务日期"
|
<el-form-item label="业务日期"
|
||||||
prop="businessDate">
|
prop="businessDate">
|
||||||
<el-date-picker v-model="dataForm.businessDate"
|
<el-date-picker v-model="dataForm.businessDate"
|
||||||
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
|
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
|
||||||
value-format="timestamp">
|
value-format="timestamp">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="客户名称"
|
<el-form-item label="客户"
|
||||||
prop="customerName" >
|
prop="customerName">
|
||||||
<el-input v-model="dataForm.customerName"
|
<el-input v-model="dataForm.customerName"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="金额"
|
<el-form-item label="金额"
|
||||||
prop="amount" >
|
prop="amount">
|
||||||
<el-input v-model="dataForm.amount"
|
<el-input v-model="dataForm.amount "
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="数量"
|
<el-form-item label="商品数量"
|
||||||
prop="quantity" >
|
prop="quantity">
|
||||||
<el-input v-model="dataForm.quantity"
|
<el-input v-model="dataForm.quantity"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="发票数量"
|
<el-form-item label="发票数量"
|
||||||
prop="invoiceQuantity" >
|
prop="invoiceQuantity">
|
||||||
<el-input v-model="dataForm.invoiceQuantity"
|
<el-input v-model="dataForm.invoiceQuantity"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="客户税号"
|
<el-form-item label="客户税号"
|
||||||
prop="customerTaxNo" >
|
prop="customerTaxNo">
|
||||||
<el-input v-model="dataForm.customerTaxNo"
|
<el-input v-model="dataForm.customerTaxNo"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="客户地址"
|
<el-form-item label="客户地址"
|
||||||
prop="customerAddress" >
|
prop="customerAddress">
|
||||||
<el-input v-model="dataForm.customerAddress"
|
<el-input v-model="dataForm.customerAddress"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="币别 "
|
<el-form-item label="币别 "
|
||||||
prop="currency" >
|
prop="currency">
|
||||||
<el-select v-model="dataForm.currency"
|
<el-select v-model="dataForm.currency"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
|
:disabled="item.disabled"></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="备注"
|
<el-form-item label="备注"
|
||||||
prop="remark" >
|
prop="remark">
|
||||||
<el-input v-model="dataForm.remark"
|
<el-input v-model="dataForm.remark"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="发票金额"
|
<el-form-item label="发票金额"
|
||||||
prop="invoiceAmount" >
|
prop="invoiceAmount">
|
||||||
<el-input v-model="dataForm.invoiceAmount"
|
<el-input v-model="dataForm.invoiceAmount"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="销售订单号"
|
<el-form-item label="销售订单号"
|
||||||
prop="salesOrderNo" >
|
prop="salesOrderNo">
|
||||||
<el-input v-model="dataForm.salesOrderNo"
|
<el-input v-model="dataForm.salesOrderNo"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="合同名称"
|
<el-form-item label="合同名称"
|
||||||
prop="contractName" >
|
prop="contractName">
|
||||||
<el-input v-model="dataForm.contractName"
|
<el-input v-model="dataForm.contractName"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="单据状态 "
|
<el-form-item label="单据状态 "
|
||||||
prop="status" >
|
prop="status">
|
||||||
<el-select v-model="dataForm.status"
|
<el-select v-model="dataForm.status"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
|
:disabled="item.disabled"></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="制单人"
|
<el-form-item label="制单人"
|
||||||
prop="creatorUserName" >
|
prop="creatorUserName">
|
||||||
<el-input v-model="dataForm.creatorUserName"
|
<el-input v-model="dataForm.creatorUserName"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-tabs v-model="activewkrlwe" tab-position="top" class="mb-20">
|
<el-tabs v-model="activewkrlwe" tab-position="top" class="mb-20">
|
||||||
<el-tab-pane label="应收明细">
|
<el-tab-pane label="应收明细">
|
||||||
</el-tab-pane >
|
</el-tab-pane>
|
||||||
<el-tab-pane label="发票明细">
|
<el-tab-pane label="发票明细">
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label-width="0">
|
<el-form-item label-width="0">
|
||||||
<div class="JNPF-common-title">
|
<div class="JNPF-common-title">
|
||||||
<h2></h2>
|
<h2></h2>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="dataForm.arinvoices_item0List" size='mini' >
|
<el-table :data="dataForm.arinvoices_item0List" size='mini'>
|
||||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
<el-table-column type="index" width="50" label="序号" align="center"/>
|
||||||
<el-table-column prop="invoiceCode" label="发票代码">
|
<el-table-column prop="invoiceCode" label="发票代码">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.invoiceCode"
|
<el-input v-model="scope.row.invoiceCode"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="invoiceNo" label="发票号码">
|
<el-table-column prop="invoiceNo" label="发票号码">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.invoiceNo"
|
<el-input v-model="scope.row.invoiceNo"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="taxRate" label="税率 ">
|
<el-table-column prop="taxRate" label="税率 ">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.taxRate"
|
<el-select v-model="scope.row.taxRate"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName"
|
||||||
</el-select>
|
:value="item.id" :disabled="item.disabled"></el-option>
|
||||||
</template>
|
</el-select>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="taxAmount" label="税额">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="taxAmount" label="税额">
|
||||||
<el-input v-model="scope.row.taxAmount"
|
<template slot-scope="scope">
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
<el-input v-model="scope.row.taxAmount"
|
||||||
</el-input>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</template>
|
</el-input>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="amountNotTax" label="不含税金额">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="amountNotTax" label="不含税金额">
|
||||||
<el-input v-model="scope.row.amountNotTax"
|
<template slot-scope="scope">
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
<el-input v-model="scope.row.amountNotTax"
|
||||||
</el-input>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</template>
|
</el-input>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="creatorUserName" label="开票人">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="creatorUserName" label="开票人">
|
||||||
<el-input v-model="scope.row.creatorUserName"
|
<template slot-scope="scope">
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
<el-input v-model="scope.row.creatorUserName"
|
||||||
</el-input>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</template>
|
</el-input>
|
||||||
</el-table-column>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="remark" label="备注信息">
|
<el-table-column prop="remark" label="备注信息">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.remark"
|
<el-input v-model="scope.row.remark"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" width="50" >
|
<el-table-column label="操作" width="50">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delarinvoices_item0List(scope.$index)">删除</el-button>
|
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||||
</template>
|
@click="delarinvoices_item0List(scope.$index)">删除
|
||||||
</el-table-column>
|
</el-button>
|
||||||
</el-table>
|
</template>
|
||||||
<div class="table-actions" @click="addarinvoices_item0List()">
|
</el-table-column>
|
||||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
</el-table>
|
||||||
</div>
|
<div class="table-actions" @click="addarinvoices_item0List()">
|
||||||
</el-form-item>
|
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||||
</el-col>
|
</div>
|
||||||
</el-tab-pane >
|
</el-form-item>
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</el-tab-pane>
|
||||||
</el-form>
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="visible = false"> 取 消</el-button>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
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"}],
|
|
||||||
|
|
||||||
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"}],
|
export default {
|
||||||
}
|
components: {},
|
||||||
},
|
props: [],
|
||||||
computed: {},
|
data() {
|
||||||
watch: {},
|
return {
|
||||||
created() {
|
visible: false,
|
||||||
},
|
loading: false,
|
||||||
mounted() {},
|
isDetail: false,
|
||||||
methods: {
|
dataForm: {
|
||||||
arinvoices_item0Exist() {
|
documentNo: '',
|
||||||
let isOk = true;
|
businessDate: '',
|
||||||
for(let i=0;i<this.dataForm.arinvoices_item0List.length;i++){
|
customerName: '',
|
||||||
const e = this.dataForm.arinvoices_item0List[i];
|
amount: '',
|
||||||
}
|
quantity: '',
|
||||||
return isOk;
|
invoiceQuantity: '',
|
||||||
},
|
customerTaxNo: '',
|
||||||
clearData(data){
|
customerAddress: '',
|
||||||
for (let key in data) {
|
currency: '0',
|
||||||
if (data[key] instanceof Array) {
|
remark: '',
|
||||||
data[key] = [];
|
invoiceAmount: '',
|
||||||
} else if (data[key] instanceof Object) {
|
salesOrderNo: '',
|
||||||
this.clearData(data[key]);
|
contractName: '',
|
||||||
} else {
|
status: '0',
|
||||||
data[key] = "";
|
creatorUserName: '',
|
||||||
}
|
arinvoices_item0List: []
|
||||||
}
|
|
||||||
},
|
|
||||||
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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
@ -1,295 +1,315 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="单据编号">
|
||||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-plus" @click="1">编辑
|
<el-button type="text" icon="el-icon-plus" @click="1">编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-plus" @click="1">删除
|
<el-button type="text" icon="el-icon-plus" @click="1">删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-plus" @click="1">审核
|
<el-button type="text" icon="el-icon-plus" @click="1">审核
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-plus" @click="1">弃审
|
<el-button type="text" icon="el-icon-plus" @click="1">弃审
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-plus" @click="1">提交
|
<el-button type="text" icon="el-icon-plus" @click="1">提交
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="JNPF-common-head-right">
|
<div class="JNPF-common-head-right">
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
@click="reset()"/>
|
@click="reset()"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<screenfull isContainer/>
|
<screenfull isContainer/>
|
||||||
</div>
|
</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>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
documentNo:undefined,
|
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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: ''
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'documentNo', label: '单据编号' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'customerName', label: '客户名称' },
|
||||||
})
|
{ prop: 'amount', label: '金额' },
|
||||||
},
|
{ prop: 'quantity', label: '数量' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'currency', label: '币别 ' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'invoiceAmount', label: '发票金额' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'invoiceQuantity', label: '发票数量' },
|
||||||
this.initData()
|
{ prop: 'salesOrderNo', label: '销售订单号' },
|
||||||
},
|
{ prop: 'contractName', label: '合同名称' },
|
||||||
initData() {
|
{ prop: 'status', label: '单据状态 ' },
|
||||||
this.listLoading = true;
|
{ prop: 'creatorUserName', label: '制单人' }
|
||||||
let _query = {
|
],
|
||||||
...this.listQuery,
|
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||||
...this.query,
|
'fullName': '英镑',
|
||||||
menuId:this.menuId
|
'id': '2'
|
||||||
};
|
}],
|
||||||
request({
|
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
url: `/api/arinvoices/Arinvoices/getList`,
|
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||||
method: 'post',
|
'fullName': '已审批',
|
||||||
data: _query
|
'id': '2'
|
||||||
}).then(res => {
|
}],
|
||||||
var _list =[];
|
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
}
|
||||||
let _data = res.data.list[i];
|
},
|
||||||
_list.push(_data)
|
computed: {
|
||||||
}
|
menuId() {
|
||||||
this.list = _list
|
return this.$route.meta.modelId || ''
|
||||||
this.total = res.data.pagination.total
|
}
|
||||||
|
},
|
||||||
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/arinvoices/Arinvoices/${id}`,
|
url: `/api/arinvoices/Arinvoices/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,334 +1,342 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="客户编码">
|
<el-form-item label="客户编码">
|
||||||
<el-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierCd" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="客户名称">
|
<el-form-item label="客户名称">
|
||||||
<el-input v-model="query.supplierNm" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierNm" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="纳税编号">
|
<el-form-item label="纳税编号">
|
||||||
<el-input v-model="query.vatRegistrationNum" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.vatRegistrationNum" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<template v-if="showAll">
|
<template v-if="showAll">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="联系人">
|
<el-form-item label="联系人">
|
||||||
<el-input v-model="query.contactName" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.contactName" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 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 type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
|
||||||
展开
|
展开
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
||||||
收起
|
收起
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
</div>
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<div class="JNPF-common-head-right">
|
||||||
@click="reset()"/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</el-tooltip>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
<screenfull isContainer/>
|
@click="reset()"/>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</div>
|
<screenfull isContainer/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showAll: false,
|
showAll: false,
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
supplierCd:undefined,
|
supplierCd: undefined,
|
||||||
supplierNm:undefined,
|
supplierNm: undefined,
|
||||||
vatRegistrationNum:undefined,
|
vatRegistrationNum: undefined,
|
||||||
contactName: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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: 'creatorTime'
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'supplierCd', label: '客户编码' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'supplierNm', label: '客户名称' },
|
||||||
})
|
{ prop: 'orgId', label: '公司ID' },
|
||||||
},
|
{ prop: 'vatRegistrationNum', label: '纳税编号' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'customerLevel', label: '客户等级' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'contactName', label: '联系人' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'country', label: '国家' },
|
||||||
this.initData()
|
{ prop: 'contactPhone', label: '电话' },
|
||||||
},
|
{ prop: 'province', label: '省市县' },
|
||||||
initData() {
|
{ prop: 'bank', label: '开户行' },
|
||||||
this.listLoading = true;
|
{ prop: 'status', label: '是否启用' },
|
||||||
let _query = {
|
{ prop: 'bankAccount', label: '银行账号' },
|
||||||
...this.listQuery,
|
{ prop: 'enterprise', label: '企业性质' },
|
||||||
...this.query,
|
{ prop: 'address', label: '地址' },
|
||||||
menuId:this.menuId
|
{ prop: 'classification', label: '客户分类' }
|
||||||
};
|
],
|
||||||
request({
|
customerLevelOptions: [{ 'fullName': '一级', 'id': '1' }, { 'fullName': '二级', 'id': '2' }, {
|
||||||
url: `/api/example/Customer/getList`,
|
'fullName': '三级',
|
||||||
method: 'post',
|
'id': '3'
|
||||||
data: _query
|
}],
|
||||||
}).then(res => {
|
customerLevelProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
var _list =[];
|
statusOptions: [{ 'fullName': '启用', 'id': '1' }, { 'fullName': '禁用', 'id': '2' }],
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
statusProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
let _data = res.data.list[i];
|
enterpriseOptions: [{ 'fullName': '民营', 'id': '0' }, { 'fullName': '私企', 'id': '1' }],
|
||||||
_list.push(_data)
|
enterpriseProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
}
|
classificationOptions: [{ 'fullName': '国内', 'id': '0' }, { 'fullName': '国外', 'id': '1' }],
|
||||||
this.list = _list
|
classificationProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
this.total = res.data.pagination.total
|
}
|
||||||
|
},
|
||||||
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Customer/${id}`,
|
url: `/api/example/Customer/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,387 +1,415 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:close-on-click-modal="false" append-to-body
|
:close-on-click-modal="false" append-to-body
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
width="800px">
|
width="1500px">
|
||||||
<el-row :gutter="15" class="">
|
<el-row :gutter="15" class="">
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="单据编号"
|
<el-form-item label="单据编号"
|
||||||
prop="documentNo" >
|
prop="documentNo">
|
||||||
<el-input v-model="dataForm.documentNo"
|
<el-input v-model="dataForm.documentNo"
|
||||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
placeholder="请输入单据编号" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="业务日期"
|
<el-form-item label="业务日期"
|
||||||
prop="businessDate" >
|
prop="businessDate">
|
||||||
<el-date-picker v-model="dataForm.businessDate"
|
<el-date-picker v-model="dataForm.businessDate"
|
||||||
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
|
placeholder="请选择业务日期" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
|
||||||
|
value-format="timestamp">
|
||||||
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="金额"
|
<el-form-item label="金额"
|
||||||
prop="amount" >
|
prop="amount">
|
||||||
<el-input v-model="dataForm.amount"
|
<el-input v-model="dataForm.amount"
|
||||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="数量"
|
<el-form-item label="数量"
|
||||||
prop="quantity" >
|
prop="quantity">
|
||||||
<el-input v-model="dataForm.quantity"
|
<el-input v-model="dataForm.quantity"
|
||||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="发票类型"
|
<el-form-item label="发票类型"
|
||||||
prop="invoiceType" >
|
prop="invoiceType">
|
||||||
<el-select v-model="dataForm.invoiceType"
|
<el-select v-model="dataForm.invoiceType"
|
||||||
placeholder="请选择" :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in invoiceTypeOptions" :key="index" :label="item.fullName"
|
||||||
|
:value="item.id" :disabled="item.disabled"></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="币别 "
|
<el-form-item label="币别 "
|
||||||
prop="currency" >
|
prop="currency">
|
||||||
<el-select v-model="dataForm.currency"
|
<el-select v-model="dataForm.currency"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
|
:disabled="item.disabled"></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="备注"
|
<el-form-item label="备注"
|
||||||
prop="remark" >
|
prop="remark">
|
||||||
<el-input v-model="dataForm.remark"
|
<el-input v-model="dataForm.remark"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="发票金额"
|
<el-form-item label="发票金额"
|
||||||
prop="invoiceAmount" >
|
prop="invoiceAmount">
|
||||||
<el-input v-model="dataForm.invoiceAmount"
|
<el-input v-model="dataForm.invoiceAmount"
|
||||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="发票数量"
|
<el-form-item label="发票数量"
|
||||||
prop="invoiceQuantity" >
|
prop="invoiceQuantity">
|
||||||
<el-input v-model="dataForm.invoiceQuantity"
|
<el-input v-model="dataForm.invoiceQuantity"
|
||||||
placeholder="请输入单据编号" clearable :style='{"width":"100%"}'>
|
placeholder="请输入单据编号" clearable :style='{"width":"100%"}':disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="单据状态"
|
<el-form-item label="单据状态"
|
||||||
prop="status" >
|
prop="status">
|
||||||
<el-select v-model="dataForm.status"
|
<el-select v-model="dataForm.status"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
|
:disabled="item.disabled" ></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="制单人"
|
<el-form-item label="制单人"
|
||||||
prop="creatorUserName" >
|
prop="creatorUserName">
|
||||||
<el-input v-model="dataForm.creatorUserName"
|
<el-input v-model="dataForm.creatorUserName"
|
||||||
placeholder="请输入制单人" clearable :style='{"width":"100%"}'>
|
placeholder="请输入制单人" clearable :style='{"width":"100%"}' :disabled="true">
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="采购订单号"
|
<el-form-item label="采购订单号"
|
||||||
prop="purchaseorderId" >
|
prop="purchaseorderId">
|
||||||
<popupSelect v-model="dataForm.purchaseorderId"
|
<popupSelect v-model="dataForm.purchaseorderId"
|
||||||
placeholder="请选择" clearable field="purchaseorderId" interfaceId="389673535976550149" :columnOptions="purchaseorderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
|
placeholder="请选择" clearable field="purchaseorderId" interfaceId="389673535976550149"
|
||||||
popupTitle="选择数据" popupWidth="800px"
|
:columnOptions="purchaseorderIdcolumnOptions" propsValue="id" relationField="document_no"
|
||||||
>
|
popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
>
|
||||||
|
|
||||||
</popupSelect>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="合同名称"
|
<el-form-item label="合同名称"
|
||||||
prop="contractId" >
|
prop="contractId">
|
||||||
<popupSelect v-model="dataForm.contractId"
|
<popupSelect v-model="dataForm.contractId"
|
||||||
placeholder="请选择" clearable field="contractId" interfaceId="389673903103979269" :columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
|
placeholder="请选择" clearable field="contractId" interfaceId="389673903103979269"
|
||||||
popupTitle="选择数据" popupWidth="800px"
|
:columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name"
|
||||||
>
|
popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
>
|
||||||
|
|
||||||
</popupSelect>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8" >
|
<el-col :span="8">
|
||||||
<el-form-item label="供应商"
|
<el-form-item label="供应商"
|
||||||
prop="supplierId" >
|
prop="supplierId">
|
||||||
<popupSelect v-model="dataForm.supplierId"
|
<popupSelect v-model="dataForm.supplierId"
|
||||||
placeholder="请选择" clearable field="supplierId" interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions" propsValue="id" relationField="supplier_name" popupType="dialog"
|
placeholder="请选择" clearable field="supplierId" interfaceId="389674191453990661"
|
||||||
popupTitle="选择数据" popupWidth="800px"
|
:columnOptions="supplierIdcolumnOptions" propsValue="id" relationField="supplier_name"
|
||||||
>
|
popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
>
|
||||||
|
|
||||||
</popupSelect>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-tabs v-model="activebnrhzx" tab-position="top" class="mb-20">
|
<el-tabs v-model="activebnrhzx" tab-position="top" class="mb-20">
|
||||||
<el-tab-pane label="应付明细">
|
<el-tab-pane label="应付明细">
|
||||||
</el-tab-pane >
|
</el-tab-pane>
|
||||||
<el-tab-pane label="发票明细">
|
<el-tab-pane label="发票明细">
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label-width="0">
|
<el-form-item label-width="0">
|
||||||
<div class="JNPF-common-title">
|
<div class="JNPF-common-title">
|
||||||
<h2></h2>
|
<h2></h2>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="dataForm.invoices_item0List" size='mini' >
|
<el-table :data="dataForm.invoices_item0List" size='mini'>
|
||||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
<el-table-column type="index" width="50" label="序号" align="center"/>
|
||||||
<el-table-column prop="invoiceCode" label="发票代码">
|
<el-table-column prop="invoiceCode" label="发票代码">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.invoiceCode"
|
<el-input v-model="scope.row.invoiceCode"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="invoiceNo" label="发票号码">
|
<el-table-column prop="invoiceNo" label="发票号码">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.invoiceNo"
|
<el-input v-model="scope.row.invoiceNo"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="invoiceStatus" label="发票状态 ">
|
<el-table-column prop="invoiceStatus" label="发票状态 ">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="scope.row.invoiceStatus"
|
<el-select v-model="scope.row.invoiceStatus"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName"
|
||||||
</el-select>
|
:value="item.id" :disabled="item.disabled"></el-option>
|
||||||
</template>
|
</el-select>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="creatorUserName" label="开票人">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="creatorUserName" label="开票人">
|
||||||
<el-input v-model="scope.row.creatorUserName"
|
<template slot-scope="scope">
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
<el-input v-model="scope.row.creatorUserName"
|
||||||
</el-input>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</template>
|
</el-input>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column prop="invoicingDate" label="开票日期">
|
</el-table-column>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="invoicingDate" label="开票日期">
|
||||||
<el-date-picker v-model="scope.row.invoicingDate"
|
<template slot-scope="scope">
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
|
<el-date-picker v-model="scope.row.invoicingDate"
|
||||||
</el-date-picker>
|
placeholder="请选择" clearable :style='{"width":"100%"}' type="date"
|
||||||
</template>
|
format="yyyy-MM-dd" value-format="timestamp">
|
||||||
</el-table-column>
|
</el-date-picker>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="remark" label="备注信息">
|
<el-table-column prop="remark" label="备注信息">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.remark"
|
<el-input v-model="scope.row.remark"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" width="50" >
|
<el-table-column label="操作" width="50">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delinvoices_item0List(scope.$index)">删除</el-button>
|
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||||
</template>
|
@click="delinvoices_item0List(scope.$index)">删除
|
||||||
</el-table-column>
|
</el-button>
|
||||||
</el-table>
|
</template>
|
||||||
<div class="table-actions" @click="addinvoices_item0List()">
|
</el-table-column>
|
||||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
</el-table>
|
||||||
</div>
|
<div class="table-actions" @click="addinvoices_item0List()">
|
||||||
</el-form-item>
|
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||||
</el-col>
|
</div>
|
||||||
</el-tab-pane >
|
</el-form-item>
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</el-tab-pane>
|
||||||
</el-form>
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="visible = false"> 取 消</el-button>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
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"},],
|
|
||||||
|
|
||||||
invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}],
|
export default {
|
||||||
}
|
components: {},
|
||||||
},
|
props: [],
|
||||||
computed: {},
|
data() {
|
||||||
watch: {},
|
return {
|
||||||
created() {
|
excludeFields: [],
|
||||||
},
|
visible: false,
|
||||||
mounted() {},
|
loading: false,
|
||||||
methods: {
|
isDetail: false,
|
||||||
invoices_item0Exist() {
|
dataForm: {
|
||||||
let isOk = true;
|
documentNo: '',
|
||||||
for(let i=0;i<this.dataForm.invoices_item0List.length;i++){
|
businessDate: '',
|
||||||
const e = this.dataForm.invoices_item0List[i];
|
amount: '',
|
||||||
}
|
quantity: '',
|
||||||
return isOk;
|
invoiceType: '1',
|
||||||
},
|
currency: '',
|
||||||
clearData(data){
|
remark: '',
|
||||||
for (let key in data) {
|
invoiceAmount: '',
|
||||||
if (data[key] instanceof Array) {
|
invoiceQuantity: '',
|
||||||
data[key] = [];
|
status: '0',
|
||||||
} else if (data[key] instanceof Object) {
|
creatorUserName: '',
|
||||||
this.clearData(data[key]);
|
purchaseorderId: '',
|
||||||
} else {
|
contractId: '',
|
||||||
data[key] = "";
|
supplierId: '',
|
||||||
}
|
invoices_item0List: []
|
||||||
}
|
|
||||||
},
|
|
||||||
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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
@ -1,286 +1,326 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="单据编号">
|
||||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">查看
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-download" @click="">审核
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="text" icon="el-icon-download" @click="">弃审
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()"/>
|
<el-button type="text" icon="el-icon-download" @click="">提交
|
||||||
</el-tooltip>
|
</el-button>
|
||||||
<screenfull isContainer/>
|
|
||||||
</div>
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
</div>
|
</el-button>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</div>
|
||||||
<el-table-column prop="businessDate" label="业务日期" width="0" align="left"
|
<div class="JNPF-common-head-right">
|
||||||
/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
/>
|
@click="reset()"/>
|
||||||
<el-table-column prop="amount" label="金额" width="0" align="left"
|
</el-tooltip>
|
||||||
/>
|
<screenfull isContainer/>
|
||||||
<el-table-column prop="quantity" label="数量" width="0" align="left"
|
</div>
|
||||||
/>
|
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
documentNo:undefined,
|
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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: ''
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'businessDate', label: '业务日期' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'documentNo', label: '单据编号' },
|
||||||
})
|
{ prop: 'amount', label: '金额' },
|
||||||
},
|
{ prop: 'quantity', label: '数量' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'currency', label: '币别 ' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'invoiceAmount', label: '发票金额' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'invoiceQuantity', label: '发票数量' },
|
||||||
this.initData()
|
{ prop: 'invoiceType', label: '发票类型' },
|
||||||
},
|
{ prop: 'status', label: '单据状态' },
|
||||||
initData() {
|
{ prop: 'creatorUserName', label: '制单人' }
|
||||||
this.listLoading = true;
|
],
|
||||||
let _query = {
|
invoiceTypeOptions: [{ 'fullName': '普通增值税发票', 'id': '1' }, {
|
||||||
...this.listQuery,
|
'fullName': '专用增值税发票',
|
||||||
...this.query,
|
'id': '2'
|
||||||
menuId:this.menuId
|
}, { 'fullName': '增值税电子普通发票', 'id': '3' }, { 'fullName': '增值税电子发票', 'id': '4' }],
|
||||||
};
|
invoiceTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
request({
|
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||||
url: `/api/invoices/Invoices/getList`,
|
'fullName': '英镑',
|
||||||
method: 'post',
|
'id': '2'
|
||||||
data: _query
|
}],
|
||||||
}).then(res => {
|
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
var _list =[];
|
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
'fullName': '已审批',
|
||||||
let _data = res.data.list[i];
|
'id': '2'
|
||||||
_list.push(_data)
|
}],
|
||||||
}
|
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
this.list = _list
|
}
|
||||||
this.total = res.data.pagination.total
|
},
|
||||||
|
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
|
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
|
||||||
handleDel(id) {
|
.substring(0, 10) : '';
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
||||||
type: 'warning'
|
let _data = res.data.list[i]
|
||||||
}).then(() => {
|
_list.push(_data)
|
||||||
request({
|
}
|
||||||
url: `/api/invoices/Invoices/${id}`,
|
this.list = _list
|
||||||
method: 'DELETE'
|
this.total = res.data.pagination.total
|
||||||
}).then(res => {
|
|
||||||
this.$message({
|
this.listLoading = false
|
||||||
type: 'success',
|
})
|
||||||
message: res.msg,
|
},
|
||||||
onClose: () => {
|
handleDel(id) {
|
||||||
this.initData()
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
}
|
type: 'warning'
|
||||||
});
|
}).then(() => {
|
||||||
})
|
request({
|
||||||
}).catch(() => {
|
url: `/api/invoices/Invoices/${id}`,
|
||||||
});
|
method: 'DELETE'
|
||||||
},
|
}).then(res => {
|
||||||
handleSelectionChange(val) {
|
this.$message({
|
||||||
const res = val.map(item => item.id)
|
type: 'success',
|
||||||
this.multipleSelection = res
|
message: res.msg,
|
||||||
},
|
onClose: () => {
|
||||||
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()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,285 +1,293 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="设备名称">
|
<el-form-item label="设备名称">
|
||||||
<el-input v-model="query.mName" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.mName" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="区域">
|
<el-form-item label="区域">
|
||||||
<el-select v-model="query.monitoringId" placeholder="请选择区域"
|
<el-select v-model="query.monitoringId" placeholder="请选择区域"
|
||||||
clearable>
|
clearable>
|
||||||
<el-option v-for="(item, index) in monitoringIdOptions" :key="index"
|
<el-option v-for="(item, index) in monitoringIdOptions" :key="index"
|
||||||
:label="item.m_name" :value="item.id"
|
:label="item.m_name" :value="item.id"
|
||||||
:disabled="item.disabled"></el-option>
|
:disabled="item.disabled"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()"/>
|
</div>
|
||||||
</el-tooltip>
|
<div class="JNPF-common-head-right">
|
||||||
<screenfull isContainer/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</div>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
</div>
|
@click="reset()"/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</el-tooltip>
|
||||||
<el-table-column prop="mName" label="设备名称" width="0" align="left"
|
<screenfull isContainer/>
|
||||||
/>
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
mName:undefined,
|
mName: undefined,
|
||||||
monitoringId: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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
this.getmonitoringIdOptions();
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: 'creatorTime'
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
getmonitoringIdOptions() {
|
exportBoxVisible: false,
|
||||||
getDataInterfaceRes('370933183241262469').then(res => {
|
columnList: [
|
||||||
let data = res.data.data
|
{ prop: 'mName', label: '设备名称' },
|
||||||
this.monitoringIdOptions = data
|
{ prop: 'serialnumber', label: '设备序列号' },
|
||||||
})
|
{ prop: 'monitoringId', label: '区域' },
|
||||||
},
|
{ prop: 'mStatus', label: '设备状态:' },
|
||||||
goDetail(id){
|
{ prop: 'channelNumber', label: '设备通道号' },
|
||||||
this.detailVisible = true
|
{ prop: 'isEnable', label: '是否显示' }
|
||||||
this.$nextTick(() => {
|
],
|
||||||
this.$refs.Detail.init(id)
|
monitoringIdOptions: [],
|
||||||
})
|
monitoringIdProps: { 'label': 'm_name', 'value': 'id' },
|
||||||
},
|
mStatusOptions: [{ 'fullName': '在线', 'id': '1' }, { 'fullName': '不在线', 'id': '0' }],
|
||||||
sortChange({column, prop, order}) {
|
mStatusProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
isEnableOptions: [{ 'fullName': '显示', 'id': '1' }, { 'fullName': '不显示', 'id': '0' }],
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
isEnableProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
this.initData()
|
}
|
||||||
},
|
},
|
||||||
initData() {
|
computed: {
|
||||||
this.listLoading = true;
|
menuId() {
|
||||||
let _query = {
|
return this.$route.meta.modelId || ''
|
||||||
...this.listQuery,
|
}
|
||||||
...this.query,
|
},
|
||||||
menuId:this.menuId
|
created() {
|
||||||
};
|
this.initData()
|
||||||
request({
|
this.getmonitoringIdOptions()
|
||||||
url: `/api/example/Monitoringitem/getList`,
|
},
|
||||||
method: 'post',
|
methods: {
|
||||||
data: _query
|
getmonitoringIdOptions() {
|
||||||
}).then(res => {
|
getDataInterfaceRes('370933183241262469').then(res => {
|
||||||
var _list =[];
|
let data = res.data.data
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
this.monitoringIdOptions = data
|
||||||
let _data = res.data.list[i];
|
})
|
||||||
_list.push(_data)
|
},
|
||||||
}
|
goDetail(id) {
|
||||||
this.list = _list
|
this.detailVisible = true
|
||||||
this.total = res.data.pagination.total
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Monitoringitem/${id}`,
|
url: `/api/example/Monitoringitem/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,195 +1,198 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:close-on-click-modal="false" append-to-body
|
:close-on-click-modal="false" append-to-body
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
width="600px">
|
width="800px">
|
||||||
<el-row :gutter="15" class="">
|
<el-row :gutter="15" class="">
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label-width="0">
|
<el-form-item label-width="0">
|
||||||
<JNPF-Text :style='{"width":"100%"}'
|
<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="自然人档案">
|
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}'
|
||||||
</JNPF-Text>
|
value="自然人档案">
|
||||||
</el-form-item>
|
</JNPF-Text>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="24" >
|
</el-col>
|
||||||
<el-form-item label="姓名"
|
<el-col :span="24">
|
||||||
prop="name" >
|
<el-form-item label="姓名"
|
||||||
<el-input v-model="dataForm.name"
|
prop="name">
|
||||||
placeholder="请输入姓名" clearable :style='{"width":"100%"}'>
|
<el-input v-model="dataForm.name"
|
||||||
|
placeholder="请输入姓名" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="地址"
|
<el-form-item label="地址"
|
||||||
prop="adress" >
|
prop="adress">
|
||||||
<el-input v-model="dataForm.adress"
|
<el-input v-model="dataForm.adress"
|
||||||
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
|
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="手机号"
|
<el-form-item label="手机号"
|
||||||
prop="contact" >
|
prop="contact">
|
||||||
<el-input v-model="dataForm.contact"
|
<el-input v-model="dataForm.contact"
|
||||||
placeholder="请输入手机号" clearable :style='{"width":"100%"}'>
|
placeholder="请输入手机号" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" >
|
<!-- <el-col :span="12">-->
|
||||||
<el-form-item label="录入人"
|
<!-- <el-form-item label="录入人"-->
|
||||||
prop="creatorUserName" >
|
<!-- prop="creatorUserName">-->
|
||||||
<el-input v-model="dataForm.creatorUserName"
|
<!-- <el-input v-model="dataForm.creatorUserName"-->
|
||||||
placeholder="请输入录入人" clearable :style='{"width":"100%"}'>
|
<!-- placeholder="请输入录入人" clearable :style='{"width":"100%"}'>-->
|
||||||
|
|
||||||
</el-input>
|
<!-- </el-input>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :span="12" >
|
<!-- <el-col :span="12">-->
|
||||||
<el-form-item label="创建时间"
|
<!-- <el-form-item label="创建时间"-->
|
||||||
prop="creatorTime" >
|
<!-- prop="creatorTime">-->
|
||||||
<el-input v-model="dataForm.creatorTime"
|
<!-- <el-input v-model="dataForm.creatorTime"-->
|
||||||
placeholder="系统自动生成" readonly >
|
<!-- placeholder="系统自动生成" readonly>-->
|
||||||
|
|
||||||
</el-input>
|
<!-- </el-input>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="visible = false"> 取 消</el-button>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
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'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
export default {
|
||||||
},
|
components: {},
|
||||||
computed: {},
|
props: [],
|
||||||
watch: {},
|
data() {
|
||||||
created() {
|
return {
|
||||||
},
|
visible: false,
|
||||||
mounted() {},
|
loading: false,
|
||||||
methods: {
|
isDetail: false,
|
||||||
clearData(data){
|
dataForm: {
|
||||||
for (let key in data) {
|
name: '',
|
||||||
if (data[key] instanceof Array) {
|
adress: '',
|
||||||
data[key] = [];
|
contact: '',
|
||||||
} else if (data[key] instanceof Object) {
|
creatorUserName: '',
|
||||||
this.clearData(data[key]);
|
creatorTime: ''
|
||||||
} 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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
@ -1,256 +1,261 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="姓名">
|
<el-form-item label="姓名">
|
||||||
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.name" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="手机号">
|
<el-form-item label="手机号">
|
||||||
<el-input v-model="query.contact" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.contact" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
</div>
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<div class="JNPF-common-head-right">
|
||||||
@click="reset()"/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</el-tooltip>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
<screenfull isContainer/>
|
@click="reset()"/>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</div>
|
<screenfull isContainer/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
name:undefined,
|
name: undefined,
|
||||||
contact: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: '创建时间'},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: 'creatorTime'
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'name', label: '姓名' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'adress', label: '地址' },
|
||||||
})
|
{ prop: 'contact', label: '手机号' },
|
||||||
},
|
{ prop: 'creatorUserName', label: '录入人' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'creatorTime', label: '创建时间' }
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
]
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
}
|
||||||
this.initData()
|
},
|
||||||
},
|
computed: {
|
||||||
initData() {
|
menuId() {
|
||||||
this.listLoading = true;
|
return this.$route.meta.modelId || ''
|
||||||
let _query = {
|
}
|
||||||
...this.listQuery,
|
},
|
||||||
...this.query,
|
created() {
|
||||||
menuId:this.menuId
|
this.initData()
|
||||||
};
|
},
|
||||||
request({
|
methods: {
|
||||||
url: `/api/example/Jg_natural/getList`,
|
goDetail(id) {
|
||||||
method: 'post',
|
this.detailVisible = true
|
||||||
data: _query
|
this.$nextTick(() => {
|
||||||
}).then(res => {
|
this.$refs.Detail.init(id)
|
||||||
var _list =[];
|
})
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
},
|
||||||
let _data = res.data.list[i];
|
sortChange({ column, prop, order }) {
|
||||||
_list.push(_data)
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
}
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
this.list = _list
|
this.initData()
|
||||||
this.total = res.data.pagination.total
|
},
|
||||||
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Jg_natural/${id}`,
|
url: `/api/example/Jg_natural/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,343 +1,353 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="单据编号">
|
||||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
<el-button type="text" icon="el-icon-download" @click="">编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
<el-button type="text" icon="el-icon-download" @click="">查看
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()" />
|
</div>
|
||||||
</el-tooltip>
|
<div class="JNPF-common-head-right">
|
||||||
<screenfull isContainer />
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</div>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
</div>
|
@click="reset()"/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
</el-tooltip>
|
||||||
@selection-change="handleSelectionChange">
|
<screenfull isContainer/>
|
||||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left" />
|
</div>
|
||||||
<el-table-column prop="jg_purchaseorder.contractName" label="合同名称" width="0" align="left" />
|
</div>
|
||||||
<el-table-column prop="jg_purchaseorder.supplierName" label="供应商名称" width="0" align="left" />
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<el-table-column prop="refundAmount" label="退货金额" width="0" align="left" />
|
@selection-change="handleSelectionChange" border>
|
||||||
<el-table-column prop="actualAmount" label="实退金额" width="0" align="left" />
|
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||||
<el-table-column label="币别 " width="0" prop="currency" algin="left">
|
<el-table-column prop="documentNo" label="单据编号" width="200" align="center"sortable fixed="left" />
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="jg_purchaseorder.contractName" label="合同名称" width="200" align="center"sortable/>
|
||||||
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
<el-table-column prop="jg_purchaseorder.supplierName" label="供应商名称" width="200" align="center"sortable/>
|
||||||
</template>
|
<el-table-column prop="refundAmount" label="退货金额" width="120" align="center"sortable/>
|
||||||
</el-table-column>
|
<el-table-column prop="actualAmount" label="实退金额" width="120" align="center"sortable/>
|
||||||
<el-table-column prop="refundNum" label="退货数量" width="0" align="left" />
|
<el-table-column label="币别 " width="120" prop="currency" algin="center" sortable>
|
||||||
<el-table-column label="单据状态 " width="0" prop="status" algin="left">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
{{ scope.row.currency | dynamicText(currencyOptions) }}
|
||||||
{{ scope.row.status | dynamicText(statusOptions) }}
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="refundNum" label="退货数量" width="120" align="center"sortable/>
|
||||||
<el-table-column prop="creatorTime" label="创建时间" width="0" align="left" />
|
<el-table-column label="单据状态 " width="120" prop="status" algin="center">
|
||||||
<el-table-column prop="creatorUserName" label="创建人" width="0" align="left" />
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="remark" label="备注" width="0" align="left" />
|
{{ scope.row.status | dynamicText(statusOptions) }}
|
||||||
<el-table-column label="操作" fixed="right" width="150">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
<el-table-column prop="creatorTime" label="创建时间" width="120" align="center"sortable/>
|
||||||
</el-button>
|
<el-table-column prop="creatorUserName" label="创建人" width="120" align="center"sortable/>
|
||||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
<el-table-column prop="remark" label="备注" width="0" align="center"sortable/>
|
||||||
</el-button>
|
<el-table-column label="操作" fixed="right" width="150">
|
||||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
<template slot-scope="scope">
|
||||||
</el-button>
|
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||||
</template>
|
</el-button>
|
||||||
</el-table-column>
|
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||||
</JNPF-table>
|
</el-button>
|
||||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
||||||
@pagination="initData" />
|
</el-button>
|
||||||
</div>
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
</JNPF-table>
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
@pagination="initData"/>
|
||||||
</div>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import {
|
||||||
getDictionaryDataSelector
|
getDictionaryDataSelector
|
||||||
} from '@/api/systemData/dictionary'
|
} from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {
|
import {
|
||||||
getDataInterfaceRes
|
getDataInterfaceRes
|
||||||
} from '@/api/systemData/dataInterface'
|
} from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
JNPFForm,
|
JNPFForm,
|
||||||
ExportBox,
|
ExportBox,
|
||||||
Detail
|
Detail
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
documentNo: undefined,
|
documentNo: undefined
|
||||||
},
|
},
|
||||||
treeProps: {
|
treeProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'fullName',
|
label: 'fullName',
|
||||||
value: 'id'
|
value: 'id'
|
||||||
},
|
},
|
||||||
list: [],
|
list: [],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
sort: "desc",
|
sort: 'desc',
|
||||||
sidx: "",
|
sidx: ''
|
||||||
},
|
},
|
||||||
formVisible: false,
|
formVisible: false,
|
||||||
exportBoxVisible: false,
|
exportBoxVisible: false,
|
||||||
columnList: [{
|
columnList: [{
|
||||||
prop: 'documentNo',
|
prop: 'documentNo',
|
||||||
label: '单据编号'
|
label: '单据编号'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'jg_purchaseorder.contractName',
|
prop: 'jg_purchaseorder.contractName',
|
||||||
label: '合同名称'
|
label: '合同名称'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'jg_purchaseorder.supplierName',
|
prop: 'jg_purchaseorder.supplierName',
|
||||||
label: '供应商名称'
|
label: '供应商名称'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'refundAmount',
|
prop: 'refundAmount',
|
||||||
label: '退货金额'
|
label: '退货金额'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'actualAmount',
|
prop: 'actualAmount',
|
||||||
label: '实退金额'
|
label: '实退金额'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'currency',
|
prop: 'currency',
|
||||||
label: '币别 '
|
label: '币别 '
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'refundNum',
|
prop: 'refundNum',
|
||||||
label: '退货数量'
|
label: '退货数量'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'status',
|
prop: 'status',
|
||||||
label: '单据状态 '
|
label: '单据状态 '
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'creatorTime',
|
prop: 'creatorTime',
|
||||||
label: '创建时间'
|
label: '创建时间'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'creatorUserName',
|
prop: 'creatorUserName',
|
||||||
label: '创建人'
|
label: '创建人'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注'
|
label: '备注'
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
currencyOptions: [{
|
currencyOptions: [{
|
||||||
"fullName": "人民币",
|
'fullName': '人民币',
|
||||||
"id": "0"
|
'id': '0'
|
||||||
}, {
|
}, {
|
||||||
"fullName": "美元",
|
'fullName': '美元',
|
||||||
"id": "1"
|
'id': '1'
|
||||||
}, {
|
}, {
|
||||||
"fullName": "英镑",
|
'fullName': '英镑',
|
||||||
"id": "2"
|
'id': '2'
|
||||||
}],
|
}],
|
||||||
currencyProps: {
|
currencyProps: {
|
||||||
"label": "fullName",
|
'label': 'fullName',
|
||||||
"value": "id"
|
'value': 'id'
|
||||||
},
|
},
|
||||||
statusOptions: [{
|
statusOptions: [{
|
||||||
"fullName": "已保存",
|
'fullName': '已保存',
|
||||||
"id": "0"
|
'id': '0'
|
||||||
}, {
|
}, {
|
||||||
"fullName": "审批中",
|
'fullName': '审批中',
|
||||||
"id": "1"
|
'id': '1'
|
||||||
}, {
|
}, {
|
||||||
"fullName": "已审批",
|
'fullName': '已审批',
|
||||||
"id": "2"
|
'id': '2'
|
||||||
}],
|
}],
|
||||||
statusProps: {
|
statusProps: {
|
||||||
"label": "fullName",
|
'label': 'fullName',
|
||||||
"value": "id"
|
'value': 'id'
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
menuId() {
|
menuId() {
|
||||||
return this.$route.meta.modelId || ''
|
return this.$route.meta.modelId || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initData()
|
this.initData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goDetail(id) {
|
goDetail(id) {
|
||||||
this.detailVisible = true
|
this.detailVisible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.Detail.init(id)
|
this.$refs.Detail.init(id)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
sortChange({
|
sortChange({
|
||||||
column,
|
column,
|
||||||
prop,
|
prop,
|
||||||
order
|
order
|
||||||
}) {
|
}) {
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
this.initData()
|
this.initData()
|
||||||
},
|
},
|
||||||
initData() {
|
initData() {
|
||||||
this.listLoading = true;
|
this.listLoading = true
|
||||||
let _query = {
|
let _query = {
|
||||||
...this.listQuery,
|
...this.listQuery,
|
||||||
...this.query,
|
...this.query,
|
||||||
menuId: this.menuId
|
menuId: this.menuId
|
||||||
};
|
}
|
||||||
request({
|
request({
|
||||||
url: `/api/purchaseback/Purchaseback/getList`,
|
url: `/api/purchaseback/Purchaseback/getList`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: _query
|
data: _query
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
var _list = [];
|
var _list = []
|
||||||
for (let i = 0; i < res.data.list.length; i++) {
|
for (let i = 0; i < res.data.list.length; i++) {
|
||||||
let _data = res.data.list[i];
|
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0,
|
||||||
_list.push(_data)
|
10) : '';
|
||||||
}
|
|
||||||
this.list = _list
|
|
||||||
this.total = res.data.pagination.total
|
|
||||||
|
|
||||||
this.listLoading = false
|
let _data = res.data.list[i]
|
||||||
})
|
_list.push(_data)
|
||||||
},
|
}
|
||||||
handleDel(id) {
|
this.list = _list
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.total = res.data.pagination.total
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
this.listLoading = false
|
||||||
request({
|
})
|
||||||
url: `/api/purchaseback/Purchaseback/${id}`,
|
},
|
||||||
method: 'DELETE'
|
handleDel(id) {
|
||||||
}).then(res => {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
this.$message({
|
type: 'warning'
|
||||||
type: 'success',
|
}).then(() => {
|
||||||
message: res.msg,
|
request({
|
||||||
onClose: () => {
|
url: `/api/purchaseback/Purchaseback/${id}`,
|
||||||
this.initData()
|
method: 'DELETE'
|
||||||
}
|
}).then(res => {
|
||||||
});
|
this.$message({
|
||||||
})
|
type: 'success',
|
||||||
}).catch(() => {});
|
message: res.msg,
|
||||||
},
|
onClose: () => {
|
||||||
handleSelectionChange(val) {
|
this.initData()
|
||||||
const res = val.map(item => item.id)
|
}
|
||||||
this.multipleSelection = res
|
})
|
||||||
},
|
})
|
||||||
handleBatchRemoveDel() {
|
}).catch(() => {
|
||||||
if (!this.multipleSelection.length) {
|
})
|
||||||
this.$message({
|
},
|
||||||
type: 'error',
|
handleSelectionChange(val) {
|
||||||
message: '请选择一条数据',
|
const res = val.map(item => item.id)
|
||||||
duration: 1500,
|
this.multipleSelection = res
|
||||||
})
|
},
|
||||||
return
|
handleBatchRemoveDel() {
|
||||||
}
|
if (!this.multipleSelection.length) {
|
||||||
const ids = this.multipleSelection.join()
|
this.$message({
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
type: 'error',
|
||||||
type: 'warning'
|
message: '请选择一条数据',
|
||||||
}).then(() => {
|
duration: 1500
|
||||||
request({
|
})
|
||||||
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
|
return
|
||||||
method: 'DELETE'
|
}
|
||||||
}).then(res => {
|
const ids = this.multipleSelection.join()
|
||||||
this.$message({
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
type: 'success',
|
type: 'warning'
|
||||||
message: res.msg,
|
}).then(() => {
|
||||||
onClose: () => {
|
request({
|
||||||
this.initData()
|
url: `/api/purchaseback/Purchaseback/batchRemove/${ids}`,
|
||||||
}
|
method: 'DELETE'
|
||||||
});
|
}).then(res => {
|
||||||
})
|
this.$message({
|
||||||
}).catch(() => {})
|
type: 'success',
|
||||||
},
|
message: res.msg,
|
||||||
addOrUpdateHandle(id, isDetail) {
|
onClose: () => {
|
||||||
this.formVisible = true
|
this.initData()
|
||||||
this.$nextTick(() => {
|
}
|
||||||
this.$refs.JNPFForm.init(id, isDetail)
|
})
|
||||||
})
|
})
|
||||||
},
|
}).catch(() => {
|
||||||
exportData() {
|
})
|
||||||
this.exportBoxVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
this.formVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.JNPFForm.init(id, isDetail)
|
||||||
download(data) {
|
})
|
||||||
let query = {
|
},
|
||||||
...data,
|
exportData() {
|
||||||
...this.listQuery,
|
this.exportBoxVisible = true
|
||||||
...this.query,
|
this.$nextTick(() => {
|
||||||
menuId: this.menuId
|
this.$refs.ExportBox.init(this.columnList)
|
||||||
}
|
})
|
||||||
request({
|
},
|
||||||
url: `/api/purchaseback/Purchaseback/Actions/Export`,
|
download(data) {
|
||||||
method: 'GET',
|
let query = {
|
||||||
data: query
|
...data,
|
||||||
}).then(res => {
|
...this.listQuery,
|
||||||
if (!res.data.url) return
|
...this.query,
|
||||||
this.jnpf.downloadFile(res.data.url)
|
menuId: this.menuId
|
||||||
this.$refs.ExportBox.visible = false
|
}
|
||||||
this.exportBoxVisible = false
|
request({
|
||||||
})
|
url: `/api/purchaseback/Purchaseback/Actions/Export`,
|
||||||
},
|
method: 'GET',
|
||||||
search() {
|
data: query
|
||||||
this.listQuery = {
|
}).then(res => {
|
||||||
currentPage: 1,
|
if (!res.data.url) return
|
||||||
pageSize: 20,
|
this.jnpf.downloadFile(res.data.url)
|
||||||
sort: "desc",
|
this.$refs.ExportBox.visible = false
|
||||||
sidx: "",
|
this.exportBoxVisible = false
|
||||||
}
|
})
|
||||||
this.initData()
|
},
|
||||||
},
|
search() {
|
||||||
refresh(isrRefresh) {
|
this.listQuery = {
|
||||||
this.formVisible = false
|
currentPage: 1,
|
||||||
if (isrRefresh) this.reset()
|
pageSize: 20,
|
||||||
},
|
sort: 'desc',
|
||||||
reset() {
|
sidx: ''
|
||||||
for (let key in this.query) {
|
}
|
||||||
this.query[key] = undefined
|
this.initData()
|
||||||
}
|
},
|
||||||
this.search()
|
refresh(isrRefresh) {
|
||||||
}
|
this.formVisible = false
|
||||||
}
|
if (isrRefresh) this.reset()
|
||||||
}
|
},
|
||||||
|
reset() {
|
||||||
|
for (let key in this.query) {
|
||||||
|
this.query[key] = undefined
|
||||||
|
}
|
||||||
|
this.search()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,371 +1,400 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="单据编号">
|
||||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="pigeonhole()">归档
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="paymentApply()">付款申请
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-download" @click="">开票文件下载
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="text" icon="el-icon-download" @click="">发票录入
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()"/>
|
<el-button type="text" icon="el-icon-download" @click="">入库
|
||||||
</el-tooltip>
|
</el-button>
|
||||||
<screenfull isContainer/>
|
<el-button type="primary" icon="el-icon-plus" @click="paymentApply()">付款申请
|
||||||
</div>
|
</el-button>
|
||||||
</div>
|
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
<el-button type="primary" icon="el-icon-plus" @click="pigeonhole()">归档
|
||||||
<el-table-column prop="documentNo" label="单据编号" width="0" align="left"
|
</el-button>
|
||||||
/>
|
<el-button type="text" icon="el-icon-download" @click="">转销售
|
||||||
<el-table-column prop="erpNo" label="ERP订单号" width="0" align="left"
|
</el-button>
|
||||||
/>
|
</div>
|
||||||
<el-table-column prop="contractName" label="合同名称" width="0" align="left"
|
<div class="JNPF-common-head-right">
|
||||||
/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
/>
|
@click="reset()"/>
|
||||||
<el-table-column prop="amount" label="金额" width="0" align="left"
|
</el-tooltip>
|
||||||
/>
|
<screenfull isContainer/>
|
||||||
<el-table-column prop="num" label="重量" width="0" align="left"
|
</div>
|
||||||
/>
|
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
import pament from '@/views/scm/basicInformation/paymentdoc/Form'
|
import pament from '@/views/scm/basicInformation/paymentdoc/Form'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
// routes:[
|
// routes:[
|
||||||
// {
|
// {
|
||||||
// path:'/paymentdoc',
|
// path:'/paymentdoc',
|
||||||
// name:'payment',
|
// name:'payment',
|
||||||
// component:pament
|
// component:pament
|
||||||
// }
|
// }
|
||||||
// ],
|
// ],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
documentNo:undefined,
|
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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: ''
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'documentNo', label: '单据编号' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'erpNo', label: 'ERP订单号' },
|
||||||
})
|
{ prop: 'contractName', label: '合同名称' },
|
||||||
},
|
{ prop: 'supplierName', label: '供应商名称' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'amount', label: '金额' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'num', label: '重量' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'currency', label: '币种' },
|
||||||
this.initData()
|
{ prop: 'payPrice', label: '已付款金额' },
|
||||||
},
|
{ prop: 'invoiceNum', label: '发票数量' },
|
||||||
initData() {
|
{ prop: 'invoiceAmount', label: '发票金额' },
|
||||||
this.listLoading = true;
|
{ prop: 'advanceAmount', label: '垫资金额' },
|
||||||
let _query = {
|
{ prop: 'creatorTime', label: '制单时间' },
|
||||||
...this.listQuery,
|
{ prop: 'status', label: '单据状态 ' },
|
||||||
...this.query,
|
{ prop: 'creatorUserName', label: '制单人' }
|
||||||
menuId:this.menuId
|
],
|
||||||
};
|
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||||
request({
|
'fullName': '英镑',
|
||||||
url: `/api/purchaseorder/Purchaseorder/getList`,
|
'id': '2'
|
||||||
method: 'post',
|
}],
|
||||||
data: _query
|
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
}).then(res => {
|
statusOptions: [{ 'fullName': '待开票', 'id': '0' }, { 'fullName': '开票中', 'id': '1' }, {
|
||||||
var _list =[];
|
'fullName': '付款中',
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
'id': '2'
|
||||||
let _data = res.data.list[i];
|
}, { 'fullName': '归档', 'id': '3' }],
|
||||||
_list.push(_data)
|
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
}
|
}
|
||||||
this.list = _list
|
},
|
||||||
this.total = res.data.pagination.total
|
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
|
let _data = res.data.list[i]
|
||||||
})
|
_list.push(_data)
|
||||||
},
|
}
|
||||||
handleDel(id) {
|
this.list = _list
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.total = res.data.pagination.total
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
this.listLoading = false
|
||||||
request({
|
})
|
||||||
url: `/api/purchaseorder/Purchaseorder/${id}`,
|
},
|
||||||
method: 'DELETE'
|
handleDel(id) {
|
||||||
}).then(res => {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
this.$message({
|
type: 'warning'
|
||||||
type: 'success',
|
}).then(() => {
|
||||||
message: res.msg,
|
request({
|
||||||
onClose: () => {
|
url: `/api/purchaseorder/Purchaseorder/${id}`,
|
||||||
this.initData()
|
method: 'DELETE'
|
||||||
}
|
}).then(res => {
|
||||||
});
|
this.$message({
|
||||||
})
|
type: 'success',
|
||||||
}).catch(() => {
|
message: res.msg,
|
||||||
});
|
onClose: () => {
|
||||||
},
|
this.initData()
|
||||||
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 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({
|
}).catch(() => {
|
||||||
type: 'error',
|
})
|
||||||
message: '请先开具发票',
|
},
|
||||||
duration: 1500,
|
handleSelectionChange(val) {
|
||||||
})
|
const res = val.map(item => item.id)
|
||||||
return
|
this.multipleSelection = res
|
||||||
}else{
|
},
|
||||||
debugger
|
handleBatchRemoveDel() {
|
||||||
// window.navigator("views/scm/basicInformation/paymentdoc/index.vue");
|
if (!this.multipleSelection.length) {
|
||||||
// window.location.href="views/scm/basicInformation/paymentdoc/index.vue";
|
this.$message({
|
||||||
// this.formVisible = true
|
type: 'error',
|
||||||
// this.$nextTick((id,isDetail) => {
|
message: '请选择一条数据',
|
||||||
// this.$refs.JNPFForm.init(id, isDetail)
|
duration: 1500
|
||||||
// })
|
})
|
||||||
this.$router.push({path:'/paymentdoc'})
|
return
|
||||||
}*/
|
}
|
||||||
},
|
const ids = this.multipleSelection.join()
|
||||||
exportData() {
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
this.exportBoxVisible = true
|
type: 'warning'
|
||||||
this.$nextTick(() => {
|
}).then(() => {
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
request({
|
||||||
})
|
url: `/api/purchaseorder/Purchaseorder/batchRemove/${ids}`,
|
||||||
},
|
method: 'DELETE'
|
||||||
download(data) {
|
}).then(res => {
|
||||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
this.$message({
|
||||||
request({
|
type: 'success',
|
||||||
url: `/api/purchaseorder/Purchaseorder/Actions/Export`,
|
message: res.msg,
|
||||||
method: 'GET',
|
onClose: () => {
|
||||||
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()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.query[key] = undefined
|
this.formVisible = true
|
||||||
}
|
this.$nextTick(() => {
|
||||||
this.search()
|
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>
|
</script>
|
||||||
|
@ -1,215 +1,237 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:close-on-click-modal="false" append-to-body
|
:close-on-click-modal="false" append-to-body
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
width="600px">
|
width="1000px">
|
||||||
<el-row :gutter="15" class="">
|
<el-row :gutter="15" class="">
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="库区编码"
|
<el-form-item label="库区编码"
|
||||||
prop="areacode" >
|
prop="areacode">
|
||||||
<el-input v-model="dataForm.areacode"
|
<el-input v-model="dataForm.areacode"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="库区名称"
|
<el-form-item label="库区名称"
|
||||||
prop="areaname" >
|
prop="areaname">
|
||||||
<el-input v-model="dataForm.areaname"
|
<el-input v-model="dataForm.areaname"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="最高库存"
|
<el-form-item label="最高库存"
|
||||||
prop="maximum" >
|
prop="maximum">
|
||||||
<el-input-number v-model="dataForm.maximum"
|
<el-input-number v-model="dataForm.maximum"
|
||||||
placeholder="数字文本" :step="1" >
|
placeholder="数字文本" :step="1">
|
||||||
|
|
||||||
</el-input-number>
|
</el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="安全库存"
|
<el-form-item label="安全库存"
|
||||||
prop="safety" >
|
prop="safety">
|
||||||
<el-input-number v-model="dataForm.safety"
|
<el-input-number v-model="dataForm.safety"
|
||||||
placeholder="数字文本" :step="1" >
|
placeholder="数字文本" :step="1">
|
||||||
|
|
||||||
</el-input-number>
|
</el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="最低库存"
|
<el-form-item label="最低库存"
|
||||||
prop="minimum" >
|
prop="minimum">
|
||||||
<el-input-number v-model="dataForm.minimum"
|
<el-input-number v-model="dataForm.minimum"
|
||||||
placeholder="数字文本" :step="1" >
|
placeholder="数字文本" :step="1">
|
||||||
|
|
||||||
</el-input-number>
|
</el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="计量单位"
|
<el-form-item label="计量单位"
|
||||||
prop="unit" >
|
prop="unit">
|
||||||
<el-select v-model="dataForm.unit"
|
<el-select v-model="dataForm.unit"
|
||||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
|
:disabled="item.disabled"></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="仓库"
|
<el-form-item label="仓库"
|
||||||
prop="warehouseId" >
|
prop="warehouseId">
|
||||||
<popupSelect v-model="dataForm.warehouseId"
|
<popupSelect v-model="dataForm.warehouseId"
|
||||||
placeholder="请选择" field="warehouseId" interfaceId="394860934465658373" :columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="NAME" popupType="dialog"
|
placeholder="请选择" field="warehouseId" interfaceId="394860934465658373"
|
||||||
popupTitle="选择数据" popupWidth="800px"
|
:columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="NAME"
|
||||||
>
|
popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
>
|
||||||
|
|
||||||
</popupSelect>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="visible = false"> 取 消</el-button>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
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"},],
|
|
||||||
|
|
||||||
}
|
export default {
|
||||||
},
|
components: {},
|
||||||
computed: {},
|
props: [],
|
||||||
watch: {},
|
data() {
|
||||||
created() {
|
return {
|
||||||
},
|
visible: false,
|
||||||
mounted() {},
|
loading: false,
|
||||||
methods: {
|
isDetail: false,
|
||||||
clearData(data){
|
dataForm: {
|
||||||
for (let key in data) {
|
areacode: '',
|
||||||
if (data[key] instanceof Array) {
|
areaname: '',
|
||||||
data[key] = [];
|
maximum: 1,
|
||||||
} else if (data[key] instanceof Object) {
|
safety: 1,
|
||||||
this.clearData(data[key]);
|
minimum: 1,
|
||||||
} else {
|
unit: '',
|
||||||
data[key] = "";
|
warehouseId: '',
|
||||||
}
|
creatorTime: '',
|
||||||
}
|
lastModifyTime: ''
|
||||||
},
|
|
||||||
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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
@ -1,268 +1,276 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="库区编码">
|
<el-form-item label="库区编码">
|
||||||
<el-input v-model="query.areacode" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.areacode" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="库区名称">
|
<el-form-item label="库区名称">
|
||||||
<el-input v-model="query.areaname" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.areaname" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
|
||||||
</el-button>
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</div>
|
</el-button>
|
||||||
<div class="JNPF-common-head-right">
|
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()"/>
|
</div>
|
||||||
</el-tooltip>
|
<div class="JNPF-common-head-right">
|
||||||
<screenfull isContainer/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</div>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
</div>
|
@click="reset()"/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</el-tooltip>
|
||||||
<el-table-column prop="areacode" label="库区编码" width="0" align="left"
|
<screenfull isContainer/>
|
||||||
/>
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
areacode:undefined,
|
areacode: undefined,
|
||||||
areaname: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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: 'creatorTime'
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'areacode', label: '库区编码' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'areaname', label: '库区名称' },
|
||||||
})
|
{ prop: 'maximum', label: '最高库存' },
|
||||||
},
|
{ prop: 'safety', label: '安全库存' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'minimum', label: '最低库存' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'unit', label: '计量单位' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'warehouseId', label: '仓库' }
|
||||||
this.initData()
|
],
|
||||||
},
|
unitOptions: [{ 'fullName': '吨', 'id': '0' }, { 'fullName': '千克', 'id': '1' }],
|
||||||
initData() {
|
unitProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
this.listLoading = true;
|
}
|
||||||
let _query = {
|
},
|
||||||
...this.listQuery,
|
computed: {
|
||||||
...this.query,
|
menuId() {
|
||||||
menuId:this.menuId
|
return this.$route.meta.modelId || ''
|
||||||
};
|
}
|
||||||
request({
|
},
|
||||||
url: `/api/example/Reservoirarea/getList`,
|
created() {
|
||||||
method: 'post',
|
this.initData()
|
||||||
data: _query
|
},
|
||||||
}).then(res => {
|
methods: {
|
||||||
var _list =[];
|
goDetail(id) {
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
this.detailVisible = true
|
||||||
let _data = res.data.list[i];
|
this.$nextTick(() => {
|
||||||
_list.push(_data)
|
this.$refs.Detail.init(id)
|
||||||
}
|
})
|
||||||
this.list = _list
|
},
|
||||||
this.total = res.data.pagination.total
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Reservoirarea/${id}`,
|
url: `/api/example/Reservoirarea/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.initData()
|
this.initData()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
const res = val.map(item => item.id)
|
const res = val.map(item => item.id)
|
||||||
this.multipleSelection = res
|
this.multipleSelection = res
|
||||||
},
|
},
|
||||||
handleBatchRemoveDel() {
|
handleBatchRemoveDel() {
|
||||||
if (!this.multipleSelection.length) {
|
if (!this.multipleSelection.length) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: '请选择一条数据',
|
message: '请选择一条数据',
|
||||||
duration: 1500,
|
duration: 1500
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const ids = this.multipleSelection.join()
|
const ids = this.multipleSelection.join()
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Reservoirarea/batchRemove/${ids}`,
|
url: `/api/example/Reservoirarea/batchRemove/${ids}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.query[key] = undefined
|
this.formVisible = true
|
||||||
}
|
this.$nextTick(() => {
|
||||||
this.search()
|
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>
|
</script>
|
||||||
|
@ -1,286 +1,297 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="单据编号">
|
||||||
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.documentNo" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="JNPF-common-head-right">
|
<div class="JNPF-common-head-right">
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
@click="reset()"/>
|
@click="reset()"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<screenfull isContainer/>
|
<screenfull isContainer/>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
documentNo:undefined,
|
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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: ''
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'documentNo', label: '单据编号' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'salesOrderId', label: '销售订单' },
|
||||||
})
|
{ prop: 'jg_salesorder.contractName', label: '合同名称' },
|
||||||
},
|
{ prop: 'jg_salesorder.costomerName', label: '客户名称' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'refundAmount', label: '退款金额' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'actualAmount', label: '实退金额' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'currency', label: '币别' },
|
||||||
this.initData()
|
{ prop: 'refundNum', label: '退货数量' },
|
||||||
},
|
{ prop: 'status', label: '单据状态 ' },
|
||||||
initData() {
|
{ prop: 'creatorTime', label: '创建时间' },
|
||||||
this.listLoading = true;
|
{ prop: 'creatorUserName', label: '创建人' },
|
||||||
let _query = {
|
{ prop: 'remark', label: '备注' }
|
||||||
...this.listQuery,
|
],
|
||||||
...this.query,
|
currencyOptions: [{ 'fullName': '人民币', 'id': '0' }, { 'fullName': '美元', 'id': '1' }, {
|
||||||
menuId:this.menuId
|
'fullName': '英镑',
|
||||||
};
|
'id': '2'
|
||||||
request({
|
}],
|
||||||
url: `/api/saleback/Saleback/getList`,
|
currencyProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
method: 'post',
|
statusOptions: [{ 'fullName': '已保存', 'id': '0' }, { 'fullName': '审批中', 'id': '1' }, {
|
||||||
data: _query
|
'fullName': '已审批',
|
||||||
}).then(res => {
|
'id': '2'
|
||||||
var _list =[];
|
}],
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
statusProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
let _data = res.data.list[i];
|
}
|
||||||
_list.push(_data)
|
},
|
||||||
}
|
computed: {
|
||||||
this.list = _list
|
menuId() {
|
||||||
this.total = res.data.pagination.total
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/saleback/Saleback/${id}`,
|
url: `/api/saleback/Saleback/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,376 +1,387 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="供应商编码">
|
<el-form-item label="供应商编码">
|
||||||
<el-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierCode" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="供应商名称">
|
<el-form-item label="供应商名称">
|
||||||
<el-input v-model="query.supplierName" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierName" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="联系人">
|
<el-form-item label="联系人">
|
||||||
<el-input v-model="query.contactName" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.contactName" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<template v-if="showAll">
|
<template v-if="showAll">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="联系电话">
|
<el-form-item label="联系电话">
|
||||||
<el-input v-model="query.contactPhone" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.contactPhone" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="供应商地点">
|
<el-form-item label="供应商地点">
|
||||||
<el-input v-model="query.supplierSiteCode" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierSiteCode" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 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 type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
|
||||||
展开
|
展开
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
|
||||||
收起
|
收起
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
</div>
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<div class="JNPF-common-head-right">
|
||||||
@click="reset()"/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</el-tooltip>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
<screenfull isContainer/>
|
@click="reset()"/>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</div>
|
<screenfull isContainer/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showAll: false,
|
showAll: false,
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
supplierCode:undefined,
|
supplierCode: undefined,
|
||||||
supplierName:undefined,
|
supplierName: undefined,
|
||||||
contactName:undefined,
|
contactName: undefined,
|
||||||
contactPhone:undefined,
|
contactPhone: undefined,
|
||||||
supplierSiteCode: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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: 'creatorTime'
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'supplierCode', label: '供应商编码' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'companyId', label: '所属公司' },
|
||||||
})
|
{ prop: 'supplierName', label: '供应商名称' },
|
||||||
},
|
{ prop: 'country', label: '国家' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'supply', label: '供货指标' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'province', label: '省' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'contactName', label: '联系人' },
|
||||||
this.initData()
|
{ prop: 'supplierLevel', label: '供应商等级' },
|
||||||
},
|
{ prop: 'contactPhone', label: '联系电话' },
|
||||||
initData() {
|
{ prop: 'enterprise', label: '供应商性质' },
|
||||||
this.listLoading = true;
|
{ prop: 'address', label: '地址' },
|
||||||
let _query = {
|
{ prop: 'classification', label: '供应商类型' },
|
||||||
...this.listQuery,
|
{ prop: 'bank', label: '开户行' },
|
||||||
...this.query,
|
{ prop: 'vatRegistrationNum', label: '纳税编号' },
|
||||||
menuId:this.menuId
|
{ prop: 'bankAccount', label: '银行账户' },
|
||||||
};
|
{ prop: 'taxCode', label: '默认税码' },
|
||||||
request({
|
{ prop: 'payable', label: '应付科目' },
|
||||||
url: `/api/example/Supplier/getList`,
|
{ prop: 'isPurchase', label: '是否采购' },
|
||||||
method: 'post',
|
{ prop: 'prepaid', label: '预付科目' },
|
||||||
data: _query
|
{ prop: 'isPayment', label: '是否付款' },
|
||||||
}).then(res => {
|
{ prop: 'status', label: '是否启用' },
|
||||||
var _list =[];
|
{ prop: 'supplierSiteCode', label: '供应商地点' }
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
],
|
||||||
let _data = res.data.list[i];
|
supplierLevelOptions: [{ 'fullName': '一级', 'id': '1' }, { 'fullName': '二级', 'id': '2' }, {
|
||||||
_list.push(_data)
|
'fullName': '三级',
|
||||||
}
|
'id': '3'
|
||||||
this.list = _list
|
}, { 'fullName': '四级', 'id': '4' }],
|
||||||
this.total = res.data.pagination.total
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Supplier/${id}`,
|
url: `/api/example/Supplier/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
@ -1,417 +1,467 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
:close-on-click-modal="false" append-to-body
|
||||||
<el-row :gutter="15" class="">
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
width="1000px">
|
||||||
label-position="right">
|
<el-row :gutter="15" class="">
|
||||||
<template v-if="!loading">
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||||
<el-col :span="12" >
|
<template v-if="!loading">
|
||||||
<el-form-item label="物料编码"
|
<el-col :span="24" >
|
||||||
prop="materialCode" >
|
<el-form-item label="磅单上传"
|
||||||
<popupSelect v-model="dataForm.materialCode"
|
prop="poundPictures" >
|
||||||
placeholder="请选择" clearable field="materialCode" interfaceId="381037852907038533" :columnOptions="materialCodecolumnOptions" propsValue="item_code" relationField="item_code" popupType="dialog"
|
<JNPF-UploadImg v-model="dataForm.poundPictures"
|
||||||
popupTitle="选择数据" popupWidth="800px">
|
:fileSize="500" sizeUnit="MB" :limit="9" buttonText="点击上传" >
|
||||||
|
|
||||||
</popupSelect>
|
</JNPF-UploadImg>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" >
|
<el-col :span="12" >
|
||||||
<el-form-item label="物料名称"
|
<el-form-item label="物料名称"
|
||||||
prop="materialName" >
|
prop="materialId" >
|
||||||
<el-input v-model="dataForm.materialName"
|
<popupSelect v-model="dataForm.materialId"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请选择物料编码" clearable field="materialId" interfaceId="381037852907038533" :columnOptions="materialIdcolumnOptions" propsValue="id" relationField="description" popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
hasPage :pageSize="20" >
|
||||||
|
|
||||||
</el-input>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="12" >
|
<el-col :span="12" >
|
||||||
<el-form-item label="物料名称"
|
<el-form-item label="客户名称"
|
||||||
>
|
prop="customerId" >
|
||||||
<popupAttr
|
<popupSelect v-model="dataForm.customerId"
|
||||||
relationField="materialCode" showField="description" >
|
placeholder="请选择客户" clearable field="customerId" interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
|
||||||
v-model="dataForm.materialCode"
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
</popupAttr>
|
hasPage :pageSize="20" >
|
||||||
</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%"}'>
|
|
||||||
|
|
||||||
</el-input>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="是否垫资" prop="advance">
|
<el-form-item label="销售合同"
|
||||||
<el-select v-model="dataForm.advance" placeholder="请选择" clearable :style='{"width":"100%"}'>
|
prop="salesId" >
|
||||||
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName"
|
<popupSelect v-model="dataForm.salesId"
|
||||||
:value="item.id" :disabled="item.disabled"></el-option>
|
placeholder="请选择合同" clearable field="salesId" interfaceId="381037852907038533" :columnOptions="salesIdcolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
hasPage :pageSize="20" >
|
||||||
|
|
||||||
</el-select>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="销售价格" prop="salesPrice">
|
<el-form-item label="车牌号"
|
||||||
<el-input-number v-model="dataForm.salesPrice" placeholder="数字文本" :step="1">
|
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>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="24" >
|
||||||
<el-form-item label="运输方式" prop="transportType">
|
<el-form-item label="车辆图片"
|
||||||
<el-select v-model="dataForm.transportType" placeholder="请选择" clearable
|
prop="vehiclePictures" >
|
||||||
:style='{"width":"100%"}'>
|
<JNPF-UploadImg v-model="dataForm.vehiclePictures"
|
||||||
<el-option v-for="(item, index) in transportTypeOptions" :key="index"
|
:fileSize="500" sizeUnit="MB" :limit="9" >
|
||||||
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
|
|
||||||
|
|
||||||
</el-select>
|
</JNPF-UploadImg>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="运费" prop="departmentId">
|
<el-form-item label="磅单时间"
|
||||||
<el-input-number v-model="dataForm.departmentId" placeholder="数字文本" :step="1">
|
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-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="车号" prop="licenseNo">
|
<el-form-item label="磅单号"
|
||||||
<popupSelect v-model="dataForm.licenseNo" placeholder="请选择" clearable field="licenseNo"
|
prop="poundlistNo" >
|
||||||
interfaceId="381432451370615173" :columnOptions="licenseNocolumnOptions" propsValue="ticketno" relationField="ticketno" popupType="dialog"
|
<el-input v-model="dataForm.poundlistNo"
|
||||||
popupTitle="选择数据" popupWidth="800px">
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</popupSelect>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="业务员名称" prop="businessName">
|
<el-form-item label="皮重"
|
||||||
<el-input v-model="dataForm.businessName" placeholder="请输入" clearable
|
prop="tareWeight" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.tareWeight"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="12" >
|
||||||
<el-form-item label="磅单图片" prop="poundPictures">
|
<el-form-item label="毛重"
|
||||||
<JNPF-UploadImg v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="9">
|
prop="grossWeight" >
|
||||||
|
<el-input v-model="dataForm.grossWeight"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</JNPF-UploadImg>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="皮重" prop="tareWeight">
|
<el-form-item label="扣重"
|
||||||
<el-input-number v-model="dataForm.tareWeight" placeholder="数字文本" :step="1">
|
prop="buckleWeight" >
|
||||||
|
<el-input v-model="dataForm.buckleWeight"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input-number>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="毛重" prop="grossWeight">
|
<el-form-item label="净重"
|
||||||
<el-input-number v-model="dataForm.grossWeight" placeholder="数字文本" :step="1">
|
prop="netWeight" >
|
||||||
|
<el-input v-model="dataForm.netWeight"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input-number>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="扣重" prop="buckleWeight">
|
<el-form-item label="单位 "
|
||||||
<el-input-number v-model="dataForm.buckleWeight" placeholder="数字文本" :step="1">
|
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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="净重" prop="netWeight">
|
<el-form-item label="运输类型"
|
||||||
<el-input-number v-model="dataForm.netWeight" placeholder="数字文本" :step="1">
|
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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="12" >
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="是否垫资"
|
||||||
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
|
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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="12" >
|
||||||
<el-form-item label="司机名称" prop="driverName">
|
<el-form-item label="运费"
|
||||||
<el-input v-model="dataForm.driverName" placeholder="请输入" clearable
|
prop="transportPrice" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.transportPrice"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="12" >
|
||||||
<el-form-item label="车辆图片" prop="vehiclePictures">
|
<el-form-item label="销售价格"
|
||||||
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
|
prop="salesPrice" >
|
||||||
|
<el-input v-model="dataForm.salesPrice"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</JNPF-UploadImg>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="12" >
|
||||||
<el-form-item label="制单人" prop="creatorusername">
|
<el-form-item label="业务员"
|
||||||
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
|
prop="creatorUserName" >
|
||||||
:style='{"width":"100%"}'>
|
<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>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
<el-col :span="12" >
|
||||||
</el-form>
|
<el-form-item label="自然人"
|
||||||
</el-row>
|
prop="naturalId" >
|
||||||
<span slot="footer" class="dialog-footer">
|
<popupSelect v-model="dataForm.naturalId"
|
||||||
<el-button @click="visible = false"> 取 消</el-button>
|
placeholder="请选择自然人" clearable field="naturalId" interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
|
||||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
</span>
|
hasPage :pageSize="20" >
|
||||||
</el-dialog>
|
|
||||||
|
</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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
getDataInterfaceRes
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
} from '@/api/systemData/dataInterface'
|
export default {
|
||||||
import {
|
components: {},
|
||||||
getDictionaryDataSelector
|
props: [],
|
||||||
} from '@/api/systemData/dictionary'
|
data() {
|
||||||
export default {
|
return {
|
||||||
components: {},
|
visible: false,
|
||||||
props: [],
|
loading: false,
|
||||||
data() {
|
isDetail: false,
|
||||||
return {
|
dataForm: {
|
||||||
visible: false,
|
poundPictures : [],
|
||||||
loading: false,
|
materialId : "",
|
||||||
isDetail: false,
|
customerId : "",
|
||||||
dataForm: {
|
salesId : "",
|
||||||
materialCode: "",
|
vehicleId : "",
|
||||||
materialName: '',
|
vehiclePictures : [],
|
||||||
salesName: "",
|
poundDate : '',
|
||||||
customerName: '',
|
poundlistNo : '',
|
||||||
advance: "",
|
tareWeight : 0,
|
||||||
salesPrice: '',
|
grossWeight : 0,
|
||||||
transportType: "",
|
buckleWeight : 0,
|
||||||
departmentId: 11.225,
|
netWeight : 0,
|
||||||
licenseNo: "",
|
unit : "0",
|
||||||
businessName: '',
|
transportType : "0",
|
||||||
poundPictures: [],
|
advance : "0",
|
||||||
tareWeight: '',
|
transportPrice : 0,
|
||||||
grossWeight: '',
|
salesPrice : '',
|
||||||
buckleWeight: '',
|
creatorUserName : "",
|
||||||
netWeight: '',
|
naturalId : "",
|
||||||
remark: '',
|
remark : '',
|
||||||
driverName: '',
|
creatorTime : "",
|
||||||
vehiclePictures: [],
|
},
|
||||||
creatorusername: '',
|
rules:
|
||||||
},
|
{
|
||||||
rules: {
|
poundPictures: [
|
||||||
materialCode: [{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择',
|
message: '请至少选择一个',
|
||||||
trigger: 'change'
|
trigger: 'click'
|
||||||
}, ],
|
},
|
||||||
salesName: [{
|
],
|
||||||
required: true,
|
materialId: [
|
||||||
message: '请选择',
|
{
|
||||||
trigger: 'change'
|
required: true,
|
||||||
}, ],
|
message: '请选择物料编码',
|
||||||
licenseNo: [{
|
trigger: 'change'
|
||||||
required: true,
|
},
|
||||||
message: '请选择',
|
],
|
||||||
trigger: 'change'
|
customerId: [
|
||||||
}, ],
|
{
|
||||||
// poundPictures: [
|
required: true,
|
||||||
// {
|
message: '请选择客户',
|
||||||
// required: true,
|
trigger: 'change'
|
||||||
// message: '请至少选择一个',
|
},
|
||||||
// trigger: 'click'
|
],
|
||||||
// },
|
salesId: [
|
||||||
// ],
|
{
|
||||||
tareWeight: [{
|
required: true,
|
||||||
required: true,
|
message: '请选择合同',
|
||||||
message: '数字文本',
|
trigger: 'change'
|
||||||
trigger: ["blur", "change"]
|
},
|
||||||
}, ],
|
],
|
||||||
grossWeight: [{
|
vehicleId: [
|
||||||
required: true,
|
{
|
||||||
message: '数字文本',
|
required: true,
|
||||||
trigger: ["blur", "change"]
|
message: '请选择车辆',
|
||||||
}, ],
|
trigger: 'change'
|
||||||
buckleWeight: [{
|
},
|
||||||
required: true,
|
],
|
||||||
message: '数字文本',
|
vehiclePictures: [
|
||||||
trigger: ["blur", "change"]
|
{
|
||||||
}, ],
|
required: true,
|
||||||
netWeight: [{
|
message: '请至少选择一个',
|
||||||
required: true,
|
trigger: 'click'
|
||||||
message: '数字文本',
|
},
|
||||||
trigger: ["blur", "change"]
|
],
|
||||||
}, ],
|
poundDate: [
|
||||||
},
|
{
|
||||||
materialCodecolumnOptions:[ {"label":"物料编码","value":"item_code"},
|
required: true,
|
||||||
{"label":"物料名称","value":"description"},
|
message: '请选择',
|
||||||
{"label":"库存组织","value":"organization_id"},
|
trigger: 'change'
|
||||||
{"label":"默认库区","value":"areaname"},],
|
},
|
||||||
salesNamecolumnOptions: [{
|
],
|
||||||
"label": "合同编码",
|
poundlistNo: [
|
||||||
"value": "contract_code"
|
{
|
||||||
},
|
required: true,
|
||||||
{
|
message: '请输入',
|
||||||
"label": "合同名称",
|
trigger: 'blur'
|
||||||
"value": "contract_name"
|
},
|
||||||
},
|
],
|
||||||
{
|
tareWeight: [
|
||||||
"label": "合同类型",
|
{
|
||||||
"value": "contract_type"
|
required: true,
|
||||||
},
|
message: '请输入',
|
||||||
{
|
trigger: 'blur'
|
||||||
"label": "供应商/客户名称",
|
},
|
||||||
"value": "name"
|
],
|
||||||
},],
|
grossWeight: [
|
||||||
advanceOptions: [{
|
{
|
||||||
"fullName": "是",
|
required: true,
|
||||||
"id": "1"
|
message: '请输入',
|
||||||
}, {
|
trigger: 'blur'
|
||||||
"fullName": "否",
|
},
|
||||||
"id": "0"
|
],
|
||||||
}],
|
buckleWeight: [
|
||||||
transportTypeOptions: [{
|
{
|
||||||
"fullName": "汽运",
|
required: true,
|
||||||
"id": "0"
|
message: '请输入',
|
||||||
}, {
|
trigger: 'blur'
|
||||||
"fullName": "船运",
|
},
|
||||||
"id": "1"
|
],
|
||||||
}, {
|
netWeight: [
|
||||||
"fullName": "火车",
|
{
|
||||||
"id": "2"
|
required: true,
|
||||||
}],
|
message: '请输入',
|
||||||
licenseNocolumnOptions: [{
|
trigger: 'blur'
|
||||||
"label": "车牌号",
|
},
|
||||||
"value": "ticketno"
|
],
|
||||||
},
|
salesPrice: [
|
||||||
{
|
{
|
||||||
"label": "司机",
|
required: true,
|
||||||
"value": "drivername"
|
message: '请输入',
|
||||||
},
|
trigger: 'blur'
|
||||||
{
|
},
|
||||||
"label": "车辆照片",
|
],
|
||||||
"value": "vehiclephotos"
|
creatorUserName: [
|
||||||
},
|
{
|
||||||
{
|
required: true,
|
||||||
"label": "手机号",
|
message: '请选择业务员',
|
||||||
"value": "contact"
|
trigger: 'change'
|
||||||
},
|
},
|
||||||
{
|
],
|
||||||
"label": "创建人",
|
},
|
||||||
"value": "f_creatorusername"
|
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"},],
|
||||||
"label": "创建时间",
|
vehicleIdcolumnOptions:[ {"label":"车牌号","value":"ticketno"}, {"label":"司机","value":"drivername"}, {"label":"车辆照片","value":"vehiclephotos"}, {"label":"手机号","value":"contact"},],
|
||||||
"value": "f_creatortime"
|
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>
|
</script>
|
||||||
|
@ -1,394 +1,306 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="物料名称">
|
<el-form-item label="磅单时间">
|
||||||
<el-input v-model="query.materialName" placeholder="请输入" clearable> </el-input>
|
<el-date-picker v-model="query.poundDate" type="daterange"
|
||||||
</el-form-item>
|
value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期"
|
||||||
</el-col>
|
end-placeholder="结束日期" >
|
||||||
<el-col :span="6">
|
</el-date-picker>
|
||||||
<el-form-item>
|
</el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
</el-col>
|
||||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
<el-col :span="6">
|
||||||
</el-form-item>
|
<el-form-item label="磅单号">
|
||||||
</el-col>
|
<el-input v-model="query.poundlistNo" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<el-col :span="6">
|
||||||
<div class="JNPF-common-head">
|
<el-form-item>
|
||||||
<div>
|
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||||
<el-button type="text" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-button>
|
</el-form-item>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
</el-col>
|
||||||
</el-button>
|
</el-form>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
</el-row>
|
||||||
</el-button>
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
</div>
|
<div class="JNPF-common-head">
|
||||||
<div class="JNPF-common-head-right">
|
<div>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
</el-button>
|
||||||
@click="reset()" />
|
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||||
</el-tooltip>
|
</el-button>
|
||||||
<screenfull isContainer />
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||||
</div>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
<div class="JNPF-common-head-right">
|
||||||
@selection-change="handleSelectionChange" border>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
<el-table-column prop="licenseNo" label="车号" fixed="left" sortable width="120" align="center" />
|
@click="reset()"/>
|
||||||
<el-table-column prop="materialName" label="物料名称" fixed="left" sortable sortable width="150" align="center" />
|
</el-tooltip>
|
||||||
<el-table-column prop="grossWeight" label="毛重" width="100" sortable align="center" />
|
<screenfull isContainer/>
|
||||||
<el-table-column prop="tareWeight" label="皮重" width="100" sortable align="center" />
|
</div>
|
||||||
<el-table-column prop="buckleWeight" label="扣重" width="100" sortable align="center" />
|
</div>
|
||||||
<el-table-column prop="netWeight" label="净重" width="100" sortable align="center" />
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||||
<el-table-column prop="driverName" label="司机名称" width="120" sortable align="center" />
|
<el-table-column prop="creatorTime" label="磅单日期" width="0" align="left"
|
||||||
<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="vehicleId" label="车牌号" width="0" align="left"
|
||||||
<el-table-column prop="advance" label="是否垫资" width="120" sortable align="center" >
|
/>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="materialId" label="物料名称" width="0" align="left"
|
||||||
{{ scope.row.advance | dynamicText(advanceOptions) }}
|
/>
|
||||||
</template>
|
<el-table-column prop="grossWeight" label="毛重" width="0" align="left"
|
||||||
</el-table-column>
|
/>
|
||||||
<el-table-column prop="transportType" label="运输方式" sortable width="100" align="center" >
|
<el-table-column prop="tareWeight" label="皮重" width="0" align="left"
|
||||||
<template slot-scope="scope">
|
/>
|
||||||
{{ scope.row.transportType | dynamicText(transportTypeOptions) }}
|
<el-table-column prop="buckleWeight" label="扣重" width="0" align="left"
|
||||||
</template>
|
/>
|
||||||
</el-table-column>
|
<el-table-column prop="netWeight" label="净重" width="0" align="left"
|
||||||
<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="customerId" label="客户名称" width="0" align="left"
|
||||||
<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="salesId" label="销售合同" width="0" align="left"
|
||||||
<el-table-column prop="remark" label="备注" sortable width="150" align="center" />
|
/>
|
||||||
<el-table-column prop="poundPictures" label="磅单图片" width="150" align="center">
|
<el-table-column label="是否垫资" width="0" prop="advance" algin="left"
|
||||||
<template slot-scope="scope">
|
>
|
||||||
<span v-for="(item,index) in JSON.parse(scope.row.poundPictures)" :key="index">
|
<template slot-scope="scope">
|
||||||
<el-popover placement="bottom" trigger="click" width="1000">
|
{{ scope.row.advance | dynamicText(advanceOptions) }}
|
||||||
<img :src="`/dev${item.url}`" width="100%" />
|
</template>
|
||||||
<img
|
</el-table-column>
|
||||||
slot="reference"
|
<el-table-column label="运输类型" width="0" prop="transportType" algin="left"
|
||||||
:src="`/dev${item.url}`"
|
>
|
||||||
:alt="`/dev${item.url}`"
|
<template slot-scope="scope">
|
||||||
style="max-height: 70px;max-width: 70px; padding: 5px"
|
{{ scope.row.transportType | dynamicText(transportTypeOptions) }}
|
||||||
/>
|
</template>
|
||||||
</el-popover>
|
</el-table-column>
|
||||||
</span>
|
<el-table-column prop="transportPrice" label="运费" width="0" align="left"
|
||||||
</template>
|
/>
|
||||||
</el-table-column>
|
<el-table-column prop="salesPrice" label="销售价格" width="0" align="left"
|
||||||
<el-table-column prop="vehiclePictures" label="车辆图片" width="150" align="center">
|
/>
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="creatorUserName" label="业务员" width="0" align="left"
|
||||||
<span v-for="(item,index) in JSON.parse(scope.row.vehiclePictures)" :key="index">
|
/>
|
||||||
<el-popover placement="bottom" trigger="click" width="1000">
|
<el-table-column prop="remark" label="备注" width="0" align="left"
|
||||||
<img :src="`/dev${item.url}`" width="100%" />
|
/>
|
||||||
<img
|
<el-table-column label="操作" fixed="right"
|
||||||
slot="reference"
|
width="150" >
|
||||||
:src="`/dev${item.url}`"
|
<template slot-scope="scope">
|
||||||
:alt="`/dev${item.url}`"
|
<el-button type="text"
|
||||||
style="max-height: 70px;max-width: 70px; padding: 5px"
|
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||||
/>
|
</el-button>
|
||||||
</el-popover>
|
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||||
</span>
|
</el-button>
|
||||||
</template>
|
<el-button type="text"
|
||||||
</el-table-column>
|
@click="goDetail(scope.row.id)">详情
|
||||||
<el-table-column label="操作" fixed="right" width="100" align="center">
|
</el-button>
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
</el-table-column>
|
||||||
</el-button>
|
</JNPF-table>
|
||||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||||
</el-button>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||||
</JNPF-table>
|
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||||
@pagination="initData" />
|
</div>
|
||||||
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||||
getDictionaryDataSelector
|
import JNPFForm from './Form'
|
||||||
} from '@/api/systemData/dictionary'
|
import ExportBox from './ExportBox'
|
||||||
import JNPFForm from './Form'
|
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||||
import ExportBox from './ExportBox'
|
import Detail from './Detail'
|
||||||
import {
|
|
||||||
getDataInterfaceRes
|
|
||||||
} from '@/api/systemData/dataInterface'
|
|
||||||
import Detail from './Detail'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {JNPFForm, ExportBox,Detail},
|
||||||
JNPFForm,
|
data() {
|
||||||
ExportBox,
|
return {
|
||||||
Detail
|
detailVisible: false,
|
||||||
},
|
query: {
|
||||||
data() {
|
poundDate:undefined,
|
||||||
return {
|
poundlistNo:undefined,
|
||||||
detailVisible: false,
|
},
|
||||||
query: {
|
treeProps: {
|
||||||
materialName: undefined,
|
children: 'children',
|
||||||
},
|
label: 'fullName',
|
||||||
treeProps: {
|
value: 'id'
|
||||||
children: 'children',
|
},
|
||||||
label: 'fullName',
|
list: [],
|
||||||
value: 'id'
|
listLoading: true,
|
||||||
},
|
multipleSelection: [], total: 0,
|
||||||
list: [],
|
listQuery: {
|
||||||
listLoading: true,
|
currentPage: 1,
|
||||||
multipleSelection: [],
|
pageSize: 20,
|
||||||
total: 0,
|
sort: "desc",
|
||||||
listQuery: {
|
sidx: "",
|
||||||
currentPage: 1,
|
},
|
||||||
pageSize: 20,
|
formVisible: false,
|
||||||
sort: "desc",
|
exportBoxVisible: false,
|
||||||
sidx: "",
|
columnList: [
|
||||||
},
|
{prop: 'creatorTime', label: '磅单日期'},
|
||||||
formVisible: false,
|
{prop: 'vehicleId', label: '车牌号'},
|
||||||
exportBoxVisible: false,
|
{prop: 'materialId', label: '物料名称'},
|
||||||
columnList: [{
|
{prop: 'grossWeight', label: '毛重'},
|
||||||
prop: 'licenseNo',
|
{prop: 'tareWeight', label: '皮重'},
|
||||||
label: '车号'
|
{prop: 'buckleWeight', label: '扣重'},
|
||||||
},
|
{prop: 'netWeight', label: '净重'},
|
||||||
{
|
{prop: 'customerId', label: '客户名称'},
|
||||||
prop: 'materialName',
|
{prop: 'salesId', label: '销售合同'},
|
||||||
label: '物料名称'
|
{prop: 'advance', label: '是否垫资'},
|
||||||
},
|
{prop: 'transportType', label: '运输类型'},
|
||||||
{
|
{prop: 'transportPrice', label: '运费'},
|
||||||
prop: 'grossWeight',
|
{prop: 'salesPrice', label: '销售价格'},
|
||||||
label: '毛重'
|
{prop: 'creatorUserName', label: '业务员'},
|
||||||
},
|
{prop: 'remark', label: '备注'},
|
||||||
{
|
],
|
||||||
prop: 'tareWeight',
|
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||||
label: '皮重'
|
unitProps:{"label":"fullName","value":"id"},
|
||||||
},
|
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
|
||||||
{
|
transportTypeProps:{"label":"fullName","value":"id"},
|
||||||
prop: 'buckleWeight',
|
advanceOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||||
label: '扣重'
|
advanceProps:{"label":"fullName","value":"id"},
|
||||||
},
|
}
|
||||||
{
|
},
|
||||||
prop: 'netWeight',
|
computed: {
|
||||||
label: '净重'
|
menuId() {
|
||||||
},
|
return this.$route.meta.modelId || ''
|
||||||
{
|
}
|
||||||
prop: 'driverName',
|
},
|
||||||
label: '司机名称'
|
created() {
|
||||||
},
|
this.initData()
|
||||||
{
|
},
|
||||||
prop: 'customerName',
|
methods: {
|
||||||
label: '客户名称'
|
goDetail(id){
|
||||||
},
|
this.detailVisible = true
|
||||||
{
|
this.$nextTick(() => {
|
||||||
prop: 'salesName',
|
this.$refs.Detail.init(id)
|
||||||
label: '销售合同'
|
})
|
||||||
},
|
},
|
||||||
{
|
sortChange({column, prop, order}) {
|
||||||
prop: 'advance',
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
label: '是否垫资'
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
},
|
this.initData()
|
||||||
{
|
},
|
||||||
prop: 'transportType',
|
initData() {
|
||||||
label: '运输方式'
|
this.listLoading = true;
|
||||||
},
|
let _query = {
|
||||||
{
|
...this.listQuery,
|
||||||
prop: 'departmentId',
|
...this.query,
|
||||||
label: '运费'
|
menuId:this.menuId
|
||||||
},
|
};
|
||||||
{
|
request({
|
||||||
prop: 'salesPrice',
|
url: `/api/tradeupload/Tradeupload/getList`,
|
||||||
label: '销售价格'
|
method: 'post',
|
||||||
},
|
data: _query
|
||||||
{
|
}).then(res => {
|
||||||
prop: 'creatorusername',
|
var _list =[];
|
||||||
label: '制单人'
|
for(let i=0;i<res.data.list.length;i++){
|
||||||
},
|
let _data = res.data.list[i];
|
||||||
{
|
_list.push(_data)
|
||||||
prop: 'businessName',
|
}
|
||||||
label: '业务员名称'
|
this.list = _list
|
||||||
},
|
this.total = res.data.pagination.total
|
||||||
{
|
|
||||||
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
|
|
||||||
|
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/tradeupload/Tradeupload/${id}`,
|
url: `/api/tradeupload/Tradeupload/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.initData()
|
this.initData()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
},
|
});
|
||||||
handleSelectionChange(val) {
|
},
|
||||||
const res = val.map(item => item.id)
|
handleSelectionChange(val) {
|
||||||
this.multipleSelection = res
|
const res = val.map(item => item.id)
|
||||||
},
|
this.multipleSelection = res
|
||||||
handleBatchRemoveDel() {
|
},
|
||||||
if (!this.multipleSelection.length) {
|
handleBatchRemoveDel() {
|
||||||
this.$message({
|
if (!this.multipleSelection.length) {
|
||||||
type: 'error',
|
this.$message({
|
||||||
message: '请选择一条数据',
|
type: 'error',
|
||||||
duration: 1500,
|
message: '请选择一条数据',
|
||||||
})
|
duration: 1500,
|
||||||
return
|
})
|
||||||
}
|
return
|
||||||
const ids = this.multipleSelection.join()
|
}
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
const ids = this.multipleSelection.join()
|
||||||
type: 'warning'
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
}).then(() => {
|
type: 'warning'
|
||||||
request({
|
}).then(() => {
|
||||||
url: `/api/tradeupload/Tradeupload/batchRemove/${ids}`,
|
request({
|
||||||
method: 'DELETE'
|
url: `/api/tradeupload/Tradeupload/batchRemove/${ids}`,
|
||||||
}).then(res => {
|
method: 'DELETE'
|
||||||
this.$message({
|
}).then(res => {
|
||||||
type: 'success',
|
this.$message({
|
||||||
message: res.msg,
|
type: 'success',
|
||||||
onClose: () => {
|
message: res.msg,
|
||||||
this.initData()
|
onClose: () => {
|
||||||
}
|
this.initData()
|
||||||
});
|
}
|
||||||
})
|
});
|
||||||
}).catch(() => {})
|
})
|
||||||
},
|
}).catch(() => {
|
||||||
addOrUpdateHandle(id, isDetail) {
|
})
|
||||||
this.formVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.$refs.JNPFForm.init(id, isDetail)
|
this.formVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.JNPFForm.init(id, isDetail)
|
||||||
exportData() {
|
})
|
||||||
this.exportBoxVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
exportData() {
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
this.exportBoxVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.ExportBox.init(this.columnList)
|
||||||
download(data) {
|
})
|
||||||
let query = {
|
},
|
||||||
...data,
|
download(data) {
|
||||||
...this.listQuery,
|
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||||
...this.query,
|
request({
|
||||||
menuId: this.menuId
|
url: `/api/tradeupload/Tradeupload/Actions/Export`,
|
||||||
}
|
method: 'GET',
|
||||||
request({
|
data: query
|
||||||
url: `/api/tradeupload/Tradeupload/Actions/Export`,
|
}).then(res => {
|
||||||
method: 'GET',
|
if (!res.data.url) return
|
||||||
data: query
|
this.jnpf.downloadFile(res.data.url)
|
||||||
}).then(res => {
|
this.$refs.ExportBox.visible = false
|
||||||
if (!res.data.url) return
|
this.exportBoxVisible = false
|
||||||
this.jnpf.downloadFile(res.data.url)
|
})
|
||||||
this.$refs.ExportBox.visible = false
|
},
|
||||||
this.exportBoxVisible = false
|
search() {
|
||||||
})
|
this.listQuery = {
|
||||||
},
|
currentPage: 1,
|
||||||
search() {
|
pageSize: 20,
|
||||||
this.listQuery = {
|
sort: "desc",
|
||||||
currentPage: 1,
|
sidx: "",
|
||||||
pageSize: 20,
|
}
|
||||||
sort: "desc",
|
this.initData()
|
||||||
sidx: "",
|
},
|
||||||
}
|
refresh(isrRefresh) {
|
||||||
this.initData()
|
this.formVisible = false
|
||||||
},
|
if (isrRefresh) this.reset()
|
||||||
refresh(isrRefresh) {
|
},
|
||||||
this.formVisible = false
|
reset() {
|
||||||
if (isrRefresh) this.reset()
|
for (let key in this.query) {
|
||||||
},
|
this.query[key] = undefined
|
||||||
reset() {
|
}
|
||||||
for (let key in this.query) {
|
this.search()
|
||||||
this.query[key] = undefined
|
}
|
||||||
}
|
}
|
||||||
this.search()
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,229 +1,281 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:close-on-click-modal="false" append-to-body
|
:close-on-click-modal="false" append-to-body
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
width="800px">
|
width="1500px">
|
||||||
<el-row :gutter="15" class="">
|
<el-row :gutter="15" class="">
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="仓库编码"
|
<el-form-item label="仓库编码"
|
||||||
prop="code" >
|
prop="code">
|
||||||
<el-input v-model="dataForm.code"
|
<el-input v-model="dataForm.code"
|
||||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="仓库名称"
|
<el-form-item label="仓库名称"
|
||||||
prop="name" >
|
prop="name">
|
||||||
<el-input v-model="dataForm.name"
|
<el-input v-model="dataForm.name"
|
||||||
placeholder="请输入仓库名称" clearable :style='{"width":"100%"}'>
|
placeholder="请输入仓库名称" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="公司"
|
<el-form-item label="公司"
|
||||||
prop="companyCode" >
|
prop="companyCode">
|
||||||
<popupSelect v-model="dataForm.companyCode"
|
<popupSelect v-model="dataForm.companyCode"
|
||||||
placeholder="请选择公司" clearable field="companyCode" interfaceId="394016341591396805" :columnOptions="companyCodecolumnOptions" propsValue="F_Id" relationField="F_FullName" popupType="dialog"
|
placeholder="请选择公司" clearable field="companyCode" interfaceId="394016341591396805"
|
||||||
popupTitle="选择数据" popupWidth="800px"
|
:columnOptions="companyCodecolumnOptions" propsValue="F_Id" relationField="F_FullName"
|
||||||
>
|
popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
>
|
||||||
|
|
||||||
</popupSelect>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="仓库位置"
|
<el-form-item label="仓库位置"
|
||||||
prop="location" >
|
prop="location">
|
||||||
<el-input v-model="dataForm.location"
|
<el-input v-model="dataForm.location"
|
||||||
placeholder="请输入仓库位置" clearable :style='{"width":"100%"}'>
|
placeholder="请输入仓库位置" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="仓库类型"
|
<el-form-item label="仓库类型"
|
||||||
prop="type" >
|
prop="type">
|
||||||
<el-select v-model="dataForm.type"
|
<el-select v-model="dataForm.type"
|
||||||
placeholder="请选择仓库类型" clearable :style='{"width":"100%"}'>
|
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-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||||
|
:disabled="item.disabled"></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="ERP子库"
|
<el-form-item label="ERP子库"
|
||||||
prop="sublibrary" >
|
prop="sublibrary">
|
||||||
<popupSelect v-model="dataForm.sublibrary"
|
<popupSelect v-model="dataForm.sublibrary"
|
||||||
placeholder="请选择子库" clearable field="sublibrary" interfaceId="394818245032483845" :columnOptions="sublibrarycolumnOptions" propsValue="id" relationField="inventory_org_detail_name" popupType="dialog"
|
placeholder="请选择子库" clearable field="sublibrary" interfaceId="394818245032483845"
|
||||||
popupTitle="选择数据" popupWidth="800px"
|
:columnOptions="sublibrarycolumnOptions" propsValue="id"
|
||||||
>
|
relationField="inventory_org_detail_name" popupType="dialog"
|
||||||
|
popupTitle="选择数据" popupWidth="800px"
|
||||||
|
>
|
||||||
|
|
||||||
</popupSelect>
|
</popupSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="激活状态 "
|
<el-form-item label="激活状态 "
|
||||||
prop="activestate" >
|
prop="activestate">
|
||||||
<el-radio-group v-model="dataForm.activestate"
|
<el-radio-group v-model="dataForm.activestate"
|
||||||
size="small" >
|
size="small">
|
||||||
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id" :disabled="item.disabled" >
|
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id"
|
||||||
{{item.fullName}}
|
:disabled="item.disabled">
|
||||||
</el-radio>
|
{{item.fullName}}
|
||||||
|
</el-radio>
|
||||||
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" >
|
<el-col :span="24">
|
||||||
<el-form-item label="备注"
|
<el-form-item label="备注"
|
||||||
prop="remark" >
|
prop="remark">
|
||||||
<el-input v-model="dataForm.remark"
|
<el-input v-model="dataForm.remark"
|
||||||
placeholder="请输入备注" clearable :style='{"width":"100%"}'>
|
placeholder="请输入备注" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="visible = false"> 取 消</el-button>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
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"}],
|
|
||||||
|
|
||||||
}
|
export default {
|
||||||
},
|
components: {},
|
||||||
computed: {},
|
props: [],
|
||||||
watch: {},
|
data() {
|
||||||
created() {
|
return {
|
||||||
},
|
visible: false,
|
||||||
mounted() {},
|
loading: false,
|
||||||
methods: {
|
isDetail: false,
|
||||||
clearData(data){
|
dataForm: {
|
||||||
for (let key in data) {
|
code: '',
|
||||||
if (data[key] instanceof Array) {
|
name: '',
|
||||||
data[key] = [];
|
companyCode: '',
|
||||||
} else if (data[key] instanceof Object) {
|
location: '',
|
||||||
this.clearData(data[key]);
|
type: '',
|
||||||
} else {
|
sublibrary: '',
|
||||||
data[key] = "";
|
activestate: '2',
|
||||||
}
|
remark: '',
|
||||||
}
|
creatorUserName: '',
|
||||||
},
|
creatorTime: '',
|
||||||
init(id, isDetail) {
|
lastModifyUserName: '',
|
||||||
this.dataForm.id = id || 0;
|
lastModifyTime: '',
|
||||||
this.visible = true;
|
orgId: '',
|
||||||
this.isDetail = isDetail || false;
|
departmentId: ''
|
||||||
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
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
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>
|
</script>
|
||||||
|
@ -1,277 +1,291 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="仓库编码">
|
<el-form-item label="仓库编码">
|
||||||
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.code" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="仓库名称">
|
<el-form-item label="仓库名称">
|
||||||
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.name" placeholder="请输入" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<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 icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
<div class="JNPF-common-head-right">
|
</el-button>
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
</div>
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<div class="JNPF-common-head-right">
|
||||||
@click="reset()"/>
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
</el-tooltip>
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
<screenfull isContainer/>
|
@click="reset()"/>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</div>
|
<screenfull isContainer/>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
@selection-change="handleSelectionChange" border>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
<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>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import JNPFForm from './Form'
|
import JNPFForm from './Form'
|
||||||
import ExportBox from './ExportBox'
|
import ExportBox from './ExportBox'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import Detail from './Detail'
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: { JNPFForm, ExportBox, Detail },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false,
|
detailVisible: false,
|
||||||
query: {
|
query: {
|
||||||
code:undefined,
|
code: undefined,
|
||||||
name: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"},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
treeProps: {
|
||||||
menuId() {
|
children: 'children',
|
||||||
return this.$route.meta.modelId || ''
|
label: 'fullName',
|
||||||
}
|
value: 'id'
|
||||||
},
|
},
|
||||||
created() {
|
list: [],
|
||||||
this.initData()
|
listLoading: true,
|
||||||
|
multipleSelection: [], total: 0,
|
||||||
|
listQuery: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
sort: 'desc',
|
||||||
|
sidx: 'creatorTime'
|
||||||
},
|
},
|
||||||
methods: {
|
formVisible: false,
|
||||||
goDetail(id){
|
exportBoxVisible: false,
|
||||||
this.detailVisible = true
|
columnList: [
|
||||||
this.$nextTick(() => {
|
{ prop: 'code', label: '仓库编码' },
|
||||||
this.$refs.Detail.init(id)
|
{ prop: 'name', label: '仓库名称' },
|
||||||
})
|
{ prop: 'companyCode', label: '公司' },
|
||||||
},
|
{ prop: 'location', label: '仓库位置' },
|
||||||
sortChange({column, prop, order}) {
|
{ prop: 'type', label: '仓库类型' },
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
{ prop: 'sublibrary', label: 'ERP子库' },
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
{ prop: 'activestate', label: '激活状态 ' },
|
||||||
this.initData()
|
{ prop: 'remark', label: '备注' }
|
||||||
},
|
],
|
||||||
initData() {
|
typeOptions: [{ 'fullName': '原料库', 'id': '0' }, { 'fullName': '中间库', 'id': '1' }, {
|
||||||
this.listLoading = true;
|
'fullName': '成品库',
|
||||||
let _query = {
|
'id': '2'
|
||||||
...this.listQuery,
|
}, { 'fullName': '副产品库', 'id': '3' }, { 'fullName': '废次品库', 'id': '4' }, {
|
||||||
...this.query,
|
'fullName': '备件辅材库',
|
||||||
menuId:this.menuId
|
'id': '5'
|
||||||
};
|
}, { 'fullName': '贸易虚拟库', 'id': '6' }, { 'fullName': '仓储库', 'id': '7' }, {
|
||||||
request({
|
'fullName': '能源库',
|
||||||
url: `/api/example/WareHouse/getList`,
|
'id': '8'
|
||||||
method: 'post',
|
}, { 'fullName': '其他库', 'id': '9' }, { 'fullName': '帐外库', 'id': '10' }],
|
||||||
data: _query
|
typeProps: { 'label': 'fullName', 'value': 'id' },
|
||||||
}).then(res => {
|
activestateOptions: [{ 'fullName': '激活', 'id': '1' }, { 'fullName': '未激活', 'id': '0' }],
|
||||||
var _list =[];
|
activestateProps: { 'label': 'fullName', 'value': 'id' }
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
}
|
||||||
let _data = res.data.list[i];
|
},
|
||||||
_list.push(_data)
|
computed: {
|
||||||
}
|
menuId() {
|
||||||
this.list = _list
|
return this.$route.meta.modelId || ''
|
||||||
this.total = res.data.pagination.total
|
}
|
||||||
|
},
|
||||||
|
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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/WareHouse/${id}`,
|
url: `/api/example/WareHouse/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
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.initData()
|
this.initData()
|
||||||
},
|
}
|
||||||
refresh(isrRefresh) {
|
})
|
||||||
this.formVisible = false
|
})
|
||||||
if (isrRefresh) this.reset()
|
}).catch(() => {
|
||||||
},
|
})
|
||||||
reset() {
|
},
|
||||||
for (let key in this.query) {
|
handleSelectionChange(val) {
|
||||||
this.query[key] = undefined
|
const res = val.map(item => item.id)
|
||||||
}
|
this.multipleSelection = res
|
||||||
this.search()
|
},
|
||||||
}
|
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>
|
</script>
|
||||||
|
Loading…
Reference in new issue