product
tengxi 2 years ago
parent 2dc4527eb9
commit 457a388d08

@ -109,10 +109,10 @@ public class CustomerEntity {
@TableField("PROVINCE") @TableField("PROVINCE")
private String province; private String province;
@TableField("CITY") // @TableField("CITY")
private String city; // private String city;
@TableField("COUNTY") // @TableField("COUNTY")
private String county; // private String county;
} }

@ -101,12 +101,12 @@ public class CustomerMobileEntity {
@TableField("PROVINCE") @TableField("PROVINCE")
private String province; private String province;
//
// @TableField("CITY")
// private String city;
@TableField("CITY") // @TableField("COUNTY")
private String city; // private String county;
@TableField("COUNTY")
private String county;
private BigDecimal settlemenSum; private BigDecimal settlemenSum;

@ -50,7 +50,7 @@
IFNULL( SUM( b.settlement ), 0.0000000000 )* IFNULL( SUM( b.sales_price ), 0.0000000000 ) salesPriceSum IFNULL( SUM( b.settlement ), 0.0000000000 )* IFNULL( SUM( b.sales_price ), 0.0000000000 ) salesPriceSum
FROM FROM
jg_supplier a jg_supplier a
LEFT JOIN jg_poundlist b ON a.id = b.supplier_code LEFT JOIN jg_poundlist b ON a.id = b.supplier_id
WHERE WHERE
( a.delete_mark != 1 OR a.delete_mark IS NULL ) ( a.delete_mark != 1 OR a.delete_mark IS NULL )
AND ( b.delete_mark != 1 OR b.delete_mark IS NULL ) AND ( b.delete_mark != 1 OR b.delete_mark IS NULL )

@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px" > :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll 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" <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
label-position="right"> label-position="right">

@ -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,358 +1,360 @@
<template> <template>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="JNPF-preview-main"> <div class="JNPF-preview-main">
<div class="JNPF-common-page-header"> <div class="JNPF-common-page-header">
<el-page-header @back="goBack" <el-page-header @back="goBack"
content="详情"/> content="详情"/>
<div class="options"> <div class="options">
<el-button @click="goBack"> </el-button> <el-button @click="goBack"> </el-button>
</div> </div>
</div> </div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}"> <el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" 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="contractType" > prop="contractType">
<p>{{ dataForm.contractType | dynamicText(contractTypeOptions) }} </p> <p>{{ dataForm.contractType | dynamicText(contractTypeOptions) }} </p>
</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="contractCode" > prop="contractCode">
<p>{{dataForm.contractCode}}</p> <p>{{dataForm.contractCode}}</p>
</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">
<p>{{dataForm.contractName}}</p> <p>{{dataForm.contractName}}</p>
</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">
<p>{{dataForm.status}}</p> <p>{{dataForm.status}}</p>
</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="bidOpeningDate" > prop="bidOpeningDate">
<p>{{jnpf.dateFormat(dataForm.bidOpeningDate)}}</p> <p>{{jnpf.dateFormat(dataForm.bidOpeningDate)}}</p>
</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="startDate" > prop="startDate">
<p>{{jnpf.dateFormat(dataForm.startDate)}}</p> <p>{{jnpf.dateFormat(dataForm.startDate)}}</p>
</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="auditDate" > prop="auditDate">
<p>{{jnpf.dateFormat(dataForm.auditDate)}}</p> <p>{{jnpf.dateFormat(dataForm.auditDate)}}</p>
</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="completionDate" > prop="completionDate">
<p>{{jnpf.dateFormat(dataForm.completionDate)}}</p> <p>{{jnpf.dateFormat(dataForm.completionDate)}}</p>
</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="closingDate" > prop="closingDate">
<p>{{jnpf.dateFormat(dataForm.closingDate)}}</p> <p>{{jnpf.dateFormat(dataForm.closingDate)}}</p>
</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="collectionCycle" > prop="collectionCycle">
<p>{{dataForm.collectionCycle}}</p> <p>{{dataForm.collectionCycle}}</p>
</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="signingDate" > prop="signingDate">
<p>{{jnpf.dateFormat(dataForm.signingDate)}}</p> <p>{{jnpf.dateFormat(dataForm.signingDate)}}</p>
</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="endDate" > prop="endDate">
<p>{{jnpf.dateFormat(dataForm.endDate)}}</p> <p>{{jnpf.dateFormat(dataForm.endDate)}}</p>
</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="code" > prop="code">
<p>{{dataForm.code}}</p> <p>{{dataForm.code}}</p>
</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="name" > prop="name">
<p>{{dataForm.name}}</p> <p>{{dataForm.name}}</p>
</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="contractNo" > prop="contractNo">
<p>{{dataForm.contractNo}}</p> <p>{{dataForm.contractNo}}</p>
</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">
<p>{{dataForm.currency}}</p> <p>{{dataForm.currency}}</p>
</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="num" > prop="num">
<p>{{dataForm.num}}</p> <p>{{dataForm.num}}</p>
</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">
<p>{{dataForm.amount}}</p> <p>{{dataForm.amount}}</p>
</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="organization" > prop="organization">
<p>{{dataForm.organization}}</p> <p>{{dataForm.organization}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16" > <el-col :span="16">
<el-form-item label="备注" <el-form-item label="备注"
prop="remark" > prop="remark">
<p>{{dataForm.remark}}</p> <p>{{dataForm.remark}}</p>
</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="classification" > prop="classification">
<p>{{dataForm.classification}}</p> <p>{{dataForm.classification}}</p>
</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="declarationDate" > prop="declarationDate">
<p>{{dataForm.declarationDate}}</p> <p>{{dataForm.declarationDate}}</p>
</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="deptCode" > prop="deptCode">
<p>{{dataForm.deptCode}}</p> <p>{{dataForm.deptCode}}</p>
</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="creatorusername" > prop="creatorusername">
<p>{{dataForm.creatorusername}}</p> <p>{{dataForm.creatorusername}}</p>
</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="deptName" > prop="deptName">
<p>{{dataForm.deptName}}</p> <p>{{dataForm.deptName}}</p>
</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="approval" > prop="approval">
<p>{{dataForm.approval}}</p> <p>{{dataForm.approval}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activemdfrsi" tab-position="top" class="mb-20"> <el-tabs v-model="activemdfrsi" tab-position="top" class="mb-20">
<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.contract_item0List" size='mini' > <el-table :data="dataForm.contract_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="materialCode" label="物料编码"> <el-table-column prop="materialCode" label="物料编码">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.materialCode}}</p> <p>{{scope.row.materialCode}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="materialName" label="物料名称"> <el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.materialName}}</p> <p>{{scope.row.materialName}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="specification" label="规格型号"> <el-table-column prop="specification" label="规格型号">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.specification}}</p> <p>{{scope.row.specification}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unit" label="单位 "> <el-table-column prop="unit" label="单位 ">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.unit}}</p> <p>{{scope.row.unit}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="数量"> <el-table-column prop="num" label="数量">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.num}}</p> <p>{{scope.row.num}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="price" label="单价"> <el-table-column prop="price" label="单价">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.price}}</p> <p>{{scope.row.price}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" label="金额"> <el-table-column prop="amount" label="金额">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amount}}</p> <p>{{scope.row.amount}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rate" label="税率 "> <el-table-column prop="rate" label="税率 ">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.rate}}</p> <p>{{scope.row.rate}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="notPrice" label="不含税单价"> <el-table-column prop="notPrice" label="不含税单价">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.notPrice}}</p> <p>{{scope.row.notPrice}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="notAmount" label="不含税金额"> <el-table-column prop="notAmount" label="不含税金额">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.notAmount}}</p> <p>{{scope.row.notAmount}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注"> <el-table-column prop="remark" label="备注">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.remark}}</p> <p>{{scope.row.remark}}</p>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
</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.contract_item1List" size='mini' > <el-table :data="dataForm.contract_item1List" 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="enclosure" label="附件内容"> <el-table-column prop="enclosure" label="附件内容">
<template slot-scope="scope"> <template slot-scope="scope">
<JNPF-UploadFz v-model="scope.row.enclosure" <JNPF-UploadFz v-model="scope.row.enclosure"
disabled disabled
detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" > detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传">
</JNPF-UploadFz> </JNPF-UploadFz>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane > </el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
</div> </div>
</transition> </transition>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse' import PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf' import jnpf from '@/utils/jnpf'
export default {
components: {PrintBrowse},
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
dataForm: {
id :'',
contractType : "",
contractCode : '',
contractName : '',
status : '',
bidOpeningDate : '',
startDate : '',
auditDate : '',
completionDate : '',
closingDate : '',
collectionCycle : '',
signingDate : '',
endDate : '',
code : '',
name : '',
contractNo : '',
currency : '',
num : '',
amount : '',
organization : '',
remark : '',
classification : '',
declarationDate : '',
deptCode : '',
creatorusername : '',
deptName : '',
approval : 0,
contract_item0List:[],
contract_item1List:[],
},
activemdfrsi:'0',
contractTypeOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
} export default {
components: { PrintBrowse },
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
dataForm: {
id: '',
contractType: '',
contractCode: '',
contractName: '',
status: '',
bidOpeningDate: '',
startDate: '',
auditDate: '',
completionDate: '',
closingDate: '',
collectionCycle: '',
signingDate: '',
endDate: '',
code: '',
name: '',
contractNo: '',
currency: '',
num: '',
amount: '',
organization: '',
remark: '',
classification: '',
declarationDate: '',
deptCode: '',
creatorusername: '',
deptName: '',
approval: 0,
contract_item0List: [],
contract_item1List: []
}, },
computed: {}, activemdfrsi: '0',
watch: {}, contractTypeOptions: [{ 'fullName': '选项一', 'id': '1' }, { 'fullName': '选项二', 'id': '2' }]
created() {
}, }
mounted() {}, },
methods: { computed: {},
dataInfo(dataAll){ watch: {},
let _dataAll =dataAll created() {
for(let i=0;i<_dataAll.contract_item0List.length;i++){
var _list = _dataAll.contract_item0List[i];
}
for(let i=0;i<_dataAll.contract_item1List.length;i++){
var _list = _dataAll.contract_item1List[i];
_list.enclosure = _list.enclosure? JSON.parse(_list.enclosure):[]
}
this.dataForm = _dataAll
},
goBack() { },
this.$emit('refresh') mounted() {
}, },
init(id) { methods: {
this.dataForm.id = id || 0; dataInfo(dataAll) {
this.visible = true; let _dataAll = dataAll
this.$nextTick(() => { for (let i = 0; i < _dataAll.contract_item0List.length; i++) {
if(this.dataForm.id){ var _list = _dataAll.contract_item0List[i]
this.loading = true }
request({ for (let i = 0; i < _dataAll.contract_item1List.length; i++) {
url: '/api/example/ContractFile/detail/'+this.dataForm.id, var _list = _dataAll.contract_item1List[i]
method: 'get' _list.enclosure = _list.enclosure ? JSON.parse(_list.enclosure) : []
}).then(res => { }
this.dataInfo(res.data) this.dataForm = _dataAll
this.loading = false },
})
}
}) goBack() {
}, this.$emit('refresh')
}, },
init(id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/ContractFile/detail/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
}
} }
}
</script> </script>

