Browse Source

完善欠款开票申请

master
yunuo970428 2 years ago
parent
commit
45f650d6fd
  1. 25
      anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/finwaitinvoiceapply.js
  2. 68
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/finginvoiceapply.vue
  3. 98
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/finginvoiceapplyAdd.vue
  4. 241
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/relation/selectCar.vue
  5. 101
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/kaipiaoguanliFlow/finginvoiceapplyEdit.vue
  6. 241
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/kaipiaoguanliFlow/relation/selectCar.vue

25
anrui-buscenter/anrui-finmanage-ui/src/api/anruifinmanagement/finwaitinvoiceapply.js

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 待开票车辆条件查询 (已改)
// 开票申请条件查询 (已改)
export function listPage(data) {
return request({
url: '/fin/v1/finbillapplication/listPage',
@ -12,6 +12,19 @@ export function listPage(data) {
})
}
// 开票申请选择车辆条件查询 (已改)
export function getSelectVinsList(data) {
return request({
url: '/fin/v1/finbillapplication/getSelectVinsList',
data: data,
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
}
// 判断申请中单台开票金额是否可以填写(只允许第一次填写)
export function fetchByContractNo(data) {
return request({
@ -28,6 +41,16 @@ export function fetchDetailsBySid(data) {
})
}
// 通过sid删除一条或多条记录
export function delBySids(data) {
return request({
url: '/fin/v1/finbillapplication/delBySids',
method: 'DELETE',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}
// 开票申请--保存
export function saveOrUpdate(data) {
return request({

68
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/finginvoiceapply.vue

@ -127,9 +127,9 @@
</div>
</div>
<!--开票申请新增及修改列表部分 -->
<finginvoiceapply-add v-show="viewState == 2" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<finginvoiceapply-add v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<!--开票申请详情列表部分-->
<finginvoiceapply-info v-show="viewState == 3" ref="divInfo" @doback="resetState" />
<finginvoiceapply-info 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>
</el-dialog>
@ -140,7 +140,7 @@
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import { listPage } from '@/api/anruifinmanagement/finwaitinvoiceapply'
import { listPage, delBySids } from '@/api/anruifinmanagement/finwaitinvoiceapply'
import { typeValues, getOrgSidByPath } from '@/api/jichuxinxi/dictcommons'
import { getStorage } from '@/utils/auth'
import finginvoiceapplyAdd from './finginvoiceapplyAdd'
@ -162,6 +162,20 @@ export default {
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',
@ -280,6 +294,12 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'doClose':
this.doClose()
break
@ -365,16 +385,54 @@ export default {
}
this.init()
},
toAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd()
},
doDel() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
return
}
// for (var i = 0; i < this.multipleSelection.length; i++) {
// if (!this.multipleSelection[i].isCZ) {
// 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)'
})
delBySids(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(() => {})
},
toEdit(row) {
if (row.isCZ) {
this.viewState = 2
this.viewState = 3
this.$refs['divAdd'].showEdit(row)
} else {
this.$message({ showClose: true, type: 'error', message: '非本人发起的申请,无权限操作' })
}
},
toInfo(row) {
this.viewState = 3
this.viewState = 4
this.$refs['divInfo'].showInfo(row)
},
//

98
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/finginvoiceapplyAdd.vue

@ -6,6 +6,7 @@
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" v-if="formobj.saleTypeValue !== '全款(含非担保贷款)'" @click="handleChoose()">选择车辆</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存
</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSubmit()">提交
@ -91,6 +92,11 @@
</el-row>
<el-table :key="tableKey" :data="formobj.finBillVehicles" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column v-if="formobj.saleTypeValue !== '全款(含非担保贷款)'" label="车架号" align="center">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="handleDelete(scope.row, scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
@ -185,6 +191,7 @@
</div>
<xiaoshoudingdanInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
<weihukaipiaoxinxi v-show="viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="resetData"/>
<selectCar v-show="viewState == 4" ref="divSelect" @doback="resetState" @backData="backData"/>
</div>
</template>
@ -194,13 +201,15 @@ import { selectAllDisList, typeValues } from '@/api/jichuxinxi/dictcommons'
import upload from '@/components/uploadFile/upload'
import xiaoshoudingdanInfo from './relation/xiaoshoudingdanInfo'
import weihukaipiaoxinxi from './relation/weihukaipiaoxinxi'
import selectCar from './relation/selectCar'
export default {
name: '',
components: {
upload,
xiaoshoudingdanInfo,
weihukaipiaoxinxi
weihukaipiaoxinxi,
selectCar
},
data() {
return {
@ -262,6 +271,7 @@ export default {
saleDeptSid: '',
saleTypeKey: '',
saleTypeValue: '',
showBtnStr: '',
sid: '',
staffName: '',
staffSid: '',
@ -290,6 +300,17 @@ export default {
e.target.value = parseFloat(e.target.value)
}
},
showAdd() {
this.init()
this.viewTitle = '【新增】公司开票申请'
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.formobj.orgSidPath = window.sessionStorage.getItem('defaultOrgPath')
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.formobj.arrearsMoney = '0'
this.formobj.showBtnStr = '1'
},
showEdit(row) {
this.init()
this.viewTitle = '【编辑】公司开票申请'
@ -349,6 +370,80 @@ export default {
}
return this.formobj.totalBillMoney
},
// --
handleChoose() {
this.viewState = 4
this.$refs['divSelect'].showData(this.formobj.finBillVehicles, this.formobj.contractNo, this.formobj.orgSidPath)
},
// --
handleDelete(row, index) {
this.formobj.finBillVehicles.splice(index, 1)
},
// -- --
backData(value) {
this.viewState = 1
value = JSON.parse(JSON.stringify(value))
if (value.length > 0) {
this.formobj.createByName = value[0].userName
this.formobj.createBySid = value[0].userSid
this.formobj.deptName = value[0].deptName
this.formobj.deptSid = value[0].deptSid
this.formobj.applyDate = value[0].applyDate
this.formobj.staffName = value[0].sellerName
this.formobj.staffSid = value[0].staffSid
this.formobj.saleDeptName = value[0].sellerDept
this.formobj.saleDeptSid = value[0].staffDeptSid
this.formobj.saleTypeValue = value[0].saleType
this.formobj.saleTypeKey = value[0].saleTypeKey
this.formobj.contractNo = value[0].contractId
this.formobj.openTickUnitName = value[0].invoicingUnit
this.formobj.customerName = value[0].name
this.formobj.customerSid = value[0].customerSid
this.formobj.useOrgSid = value[0].useOrgSid
this.formobj.busSalesOrderSid = value[0].busSalesOrderSid
this.formobj.billStateValue = '正常开票'
this.formobj.billStateKey = '001'
this.formobj.modelName = value[0].modelName
this.formobj.modelSid = value[0].modelSid
fetchByContractNo(this.formobj.contractNo).then((res) => {
if (res.success) {
this.isEdit = res.data.isEdit
if (res.data.oneBillMoney !== '') {
this.formobj.oneBillMoney = res.data.oneBillMoney
}
}
})
selectAllDisList({ orgSid: this.formobj.useOrgSid, staffSid: this.formobj.staffSid }).then((resp) => {
if (resp.success) {
this.openTick_list = resp.data
}
})
value.forEach((e) => {
//
this.formobj.finBillVehicles.push({
vinNo: e.vin,
vehSid: e.vinSid,
certificateStateValue: e.certificateState,
certificateStateKey: e.certificateStateKey,
billTypeValue: '',
billTypeKey: '',
openTickName: '',
openTickSid: '',
openTickRemarks: ''
})
//
if (e.finBillTrailers.length > 0) {
e.finBillTrailers.forEach((h) => {
this.formobj.finBillTrailers.push({
gcVinNo: h.gcVinNo,
vinNo: h.vinNo,
oneBillMoney: ''
})
})
}
})
}
},
changeOpenTickType(val) {
const choose = this.openTickType_list.filter((item) => item.dictValue === val)
this.formobj.openTickTypeKey = choose[0].dictKey
@ -554,6 +649,7 @@ export default {
saleDeptSid: '',
saleTypeKey: '',
saleTypeValue: '',
showBtnStr: '',
sid: '',
staffName: '',
staffSid: '',

241
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/finginvoiceapply/backups/relation/selectCar.vue

@ -0,0 +1,241 @@
<template>
<div class="app-container">
<button-bar view-title="待开票车辆列表" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<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.contractId" placeholder="" clearable class="filter-item"/>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="listQuery.params.name" placeholder="" clearable class="filter-item"/>
</el-form-item>
<el-form-item label="车架号">
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable class="filter-item"/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</div>
</div>
</div>
<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>
<div class="">
<el-table ref="multipleTable" :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50"/>
<el-table-column fixed label="序号" type="index" width="60" :index="indexMethod" align="center"/>
<el-table-column label="销售类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.saleType }}</span>
</template>
</el-table-column>
<el-table-column label="合同编号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.contractId }}</span>
</template>
</el-table-column>
<el-table-column label="客户名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vin }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
</template>
<script>
import { getSelectVinsList } from '@/api/anruifinmanagement/finwaitinvoiceapply'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
export default {
name: 'DaiKaiPiao',
components: {
Pagination,
pageye,
ButtonBar
},
data() {
return {
btndisabled: false,
isSearchShow: false, //
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
sids: [], // SIDs
FormLoading: false,
listLoading: false,
typeList: [], //
list: [],
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'doCreate',
btnLabel: '确定'
},
{
type: 'info',
size: 'small',
icon: '',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
//
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
contractId: '', //
name: '', //
vinNo: '', //
userSid: '',
orgPath: '',
vins: []
}
},
multipleSelection: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doCreate':
this.doCreate()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
showData(value, contractNo, orgSidPath) {
const aa = []
if (value.length > 0) {
for (var i = 0; i < value.length; i++) {
aa.push(value[i].vehSid)
}
this.listQuery.params.vins = aa
} else {
this.listQuery.params.vins = []
}
this.listQuery.params.contractId = contractNo
this.listQuery.params.orgPath = orgSidPath
this.getList()
},
// ========== ==========
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
// sid
handleSelectionChange(row) {
this.multipleSelection = row
const aa = []
row.forEach(element => {
aa.push({
contractNo: element.contractId,
vinSid: element.vinSid
})
})
this.sids = aa
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
//
handleReset() {
this.listQuery.current = 1
this.listQuery.size = 10
this.listQuery.total = 0
this.listQuery.params.name = ''
this.listQuery.params.vinNo = ''
this.listQuery.params.userSid = ''
this.getList()
},
//
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
getSelectVinsList(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
}
})
},
//
doCreate() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行出库申请' })
return
}
if (this.sids.length > 0) {
this.FormLoading = true
for (var i = 0; i < this.multipleSelection.length; i++) {
for (var j = i + 1; j < this.multipleSelection.length; j++) {
if (this.multipleSelection[i].contractId !== this.multipleSelection[j].contractId) {
this.$message({
showClose: true,
message: '请选择同一合同编号的车辆!',
type: 'error'
})
return
}
}
}
this.$emit('backData', this.multipleSelection)
}
},
doClose() {
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>

101
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/kaipiaoguanliFlow/finginvoiceapplyEdit.vue

@ -6,6 +6,7 @@
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" v-if="formobj.saleTypeValue !== '全款(含非担保贷款)'" @click="handleChoose()">选择车辆</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存
</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSubmit()">提交
@ -90,6 +91,11 @@
</el-row>
<el-table :key="tableKey" :data="formobj.finBillVehicles" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column v-if="formobj.saleTypeValue !== '全款(含非担保贷款)'" label="车架号" align="center">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="handleDelete(scope.row, scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span>
@ -185,6 +191,7 @@
<!-- 查看销售订单详情 -->
<xiaoshoudingdanInfo v-show="viewState == 2" ref="divInfo" @doback="resetState"/>
<weihukaipiaoxinxi v-show="viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="resetData"/>
<selectCar v-show="viewState == 4" ref="divSelect" @doback="resetState" @backData="backData"/>
</div>
</template>
@ -194,13 +201,15 @@ import { selectAllDisList, typeValues } from '@/api/jichuxinxi/dictcommons'
import upload from '@/components/uploadFile/upload'
import xiaoshoudingdanInfo from './relation/xiaoshoudingdanInfo'
import weihukaipiaoxinxi from './relation/weihukaipiaoxinxi'
import selectCar from './relation/selectCar'
export default {
name: '',
components: {
upload,
xiaoshoudingdanInfo,
weihukaipiaoxinxi
weihukaipiaoxinxi,
selectCar
},
data() {
return {
@ -262,6 +271,7 @@ export default {
saleDeptSid: '',
saleTypeKey: '',
saleTypeValue: '',
showBtnStr: '',
sid: '',
staffName: '',
staffSid: '',
@ -381,6 +391,80 @@ export default {
}
return this.formobj.totalBillMoney
},
// --
handleChoose() {
this.viewState = 4
this.$refs['divSelect'].showData(this.formobj.finBillVehicles, this.formobj.contractNo, this.formobj.orgSidPath)
},
// --
handleDelete(row, index) {
this.formobj.finBillVehicles.splice(index, 1)
},
// -- --
backData(value) {
this.viewState = 1
value = JSON.parse(JSON.stringify(value))
if (value.length > 0) {
this.formobj.createByName = value[0].userName
this.formobj.createBySid = value[0].userSid
this.formobj.deptName = value[0].deptName
this.formobj.deptSid = value[0].deptSid
this.formobj.applyDate = value[0].applyDate
this.formobj.staffName = value[0].sellerName
this.formobj.staffSid = value[0].staffSid
this.formobj.saleDeptName = value[0].sellerDept
this.formobj.saleDeptSid = value[0].staffDeptSid
this.formobj.saleTypeValue = value[0].saleType
this.formobj.saleTypeKey = value[0].saleTypeKey
this.formobj.contractNo = value[0].contractId
this.formobj.openTickUnitName = value[0].invoicingUnit
this.formobj.customerName = value[0].name
this.formobj.customerSid = value[0].customerSid
this.formobj.useOrgSid = value[0].useOrgSid
this.formobj.busSalesOrderSid = value[0].busSalesOrderSid
this.formobj.billStateValue = '正常开票'
this.formobj.billStateKey = '001'
this.formobj.modelName = value[0].modelName
this.formobj.modelSid = value[0].modelSid
fetchByContractNo(this.formobj.contractNo).then((res) => {
if (res.success) {
this.isEdit = res.data.isEdit
if (res.data.oneBillMoney !== '') {
this.formobj.oneBillMoney = res.data.oneBillMoney
}
}
})
selectAllDisList({ orgSid: this.formobj.useOrgSid, staffSid: this.formobj.staffSid }).then((resp) => {
if (resp.success) {
this.openTick_list = resp.data
}
})
value.forEach((e) => {
//
this.formobj.finBillVehicles.push({
vinNo: e.vin,
vehSid: e.vinSid,
certificateStateValue: e.certificateState,
certificateStateKey: e.certificateStateKey,
billTypeValue: '',
billTypeKey: '',
openTickName: '',
openTickSid: '',
openTickRemarks: ''
})
//
if (e.finBillTrailers.length > 0) {
e.finBillTrailers.forEach((h) => {
this.formobj.finBillTrailers.push({
gcVinNo: h.gcVinNo,
vinNo: h.vinNo,
oneBillMoney: ''
})
})
}
})
}
},
changeOpenTickType(val) {
const choose = this.openTickType_list.filter((item) => item.dictValue === val)
this.formobj.openTickTypeKey = choose[0].dictKey
@ -462,14 +546,6 @@ export default {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.getUrl()
if (this.formobj.zjApplicationAppendxs.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请上传证件(营业执照或身份证)' })
return
}
if (this.formobj.khkpsqsApplicationAppendxs.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请上传客户开票申请书' })
return
}
this.submitdisabled = true
submit(this.formobj).then((res) => {
if (res.success) {
@ -557,6 +633,13 @@ export default {
text-align: center;
padding: 30px 0 20px 0;
}
.titleOne {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.span-sty {
width: 100px !important;
}

241
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/kaipiaoguanliFlow/relation/selectCar.vue

@ -0,0 +1,241 @@
<template>
<div class="app-container">
<button-bar view-title="待开票车辆列表" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<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.contractId" placeholder="" clearable class="filter-item"/>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="listQuery.params.name" placeholder="" clearable class="filter-item"/>
</el-form-item>
<el-form-item label="车架号">
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable class="filter-item"/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</div>
</div>
</div>
<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>
<div class="">
<el-table ref="multipleTable" :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" align="center" width="50"/>
<el-table-column fixed label="序号" type="index" width="60" :index="indexMethod" align="center"/>
<el-table-column label="销售类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.saleType }}</span>
</template>
</el-table-column>
<el-table-column label="合同编号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.contractId }}</span>
</template>
</el-table-column>
<el-table-column label="客户名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="车架号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.vin }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
</template>
<script>
import { getSelectVinsList } from '@/api/anruifinmanagement/finwaitinvoiceapply'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
export default {
name: 'DaiKaiPiao',
components: {
Pagination,
pageye,
ButtonBar
},
data() {
return {
btndisabled: false,
isSearchShow: false, //
searchxianshitit: '显示查询条件',
// -----------
tableKey: 0,
sids: [], // SIDs
FormLoading: false,
listLoading: false,
typeList: [], //
list: [],
btnList: [
{
type: 'primary',
size: 'small',
icon: '',
btnKey: 'doCreate',
btnLabel: '确定'
},
{
type: 'info',
size: 'small',
icon: '',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
//
listQuery: {
current: 1,
size: 10,
total: 0,
params: {
contractId: '', //
name: '', //
vinNo: '', //
userSid: '',
orgPath: '',
vins: []
}
},
multipleSelection: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'doCreate':
this.doCreate()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
showData(value, contractNo, orgSidPath) {
const aa = []
if (value.length > 0) {
for (var i = 0; i < value.length; i++) {
aa.push(value[i].vehSid)
}
this.listQuery.params.vins = aa
} else {
this.listQuery.params.vins = []
}
this.listQuery.params.contractId = contractNo
this.listQuery.params.orgPath = orgSidPath
this.getList()
},
// ========== ==========
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
// sid
handleSelectionChange(row) {
this.multipleSelection = row
const aa = []
row.forEach(element => {
aa.push({
contractNo: element.contractId,
vinSid: element.vinSid
})
})
this.sids = aa
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
//
handleReset() {
this.listQuery.current = 1
this.listQuery.size = 10
this.listQuery.total = 0
this.listQuery.params.name = ''
this.listQuery.params.vinNo = ''
this.listQuery.params.userSid = ''
this.getList()
},
//
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
getSelectVinsList(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
}
})
},
//
doCreate() {
if (this.sids.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行出库申请' })
return
}
if (this.sids.length > 0) {
this.FormLoading = true
for (var i = 0; i < this.multipleSelection.length; i++) {
for (var j = i + 1; j < this.multipleSelection.length; j++) {
if (this.multipleSelection[i].contractId !== this.multipleSelection[j].contractId) {
this.$message({
showClose: true,
message: '请选择同一合同编号的车辆!',
type: 'error'
})
return
}
}
}
this.$emit('backData', this.multipleSelection)
}
},
doClose() {
this.$emit('doback')
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save