Commit b72764c4 by 胡锦波

1. 发票抬头添加

2. fix
parent 499d0ffd
......@@ -11949,9 +11949,9 @@
"dev": true
},
"teammix-frame-element-vue": {
"version": "0.1.119",
"resolved": "http://npm.job.qinqinxiaobao.com/teammix-frame-element-vue/-/teammix-frame-element-vue-0.1.119.tgz",
"integrity": "sha512-LCuVNtWhDu7HU5F8o/kK1GDoqjbxJeFgvK0OONVCnoCMvrA8FQJCsva9oKrRoxNNlDrgXtNxgjMOVmTVUw+Szw==",
"version": "0.1.126",
"resolved": "http://npm.job.qinqinxiaobao.com/teammix-frame-element-vue/-/teammix-frame-element-vue-0.1.126.tgz",
"integrity": "sha512-7xiYWhOmGPzlILRfyFG14Xt+dKvebJV4q1gI+8ZXuPiuixX50+Nt0lRe9v7bKo1dtwuF/NcBhniUsKkj1d+VmA==",
"requires": {
"bankcardinfo": "^2.0.6",
"vue": "^2.6.11",
......
......@@ -14,7 +14,7 @@
"element-ui": "^2.15.7",
"lodash": "^4.17.21",
"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",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
......
......@@ -110,7 +110,7 @@ export const enum ApplyOperateType {
Reject = 'reject',
}
export const enum InvoiceType4Comapny {
export const enum InvoiceType4Company {
CORP = 'CORP',
PERSONAL = 'PERSONAL'
}
......@@ -120,9 +120,9 @@ export const enum InvoiceType4Person {
SMALL = 'SMALL'
}
export const InvoiceType4ComapnyMap = new Map<InvoiceType4Comapny, string>([
[InvoiceType4Comapny.CORP, '企业'],
[InvoiceType4Comapny.PERSONAL, '个人'],
export const InvoiceType4CompanyMap = new Map<InvoiceType4Company, string>([
[InvoiceType4Company.CORP, '企业'],
[InvoiceType4Company.PERSONAL, '个人'],
]);
export const InvoiceType4PersonMap = new Map<InvoiceType4Person, string>([
......@@ -140,7 +140,7 @@ export interface InvoiceListItem {
no: string;
oid: string;
phone: string;
taxpayerNature: InvoiceType4Comapny;
taxpayerNature: InvoiceType4Company;
type: InvoiceType4Person;
}
......@@ -166,6 +166,24 @@ class SdkService extends SdkCoreService {
const oid = EnterpriseHost.getOid();
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();
......
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 @@
private headerOption: TeammixEnterpriseSelectorOption | null = null;
mounted() {
UserController.tryLogin();
this.buildPublicHeader();
}
......@@ -66,6 +67,7 @@
selectedEnterpriseId: comid,
onlyShowOwner: true,
autoSelectEnterprise4One: true,
isSkipRealNameVertify: true,
offset: 64,
disableMoreService: true,
onEnterpriseChanged: this.onEnterpriseChanged as any,
......
......@@ -90,19 +90,12 @@
>通过</mg-button
>
<mg-button
class="table-operation"
@click="onReject(scope.row.id)"
v-if="scope.row.status === 0"
>拒绝</mg-button
>
<span v-if="scope.row.status === 1">
已通过
<!-- <i class="el-icon-info"></i> -->
</span>
<span v-if="scope.row.status === -1">
已拒绝
<!-- <i class="el-icon-info"></i> -->
</span>
<span v-if="scope.row.status === 1"> 已通过 </span>
<span v-if="scope.row.status === -1"> 已拒绝 </span>
</template>
</el-table-column>
</el-table>
......
......@@ -4,7 +4,7 @@
<div class="title">
发票抬头 <span class="total">({{ total }})</span>
</div>
<mg-button type="primary">添加发票抬头</mg-button>
<mg-button type="primary" @click="goAdd">添加发票抬头</mg-button>
</div>
<div class="table-container">
<el-table
......@@ -15,7 +15,7 @@
stripe
class="hrs-table"
>
<el-table-column label="名称" align="center">
<el-table-column label="名称" align="left">
<template slot-scope="scope">
<span v-if="scope.row.name">{{ scope.row.name }}</span>
<span v-else>-</span>
......@@ -30,84 +30,96 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
<el-table-column label="纳税人性质" align="center">
<template slot-scope="scope">
<span v-if="scope.row.type">{{
formatType(scope.row.type)
<span v-if="scope.row.taxpayerNature">{{
formatTypeV2(scope.row.taxpayerNature)
}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="纳税人性质" align="center">
<el-table-column label="是否默认" align="center" width="160px">
<template slot-scope="scope">
<span v-if="scope.row.taxpayerNature">{{
formatTypeV2(scope.row.taxpayerNature)
}}</span>
<span v-else>-</span>
<span>{{ scope.row.default ? "是" : "否" }}</span>
</template>
</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">
<div class="operated">
<mg-button
<span class="operated">
<el-button
type="text"
class="primary detail"
class="primary"
size="small"
@click="showData(scope.row, 'detail')"
>
<span class="text-blue"> 详情 </span>
</mg-button>
<mg-button
<span> 详情 </span>
</el-button>
<el-button
type="text"
class="primary edit"
size="small"
@click="showData(scope.row, 'edit')"
class="cancel"
@click="goDelete(scope.row.id)"
>
编辑
</mg-button>
<mg-button
type="text"
size="small"
class="cancel delete"
@click="goDelete(scope.row.id, scope.row.oid)"
>
<span class="text-orange"> 删除 </span>
</mg-button>
</div>
<span> 删除 </span>
</el-button>
</span>
</template>
</el-table-column>
</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>
<DialogInvoiceTitleDetail
v-model="isShowDetail"
@confirm="onConfirm"
@close="onClose"
@updateType="updateType"
:type="alertType"
:defaultData="defaultData"
></DialogInvoiceTitleDetail>
</div>
</template>
<script lang="ts">
import {
InvoiceListItem,
InvoiceType4Comapny,
InvoiceType4ComapnyMap,
InvoiceType4Company,
InvoiceType4CompanyMap,
InvoiceType4Person,
InvoiceType4PersonMap,
sdkService,
} from "@/api/sdk-service";
import { popupService } from "@/apppackage/element-upgrades/popup";
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 {
private total = 0;
private tableData: InvoiceListItem[] = [];
private alertType = DialogType.Detail;
private isShowDetail = false;
private defaultData: InvoiceListItem | { [key: string]: any } = {};
private type: any = {
CORP: "企业",
PERSONAL: "个人",
};
private typeV2: any = {
GENERAL: "一般纳税人",
SMALL: "小规模纳税人",
};
private page = 1;
private pageSize = 10;
private total = 0;
created() {
this.getList();
......@@ -120,20 +132,81 @@
});
}
private formatType(type: InvoiceType4Comapny) {
return InvoiceType4ComapnyMap.get(type);
changePages(index: number) {
this.page = index;
this.getList();
}
private formatType(type: InvoiceType4Company) {
return InvoiceType4CompanyMap.get(type);
}
private formatTypeV2(type: InvoiceType4Person) {
return InvoiceType4PersonMap.get(type);
}
private showData() {
return "";
private goAdd() {
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() {
return "";
private updateType(type: DialogType) {
this.alertType = type;
}
}
</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