@ -1,69 +1,74 @@
<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.contractCode" placeholder="请输入" clearable> </el-input> <el-input v-model="query.contractCode" 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.contractName" placeholder="请输入" clearable> </el-input> <el-input v-model="query.contractName" 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-detail" @click="goDetail(scope.row.id)">--> <!-- <el-button type="text" icon="=el-icon-detail" @click="goDetail(scope.row.id)">-->
<!-- </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> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange" border>
<el-table-column prop="contractCode" label="合同编码" width="0" align="left" /> <el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
<el-table-column prop="contractName" label="合同名称" width="0" align="left" /> <el-table-column prop="contractCode" label="合同编码" width="200" align="center" sortable fixed="left"/>
<el-table-column prop="contractNo" label="对方合同号" width="0" align="left" /> <el-table-column prop="contractName" label="合同名称" width="200" align="center" sortable fixed="left"/>
<el-table-column label="合同类型 " width="0" prop="contractType" algin="left"> <el-table-column prop="contractNo" label="对方合同号" width="200" align="center" sortable/>
<template slot-scope="scope"> <el-table-column label="合同类型 " width="120" prop="contractType" algin="center" sortable>
{{ scope.row.contractType | dynamicText(contractTypeOptions) }} <template slot-scope="scope">
</template> {{ scope.row.contractType | dynamicText(contractTypeOptions) }}
</el-table-column> </template>
<el-table-column prop="classification" label="合同分类 " width="0" align="left" /> </el-table-column>
<el-table-column prop="declarationDate" label="申报日期" width="0" align="left" /> <el-table-column prop="classification" label="合同分类 " width="120" align="center" sortable/>
<el-table-column prop="name" label="供应商/客户名" width="0" align="left" /> <el-table-column prop="declarationDate" label="申报日期" width="120" align="center" sortable/>
<el-table-column prop="num" label="数量" width="0" align="left" /> <el-table-column prop="name" label="供应商/客户名" width="200" align="center" sortable/>
<el-table-column prop="amount" label="金额" width="0" align="left" /> <el-table-column prop="num" label="数量" width="120" align="center" sortable/>
<el-table-column prop="deptName" label="部门名称" width="0" align="left" /> <el-table-column prop="amount" label="金额" width="120" align="center" sortable/>
<el-table-column prop="remark" label="备注" width="0" align="left" /> <el-table-column prop="deptName" label="部门名称" width="120" align="center" sortable/>
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" /> <el-table-column prop="remark" label="备注" width="120" align="center" sortable/>
<el-table-column prop="status" label="合同状态" width="0" align="left" /> <el-table-column prop="creatorusername" label="录入人" width="120" align="center" sortable/>
<el-table-column prop="status" label="合同状态" width="120" align="center" sortable>
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column prop="approval" label="集团审批" width="0" align="left" > <el-table-column prop="approval" label="集团审批" width="120" align="center" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag type="danger" disable-transitions v-if="scope.row.approval == '关'"> <el-tag type="danger" disable-transitions v-if="scope.row.approval == '关'">
</el-tag> </el-tag>
@ -72,301 +77,310 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="exportData()"> <el-button type="text" @click="exportData()">
</el-button> </el-button>
<!-- <el-button type="text" @click="addOrUpdateHandle(scope.row.id)">--> <!-- <el-button type="text" @click="addOrUpdateHandle(scope.row.id)">-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">--> <!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">-->
<!-- </el-button>--> <!-- </el-button>-->
<el-button type="text" @click="goDetail(scope.row.id)"> <el-button type="text" @click="goDetail(scope.row.id)">
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" /> @pagination="initData"/>
</div> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" /> <JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" /> <Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div> </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 {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
contractCode: undefined,
contractName: 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: 'contractCode',
label: '合同编码'
},
{
prop: 'contractName',
label: '合同名称'
},
{
prop: 'contractNo',
label: '对方合同号'
},
{
prop: 'contractType',
label: '合同类型 '
},
{
prop: 'classification',
label: '合同分类 '
},
{
prop: 'declarationDate',
label: '申报日期'
},
{
prop: 'name',
label: '供应商/客户名'
},
{
prop: 'num',
label: '数量'
},
{
prop: 'amount',
label: '金额'
},
{
prop: 'deptName',
label: '部门名称'
},
{
prop: 'remark',
label: '备注'
},
{
prop: 'creatorusername',
label: '录入人'
},
{
prop: 'status',
label: '合同状态'
},
{
prop: 'approval',
label: '集团审批'
}
],
contractTypeOptions: [{
'fullName': '采购合同',
'id': '1'
}, {
'fullName': '销售合同',
'id': '2'
},
{
'fullName': '租赁合同',
'id': '3'
}, {
'fullName': '仓储合同',
'id': '4'
}, {
'fullName': '运输合同',
'id': '5'
},
{
'fullName': '施工合同',
'id': '6'
}
],
statusOptions: [{
"fullName": "进行中",
"id": "1"
}],
export default { contractTypeProps: {
components: { 'label': 'fullName',
JNPFForm, 'value': 'id'
ExportBox, }
Detail }
}, },
data() { computed: {
return { menuId() {
detailVisible: false, return this.$route.meta.modelId || ''
query: { }
contractCode: undefined, },
contractName: undefined, created() {
}, this.initData()
treeProps: { },
children: 'children', methods: {
label: 'fullName', goDetail(id) {
value: 'id' this.detailVisible = true
}, this.$nextTick(() => {
list: [], this.$refs.Detail.init(id)
listLoading: true, })
multipleSelection: [], },
total: 0, sortChange({
listQuery: { column,
currentPage: 1, prop,
pageSize: 20, order
sort: "desc", }) {
sidx: "", this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
}, this.listQuery.sidx = !order ? '' : prop
formVisible: false, this.initData()
exportBoxVisible: false, },
columnList: [{ initData() {
prop: 'contractCode', this.listLoading = true
label: '合同编码' let _query = {
}, ...this.listQuery,
{ ...this.query,
prop: 'contractName', menuId: this.menuId
label: '合同名称' }
}, request({
{ url: `/api/example/ContractFile/getList`,
prop: 'contractNo', method: 'post',
label: '对方合同号' data: _query
}, }).then(res => {
{ var _list = []
prop: 'contractType', for (let i = 0; i < res.data.list.length; i++) {
label: '合同类型 ' 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)
prop: 'classification', }
label: '合同分类 ' this.list = _list
}, this.total = res.data.pagination.total
{
prop: 'declarationDate',
label: '申报日期'
},
{
prop: 'name',
label: '供应商/客户名'
},
{
prop: 'num',
label: '数量'
},
{
prop: 'amount',
label: '金额'
},
{
prop: 'deptName',
label: '部门名称'
},
{
prop: 'remark',
label: '备注'
},
{
prop: 'creatorusername',
label: '录入人'
},
{
prop: 'status',
label: '合同状态'
},
{
prop: 'approval',
label: '集团审批'
},
],
contractTypeOptions: [{
"fullName": "采购合同",
"id": "1"
}, {
"fullName": "销售合同",
"id": "2"
},
{
"fullName": "租赁合同",
"id": "3"
}, {
"fullName": "仓储合同",
"id": "4"
}, {
"fullName": "运输合同",
"id": "5"
},
{
"fullName": "施工合同",
"id": "6"
}
],
contractTypeProps: {
"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/ContractFile/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/ContractFile/${id}`, url: `/api/example/ContractFile/${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/example/ContractFile/batchRemove/${ids}`, request({
method: 'DELETE' url: `/api/example/ContractFile/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 = {
...this.query, ...data,
menuId: this.menuId ...this.listQuery,
} ...this.query,
request({ menuId: this.menuId
url: `/api/example/ContractFile/Actions/Export`, }
method: 'GET', request({
data: query url: `/api/example/ContractFile/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: "contractCode", pageSize: 20,
} sort: 'desc',
this.initData() sidx: 'contractCode'
}, }
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>

@ -2,12 +2,12 @@
<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="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="supplierCd" > prop="supplierCd" >
<el-input v-model="dataForm.supplierCd" <el-input v-model="dataForm.supplierCd"
placeholder="请输入客户编码" clearable :style='{"width":"100%"}'> placeholder="请输入客户编码" clearable :style='{"width":"100%"}'>
@ -16,7 +16,7 @@
</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="supplierNm" > prop="supplierNm" >
<el-input v-model="dataForm.supplierNm" <el-input v-model="dataForm.supplierNm"
placeholder="请输入客户名称" clearable :style='{"width":"100%"}'> placeholder="请输入客户名称" clearable :style='{"width":"100%"}'>
@ -25,7 +25,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="24" >
<el-form-item label="公司ID" <el-form-item label="公司ID"
prop="orgId" > prop="orgId" >
<popupSelect v-model="dataForm.orgId" <popupSelect v-model="dataForm.orgId"
placeholder="请选择" clearable field="orgId" interfaceId="394016341591396805" :columnOptions="orgIdcolumnOptions" propsValue="F_Id" relationField="F_FullName" popupType="dialog" placeholder="请选择" clearable field="orgId" interfaceId="394016341591396805" :columnOptions="orgIdcolumnOptions" propsValue="F_Id" relationField="F_FullName" popupType="dialog"
@ -36,7 +36,7 @@
</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="vatRegistrationNum" > prop="vatRegistrationNum" >
<el-input v-model="dataForm.vatRegistrationNum" <el-input v-model="dataForm.vatRegistrationNum"
placeholder="请输入纳税编号" clearable :style='{"width":"100%"}'> placeholder="请输入纳税编号" clearable :style='{"width":"100%"}'>
@ -45,7 +45,7 @@
</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="customerLevel" > prop="customerLevel" >
<el-select v-model="dataForm.customerLevel" <el-select v-model="dataForm.customerLevel"
placeholder="请选择客户等级" :style='{"width":"100%"}'> placeholder="请选择客户等级" :style='{"width":"100%"}'>
@ -55,7 +55,7 @@
</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="contactName" > prop="contactName" >
<el-input v-model="dataForm.contactName" <el-input v-model="dataForm.contactName"
placeholder="请输入联系人" clearable :style='{"width":"100%"}'> placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
@ -64,7 +64,7 @@
</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="country" > prop="country" >
<el-input v-model="dataForm.country" <el-input v-model="dataForm.country"
placeholder="请输入国家" clearable :style='{"width":"100%"}'> placeholder="请输入国家" clearable :style='{"width":"100%"}'>
@ -73,7 +73,7 @@
</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="contactPhone" > prop="contactPhone" >
<el-input v-model="dataForm.contactPhone" <el-input v-model="dataForm.contactPhone"
placeholder="请输入电话" clearable :style='{"width":"100%"}'> placeholder="请输入电话" clearable :style='{"width":"100%"}'>
@ -82,7 +82,7 @@
</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="province" > prop="province" >
<JNPF-Address v-model="dataForm.province" <JNPF-Address v-model="dataForm.province"
placeholder="请选择" clearable :level=2 > placeholder="请选择" clearable :level=2 >
@ -91,7 +91,7 @@
</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="bank" > prop="bank" >
<el-input v-model="dataForm.bank" <el-input v-model="dataForm.bank"
placeholder="请输入开户行" clearable :style='{"width":"100%"}'> placeholder="请输入开户行" clearable :style='{"width":"100%"}'>
@ -100,7 +100,7 @@
</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="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%"}'>
@ -110,7 +110,7 @@
</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="bankAccount" > prop="bankAccount" >
<el-input v-model="dataForm.bankAccount" <el-input v-model="dataForm.bankAccount"
placeholder="请输入银行账号" clearable :style='{"width":"100%"}'> placeholder="请输入银行账号" clearable :style='{"width":"100%"}'>
@ -119,7 +119,7 @@
</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="enterprise" > prop="enterprise" >
<el-radio-group v-model="dataForm.enterprise" <el-radio-group v-model="dataForm.enterprise"
size="small" > size="small" >
@ -131,7 +131,7 @@
</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="address" > prop="address" >
<el-input v-model="dataForm.address" <el-input v-model="dataForm.address"
placeholder="请输入地址" clearable :style='{"width":"100%"}'> placeholder="请输入地址" clearable :style='{"width":"100%"}'>
@ -140,7 +140,7 @@
</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="classification" > prop="classification" >
<el-radio-group v-model="dataForm.classification" <el-radio-group v-model="dataForm.classification"
size="small" > size="small" >

@ -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>

@ -2,7 +2,7 @@
<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">

@ -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>

@ -8,7 +8,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单据编号" prop="documentNo"> <el-form-item label="单据编号" prop="documentNo">
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable <el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}' :disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -17,9 +17,9 @@
<el-form-item label="采购订单" prop="purchaseOrderId"> <el-form-item label="采购订单" prop="purchaseOrderId">
<popupSelect v-model="dataForm.purchaseOrderId" placeholder="请选择" clearable <popupSelect v-model="dataForm.purchaseOrderId" placeholder="请选择" clearable
field="purchaseOrderId" interfaceId="383149471917185157" field="purchaseOrderId" interfaceId="383149471917185157"
:columnOptions="purchaseOrderIdcolumnOptions" propsValue="id" :columnOptions="purchaseOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id"
relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange"> relationField="document_no" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange">
</popupSelect> </popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -35,14 +35,14 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="退货金额" prop="refundAmount"> <el-form-item label="退货金额" prop="refundAmount">
<el-input v-model="dataForm.refundAmount" clearable :style='{"width":"100%"}'> <el-input v-model="dataForm.refundAmount" 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="退货数量" prop="refundNum"> <el-form-item label="退货数量" prop="refundNum">
<el-input v-model="dataForm.refundNum" clearable :style='{"width":"100%"}'> <el-input v-model="dataForm.refundNum" clearable :style='{"width":"100%"}' :disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -68,7 +68,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<popupSelect v-model="scope.row.licenseNum" placeholder="请选择" <popupSelect v-model="scope.row.licenseNum" placeholder="请选择"
clearable :field="'licenseNum'+scope.$index" clearable :field="'licenseNum'+scope.$index"
interfaceId="383214061812227333" interfaceId="383214061812227333" :excludeFields="excludeFields"
:bissId="dataForm.purchaseOrderId" :bissId="dataForm.purchaseOrderId"
:columnOptions="purchaseback_item0licenseNumcolumnOptions" :columnOptions="purchaseback_item0licenseNumcolumnOptions"
propsValue="license_num" relationField="license_num" propsValue="license_num" relationField="license_num"
@ -187,6 +187,7 @@
data() { data() {
return { return {
bissId: '380716763022647941', bissId: '380716763022647941',
excludeFields: [],
formVisible: false, formVisible: false,
visible: false, visible: false,
loading: false, loading: false,
@ -324,7 +325,10 @@
mounted() {}, mounted() {},
methods: { methods: {
popupSelectChange2(a, b){ popupSelectChange2(a, b){
var excludeFields = [];
for (let i = 0; i < this.dataForm.purchaseback_item0List.length; i++) { for (let i = 0; i < this.dataForm.purchaseback_item0List.length; i++) {
excludeFields.push(this.dataForm.purchaseback_item0List[i].licenseNo);
if(a == this.dataForm.purchaseback_item0List[i].licenseNum){ if(a == this.dataForm.purchaseback_item0List[i].licenseNum){
this.dataForm.purchaseback_item0List[i].materialName = b.material_name; this.dataForm.purchaseback_item0List[i].materialName = b.material_name;
this.dataForm.purchaseback_item0List[i].settlement = b.settlement; this.dataForm.purchaseback_item0List[i].settlement = b.settlement;
@ -337,9 +341,12 @@
this.dataForm.purchaseback_item0List[i].pountType = b.pount_type; this.dataForm.purchaseback_item0List[i].pountType = b.pount_type;
} }
} }
this.excludeFields = excludeFields;
}, },
popupSelectChange(e,d){ popupSelectChange(e,d){
this.dataForm.currency = d.currency; this.dataForm.currency = d.currency;
this.excludeFields = [];
this.dataForm.receiptout_item0List = [];
}, },
purchaseback_item0Exist() { purchaseback_item0Exist() {
let isOk = true; let isOk = true;

@ -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>

@ -8,7 +8,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单据编号" prop="documentNo"> <el-form-item label="单据编号" prop="documentNo">
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable <el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}' :disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -17,7 +17,7 @@
<el-form-item label="销售订单" prop="salesOrderId"> <el-form-item label="销售订单" prop="salesOrderId">
<popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable <popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable
field="salesOrderId" interfaceId="383568951197606085" field="salesOrderId" interfaceId="383568951197606085"
:columnOptions="salesOrderIdcolumnOptions" propsValue="id" relationField="document_no" :columnOptions="salesOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id" relationField="document_no"
popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange"> popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange">
</popupSelect> </popupSelect>
@ -34,15 +34,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="退款金额" prop="refundAmount"> <el-form-item label="退款金额" prop="refundAmount" >
<el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}'> <el-input v-model="dataForm.refundAmount" readonly 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="退货数量" prop="refundNum"> <el-form-item label="退货数量" prop="refundNum" >
<el-input v-model="dataForm.refundNum" readonly clearable :style='{"width":"100%"}'> <el-input v-model="dataForm.refundNum" readonly clearable :style='{"width":"100%"}' :disabled="true">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -68,7 +68,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<popupSelect v-model="scope.row.licenseNum" placeholder="请选择" <popupSelect v-model="scope.row.licenseNum" placeholder="请选择"
clearable :field="'licenseNum'+scope.$index" clearable :field="'licenseNum'+scope.$index"
interfaceId="383568082196537541" :bissId="dataForm.salesOrderId" interfaceId="383568082196537541" :bissId="dataForm.salesOrderId" :excludeFields="excludeFields"
:columnOptions="saleback_item0licenseNumcolumnOptions" :columnOptions="saleback_item0licenseNumcolumnOptions"
propsValue="license_num" relationField="license_num" propsValue="license_num" relationField="license_num"
popupType="dialog" popupWidth="800px" @change="popupSelectChange2"> popupType="dialog" popupWidth="800px" @change="popupSelectChange2">
@ -184,6 +184,7 @@
props: [], props: [],
data() { data() {
return { return {
excludeFields: [],
visible: false, visible: false,
loading: false, loading: false,
isDetail: false, isDetail: false,
@ -320,7 +321,9 @@
mounted() {}, mounted() {},
methods: { methods: {
popupSelectChange2(a, b){ popupSelectChange2(a, b){
var excludeFields = [];
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) { for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
excludeFields.push(this.dataForm.saleback_item0List[i].licenseNo);
if(a == this.dataForm.saleback_item0List[i].licenseNum){ if(a == this.dataForm.saleback_item0List[i].licenseNum){
this.dataForm.saleback_item0List[i].materialName = b.material_name; this.dataForm.saleback_item0List[i].materialName = b.material_name;
this.dataForm.saleback_item0List[i].settlement = b.settlement; this.dataForm.saleback_item0List[i].settlement = b.settlement;
@ -333,9 +336,12 @@
this.dataForm.saleback_item0List[i].pountType = b.pound_type; this.dataForm.saleback_item0List[i].pountType = b.pound_type;
} }
} }
this.excludeFields = excludeFields;
}, },
popupSelectChange(e,d){ popupSelectChange(e,d){
this.dataForm.currency = d.currency; this.dataForm.currency = d.currency;
this.excludeFields = [];
this.dataForm.saleback_item0List = [];
}, },
saleback_item0Exist() { saleback_item0Exist() {
let isOk = true; let isOk = true;

@ -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,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…
Cancel
Save