源文件
This commit is contained in:
142
pages/plugins/invoice/invoice-detail/invoice-detail.vue
Normal file
142
pages/plugins/invoice/invoice-detail/invoice-detail.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<block v-if="detail != null">
|
||||
<!-- 申请信息 -->
|
||||
<component-panel-content :propData="detail" :propDataField="field_list" propExcludeField="express_name,express_number" :propTitle="$t('invoice-detail.invoice-detail.s70kj4')"></component-panel-content>
|
||||
|
||||
<!-- 快递信息 -->
|
||||
<block v-if="detail.status == 2 && detail.invoice_type != 0">
|
||||
<component-panel-content :propData="detail" :propDataField="field_list" propAppointField="express_name,express_number" :propTitle="$t('user-order-detail.user-order-detail.0876xf')"></component-panel-content>
|
||||
</block>
|
||||
|
||||
<!-- 电子发票 -->
|
||||
<block v-if="detail.status == 2 && detail.invoice_type == 0 && (detail.electronic_invoice || null) != null" class="panel-item padding-main border-radius-main bg-white spacing-mb">
|
||||
<component-panel-content :propTitle="$t('invoice-detail.invoice-detail.1s2f0g')">
|
||||
<view v-for="(item, index) in detail.electronic_invoice" :key="index" class="item br-b-f5 oh padding-vertical-main">
|
||||
<view class="content fl" @tap="electronic_invoice_event" :data-value="item.url">{{ item.title }}</view>
|
||||
</view>
|
||||
<view class="cr-red padding-top-main">{{$t('invoice-detail.invoice-detail.4tu3v3')}}</view>
|
||||
</component-panel-content>
|
||||
</block>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
import componentPanelContent from "@/components/panel-content/panel-content";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: null,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
field_list: [],
|
||||
detail: null
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPanelContent
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("detail", "user", "invoice"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.params.id,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
detail: data.data,
|
||||
field_list: data.field_list || [],
|
||||
data_list_loding_status: 3,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: "",
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, "init")) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 电子发票复制
|
||||
electronic_invoice_event(e) {
|
||||
app.globalData.text_copy_event(e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
438
pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.vue
Normal file
438
pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo.vue
Normal file
@@ -0,0 +1,438 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view class="page-bottom-fixed">
|
||||
<view v-if="save_base_data != null && save_base_data.total_price > 0">
|
||||
<form @submit="form_submit" class="form-container">
|
||||
<view class="padding-main oh">
|
||||
<view class="padding-main border-radius-main bg-white spacing-mb">
|
||||
<view>
|
||||
<text class="cr-base margin-right-sm">{{$t('invoice.invoice.fvuc4p')}}</text>
|
||||
<text class="cr-main text-size fw-b">{{ save_base_data.total_price }}</text>
|
||||
</view>
|
||||
<view class="cr-base margin-top-sm">{{ save_base_data.business_desc }}</view>
|
||||
</view>
|
||||
|
||||
<view class="border-radius-main bg-white oh spacing-mb">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice.invoice.j04kjc')}}<text class="form-group-tips-must">*</text></view>
|
||||
<picker name="invoice_type" @change="form_invoice_type_event" :value="form_invoice_type_index" :range="can_invoice_type_list" range-key="name">
|
||||
<view :class="'picker ' + (can_invoice_type_list[form_invoice_type_index] == undefined ? 'cr-grey' : 'cr-base') + ' arrow-right'">
|
||||
{{ can_invoice_type_list[form_invoice_type_index] == undefined ? $t('invoice-saveinfo.invoice-saveinfo.t3i3e3') : can_invoice_type_list[form_invoice_type_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice.invoice.hoenw8')}}<text class="form-group-tips-must">*</text></view>
|
||||
<picker name="apply_type" @change="form_apply_type_event" :disabled="form_apply_type_disabled" :value="form_apply_type_index" :range="apply_type_list" range-key="name">
|
||||
<view :class="'picker ' + (apply_type_list[form_apply_type_index] == undefined ? 'cr-grey' : 'cr-base') + ' arrow-right'">
|
||||
{{ apply_type_list[form_apply_type_index] == undefined ? $t('invoice-saveinfo.invoice-saveinfo.k31t2s') : apply_type_list[form_apply_type_index]['name'] }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view v-if="invoice_content_list.length > 0" class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.p73963')}}<text class="form-group-tips-must">*</text></view>
|
||||
<picker name="invoice_content" @change="form_invoice_content_event" :value="form_invoice_content_index" :range="invoice_content_list">
|
||||
<view :class="'picker ' + (invoice_content_list[form_invoice_content_index] == undefined ? 'cr-grey' : 'cr-base') + ' arrow-right'">
|
||||
{{ invoice_content_list[form_invoice_content_index] == undefined ? $t('invoice-saveinfo.invoice-saveinfo.i73t3c') : invoice_content_list[form_invoice_content_index] }}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice.invoice.y724c7')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="invoice_title" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.x461e0')" maxlength="200" :value="data.invoice_title || ''" />
|
||||
</view>
|
||||
|
||||
<!-- 企业信息 -->
|
||||
<view v-if="company_container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-saveinfo.invoice-saveinfo.x8hhiv')}}<text class="form-group-tips-must">*</text> </view>
|
||||
<input type="text" name="invoice_code" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.924cag')" maxlength="160" :value="data.invoice_code || ''" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 企业专票信息 -->
|
||||
<view v-if="company_special_container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.41qbu6')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="invoice_bank" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.ymvw6b')" maxlength="200" :value="data.invoice_bank || ''" />
|
||||
</view>
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.3a9459')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="invoice_account" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.664qc7')" maxlength="160" :value="data.invoice_account || ''" />
|
||||
</view>
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.2g7t23')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="invoice_tel" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.bbseo1')" maxlength="15" :value="data.invoice_tel || ''" />
|
||||
</view>
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.6k6sov')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="invoice_address" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.85735j')" maxlength="230" :value="data.invoice_address || ''" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 收件人信息 -->
|
||||
<view v-if="addressee_container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.7159m0')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="name" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.gsc7dy')" maxlength="30" :value="data.name || ''" />
|
||||
</view>
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.f2222p')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="tel" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.bp8822')" maxlength="15" :value="data.tel || ''" />
|
||||
</view>
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('invoice-detail.invoice-detail.q8l3zj')}}<text class="form-group-tips-must">*</text></view>
|
||||
<input type="text" name="address" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.u7h724')" maxlength="230" :value="data.address || ''" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 电子邮箱信息 -->
|
||||
<view v-if="email_container">
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('login.login.db1rf4')}}</view>
|
||||
<input type="text" name="email" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.d3qbe1')" maxlength="60" :value="data.email || ''" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="form-gorup">
|
||||
<view class="form-gorup-title">{{$t('common.note')}}</view>
|
||||
<input type="text" name="user_note" placeholder-class="cr-grey" class="cr-base" :placeholder="$t('invoice-saveinfo.invoice-saveinfo.vaw647')" maxlength="60" :value="data.user_note || ''" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-main br-main cr-white round text-size" type="default" form-type="submit" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">{{$t('form.form.4yd066')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
params: {},
|
||||
form_submit_loading: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
bottom_fixed_style: '',
|
||||
data_base: null,
|
||||
apply_type_list: [],
|
||||
can_invoice_type_list: [],
|
||||
invoice_content_list: [],
|
||||
save_base_data: null,
|
||||
data: {},
|
||||
form_invoice_type_index: 0,
|
||||
form_apply_type_index: 0,
|
||||
form_invoice_content_index: 0,
|
||||
form_apply_type_disabled: false,
|
||||
company_container: false,
|
||||
company_special_container: false,
|
||||
addressee_container: false,
|
||||
email_container: true,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params || {},
|
||||
});
|
||||
|
||||
// 标题设置
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$t('invoice-saveinfo.invoice-saveinfo.89815t') + ((this.params.id || null) == null ? this.$t('invoice-saveinfo.invoice-saveinfo.004t56') : this.$t('common.edit')),
|
||||
});
|
||||
|
||||
// 加载数据
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.init();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
this.setData({
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('saveinfo', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {...this.params, ...{lang_can_key: 'apply_type_list,can_invoice_type_list'}},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
var default_data = ((data.data || null) == null || data.data.length == 0) ? null : data.data;
|
||||
var upd_data = {
|
||||
data_base: data.base || null,
|
||||
apply_type_list: data.apply_type_list || [],
|
||||
can_invoice_type_list: data.can_invoice_type_list || [],
|
||||
invoice_content_list: data.invoice_content_list || [],
|
||||
save_base_data: data.save_base_data,
|
||||
data: default_data || {},
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
data_list_loding_msg: data.save_base_data.total_price <= 0 ? this.$t('invoice-saveinfo.invoice-saveinfo.dl11n1') : '',
|
||||
};
|
||||
// 类型数据处理
|
||||
if (default_data != null) {
|
||||
var invoice_content_index = upd_data.invoice_content_list.indexOf(default_data.invoice_content);
|
||||
upd_data['form_invoice_type_index'] = default_data.invoice_type;
|
||||
upd_data['form_apply_type_index'] = default_data.apply_type;
|
||||
upd_data['form_invoice_content_index'] = invoice_content_index == -1 ? 0 : invoice_content_index;
|
||||
upd_data['form_apply_type_disabled'] = default_data.apply_type == 1;
|
||||
}
|
||||
this.setData(upd_data);
|
||||
|
||||
// 数据容器处理
|
||||
this.invoice_container_handle();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'init')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 发票类型事件
|
||||
form_invoice_type_event(e) {
|
||||
this.setData({
|
||||
form_invoice_type_index: e.detail.value,
|
||||
});
|
||||
this.invoice_container_handle();
|
||||
},
|
||||
|
||||
// 发票类型事件
|
||||
form_apply_type_event(e) {
|
||||
this.setData({
|
||||
form_apply_type_index: e.detail.value,
|
||||
});
|
||||
this.invoice_container_handle();
|
||||
},
|
||||
|
||||
// 发票内容事件
|
||||
form_invoice_content_event(e) {
|
||||
this.setData({
|
||||
form_invoice_content_index: e.detail.value,
|
||||
});
|
||||
},
|
||||
|
||||
// 容器显隐处理
|
||||
invoice_container_handle() {
|
||||
// 发票类型
|
||||
var invoice_type = this.can_invoice_type_list[this.form_invoice_type_index]['id'];
|
||||
if (invoice_type == 2 || invoice_type == 3) {
|
||||
// 选择专票的时候申请类型必须是企业
|
||||
this.setData({
|
||||
form_apply_type_index: 1,
|
||||
form_apply_type_disabled: true,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
form_apply_type_disabled: false,
|
||||
});
|
||||
}
|
||||
|
||||
// 申请类型
|
||||
switch (invoice_type) {
|
||||
// 增值税普通电子发票
|
||||
case 0:
|
||||
this.setData({
|
||||
company_special_container: false,
|
||||
addressee_container: false,
|
||||
email_container: true,
|
||||
});
|
||||
break;
|
||||
// 增值税普通纸质发票
|
||||
case 1:
|
||||
this.setData({
|
||||
company_special_container: false,
|
||||
addressee_container: true,
|
||||
email_container: false,
|
||||
});
|
||||
break;
|
||||
// 增值税专用纸质发票
|
||||
case 2:
|
||||
this.setData({
|
||||
company_container: true,
|
||||
company_special_container: true,
|
||||
addressee_container: true,
|
||||
email_container: false,
|
||||
});
|
||||
break;
|
||||
|
||||
// 增值税专用纸质发票
|
||||
case 3:
|
||||
this.setData({
|
||||
company_container: true,
|
||||
company_special_container: true,
|
||||
addressee_container: false,
|
||||
email_container: true,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
// 增值税专用纸质发票情况下个人类型处理
|
||||
if (invoice_type == 0 || invoice_type == 1) {
|
||||
var apply_type = this.apply_type_list[this.form_apply_type_index]['id'];
|
||||
this.setData({
|
||||
company_container: apply_type != 0,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 表单提交
|
||||
form_submit(e) {
|
||||
var data = e.detail.value;
|
||||
if ((this.data || null) == null || (this.data.id || null) == null) {
|
||||
data['ids'] = this.params.ids || '';
|
||||
data['type'] = this.params.type || '';
|
||||
} else {
|
||||
data['id'] = this.data.id;
|
||||
}
|
||||
|
||||
// 数据验证
|
||||
var validation = [
|
||||
{ fields: 'invoice_type', msg: this.$t('invoice-saveinfo.invoice-saveinfo.t3i3e3'), is_can_zero: 1 },
|
||||
{ fields: 'apply_type', msg: this.$t('invoice-saveinfo.invoice-saveinfo.k31t2s'), is_can_zero: 1 },
|
||||
{ fields: 'invoice_title', msg: this.$t('invoice-saveinfo.invoice-saveinfo.r13p43') },
|
||||
];
|
||||
if (app.globalData.fields_check(data, validation)) {
|
||||
var invoice_type = this.can_invoice_type_list[this.form_invoice_type_index]['id'];
|
||||
var apply_type = this.apply_type_list[this.form_apply_type_index]['id'];
|
||||
if (apply_type == 1) {
|
||||
validation.push({ fields: 'invoice_code', msg: this.$t('invoice-saveinfo.invoice-saveinfo.ws4wbb') });
|
||||
}
|
||||
if (invoice_type == 2) {
|
||||
validation.push({ fields: 'invoice_bank', msg: this.$t('invoice-saveinfo.invoice-saveinfo.87itn8') });
|
||||
validation.push({ fields: 'invoice_account', msg: this.$t('invoice-saveinfo.invoice-saveinfo.01lw93') });
|
||||
validation.push({ fields: 'invoice_tel', msg: this.$t('invoice-saveinfo.invoice-saveinfo.414ihr') });
|
||||
validation.push({ fields: 'invoice_address', msg: this.$t('invoice-saveinfo.invoice-saveinfo.g3yh32') });
|
||||
}
|
||||
|
||||
if (invoice_type == 1 || invoice_type == 2) {
|
||||
validation.push({ fields: 'name', msg: this.$t('invoice-saveinfo.invoice-saveinfo.4xy6xi') });
|
||||
validation.push({ fields: 'tel', msg: this.$t('invoice-saveinfo.invoice-saveinfo.quhnk0') });
|
||||
validation.push({ fields: 'address', msg: this.$t('invoice-saveinfo.invoice-saveinfo.kq77u3') });
|
||||
}
|
||||
|
||||
if (app.globalData.fields_check(data, validation)) {
|
||||
// 发票类型
|
||||
data['invoice_type'] = this.can_invoice_type_list[this.form_invoice_type_index]['id'];
|
||||
|
||||
// 发票内容
|
||||
if (this.invoice_content_list.length > 0 && this.invoice_content_list[this.form_invoice_content_index] != undefined) {
|
||||
data['invoice_content'] = this.invoice_content_list[this.form_invoice_content_index];
|
||||
}
|
||||
uni.showLoading({
|
||||
title: this.$t('buy.buy.r79t77'),
|
||||
});
|
||||
this.setData({
|
||||
form_submit_loading: true,
|
||||
});
|
||||
|
||||
// 网络请求
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('save', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
var is_to = (this.params || null) != null && (this.params.is_redirect || 0) == 1;
|
||||
setTimeout(function () {
|
||||
// 是否关闭页面进入我的发票、适合从订单开票中过来提交成功直接进入我的发票列表
|
||||
if (is_to) {
|
||||
app.globalData.url_open('/pages/plugins/invoice/invoice/invoice', true);
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}, 2000);
|
||||
} else {
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data)) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
} else {
|
||||
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
this.setData({
|
||||
form_submit_loading: false,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
15
pages/plugins/invoice/invoice/invoice.css
Normal file
15
pages/plugins/invoice/invoice/invoice.css
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* 导航
|
||||
*/
|
||||
.scroll-box-ece-nav.top-notice {
|
||||
height: calc(100vh - 154rpx);
|
||||
}
|
||||
|
||||
/*
|
||||
* 发票内容
|
||||
*/
|
||||
.item-operation .btn {
|
||||
padding: 0 48rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
358
pages/plugins/invoice/invoice/invoice.vue
Normal file
358
pages/plugins/invoice/invoice/invoice.vue
Normal file
@@ -0,0 +1,358 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 公告 -->
|
||||
<view v-if="(data_base || null) != null && (data_base.invoice_desc || null) != null && data_base.invoice_desc.length > 0" class="padding-horizontal-main padding-vertical-sm bg-white">
|
||||
<uni-notice-bar class="padding-0 margin-0" show-icon scrollable :text="data_base.invoice_desc.join('')" background-color="transparent" color="#666" />
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view v-if="nav_status_list.length > 0" class="nav-base bg-white flex-row jc-sa align-c">
|
||||
<block v-for="(item, index) in nav_status_list" :key="index">
|
||||
<view :class="'item tc ' + (nav_status_index == index ? 'cr-main nav-active-line' : '')" :data-index="index" @tap="nav_event">{{ item.name }}</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<scroll-view :scroll-y="true" :class="'scroll-box-ece-nav '+((data_base || null) != null && (data_base.invoice_desc || null) != null && data_base.invoice_desc.length > 0 ? 'top-notice' : '')" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="page-bottom-fixed">
|
||||
<view v-if="data_list.length > 0" class="data-list padding-horizontal-main padding-top-main">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main flex-row jc-sb align-c">
|
||||
<text class="cr-grey-9">{{ item.add_time }}</text>
|
||||
<text class="cr-black" :class="item.status == 0 || item.status == 1 ? 'cr-black' : item.status == 2 ? 'cr-grey-c' : 'cr-red'">{{ item.status_name }}</text>
|
||||
</view>
|
||||
<view :data-value="'/pages/plugins/invoice/invoice-detail/invoice-detail?id=' + item.id" @tap="url_event" class="content margin-top-main cp">
|
||||
<component-panel-content :propData="item" :propDataField="field_list" propIsItemShowMax="6" propExcludeField="add_time,status_name" :propIsTerse="true"></component-panel-content>
|
||||
</view>
|
||||
<!-- 0待审核、1待开票、2已开票、3已拒绝, 4已关闭) -->
|
||||
<view v-if="item.status == 0 || item.status == 3 || item.status == 4" class="item-operation tr margin-top-main">
|
||||
<button class="btn round br-grey-9 bg-white text-size-md" type="default" size="mini" @tap="delete_event" :data-value="item.id" :data-index="index" hover-class="none">{{$t('common.del')}}</button>
|
||||
<button v-if="item.status == 0 || item.status == 3" class="btn round cr-main br-main bg-white text-size-md" type="default" size="mini" :data-value="'/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?id='+item.id" @tap="url_event" hover-class="none">{{$t('common.edit')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
<view v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</view>
|
||||
|
||||
<!-- 添加发票 -->
|
||||
<view v-if="(data_base.is_invoice_order || 0) == 1 || (data_base.is_invoice_recharge || 0) == 1" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude flex-row gap-10">
|
||||
<button v-if="(data_base.is_invoice_order || 0) == 1" class="item round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none" data-value="/pages/plugins/invoice/order/order" @tap="url_event">{{$t('invoice.invoice.p3dmd2')}}</button>
|
||||
<button v-if="(data_base.is_invoice_recharge || 0) == 1" class="item round cr-main bg-white br-main text-size wh-auto" type="default" hover-class="none" data-value="/pages/plugins/invoice/recharge/recharge" @tap="url_event">{{$t('invoice.invoice.bh8yt3')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentPanelContent from "@/components/panel-content/panel-content";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
field_list: [],
|
||||
data_base: null,
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
nav_status_list: [],
|
||||
nav_status_index: 0,
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPanelContent
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 是否指定状态
|
||||
var nav_status_index = 0;
|
||||
if ((params.status || null) != null) {
|
||||
for (var i in this.nav_status_list) {
|
||||
if (this.nav_status_list[i]['id'] == params.status) {
|
||||
nav_status_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
params: params,
|
||||
nav_status_index: nav_status_index,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 初始化配置
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化
|
||||
init(e) {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data_base();
|
||||
}
|
||||
},
|
||||
// 获取公共数据
|
||||
get_data_base() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('center', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
nav_status_list: data.nav || [],
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_base')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 请求数据
|
||||
var data = {
|
||||
page: this.data_page,
|
||||
};
|
||||
|
||||
// 状态
|
||||
var status = (this.nav_status_list[this.nav_status_index] || null) == null ? -1 : this.nav_status_list[this.nav_status_index]['id'];
|
||||
if (status != -1) {
|
||||
data['status'] = status;
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
// 数据列表
|
||||
var data = res.data.data;
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list || [];
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
field_list: data.field_list || [],
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: temp_data_list.length > 0 ? 3 : 0,
|
||||
data_list_loding_msg: '',
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
delete_event(e) {
|
||||
uni.showModal({
|
||||
title: this.$t('common.warm_tips'),
|
||||
content: this.$t('recommend-list.recommend-list.54d418'),
|
||||
confirmText: this.$t('common.confirm'),
|
||||
cancelText: this.$t('recommend-list.recommend-list.w9460o'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
// 参数
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var index = e.currentTarget.dataset.index;
|
||||
|
||||
// 加载loding
|
||||
uni.showLoading({
|
||||
title: this.$t('common.processing_in_text'),
|
||||
});
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('delete', 'user', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: value,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.data.code == 0) {
|
||||
var temp_data_list = this.data_list;
|
||||
temp_data_list.splice(index, 1);
|
||||
this.setData({
|
||||
data_list: temp_data_list,
|
||||
});
|
||||
if (temp_data_list.length == 0) {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
app.globalData.showToast(res.data.msg, 'success');
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 导航事件
|
||||
nav_event(e) {
|
||||
this.setData({
|
||||
nav_status_index: e.currentTarget.dataset.index || 0,
|
||||
data_page: 1,
|
||||
data_list: [],
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './invoice.css';
|
||||
</style>
|
||||
11
pages/plugins/invoice/order/order.css
Normal file
11
pages/plugins/invoice/order/order.css
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.select-scroll-box {
|
||||
height: calc(100vh - 186rpx);
|
||||
}
|
||||
|
||||
.data-list .item .select-icon {
|
||||
width: 35rpx;
|
||||
height: 35rpx !important;
|
||||
}
|
||||
272
pages/plugins/invoice/order/order.vue
Normal file
272
pages/plugins/invoice/order/order.vue
Normal file
@@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list.length > 0" class="data-list">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="padding-horizontal-main padding-top-main" :class="select_ids.length > 0 ? 'page-bottom-fixed' : ''">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main">
|
||||
<view class="dis-inline-block va-m" data-type="node":data-value="item.id" @tap="selected_event">
|
||||
<iconfont
|
||||
propClass="margin-right-sm pr top-xs"
|
||||
:name="select_ids.indexOf(item.id) != -1 ? 'icon-zhifu-yixuan' : 'icon-zhifu-weixuan'"
|
||||
size="40rpx"
|
||||
:color="select_ids.indexOf(item.id) != -1 ? '#E22C08' : '#999'"
|
||||
></iconfont>
|
||||
</view>
|
||||
<text class="va-m">{{ item.order_no }}</text>
|
||||
<text class="fr">{{ item.pay_price }}</text>
|
||||
</view>
|
||||
<view :data-value="'/pages/user-order-detail/user-order-detail?id=' + item.id" @tap="url_event" class="content margin-top cp">
|
||||
<component-panel-content :propData="item" :propDataField="field_list" propExcludeField="order_no,pay_price" :propIsTerse="true"></component-panel-content>
|
||||
</view>
|
||||
<view class="item-operation tr margin-top-main">
|
||||
<button class="round bg-white br-grey-9 text-size-md" type="default" size="mini" hover-class="none" :data-ids="item.id" data-type="item" @tap="invoice_event">{{$t('invoice-saveinfo.invoice-saveinfo.89815t')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 合并开票 -->
|
||||
<view v-if="select_ids.length > 0" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-white cr-main br-main round wh-auto" type="default" hover-class="none" data-type="all" @tap="invoice_event">{{$t('order.order.o411h6')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentPanelContent from "@/components/panel-content/panel-content";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_base: null,
|
||||
field_list: [],
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
select_ids: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPanelContent
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'order', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data_list.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
field_list: data.field_list || [],
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 选择
|
||||
selected_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var temp_select_ids = this.select_ids;
|
||||
var index = temp_select_ids.indexOf(value);
|
||||
if (index == -1) {
|
||||
temp_select_ids.push(value);
|
||||
} else {
|
||||
temp_select_ids.splice(index, 1);
|
||||
}
|
||||
this.setData({
|
||||
select_ids: temp_select_ids,
|
||||
});
|
||||
},
|
||||
|
||||
// 合并开票
|
||||
invoice_event(e) {
|
||||
var type = e.currentTarget.dataset.type || 'all';
|
||||
var ids = e.currentTarget.dataset.ids || null;
|
||||
if (type == 'all') {
|
||||
if (this.select_ids.length <= 0) {
|
||||
app.globalData.showToast(this.$t('order.order.15k32o'));
|
||||
return false;
|
||||
} else {
|
||||
ids = this.select_ids.join(',');
|
||||
}
|
||||
} else {
|
||||
if (ids === null) {
|
||||
app.globalData.showToast(this.$t('order.order.3fr155'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
app.globalData.url_open('/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?ids=' + ids + '&type=0&is_redirect=1');
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './order.css';
|
||||
</style>
|
||||
11
pages/plugins/invoice/recharge/recharge.css
Normal file
11
pages/plugins/invoice/recharge/recharge.css
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* 列表
|
||||
*/
|
||||
.select-scroll-box {
|
||||
height: calc(100vh - 186rpx);
|
||||
}
|
||||
|
||||
.data-list .item .select-icon {
|
||||
width: 35rpx;
|
||||
height: 35rpx !important;
|
||||
}
|
||||
272
pages/plugins/invoice/recharge/recharge.vue
Normal file
272
pages/plugins/invoice/recharge/recharge.vue
Normal file
@@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="data_list.length > 0" class="data-list">
|
||||
<scroll-view :scroll-y="true" class="scroll-box" @scrolltolower="scroll_lower" lower-threshold="60">
|
||||
<view class="padding-horizontal-main padding-top-main" :class="select_ids.length > 0 ? 'page-bottom-fixed' : ''">
|
||||
<view v-for="(item, index) in data_list" :key="index" class="item padding-main border-radius-main oh bg-white spacing-mb">
|
||||
<view class="base oh br-b-dashed padding-bottom-main">
|
||||
<view class="dis-inline-block va-m" data-type="node":data-value="item.id" @tap="selected_event">
|
||||
<iconfont
|
||||
propClass="margin-right-sm pr top-xs"
|
||||
:name="select_ids.indexOf(item.id) != -1 ? 'icon-zhifu-yixuan' : 'icon-zhifu-weixuan'"
|
||||
size="40rpx"
|
||||
:color="select_ids.indexOf(item.id) != -1 ? '#E22C08' : '#999'"
|
||||
></iconfont>
|
||||
</view>
|
||||
<text class="va-m">{{ item.recharge_no }}</text>
|
||||
<text class="fr">{{ item.pay_money }}</text>
|
||||
</view>
|
||||
<view :data-value="'/pages/plugins/wallet/user-recharge-detail/user-recharge-detail?id=' + item.id" @tap="url_event" class="content margin-top cp">
|
||||
<component-panel-content :propData="item" :propDataField="field_list" propExcludeField="recharge_no,pay_money" :propIsTerse="true"></component-panel-content>
|
||||
</view>
|
||||
<view class="item-operation tr margin-top-main">
|
||||
<button class="round bg-white br-grey-9 text-size-md" type="default" size="mini" hover-class="none" :data-ids="item.id" data-type="item" @tap="invoice_event">{{$t('invoice-saveinfo.invoice-saveinfo.89815t')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 合并开票 -->
|
||||
<view v-if="select_ids.length > 0" class="bottom-fixed" :style="bottom_fixed_style">
|
||||
<view class="bottom-line-exclude">
|
||||
<button class="item bg-white cr-main br-main round wh-auto" type="default" hover-class="none" data-type="all" @tap="invoice_event">{{$t('order.order.o411h6')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status"></component-no-data>
|
||||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
import componentPanelContent from "@/components/panel-content/panel-content";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_base: null,
|
||||
field_list: [],
|
||||
data_list: [],
|
||||
data_total: 0,
|
||||
data_page_total: 0,
|
||||
data_page: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
bottom_fixed_style: '',
|
||||
params: null,
|
||||
select_ids: [],
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentCommon,
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
componentPanelContent
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.setData({
|
||||
data_page: 1,
|
||||
});
|
||||
this.get_data_list(1);
|
||||
},
|
||||
|
||||
methods: {
|
||||
init() {
|
||||
var user = app.globalData.get_user_info(this, 'init');
|
||||
if (user != false) {
|
||||
this.get_data_list();
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data_list(is_mandatory) {
|
||||
// 分页是否还有数据
|
||||
if ((is_mandatory || 0) == 0) {
|
||||
if (this.data_bottom_line_status == true) {
|
||||
uni.stopPullDownRefresh();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 是否加载中
|
||||
if (this.data_is_loading == 1) {
|
||||
return false;
|
||||
}
|
||||
this.setData({
|
||||
data_is_loading: 1,
|
||||
data_list_loding_status: 1,
|
||||
});
|
||||
|
||||
// 加载loding
|
||||
if(this.data_page > 1) {
|
||||
uni.showLoading({
|
||||
title: this.$t('common.loading_in_text'),
|
||||
});
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'recharge', 'invoice'),
|
||||
method: 'POST',
|
||||
data: {
|
||||
page: this.data_page,
|
||||
},
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
if (data.data_list.length > 0) {
|
||||
if (this.data_page <= 1) {
|
||||
var temp_data_list = data.data_list;
|
||||
} else {
|
||||
var temp_data_list = this.data_list || [];
|
||||
var temp_data = data.data_list;
|
||||
for (var i in temp_data) {
|
||||
temp_data_list.push(temp_data[i]);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
field_list: data.field_list || [],
|
||||
data_list: temp_data_list,
|
||||
data_total: data.total,
|
||||
data_page_total: data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data_page + 1,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
this.setData({
|
||||
data_bottom_line_status: this.data_page > 1 && this.data_page > this.data_page_total,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: false,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_list_loding_status: 0,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
if (app.globalData.is_login_check(res.data, this, 'get_data_list')) {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if(this.data_page > 1) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
this.setData({
|
||||
data_list_loding_status: 2,
|
||||
data_is_loading: 0,
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 滚动加载
|
||||
scroll_lower(e) {
|
||||
this.get_data_list();
|
||||
},
|
||||
|
||||
// 选择
|
||||
selected_event(e) {
|
||||
var value = e.currentTarget.dataset.value;
|
||||
var temp_select_ids = this.select_ids;
|
||||
var index = temp_select_ids.indexOf(value);
|
||||
if (index == -1) {
|
||||
temp_select_ids.push(value);
|
||||
} else {
|
||||
temp_select_ids.splice(index, 1);
|
||||
}
|
||||
this.setData({
|
||||
select_ids: temp_select_ids,
|
||||
});
|
||||
},
|
||||
|
||||
// 合并开票
|
||||
invoice_event(e) {
|
||||
var type = e.currentTarget.dataset.type || 'all';
|
||||
var ids = e.currentTarget.dataset.ids || null;
|
||||
if (type == 'all') {
|
||||
if (this.select_ids.length <= 0) {
|
||||
app.globalData.showToast(this.$t('order.order.15k32o'));
|
||||
return false;
|
||||
} else {
|
||||
ids = this.select_ids.join(',');
|
||||
}
|
||||
} else {
|
||||
if (ids === null) {
|
||||
app.globalData.showToast(this.$t('order.order.3fr155'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
app.globalData.url_open('/pages/plugins/invoice/invoice-saveinfo/invoice-saveinfo?ids=' + ids + '&type=1&is_redirect=1');
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
@import './recharge.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user