Commit b72764c4 by 胡锦波

1. 发票抬头添加

2. fix
parent 499d0ffd
...@@ -11949,9 +11949,9 @@ ...@@ -11949,9 +11949,9 @@
"dev": true "dev": true
}, },
"teammix-frame-element-vue": { "teammix-frame-element-vue": {
"version": "0.1.119", "version": "0.1.126",
"resolved": "http://npm.job.qinqinxiaobao.com/teammix-frame-element-vue/-/teammix-frame-element-vue-0.1.119.tgz", "resolved": "http://npm.job.qinqinxiaobao.com/teammix-frame-element-vue/-/teammix-frame-element-vue-0.1.126.tgz",
"integrity": "sha512-LCuVNtWhDu7HU5F8o/kK1GDoqjbxJeFgvK0OONVCnoCMvrA8FQJCsva9oKrRoxNNlDrgXtNxgjMOVmTVUw+Szw==", "integrity": "sha512-7xiYWhOmGPzlILRfyFG14Xt+dKvebJV4q1gI+8ZXuPiuixX50+Nt0lRe9v7bKo1dtwuF/NcBhniUsKkj1d+VmA==",
"requires": { "requires": {
"bankcardinfo": "^2.0.6", "bankcardinfo": "^2.0.6",
"vue": "^2.6.11", "vue": "^2.6.11",
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"element-ui": "^2.15.7", "element-ui": "^2.15.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"oidc-client": "^1.11.5", "oidc-client": "^1.11.5",
"teammix-frame-element-vue": "^0.1.119", "teammix-frame-element-vue": "^0.1.126",
"uniplat-sdk": "^0.1.350-private", "uniplat-sdk": "^0.1.350-private",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-class-component": "^7.2.3", "vue-class-component": "^7.2.3",
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"eslint-plugin-standard": "^4.0.0", "eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"typescript": "~4.1.5", "typescript": "~4.1.5",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11"
}, },
......
...@@ -110,7 +110,7 @@ export const enum ApplyOperateType { ...@@ -110,7 +110,7 @@ export const enum ApplyOperateType {
Reject = 'reject', Reject = 'reject',
} }
export const enum InvoiceType4Comapny { export const enum InvoiceType4Company {
CORP = 'CORP', CORP = 'CORP',
PERSONAL = 'PERSONAL' PERSONAL = 'PERSONAL'
} }
...@@ -120,9 +120,9 @@ export const enum InvoiceType4Person { ...@@ -120,9 +120,9 @@ export const enum InvoiceType4Person {
SMALL = 'SMALL' SMALL = 'SMALL'
} }
export const InvoiceType4ComapnyMap = new Map<InvoiceType4Comapny, string>([ export const InvoiceType4CompanyMap = new Map<InvoiceType4Company, string>([
[InvoiceType4Comapny.CORP, '企业'], [InvoiceType4Company.CORP, '企业'],
[InvoiceType4Comapny.PERSONAL, '个人'], [InvoiceType4Company.PERSONAL, '个人'],
]); ]);
export const InvoiceType4PersonMap = new Map<InvoiceType4Person, string>([ export const InvoiceType4PersonMap = new Map<InvoiceType4Person, string>([
...@@ -140,7 +140,7 @@ export interface InvoiceListItem { ...@@ -140,7 +140,7 @@ export interface InvoiceListItem {
no: string; no: string;
oid: string; oid: string;
phone: string; phone: string;
taxpayerNature: InvoiceType4Comapny; taxpayerNature: InvoiceType4Company;
type: InvoiceType4Person; type: InvoiceType4Person;
} }
...@@ -166,6 +166,24 @@ class SdkService extends SdkCoreService { ...@@ -166,6 +166,24 @@ class SdkService extends SdkCoreService {
const oid = EnterpriseHost.getOid(); const oid = EnterpriseHost.getOid();
return this.get<InvoiceListItem[]>(`/system/org/${oid}/invoice_title/list`); return this.get<InvoiceListItem[]>(`/system/org/${oid}/invoice_title/list`);
} }
public checkIdCanDelete(id: number) {
const oid = EnterpriseHost.getOid();
return this.post<{ errcode: string }>(`/general/project/welfare_v2/service/company_api/comInvoiceTitle_check_delete`, {
id: id,
oid: oid
});
}
public createInvoiceTitle(params: { [key: string]: any }) {
const oid = EnterpriseHost.getOid();
return this.post(`/system/org/${oid}/invoice_title/create`, params);
}
updateInvoiceTitle(id: string, params: { [key: string]: any }) {
const oid = EnterpriseHost.getOid();
return this.post(`/system/org/${oid}/invoice_title/${id}/update`, params);
}
} }
const sdkService = new SdkService(); const sdkService = new SdkService();
......
import { popupService } from "@/apppackage/element-upgrades/popup";
import { Component, Model, Watch, Vue } from "vue-property-decorator";
@Component({ components: {} })
export default class DepartmentActor extends Vue {
@Model('update')
protected value!: boolean;
protected readonly dialogWidth = 540 + 'px';
protected animationValue = false;
protected commit() {
popupService.noop();
}
protected close() {
this.$emit('update', false);
this.onClosing();
}
protected onClosing() {
popupService.noop();
setTimeout(() => {
this.animationValue = false;
}, 500);
}
@Watch("value")
private onValueChanged() {
if (this.value) {
this.onOpen();
this.animationValue = true;
}
}
protected onOpen() {
popupService.noop();
}
}
<template>
<transition name="el-drawer-fade">
<div class="com-drawer-container" v-if="remove">
<i class="drawer-close el-icon-close" @click="close"></i>
<input style="position: absolute; left: -1000px" type="text" />
<div class="drawer-title">
<slot name="header">
<div v-if="back" class="drawer-back" @click="goBack">
<i class="el-icon-arrow-left"></i>
返回
</div>
{{ title }}
</slot>
</div>
<el-scrollbar
class="scrolling-container"
:class="{ 'inner-hidden': !scroll }"
>
<div class="main-container" v-loading="loading">
<slot></slot>
</div>
</el-scrollbar>
<div class="footer" v-if="!readonly">
<slot name="footer">
<hrs-button @click="close">取消</hrs-button>
<hrs-button @click="confirm" type="primary">{{
confirmText
}}</hrs-button>
</slot>
</div>
</div>
</transition>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
@Component({ components: {} })
export default class DrawerContent extends Vue {
@Prop({ default: "默认标题" })
private title!: string;
@Prop()
private back!: boolean;
@Prop()
private loading!: boolean;
@Prop({ default: false })
private look!: boolean;
@Prop({ default: "确认" })
private confirmText!: string;
@Prop({ default: true })
private scroll!: boolean;
@Prop({ default: true })
private remove!: boolean;
@Prop()
private readonly!: boolean;
private goBack() {
this.$emit("back");
}
private confirm() {
this.$emit("confirm");
}
private close() {
this.$emit("close");
}
}
</script>
<style lang="less">
@import "~@/css/variables.less";
.com-drawer-container {
min-width: 500px;
display: flex;
flex-direction: column;
height: 100%;
color: @benefits-primary-header;
.header{
color: #666;
}
.main-container {
flex: 1;
overflow: auto;
padding: 0 50px;
.el-date-editor {
width: 100%;
}
}
.footer {
flex-shrink: 0;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #f0f0f0;
padding: 15px 0;
.el-button + .el-button{
margin-left: 20px;
}
}
}
.com-drawer-container {
position: relative;
.drawer-close {
position: absolute;
right: 20px;
top: 20px;
font-size: 20px;
color: #000;
cursor: pointer;
z-index: 1;
}
.drawer-title {
width: 100%;
margin-top: 32px;
margin-bottom: 30px;
text-align: center;
font-size: 18px;
font-weight: 400;
color: @benefits-primary-header;
line-height: 24px;
position: relative;
.drawer-back {
font-size: 14px;
color: #999999;
line-height: 24px;
position: absolute;
left: 30px;
cursor: pointer;
user-select: none;
}
}
.form-item {
margin-bottom: 30px;
.form-label {
font-size: 14px;
color: @benefits-primary-header;
line-height: 24px;
margin-bottom: 10px;
.sub-title{
color: @benefits-label;
}
}
textarea {
height: 195px;
}
}
.scrolling-container {
height: 100%;
> .el-scrollbar__wrap {
overflow-x: hidden;
}
&.inner-hidden {
> .el-scrollbar__wrap {
> .el-scrollbar__view {
max-height: 100%;
height: 100%;
.main-container {
overflow: hidden;
max-height: 100%;
height: 100%;
}
}
}
}
}
&,
.drawer-component-inner-content {
.drawer-content-item {
width: 100%;
margin-bottom: 30px;
.item-label {
font-size: 14px;
color: #999999;
line-height: 24px;
margin-bottom: 10px;
}
}
}
}
.com-drawer-container {
.com-max-input {
width: 100%;
}
.com-date-input {
width: 361px;
}
.com-bigger-input {
width: 365px;
}
.com-smaller-input {
width: 238px;
}
.com-number-input {
width: 217px;
}
.com-mini-input {
width: 117px;
}
.com-button {
background: #fafafa !important;
border: 1px solid #fafafa !important;
&:hover {
color: @mainColor !important;
background: #ffffff !important;
border: 1px solid @mainColor !important;
}
}
.mr19 {
margin-right: 19px;
}
}
</style>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
private headerOption: TeammixEnterpriseSelectorOption | null = null; private headerOption: TeammixEnterpriseSelectorOption | null = null;
mounted() { mounted() {
UserController.tryLogin();
this.buildPublicHeader(); this.buildPublicHeader();
} }
...@@ -66,6 +67,7 @@ ...@@ -66,6 +67,7 @@
selectedEnterpriseId: comid, selectedEnterpriseId: comid,
onlyShowOwner: true, onlyShowOwner: true,
autoSelectEnterprise4One: true, autoSelectEnterprise4One: true,
isSkipRealNameVertify: true,
offset: 64, offset: 64,
disableMoreService: true, disableMoreService: true,
onEnterpriseChanged: this.onEnterpriseChanged as any, onEnterpriseChanged: this.onEnterpriseChanged as any,
......
...@@ -90,19 +90,12 @@ ...@@ -90,19 +90,12 @@
>通过</mg-button >通过</mg-button
> >
<mg-button <mg-button
class="table-operation"
@click="onReject(scope.row.id)" @click="onReject(scope.row.id)"
v-if="scope.row.status === 0" v-if="scope.row.status === 0"
>拒绝</mg-button >拒绝</mg-button
> >
<span v-if="scope.row.status === 1"> <span v-if="scope.row.status === 1"> 已通过 </span>
已通过 <span v-if="scope.row.status === -1"> 已拒绝 </span>
<!-- <i class="el-icon-info"></i> -->
</span>
<span v-if="scope.row.status === -1">
已拒绝
<!-- <i class="el-icon-info"></i> -->
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="title"> <div class="title">
发票抬头 <span class="total">({{ total }})</span> 发票抬头 <span class="total">({{ total }})</span>
</div> </div>
<mg-button type="primary">添加发票抬头</mg-button> <mg-button type="primary" @click="goAdd">添加发票抬头</mg-button>
</div> </div>
<div class="table-container"> <div class="table-container">
<el-table <el-table
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
stripe stripe
class="hrs-table" class="hrs-table"
> >
<el-table-column label="名称" align="center"> <el-table-column label="名称" align="left">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.name">{{ scope.row.name }}</span> <span v-if="scope.row.name">{{ scope.row.name }}</span>
<span v-else>-</span> <span v-else>-</span>
...@@ -30,84 +30,96 @@ ...@@ -30,84 +30,96 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型" align="center"> <el-table-column label="纳税人性质" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type">{{ <span v-if="scope.row.taxpayerNature">{{
formatType(scope.row.type) formatTypeV2(scope.row.taxpayerNature)
}}</span> }}</span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="纳税人性质" align="center"> <el-table-column label="是否默认" align="center" width="160px">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.taxpayerNature">{{ <span>{{ scope.row.default ? "是" : "否" }}</span>
formatTypeV2(scope.row.taxpayerNature)
}}</span>
<span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="active" label="操作" align="center">
<el-table-column
prop="active"
label="操作"
align="center"
width="160px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="operated"> <span class="operated">
<mg-button <el-button
type="text" type="text"
class="primary detail" class="primary"
size="small" size="small"
@click="showData(scope.row, 'detail')" @click="showData(scope.row, 'detail')"
> >
<span class="text-blue"> 详情 </span> <span> 详情 </span>
</mg-button> </el-button>
<mg-button <el-button
type="text" type="text"
class="primary edit"
size="small" size="small"
@click="showData(scope.row, 'edit')" class="cancel"
@click="goDelete(scope.row.id)"
> >
编辑 <span> 删除 </span>
</mg-button> </el-button>
<mg-button </span>
type="text"
size="small"
class="cancel delete"
@click="goDelete(scope.row.id, scope.row.oid)"
>
<span class="text-orange"> 删除 </span>
</mg-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination
class="pagination-content hrs-pager"
layout="prev, pager, next"
:current-page="page"
:page-size="pageSize"
:total="total"
:hide-on-single-page="true"
@current-change="changePages"
></el-pagination>
</div> </div>
<DialogInvoiceTitleDetail
v-model="isShowDetail"
@confirm="onConfirm"
@close="onClose"
@updateType="updateType"
:type="alertType"
:defaultData="defaultData"
></DialogInvoiceTitleDetail>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { import {
InvoiceListItem, InvoiceListItem,
InvoiceType4Comapny, InvoiceType4Company,
InvoiceType4ComapnyMap, InvoiceType4CompanyMap,
InvoiceType4Person, InvoiceType4Person,
InvoiceType4PersonMap, InvoiceType4PersonMap,
sdkService, sdkService,
} from "@/api/sdk-service"; } from "@/api/sdk-service";
import { popupService } from "@/apppackage/element-upgrades/popup";
import { Component, Vue } from "vue-property-decorator"; import { Component, Vue } from "vue-property-decorator";
import DialogInvoiceTitleDetail, {
DialogType,
} from "./dialog-invoice-title-detail.vue";
@Component({ components: {} }) @Component({ components: { DialogInvoiceTitleDetail } })
export default class InvoiceTitles extends Vue { export default class InvoiceTitles extends Vue {
private total = 0;
private tableData: InvoiceListItem[] = []; private tableData: InvoiceListItem[] = [];
private alertType = DialogType.Detail;
private isShowDetail = false;
private defaultData: InvoiceListItem | { [key: string]: any } = {};
private type: any = { private page = 1;
CORP: "企业", private pageSize = 10;
PERSONAL: "个人", private total = 0;
};
private typeV2: any = {
GENERAL: "一般纳税人",
SMALL: "小规模纳税人",
};
created() { created() {
this.getList(); this.getList();
...@@ -120,20 +132,81 @@ ...@@ -120,20 +132,81 @@
}); });
} }
private formatType(type: InvoiceType4Comapny) { changePages(index: number) {
return InvoiceType4ComapnyMap.get(type); this.page = index;
this.getList();
}
private formatType(type: InvoiceType4Company) {
return InvoiceType4CompanyMap.get(type);
} }
private formatTypeV2(type: InvoiceType4Person) { private formatTypeV2(type: InvoiceType4Person) {
return InvoiceType4PersonMap.get(type); return InvoiceType4PersonMap.get(type);
} }
private showData() { private goAdd() {
return ""; this.alertType = DialogType.Add;
this.defaultData = {};
this.isShowDetail = true;
}
private showData(data: InvoiceListItem, type: DialogType) {
this.alertType = type;
this.defaultData = data;
this.isShowDetail = true;
}
private goDelete(id: number) {
this.$notice({
currentTitle: "提示",
message: "是否永久删除当前发票抬头?",
confirmText: "确定",
cancelText: "取消",
confirm: () => {
this.onDelete(id);
},
});
}
private onDelete(id: number) {
sdkService
.checkIdCanDelete(id)
.then((res: any) => {
if ([101, "101"].includes(res.errcode)) {
this.$notice({
currentTitle: "提示",
message:
"当前发票已被福利宝业务设为发票抬头,不能删除!",
confirmText: "确定",
confirm: () => {
this.onDelete(id);
},
});
}
popupService.toast.success("删除成功");
this.getList();
})
.catch((err) => {
popupService.toast.error(err.msg);
});
}
private onConfirm(type: DialogType) {
if (type === "add") {
this.page = 1;
}
this.defaultData = {};
this.getList();
}
private onClose() {
this.isShowDetail = false;
this.defaultData = {};
} }
private goDelete() { private updateType(type: DialogType) {
return ""; this.alertType = type;
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment