开票优化

This commit is contained in:
duan
2024-11-25 10:59:20 +08:00
parent d704253591
commit 161caeeabe
4 changed files with 125 additions and 36 deletions

View File

@@ -2,15 +2,6 @@
<div class="app-container">
<div class="title">应用中心</div>
<div class="list">
<div class="item" @click="upPop">
<img src="./kp.png" class="icon">
<div class="info">
<div class="name">开票</div>
<div class="intro">
</div>
</div>
</div>
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
<img :src="item.coverImg" class="icon">
<div class="info">
@@ -22,28 +13,35 @@
</div>
</div>
<!-- 弹窗 -->
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" >
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
<el-form :model="forms">
<el-form-item label="账号:" label-width="60px">
<el-form-item label="账号:" label-width="100px">
<el-input v-model="forms.account" :disabled="title != '绑定数点票账号'" autocomplete="off"></el-input>
</el-form-item>
<!-- <el-form-item label="密码/验证码" label-width="120px">
<el-input v-model="forms.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="开票项目:" label-width="120px">
<el-input v-model="forms.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="开票类型:" label-width="120px">
<el-input v-model="forms.name" autocomplete="off"></el-input>
</el-form-item> -->
<div style="text-align: right;" v-if="title == '绑定数点票账号'">联系区域经理开通</div>
<div style="text-align: center;" v-else @click="title = '绑定数点票账号'">更换绑定</div>
<!-- <el-form-item label="活动区域" label-width="120px">
<el-select v-model="form.region" placeholder="请选择活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
<el-form-item label="项目分类:" label-width="100px">
<el-select v-model="forms.article" :disabled="title != '绑定数点票账号'" :filter-method="getindustry"
filterable style="width: 100%;" placeholder="餐饮">
<el-option :label="item.name" :value="item.name" v-for="(item, index) in getindustryList"
:key="index"></el-option>
</el-select>
</el-form-item> -->
</el-form-item>
<el-form-item label="数电发票:" label-width="100px">
<el-select v-model="forms.sdType" :disabled="title != '绑定数点票账号'"
@change="changeEvent($event, 'sdType')" style="width: 100%;" placeholder="">
<el-option :label="item" :value="item" v-for="(item, index) in digitalInvoiceList[0]"
:key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="税率:" label-width="100px">
<el-select :disabled="title != '绑定数点票账号'" v-model="forms.taxAmount" style="width: 100%;"
placeholder="">
<el-option :label="item" :value="item" v-for="(item, index) in digitalInvoiceList[1]"
:key="index"></el-option>
</el-select>
</el-form-item>
<div style="text-align: right;" v-if="title == '绑定数点票账号'">联系区域经理开通</div>
<div style="text-align: center;cursor: pointer;" v-else @click="title = '绑定数点票账号'">更换绑定</div>
</el-form>
<span slot="footer" class="dialog-footer" v-if="title == '绑定数点票账号'">
<el-button @click="dialogVisible = false"> </el-button>
@@ -54,37 +52,63 @@
</template>
<script>
import { appCenterGet, getbinding } from "@/api/application";
import { appCenterGet, getbinding, getindustry, getdigitalInvoice } from "@/api/application";
export default {
data() {
return {
list: [],
dialogVisible: false,
forms: {},
forms: {
article: '餐饮',
sdType: ""
},
title: '绑定数点票账号',
digitalInvoiceList: [],
getindustryList: [],
}
},
mounted() {
this.appCenterGet()
this.getbinding()
this.getdigitalInvoice()
this.getindustry()
},
methods: {
changeEvent(d, names) {
console.log(d, names, '调试1')
console.log(this.forms, '调试2')
this.forms[names] = d
// this.forms.sdType = '啊可是觉得哈桑'
},
upPop() {
this.dialogVisible = true
},
sumbitEvent() {
if (this.forms.account) {
this.dialogVisible = false
this.getbinding(this.forms)
}
},
// 获取数电发票类型
async getdigitalInvoice() {
const res = await getdigitalInvoice()
this.digitalInvoiceList = res
},
// 获取项目分类
async getindustry(d = '餐饮') {
const res = await getindustry({ article: d })
this.getindustryList = res.list
},
// 跳转
to(item) {
localStorage.setItem('applocation', JSON.stringify(item))
this.$router.push({
name: item.absUrl
})
if (item.absUrl) {
this.$router.push({
name: item.absUrl
})
} else {
this.upPop()
}
},
// 获取应用列表
async appCenterGet() {
@@ -102,7 +126,11 @@ export default {
const res = await getbinding(d)
if (res) {
this.forms = res.store
this.$set(this.forms, 'article', res.article)
this.$set(this.forms, 'sdType', res.sdType)
this.$set(this.forms, 'taxAmount', res.taxAmount)
this.title = '数电票账号已绑定'
this.dialogVisible = false
} else {
this.title = '绑定数点票账号'
this.forms = {}