Browse Source

完善配件销售单开票管理

master
yunuo970428 2 months ago
parent
commit
a0cdf197c6
  1. 587
      yxt-as-ui/src/views/operation/salesInvoice/salesInvoice.vue

587
yxt-as-ui/src/views/operation/salesInvoice/salesInvoice.vue

@ -2,7 +2,7 @@
<div class="app-container">
<!--列表页面-->
<div v-show="viewState == 1">
<button-bar view-title="配件销售单开票申请管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar view-title="配件销售单开票申请管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<!--Start查询列表部分-->
<div class="main-content">
<div class="searchcon">
@ -10,39 +10,35 @@
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-form-item label="分公司">
<el-input v-model="listQuery.params.useOrgName" placeholder="" clearable />
<el-input v-model="listQuery.params.useOrgName" placeholder="" clearable/>
</el-form-item>
<el-form-item label="申请部门">
<el-input v-model="listQuery.params.deptName" placeholder="" clearable />
<el-input v-model="listQuery.params.deptName" placeholder="" clearable/>
</el-form-item>
<el-form-item label="申请人">
<el-input v-model="listQuery.params.createByName" placeholder="" clearable />
<el-input v-model="listQuery.params.createByName" placeholder="" clearable/>
</el-form-item>
<el-form-item label="单据编号">
<el-input v-model="listQuery.params.billNo" placeholder="" clearable />
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/>
</el-form-item>
<el-form-item label="申请日期">
<el-date-picker v-model="listQuery.params.startDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
type="date" placeholder="选择日期"></el-date-picker>
<el-date-picker v-model="listQuery.params.startDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
<span style="padding: 0 8px"></span>
<el-date-picker v-model="listQuery.params.endDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
type="date" placeholder="选择日期"></el-date-picker>
<el-date-picker v-model="listQuery.params.endDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
</el-form-item>
<el-form-item label="办结日期">
<el-date-picker v-model="listQuery.params.startDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
type="date" placeholder="选择日期"></el-date-picker>
<el-date-picker v-model="listQuery.params.startDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
<span style="padding: 0 8px"></span>
<el-date-picker v-model="listQuery.params.endDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
type="date" placeholder="选择日期"></el-date-picker>
<el-date-picker v-model="listQuery.params.endDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
</el-form-item>
<el-form-item label="开票单位">
<el-input v-model="listQuery.params.customerName" placeholder="" clearable />
<el-input v-model="listQuery.params.customerName" placeholder="" clearable/>
</el-form-item>
<el-form-item label="开票名称">
<el-input v-model="listQuery.params.vehMark" placeholder="" clearable />
<el-input v-model="listQuery.params.vehMark" placeholder="" clearable/>
</el-form-item>
<el-form-item label="开票类型">
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable />
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
@ -54,19 +50,16 @@
<!--End查询列表部分-->
<div class="listtop">
<div class="tit">配件销售单开票申请列表</div>
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" /> -->
</div>
<!--Start 主页面主要部分 -->
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
@selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50" />
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="primary" :disabled="scope.row.state == '已办结'" size="small"
@click="toEdit(scope.row)">办理</el-button>
<el-button type="primary" size="small" @click="toEdit(scope.row)" :disabled="scope.row.nodeState =='发起申请' ? false : scope.row.nodeState == '待提交' ? false : true">办理
</el-button>
<el-button type="primary" size="small" @click="toInfo(scope.row)">查看</el-button>
</template>
</el-table-column>
@ -76,16 +69,16 @@
<span v-else @click="flowRecord(scope.row)" class="bluezi">{{ scope.row.nodeState }}</span>
</template>
</el-table-column>
<el-table-column prop="billNo" label="单据编号" align="center" width="220" />
<el-table-column prop="useOrgName" label="分公司" align="center" min-width="150" />
<el-table-column prop="deptName" label="申请部门" align="center" min-width="150" />
<el-table-column prop="createByName" label="申请人" align="center" width="120" />
<el-table-column prop="createTime" label="申请日期" align="center" width="120" />
<el-table-column prop="finishTime" label="办结日期" align="center" width="120" />
<el-table-column prop="invoiceOrg" label="开票单位" align="center" width="160" />
<el-table-column prop="invoiceName" label="开票名称" align="center" width="160" />
<el-table-column prop="invoiceType" label="开票类型" align="center" width="120" />
<el-table-column prop="invoicePrice" label="开票金额" align="center" width="120" />
<el-table-column prop="billNo" label="单据编号" align="center" width="220"/>
<el-table-column prop="useOrgName" label="分公司" align="center" min-width="150"/>
<el-table-column prop="deptName" label="申请部门" align="center" min-width="150"/>
<el-table-column prop="createByName" label="申请人" align="center" width="120"/>
<el-table-column prop="createTime" label="申请日期" align="center" width="120"/>
<el-table-column prop="finishTime" label="办结日期" align="center" width="120"/>
<el-table-column prop="invoiceOrg" label="开票单位" align="center" width="160"/>
<el-table-column prop="invoiceName" label="开票名称" align="center" width="160"/>
<el-table-column prop="invoiceType" label="开票类型" align="center" width="120"/>
<el-table-column prop="invoicePrice" label="开票金额" align="center" width="120"/>
<el-table-column label="附件" width="80" align="center">
<template slot-scope="scope">
<span @click="showFiles(scope.row.files)" class="bluezi">查看</span>
@ -95,307 +88,299 @@
</div>
<!--End 主页面主要部分-->
<div class="pages">
<div class="tit" />
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<!--End查询列表部分-->
</div>
</div>
<!--新增及修改 -->
<salesInvoiceAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState"
@reloadlist="getList" />
<salesInvoiceAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<!-- 详情 -->
<salesInvoiceInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" />
<salesInvoiceInfo v-show="viewState == 4" ref="divInfo" @doback="resetState"/>
<!-- 流程审批记录 -->
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center>
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no"
:src="this.centerDialogVisible === true ? url :''"></iframe>
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no" :src="this.centerDialogVisible === true ? url :''"></iframe>
</el-dialog>
<!-- 附件 -->
<el-dialog title="附件" :visible.sync="filesDialogVisible" width="78%" height="1%"
:before-close="closeFilesDialogVisible">
<el-dialog title="附件" :visible.sync="filesDialogVisible" width="78%" height="1%" :before-close="closeFilesDialogVisible">
<div style=" margin-top: -20px">
<el-image class="addinputInfo" style="width: 150px;height: 150px;padding: 10px;"
v-for="(item, index) in filesList" :key="index" :src="item" :preview-src-list="filesList" />
<el-image class="addinputInfo" style="width: 150px;height: 150px;padding: 10px;" v-for="(item, index) in filesList" :key="index" :src="item" :preview-src-list="filesList"/>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import req from '@/api/operation/salesInvoice'
import salesInvoiceAdd from './salesInvoiceAdd'
import salesInvoiceInfo from './salesInvoiceInfo'
import {
getStorage
} from '@/utils/auth'
import Pagination from '@/components/pagination'
import ButtonBar from '@/components/ButtonBar'
import req from '@/api/operation/salesInvoice'
import salesInvoiceAdd from './salesInvoiceAdd'
import salesInvoiceInfo from './salesInvoiceInfo'
import {
getStorage
} from '@/utils/auth'
export default {
name: 'SalesTicket',
components: {
Pagination,
pageye,
ButtonBar,
salesInvoiceAdd,
salesInvoiceInfo
},
data() {
return {
url: '',
dialogHeight: '80%',
centerDialogVisible: false,
btndisabled: false,
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
viewState: 1, // 1 2 3 4
tableKey: 0,
list: [],
sids: [], // SIDs
listLoading: false,
//
listQuery: {
current: 1,
size: 5,
total: 0,
params: {
useOrgName: '',
deptName: '',
createByName: '',
billNo: '',
startDate: '',
endDate: '',
colesStartDate: '',
colesEndDate: '',
invoiceName: '',
invoiceValue: '',
createBySid: '',
orgPath: ''
}
export default {
name: 'SalesTicket',
components: {
Pagination,
ButtonBar,
salesInvoiceAdd,
salesInvoiceInfo
},
data() {
return {
url: '',
dialogHeight: '80%',
centerDialogVisible: false,
btndisabled: false,
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
},
filesList: [],
filesDialogVisible: false,
}
},
created() {
//
this.getList()
},
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
async handleMessage(event) {
var code = ''
if (event.data.params !== null && event.data.params !== undefined) {
code = event.data.params.code
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
if (code === 1) {
this.centerDialogVisible = false
} else if (code === 2) {
this.dialogHeight = event.data.params.data
this.setIframeHeight(document.getElementById('iframe'))
],
isSearchShow: false,
searchxianshitit: '显示查询条件',
viewState: 1, // 1 2 3 4
tableKey: 0,
list: [],
sids: [], // SIDs
listLoading: false,
//
listQuery: {
current: 1,
size: 5,
total: 0,
params: {
useOrgName: '',
deptName: '',
createByName: '',
billNo: '',
startDate: '',
endDate: '',
colesStartDate: '',
colesEndDate: '',
invoiceName: '',
invoiceValue: '',
createBySid: '',
orgPath: ''
}
},
closeIt() {
this.url = ''
filesList: [],
filesDialogVisible: false
}
},
created() {
//
this.getList()
},
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
async handleMessage(event) {
var code = ''
if (event.data.params !== null && event.data.params !== undefined) {
code = event.data.params.code
}
if (code === 1) {
this.centerDialogVisible = false
},
setIframeHeight(iframe) {
iframe.height = this.dialogHeight
},
flowRecord(row) {
this.centerDialogVisible = true
var params = {
deployId: row.procDefId,
procInsId: row.procInstId,
token: getStorage()
}
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else if (code === 2) {
this.dialogHeight = event.data.params.data
this.setIframeHeight(document.getElementById('iframe'))
}
},
closeIt() {
this.url = ''
this.centerDialogVisible = false
},
setIframeHeight(iframe) {
iframe.height = this.dialogHeight
},
flowRecord(row) {
this.centerDialogVisible = true
var params = {
deployId: row.procDefId,
procInsId: row.procInstId,
token: getStorage()
}
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
// sid
handleSelectionChange(row) {
const aa = []
row.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.listQuery.params.menuUrl = this.$route.path
req.listPage(this.listQuery).then(response => {
this.listLoading = false
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.searchxianshitit = '显示查询条件'
this.list = []
this.listQuery.total = 0
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
default:
break
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
//
handleReset() {
this.listQuery = {
current: 1,
size: 5,
total: 0,
params: {
useOrgName: '',
deptName: '',
createByName: '',
bilLNo: '',
startDate: '',
endDate: '',
customerName: '',
vehMark: '',
vinNo: '',
salesName: '',
orgPath: '',
usersid: '',
menuUrl: ''
}
},
// sid
handleSelectionChange(row) {
const aa = []
row.forEach(element => {
aa.push(element.sid)
}
this.getList()
},
showFiles(files) {
this.filesList = files
this.filesDialogVisible = true
},
closeFilesDialogVisible() {
this.filesDialogVisible = false
},
toAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd()
},
toEdit(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row)
},
toInfo(row) {
this.viewState = 4
this.$refs['divInfo'].showInfo(row)
},
//
doDel() {
if (this.sids.length === 0) {
this.$message({
showClose: true,
type: 'error',
message: '请选择至少一条记录进行删除操作'
})
this.sids = aa
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.listQuery.params.menuUrl = this.$route.path
req.listPage(this.listQuery).then(response => {
this.listLoading = false
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
this.list = []
this.listQuery.total = 0
}
return
}
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
//
handleReset() {
this.listQuery = {
current: 1,
size: 5,
total: 0,
params: {
useOrgName: '',
deptName: '',
createByName: '',
bilLNo: '',
startDate: '',
endDate: '',
customerName: '',
vehMark: '',
vinNo: '',
salesName: '',
orgPath: '',
usersid: '',
menuUrl: ''
req.deleteBySids(this.sids).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
}
}
this.getList()
},
showFiles(files) {
this.filesList = files
this.filesDialogVisible = true
},
closeFilesDialogVisible() {
this.filesDialogVisible = false
},
toAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd()
},
toEdit(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row)
},
toInfo(row) {
this.viewState = 4
this.$refs['divInfo'].showInfo(row)
},
//
doDel() {
if (this.sids.length === 0) {
this.$message({
showClose: true,
type: 'error',
message: '请选择至少一条记录进行删除操作'
})
return
}
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteBySids(this.sids).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
//
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
this.getList()
loading.close()
}).catch(e => {
loading.close()
})
}).catch(() => {
})
},
//
resetState() {
this.viewState = 1
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
}
}
}
</script>
<style scoped>
</style>

Loading…
Cancel
Save