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

Loading…
Cancel
Save