<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>开票申请</title>
|
<script src="../../../jsnew/elementDefault.js?v=20220425"></script>
|
<script src="../../../jsnew/vue/vue.js"></script>
|
<script src="../../../jsnew/vue/element-ui/element-ui_15/index.js"></script>
|
<script src="../../../jsnew/myelement.js?v=20220425"></script>
|
<script src="../../../jsnew/page.js?v=20220425"></script>
|
<!-- <script src="../../../setting.js"></script> -->
|
|
<link href="../../../jsnew/vue/element-ui/element-ui_15/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../jsnew/myelement.css?v=20220426" rel="stylesheet">
|
<link href="../../../jsnew/theme.css?v=20220426" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../jsnew/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<style>
|
/* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
|
[v-cloak] {
|
display: none !important;
|
}
|
</style>
|
|
<body style="margin: 0px;">
|
<div v-cloak id="vbody">
|
<div id="page_root">
|
<div ref="popup_body" style="padding: 0 20px;">
|
<div class="el-dialog__header">
|
<div class="dialog-title">
|
<i class="iconfont icon-customermanagement"></i>
|
<span> {{title}}</span>
|
</div>
|
</div>
|
|
<div style=" text-align: right; padding: 5px 30px 0px 0px;" v-if="!isedit">
|
<el-button-group>
|
<el-button size="small" v-if="isapproval" type="success" @click="approvalOp(true)">批 准</el-button>
|
<el-button size="small" v-if="isapproval" type="danger" @click="approvalOp(false)">拒 绝</el-button>
|
</el-button-group>
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
</div>
|
|
<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
|
<div class="el-dialog__body">
|
<h-form
|
ref="form1"
|
:form-attr="formAttr"
|
:table-fields="formFields"
|
:form-data="formData"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
|
<div class="h_dialog__body">
|
<div v-if="(isedit || isrefuseedit) && formData.type != 'fee_invoice'" style=" text-align: right; padding-top: 30px;">
|
<!-- 工具栏 -->
|
<div style="float: right;">
|
<el-button-group style="display: flex;">
|
<el-button @click="showOrder">{{addBtnText}}</el-button>
|
<!-- <el-button @click="">模板下载</el-button>
|
<el-button @click="">导 入</el-button> -->
|
</el-button-group>
|
</div>
|
</div>
|
|
<h-table
|
v-if="isRefresh && tableFields.length && formData.type != 'fee_invoice'"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isedit || isrefuseedit"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="tableData.length ? true : false"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
|
v-on:get-data="getData"
|
v-on:del-data="(scope) => delData(scope, tableData, 'order')"
|
>
|
</h-table>
|
|
<div v-if="formData.type != 'ro_invoice'" style=" text-align: right; padding-top: 30px;">
|
<div style="float: left;">
|
<span style="font-weight: 600; color: black; padding-right: 15px;">折让使用明细</span>
|
使用折让金额汇总:<span>{{ discountTotal }}</span>
|
</div>
|
<div v-if="isedit || isrefuseedit" style="float: right;">
|
<el-button-group>
|
<el-button @click="addSelfData">新增个人承担</el-button>
|
<el-button @click="selectDiscount">新增折让明细</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
|
<h-table
|
v-if="isRefresh && formData.type != 'ro_invoice'"
|
ref="table4"
|
:table-fields="tableFields2"
|
:table-data="tableData2"
|
:is-edit-table-data="isedit || isrefuseedit"
|
:is-within-edit-table-data="isedit || isrefuseedit"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
:is-show-index="tableData2.length ? true : false"
|
:edit-table-button="editTableButton"
|
:table-height="tableHeight"
|
:isdraggableorder="false"
|
|
v-on:get-data="getData"
|
v-on:del-data="(scope) => delData(scope, tableData2, 'discount')"
|
>
|
</h-table>
|
</div>
|
|
<div class="h_dialog__body" style="padding-top: 30px;">
|
<h-form
|
ref="form2"
|
:form-attr="formAttr2"
|
:table-fields="formFields2"
|
:form-data="formData2"
|
:table-field-click="formfieldClick"
|
:is-end-colspan = "false"
|
>
|
</h-form>
|
</div>
|
|
<div v-if="showApprovalInfo" style="height: 150px; border-top: 15px">
|
<div style="width: 100%; height: 100%; border: 0px;">
|
<div class="topbar">
|
<span>审批记录</span>
|
|
<div style="float: right; margin-right: 20px;">
|
<el-button-group>
|
<el-button @click="onShowApproval">查看流程图</el-button>
|
</el-button-group>
|
</div>
|
</div>
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table3"
|
:table-fields="tableFields3"
|
:table-data="tableData3"
|
:table-height="tableHeight"
|
:isdraggableorder="true"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
>
|
</h-table>
|
|
</div>
|
</div>
|
</div>
|
|
<el-dialog :title="approvalTitle" :close-on-click-modal="false" :visible.sync="reasonvisible" height="50%">
|
<el-input
|
type="textarea"
|
:autosize="{ minRows: 2, maxRows: 10}"
|
placeholder="请输入原因"
|
v-model="approveremark">
|
</el-input>
|
|
<h-form
|
ref="form3"
|
:form-attr="formAttr3"
|
:table-fields="formFields3"
|
:form-data="formData3"
|
:table-field-click="formfieldClick"
|
>
|
</h-form>
|
|
<div slot="footer" class="dialog-footer" >
|
<el-button type="default" @click="reasonvisible = false">取 消</el-button>
|
<el-button type="primary" :loading="loading_pass" @click="saveReason">确 定</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog title="附件列表" :close-on-click-modal="false" :visible.sync="showFileList" width="30%" height="10%">
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields4"
|
:table-data="tableData4"
|
:table-height="250"
|
:is-pagination="false"
|
:table-field-click="tablefieldClick"
|
>
|
</h-table>
|
</div>
|
</el-dialog>
|
</div>
|
</div>
|
<div class="el-dialog__footer" v-if="isedit">
|
<el-button size="small" type="default" @click="closeDialog">取 消</el-button>
|
<el-button size="small" v-if="(isedit || isrefuseedit) && !isend" type="primary" @click="saveRowTable">保 存</el-button>
|
<el-button size="small" v-if="isedit && !isend" type="success" @click="submitRowTable">提 交</el-button>
|
<el-button size="small" v-if="isend" type="primary" @click="">提交申请</el-button>
|
<el-button size="small" v-if="isrefuseedit" type="success" @click="">再次提交</el-button>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
function initVue() {
|
new FormVue({
|
el: "#vbody",
|
data: {
|
dataname: "pkg_invoice_order",
|
table_dataname: "do_invoice_order_detail",
|
table_dataname2: "do_invoice_order_fee",
|
title: "表单+明细模板1",
|
dataurl: "rootjemin/data/getEntity",
|
|
editTableButton: {
|
del: {
|
isshow: true,
|
txt: "删除"
|
}
|
},
|
//表单
|
formAttr: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 3,
|
labelwidth: "150px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields: [
|
{isshow: "T", field: "process_no", name: "流程号", type:"span", required: true, group_name: "基本信息"},
|
{isshow: "T", field: "order_date", name: "申请日期", type:"span", required: true, group_name: "基本信息"},
|
{isshow: "T", field: "apply_code", name: "申请人编码", type:"span", required: true, group_name: "基本信息"},
|
{isshow: "T", field: "apply_name", name: "申请人名称", type:"span", required: true, group_name: "基本信息"},
|
{isshow: "T",field: "department",name: "所在部门",width: "150",align: "left", isminwidth: true, type: "span", required: true, group_name: "基本信息"},
|
{isshow: "T",field: "province",name: "所在省份",width: "150",align: "left", isminwidth: true, type: "select", required: true, group_name: "基本信息"},
|
|
{isshow: "T", field: "invoice_type", name: "发票类型", type:"select", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "org_name", name: "管理主体名称", width: "200", type: "select", align: "left", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "delivery_name", name: "发货主体", width: "200", type:"select", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "customer_code", name: "客户编码", width: "150", type: "select", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "customer_name", name: "客户名称", type:"span", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "uni_code", name: "统一信用代码", width: "150", type:"span", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "net_name", name: "开户银行", width: "200", type: "select", align: "left", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "account_no", name: "银行账号", type:"input", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "mail_no", name: "联系电话", type:"input", required: true, group_name: "客户开票信息"},
|
{isshow: "T", field: "address", name: "地址", type:"input", required: true, group_name: "客户开票信息"},
|
|
{isshow: "T", field: "receive_name", name: "收件人", type:"input", group_name: "邮寄信息"},
|
{isshow: "T", field: "phone_no", name: "手机号", type:"input", group_name: "邮寄信息"},
|
{isshow: "T", field: "receive_address", name: "地址", type:"input", group_name: "邮寄信息"},
|
|
{isshow: "T", field: "invoice_no", name: "发票号", type:"input", group_name: "反馈信息"},
|
{isshow: "T", field: "account_no_target", name: "挂帐号", type:"input", group_name: "反馈信息"},
|
{isshow: "T", field: "receive_time", name: "快递时间", type:"date", group_name: "反馈信息"},
|
{isshow: "T", field: "delivery_no", name: "快递号", type:"input", group_name: "反馈信息"},
|
{isshow: "T", field: "remark", name: "备注", type:"textarea", group_name: "反馈信息"},
|
],
|
formFields: [],
|
newformData: {
|
//id: uuid_short(),
|
// code: createCode("BA"),
|
// create_time: createDatetime(),
|
state_code: "Draft",
|
state_name: "录入",
|
// creator_name: window.top.vue.userinfo.name,
|
type_code: "",
|
type_name: "",
|
},
|
formData: {},
|
|
//附件
|
formAttr2: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
default_formFields2: [
|
{isshow: "T", field: "attachment_file", name: "附件", type: "uploadfilelist", colspan: 2},
|
{isshow: "T", field: "attachment_redinvoice", name: "红字开票申请表", type: "uploadfilelist", colspan: 2, required: true},
|
{isshow: "T", field: "attachment_discount", name: "折让协议", type: "uploadfilelist", colspan: 2},
|
],
|
formFields2: [],
|
formData2: {
|
oa_code: "test123",
|
},
|
|
//发货单
|
default_tableFields: [
|
// {isshow: "T", field: "delivery_no", name: "工厂的发货单号", width: "200", type:"span",},
|
// {isshow: "T", field: "product_name", name: "产品名称", width: "150", type:"span",},
|
// {isshow: "T", field: "product_code", name: "产品编码", width: "150", type:"span",},
|
// {isshow: "T", field: "spec", name: "产品规格", width: "100", type: "span",},
|
// {isshow: "T", field: "qty", name: "发货数量", width: "100", type: "span",},
|
// {isshow: "T", field: "invoice_qty", name: "本次开票数量", width: "100", type: "span",},
|
// {isshow: "T", field: "price", name: "单价", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
// {isshow: "T", field: "store_price", name: "价税合计", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
// {isshow: "T", field: "pay_type", name: "票折类型", width: "100", type: "span"},
|
// {isshow: "T", field: "batch_no", name: "批号", width: "100", type: "span",},
|
// {isshow: "T", field: "remark", name: "备注", type: "span", width: "150"},
|
|
{isshow: "T", field: "raw_code", name: "工厂的发货单号", width: "200", type:"span",},
|
{isshow: "T", field: "product_name", name: "产品名称", width: "200", type:"span",},
|
{isshow: "T", field: "product_code", name: "产品编码", width: "150", type:"span",},
|
{isshow: "T", field: "product_spec", name: "产品规格", width: "200", type: "span",},
|
{isshow: "T", field: "delivery_cnt", name: "可开票数量", width: "100", type: "span",},
|
{isshow: "T", field: "cnt", name: "本次开票数量", width: "100", type: "input",},
|
{isshow: "T", field: "delivery_price", name: "单价", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "total_price_tax", name: "价税合计", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "discount_amt", name: "折让金额", width: "100", type: "input", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "final_amt", name: "实际开票金额", width: "100", type: "span", formatter: "formatter_money", align: "right"},
|
{isshow: "T", field: "batch_no", name: "批号", width: "100", type: "span"},
|
{isshow: "T", field: "remark", name: "备注", type: "input", width: "150"},
|
|
{isshow: "T", field: "is_batch_no", name: "备注批号", type: "select", width: "100"},
|
{isshow: "T", field: "is_effective_date", name: "备注有效期", type: "select", width: "100"},
|
{isshow: "T", field: "is_production_date", name: "备注生产日期", type: "select", width: "100"},
|
{isshow: "T", field: "is_raw_code", name: "备注发货单号", type: "select", width: "100"},
|
{isshow: "T", field: "is_biz_date", name: "备注发货日期", type: "select", width: "100"},
|
{isshow: "T", field: "is_singleton", name: "是否单开", type: "select", width: "100"},
|
{isshow: "T", field: "is_price_reviewers", name: "带收款复核人", type: "select", width: "100"},
|
],
|
tableFields: [],
|
newTableData: {
|
// create_time: createDatetime(),
|
// creator_name: window.top.vue.userinfo.name,
|
},
|
tableData: [],
|
|
//折让明细
|
tableFields2: [
|
{isshow: "T", field: "discount_detail", name: "折让编码明细", width: "200", type: "span",},
|
{isshow: "T", field: "discount_type", name: "折让类型", width: "150", type: "span", isminwidth: true, formatter: "formatter_json", formatpattern: "fee_type"},
|
{isshow: "T", field: "fee_price", name: "折让金额", width: "150", type:"span",},
|
// {isshow: "T", field: "production_code", name: "产品编码", width: "150", type: "span",},
|
// {isshow: "T", field: "production_name", name: "产品名称", width: "100", type:"span", isminwidth: true},
|
// {isshow: "T", field: "production_spec", name: "产品规格", width: "150", type: "span",},
|
],
|
tableData2: [],
|
|
//审批
|
default_tableFields3: [
|
{isshow: "T", field: "node_name", name: "当前节点", width: "150", type:"span", required: true},
|
{isshow: "T", field: "end_time", name: "申请/审批时间", width: "100", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
|
{isshow: "T", field: "pass", name: "审批情况", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "reason", name: "原因", width: "150", type: "span", required: true, isminwidth: true,},
|
{isshow: "T", field: "user_name", name: "申请/审批人", width: "150", type:"span", required: true, isminwidth: true,},
|
{isshow: "T", field: "viewFile", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableFields4: [
|
{isshow: "T", field: "attachment_file", name: "附件", width: "200", type:"span", required: true, isminwidth: true,},
|
],
|
tableFields3: [],
|
tableData3: [],
|
tableData4: [],
|
|
formAttr3: {
|
istitle: false,
|
title: "表单名称",
|
columnnumber: 2,
|
labelwidth: "140px",
|
labelposition: "left",//"left",// right//top
|
size: "mini",
|
border: "3px solid #c6c6c600"
|
},
|
formFields3: [],
|
formData3: {},
|
|
default_formFields3: [
|
{isshow: "T", field: "files2", name: "附件", type: "uploadfilelist"},
|
],
|
|
//字段设置
|
tablefieldClick: {},
|
formfieldClick: {},
|
|
//按键权限设置
|
isedit: false,//提交前编辑,保存/提交
|
isrefuseedit: false,//拒绝后编辑,保存/再次提交
|
isapproval: false,//审批,同意/拒绝/转办/退回
|
isend: false,
|
|
iscommit: false,//提交标记
|
|
//弹窗参数
|
popupParames: {},
|
|
flow_id: "c1355b3fd4b049f28135548d17f2071f",
|
t_height:null,
|
isRefresh: true,
|
|
showFileList: false,
|
loading_pass: false,
|
showApprovalInfo: false,
|
reasonvisible: false,
|
pass: false,
|
approveremark: '',
|
approvalTitle: '通过原因',
|
|
discountTotal: 0,
|
addBtnText: ""
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.title = this.popupParames.title || this.popupParames.text;
|
if (this.popupParames.data) {
|
this.formData = clone(this.popupParames.data);
|
}
|
|
if (this.popupParames.sceneCode) {
|
if (this.popupParames.sceneCode == "add") {//新增
|
// if (this.newformData) {
|
// let formData_ = clone(this.formData);
|
|
// for (var k in this.newformData) {
|
// formData_[k] = this.newformData[k];
|
// }
|
// this.formData = formData_;
|
// }
|
|
// if (this.newTableData) {
|
// this.tableData.push(clone(this.newTableData));
|
// }
|
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "browse") {//只读
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
}
|
else if (this.popupParames.sceneCode == "edit") {//编辑
|
this.isedit = true;
|
}
|
else if (this.popupParames.sceneCode == "approval") {//审批
|
this.formAttr.disabled = true;
|
this.formAttr2.disabled = true;
|
this.isapproval = true;
|
}
|
else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
|
this.isrefuseedit = true;
|
}
|
}
|
},
|
|
mounted() {
|
var me = this;
|
me.t_height = document.documentElement.clientHeight*1 - 91;
|
|
//预加载数据
|
if (this.dataRequest && this.dataRequest.length) {
|
var result = {};
|
this.loadRequestData(this.dataRequest, result, function(data) {
|
me.dataRequestObj = data;
|
//预加载数据后给哪些字段设置options或formatterjson
|
|
me.initData();
|
});
|
}
|
else {
|
this.initData();
|
}
|
|
// 以服务的方式调用的 Loading 需要异步关闭
|
this.$nextTick(() => {
|
hideLoading();
|
|
//重新设置弹窗宽高
|
this.$nextTick(function(){
|
let w_ = this.$refs.popup_body.offsetWidth + "px";
|
// let w_ = "900px";
|
let h_ = this.$refs.popup_body.offsetHeight + "px";
|
Root.setPopupWH(w_, h_);
|
})
|
});
|
},
|
|
methods:{
|
//关闭弹窗
|
closeDialog() {
|
var me = this;
|
if (me.popupParames.totab){
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
}
|
else {
|
Root.hidePopup();
|
}
|
},
|
//关闭前调回调
|
saveAfter() {
|
var me = this;
|
if(this.popupParames.callback) {
|
let obj = {
|
//row: this.formData
|
}
|
this.popupParames.callback(obj, function() {
|
me.closeDialog();
|
});
|
}
|
else {
|
me.closeDialog();
|
}
|
},
|
|
initData() {
|
let me = this
|
var id_ = null;
|
|
// if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
// me.formFields = clone(me.default_formFields);
|
// me.formFields2 = clone(me.default_formFields2);
|
// me.tableFields = clone(me.default_tableFields);
|
// me.tableFields3 = clone(me.default_tableFields3);
|
|
// //字段数组转字段obj
|
// me.fieldsToFieldsObj();
|
|
// //设置字段事件
|
// me.tableFieldClick();
|
// }
|
|
if (this.formData.id) {
|
id_ = this.formData.id;
|
}
|
this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
|
if (result.meta && result.meta['do_invoice_order'] && result.meta['do_invoice_order'].fields) {
|
var metas = clone(result.meta['do_invoice_order'].fields);
|
var table_dataname_ = me.table_dataname;
|
var table_dataname_2 = me.table_dataname2;
|
|
var table_metas = [];
|
var table_metas2 = [];
|
table_metas = clone(result.meta[table_dataname_].fields);
|
table_metas2 = clone(result.meta[table_dataname_2].fields);
|
|
var formFields_ = [];
|
var tableFields_ = [];
|
var tableFields_2 = [];
|
metas.map(f=>{
|
f.isshow = "T";
|
if (f.field == "revo_red_notifycation" || f.field == "revo_red_date") {
|
if (me.formData.type != 'ro_invoice') {
|
f.isshow = "F"
|
}
|
}
|
|
formFields_.push(clone(f));
|
})
|
table_metas.map(f=>{
|
f.isshow = "T";
|
tableFields_.push(clone(f));
|
})
|
table_metas2.map(f=>{
|
f.isshow = "T";
|
tableFields_2.push(clone(f));
|
})
|
|
if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
|
me.formFields = clone(formFields_);
|
//me.tableFields = clone(tableFields_);
|
if (me.formData.type == 'so_invoice') {
|
me.default_formFields2[1].isshow = "F"
|
me.default_formFields2[2].isshow = "F"
|
me.addBtnText = "新增发货单"
|
}
|
if (me.formData.type == 'ro_invoice') {
|
me.default_formFields2[2].isshow = "F"
|
me.addBtnText = "新增退货单"
|
}
|
me.formFields2 = clone(me.default_formFields2);
|
me.default_tableFields.map(s => {
|
if (s.type == 'select') {
|
s.options = [
|
{value: "是", code: "T"},
|
{value: "否", code: "F"}
|
]
|
}
|
if (me.formData.type == 'ro_invoice' && s.field == "discount_amt") {
|
s.isshow = "F"
|
}
|
})
|
me.tableFields = clone(me.default_tableFields);
|
me.tableFields2 = clone(tableFields_2);
|
me.tableFields3 = clone(me.default_tableFields3);
|
me.formFields3 = clone(me.default_formFields3);
|
|
//字段数组转字段obj
|
me.fieldsToFieldsObj();
|
|
//设置字段事件
|
me.tableFieldClick();
|
}
|
}
|
|
if (me.rowData['do_invoice_order']) {
|
me.formData = me.rowData['do_invoice_order'];
|
|
if (me.formData.flow_id) {
|
me.showApprovalInfo = true
|
me.getApprovalHisInfo(me.formData.flow_id || "")
|
}
|
}
|
if (me.rowData['do_invoice_file']) {
|
let fileData = me.rowData['do_invoice_file'];
|
let formData2 = clone(me.formData2)
|
if (fileData.length > 0) {
|
fileData.map(e => {
|
if (!formData2[e.type]) {
|
formData2[e.type] = []
|
}
|
formData2[e.type].push(e)
|
})
|
}
|
me.formData2 = formData2
|
}
|
if (me.rowData[me.table_dataname]) {
|
if (me.rowData[me.table_dataname].length > 0) {
|
if (me.popupParames.sceneCode == "browse" || me.popupParames.sceneCode == "approval") {
|
me.rowData[me.table_dataname].map(s => {
|
s.is_batch_no = s.is_batch_no? "是" : "否"
|
s.is_effective_date = s.is_effective_date? "是" : "否"
|
s.is_production_date = s.is_production_date? "是" : "否"
|
s.is_raw_code = s.is_raw_code? "是" : "否"
|
s.is_biz_date = s.is_biz_date? "是" : "否"
|
s.is_singleton = s.is_singleton? "是" : "否"
|
s.is_price_reviewers = s.is_price_reviewers? "是" : "否"
|
})
|
}
|
else {
|
me.rowData[me.table_dataname].map(s => {
|
s.is_batch_no = s.is_batch_no? "T" : "F"
|
s.is_effective_date = s.is_effective_date? "T" : "F"
|
s.is_production_date = s.is_production_date? "T" : "F"
|
s.is_raw_code = s.is_raw_code? "T" : "F"
|
s.is_biz_date = s.is_biz_date? "T" : "F"
|
s.is_singleton = s.is_singleton? "T" : "F"
|
s.is_price_reviewers = s.is_price_reviewers? "T" : "F"
|
})
|
}
|
}
|
me.tableData = me.rowData[me.table_dataname];
|
}
|
if (me.rowData[me.table_dataname2]) {
|
me.tableData2 = me.rowData[me.table_dataname2];
|
|
let discountTotal = 0
|
me.tableData2.map(e => {
|
if (e.fee_price) {
|
discountTotal += parseFloat(e.fee_price)
|
}
|
})
|
me.discountTotal = discountTotal
|
}
|
|
if (me.popupParames.sceneCode == "approval" && me.formData.readed != "T") {
|
me.setReaded()
|
}
|
})
|
},
|
setReaded() {
|
let me = this
|
let param = {
|
dataName: 'pkg_invoice_order',
|
data: {
|
do_invoice_order: {
|
id: me.formData.id,
|
readed: "T"
|
}
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {});
|
},
|
|
addSelfData() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "折让明细",
|
id: "popup_self_discount_detail",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/invoice/popup_self_discount_detail.html",
|
data: "",
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
let tableData2 = clone(me.tableData2)
|
tableData2.push(obj.row)
|
me.tableData2 = tableData2
|
|
let discountTotal = 0
|
me.tableData2.map(e => {
|
if (e.fee_price) {
|
discountTotal += parseFloat(e.fee_price)
|
}
|
})
|
me.discountTotal = discountTotal
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
selectDiscount() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "折让明细",
|
id: "popup_discount_detail_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../tradeDiscount/invoice/popup_discount_detail_list.html",
|
data: "",
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData = clone(me.tableData2)
|
data.map(e => {
|
e.fee_detail_id = e.id
|
e.fee_detail_code = e.raw_code
|
e.fee_type = "discount"
|
e.fee_price = e.final_amt
|
|
tableData.push(e)
|
})
|
me.tableData2 = tableData
|
|
let discountTotal = 0
|
me.tableData2.map(e => {
|
if (e.fee_price) {
|
discountTotal += parseFloat(e.fee_price)
|
}
|
})
|
me.discountTotal = discountTotal
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
showOrder() {
|
var me = this;
|
let dataname = ""
|
let text = ""
|
let filter = " can_invoice_cnt > 0 and order_type = '1' and customer_code = '" + this.formData.customer_code + "'"
|
if (this.formData.type == 'so_invoice') {
|
dataname = "invoice_delivery_order_detail"
|
text = "发货单选择"
|
}
|
if (this.formData.type == 'ro_invoice') {
|
dataname = "invoice_delivery_order_detail_revo"
|
filter = " can_invoice_cnt > 0 and order_type = '2' and customer_code = '" + this.formData.customer_code + "'"
|
text = "退货单选择"
|
}
|
if (this.tableData.length > 0) {
|
let str = ""
|
this.tableData.map(s => {
|
if (!str) {
|
str = "'" + s.raw_code + "'"
|
}
|
else {
|
str += ",'" + s.raw_code + "'"
|
}
|
})
|
|
filter += " and raw_code not in (" + str + ")"
|
}
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "600px",
|
icon: "icon-product",
|
text: text,
|
id: "delivery_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../logistics/delivery/popup/popup_delivery_list.html",
|
data: "",
|
delta: {},
|
filter: filter,
|
dataname: dataname,
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(data, callback) {
|
let tableData = clone(me.tableData)
|
data.map(s => {
|
tableData.push({
|
delivery_order_detail_id: s.id,
|
raw_code: s.raw_code,
|
product_id: s.product_id,
|
product_code: s.product_code,
|
product_name: s.product_name,
|
product_spec: s.product_spec,
|
product_unit: s.product_unit,
|
delivery_cnt: s.cnt,
|
delivery_price: s.product_price,
|
batch_no: s.batch_no,
|
|
is_batch_no: "F",
|
is_effective_date: "F",
|
is_production_date: "F",
|
is_raw_code: "F",
|
is_biz_date: "F",
|
is_singleton: "F",
|
is_price_reviewers: "F"
|
})
|
})
|
|
me.tableData = tableData
|
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
newEndDeatil() {
|
var me = this;
|
|
var config = {
|
totab: false, //true: 以Tab导航的方式打开
|
width: "900px",
|
height: "900px",
|
icon: "icon-product",
|
text: "请选择要终止的开票申请明细数据",
|
id: "popup_terminal_policy_info_list",//totab: true时需设置,用于判断是否已打开此页面
|
url: "../agreement/policy/popup_terminal_policy_info_list.html",
|
data: {},
|
delta: {},
|
sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse",
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
me.doPopupByPublic(config);
|
},
|
|
tableFieldClick() {
|
var me = this;
|
//表单字段事件设置
|
this.formfieldClick = {
|
attachment_file: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "attachment_file";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj);
|
}
|
}
|
}
|
},
|
attachment_redinvoice: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "attachment_redinvoice";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj);
|
}
|
}
|
}
|
},
|
attachment_discount: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "attachment_discount";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj);
|
}
|
}
|
}
|
},
|
files2: {
|
buttonarray: {
|
onclick: function(obj) {
|
var filenamefield = obj.obj.field;
|
var fileidfield = "files2";
|
if(obj.buttonobj && obj.buttonobj.code == "showfilebyfile"){
|
me.showFileImgByFileId(obj.buttonobj.fileobj, true);
|
}else if (obj.buttonobj && obj.buttonobj.code == "uploadlist"){
|
me.onPopupByUploadFile(filenamefield, fileidfield, me.dataname, true);
|
}else if (obj.buttonobj && obj.buttonobj.code == "delfilebyfile"){
|
me.deleteByFileId(filenamefield, obj.buttonobj.fileobj, true);
|
}
|
}
|
}
|
},
|
manage_depart_name: {
|
select: {
|
onchange: function(obj) {
|
obj.data.manage_depart_code = obj.selectoption.code
|
obj.data.manage_depart_name = obj.selectoption.value
|
}
|
},
|
},
|
|
oa_code: {
|
val: {
|
onclick: function(obj) {
|
|
}
|
}
|
}
|
};
|
|
//表格字段事件设置
|
this.tablefieldClick = {
|
attachment_file: {
|
val: {
|
onclick: function(obj) {
|
me.showFileImgByFileId({file_id: obj.row.attachment, file_name: obj.row.attachment_file}, true);
|
},
|
}
|
},
|
viewFile: {
|
val: {
|
onclick: function(obj) {
|
me.showFileList = true
|
me.getFileList(obj.row.attachment)
|
},
|
}
|
},
|
cnt: {
|
input: {
|
onchange: function(obj) {
|
obj.row.total_price_tax = parseFloat(obj.row.delivery_price) * parseFloat(obj.row.cnt)
|
obj.row.final_amt = parseFloat((obj.row.total_price_tax || 0) - (obj.row.discount_amt || 0)).toFixed(10)
|
me.$forceUpdate()
|
}
|
},
|
},
|
discount_amt: {
|
input: {
|
onchange: function(obj) {
|
obj.row.final_amt = parseFloat((obj.row.total_price_tax || 0) - obj.row.discount_amt).toFixed(10)
|
me.$forceUpdate()
|
}
|
},
|
}
|
// cnt: {
|
// input: {
|
// onchange: function(obj) {
|
// let tableData = clone(me.tableData)
|
// tableData[obj.$index]['total_price_tax'] = parseFloat((obj.row.delivery_price * obj.row.cnt).toFixed(10))
|
// me.tableData = tableData
|
// }
|
// },
|
// }
|
};
|
|
},
|
|
getFileList(parentFileId) {
|
let me = this
|
|
let param = {
|
dataName: "sys_file_mapping",
|
filter: "parent_id = '" + parentFileId + "'"
|
}
|
Server.call("rootjemin/data/getEntitySet", param, function(result) {
|
if (result.success) {
|
let fileList = result.data.entityset || []
|
fileList.map(e => {
|
e.attachment_file = e.file_name
|
e.attachment = e.file_id
|
})
|
|
me.tableData4 = fileList
|
}
|
});
|
},
|
|
getApprovalHisInfo(flowId) {
|
let me = this
|
|
if (!flowId) {
|
return
|
}
|
|
let param = {
|
flowId: flowId
|
}
|
|
Server.call("jeminact/root/order/getHistoryTask", param, function(result) {
|
if (result.success) {
|
let tableData = []
|
tableData = result.data.entityset
|
tableData.map(s => {
|
s.pass = !s.pass && s.pass !== 0? '' : s.pass == '1'? '同意' : '拒绝'
|
s.user_name = s.user_name? s.user_name : '已完成'
|
|
s.viewFile = s.attachment? "查看附件" : ''
|
})
|
me.tableData3 = tableData
|
}
|
});
|
},
|
onShowApproval() {
|
var me = this;
|
let param = {
|
isClientMode: false,
|
flowId: this.formData.flow_id
|
}
|
|
var config = {
|
hide_close: true,
|
width: "85vw",
|
height: "95vh",
|
url: "../approval_new/Approval_flowid_new.html",
|
data: {},
|
delta: {
|
flow_id: this.formData.flow_id,
|
title: ''
|
},
|
};
|
|
this.doPopupByPublic(config);
|
},
|
|
approvalOp(op) {
|
this.reasonvisible = true
|
this.approveremark = ""
|
this.formData3.files2 = null
|
if (op) {
|
this.approvalTitle = '通过原因'
|
this.pass = true
|
}
|
else {
|
this.approvalTitle = '拒绝原因'
|
this.pass = false
|
}
|
},
|
|
saveReason() {
|
let me = this
|
|
if (!this.pass && !this.approveremark) {
|
Root.message({
|
type: 'warning',
|
message: '请填写拒绝原因'
|
})
|
|
return
|
}
|
|
if (this.formData3.files2 && this.formData3.files2.length > 0) {
|
let sys_file_mapping = []
|
let parent_id = uuid_short()
|
this.formData3.files2.map(e => {
|
let list = {
|
parent_id: parent_id,
|
type: "openInvoice",
|
id: e.id,
|
file_id: e.id,
|
file_name: e.file_name
|
}
|
sys_file_mapping.push(list)
|
})
|
let param = {
|
dataName: 'sys_file_mapping',
|
data: {
|
sys_file_mapping: sys_file_mapping
|
},
|
}
|
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
if (result.success) {
|
me.doSaveReason(parent_id)
|
}
|
});
|
}
|
else {
|
me.doSaveReason()
|
}
|
},
|
|
doSaveReason(parent_id) {
|
let me = this
|
|
let param = {
|
businessId: this.formData.id,
|
flowId: this.formData.flow_id,
|
variableMap: {
|
dataName: "do_invoice_order",
|
invoiceType: this.formData.type,
|
reason: this.approveremark,
|
flowId: this.formData.flow_id,
|
attachment: parent_id?parent_id : ""
|
},
|
pass: this.pass
|
}
|
Server.call("jeminact/rootact/act/deal/" + this.formData.flow_id, param, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '审批成功'
|
})
|
window.top.vue.setMenuBadgeByMenuid('A10-62', 'openInvoice');
|
me.saveAfter()
|
}
|
else {
|
Root.message({
|
type: 'error',
|
message: result.error
|
})
|
}
|
});
|
},
|
|
onPopupByUploadFile(filenamefield, fileidfield,dataname, isApprovalReason) {
|
var me = this;
|
let url = isApprovalReason? "../tool_new/popup_uploadFile_new.html" : "../tool/popup_uploadFile.html"
|
var analysistype_ = "";
|
var formData_ = isApprovalReason? clone(me.formData3) : clone(me.formData2);
|
var delta_ = {filetypelist: []}//".png", ".jpg", ".pdf"
|
var config = {
|
totab: false,
|
width: "500px",
|
icon: "icon-product",
|
text: "附件上传",
|
id: "popupByUploadFile",
|
url: url,
|
data: {
|
dataName: dataname,
|
fileidfieldName: fileidfield,
|
id: me.formData.id,
|
fileNamefieldName: filenamefield,
|
// max_size: "100MB",
|
},
|
delta: delta_,
|
callback: function(obj, callback) {
|
me.$message({
|
showClose: true,
|
message: '上传成功!',
|
type: 'success'
|
});
|
|
var file_ = {
|
id: obj.row[0].id,
|
file_name: decodeURI(obj.row[0].name)
|
}
|
if (!formData_[filenamefield]) {
|
formData_[filenamefield] = []
|
}
|
formData_[filenamefield].push(file_);
|
|
if (isApprovalReason) {
|
me.formData3 = formData_;
|
}
|
else {
|
me.formData2 = formData_;
|
}
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
},
|
|
deleteByFileId(filenamefield, fileobj, isApprovalReason){
|
var me = this;
|
Root.confirm('确定删除附件【' + fileobj.file_name + '】吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
if (isApprovalReason) {
|
me.formData3[filenamefield].remove(fileobj);
|
}
|
else {
|
me.formData2[filenamefield].remove(fileobj);
|
}
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}).catch(() => {
|
|
});
|
},
|
|
showFileImgByFileId(fileobj, isApprovalReason) {
|
let me = this;
|
var file_id = fileobj.file_id || fileobj.id;
|
var file_name = fileobj.file_name;
|
|
this.zzimg = {};
|
this.zzimgList = [];
|
this.file_txt = false;
|
if(file_id) {
|
var fileid = file_id;
|
let fileName = clone(file_name);
|
let index1 = fileName.lastIndexOf(".");
|
let index2 = fileName.length;
|
let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
|
if (suffix == ".png" || suffix == ".jpg" || suffix == ".pdf") {
|
var row = {
|
fileid: fileid,
|
filename: fileName
|
}
|
|
var config = {
|
totab: false,
|
width: "1200px",
|
height: 800,
|
icon: "icon-product",
|
text: "附件预览",
|
id: "pdf_" + fileid,
|
url: "../tool/popup_file_pdf.html",
|
data: row,
|
delta: {},
|
callback: function(obj, callback) {
|
if (callback) {
|
callback();
|
}
|
}
|
};
|
this.doPopupByPublic(config);
|
|
}
|
else {//只可下载,不可预览
|
if (isApprovalReason) {
|
handleDownloadNew(fileid);
|
}
|
else {
|
handleDownload(fileid);
|
}
|
}
|
}
|
},
|
|
|
|
|
|
addTableData() {
|
var table_row = clone(this.newTableData);
|
this.rowChange(table_row, "add", this.table_dataname);
|
},
|
|
delData(scope, tableData, remark) {
|
let me = this;
|
let row = scope.row;
|
let index_ = scope.$index;
|
|
Root.confirm('确定删除吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
tableData.remove(row)
|
|
if (remark == "discount") {
|
let discountTotal = 0
|
tableData.map(e => {
|
if (e.fee_price) {
|
discountTotal += parseFloat(e.fee_price)
|
}
|
})
|
me.discountTotal = discountTotal
|
}
|
}).catch(() => {
|
|
});
|
},
|
|
rowChange(row, type, tablename) {
|
var me = this;
|
if (type == "add") {
|
this.tableData2.unshift(row);
|
}
|
else if (type == "del") {
|
if (row.id) {
|
let param = {
|
dataname: tablename,
|
id: row.id
|
}
|
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
if (result && result.data) {
|
me.tableData2.remove(row);
|
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
}
|
});
|
}
|
else {
|
this.tableData2.remove(row);
|
}
|
}
|
else {
|
|
}
|
},
|
|
//提交
|
submitRowTable() {
|
this.iscommit = true;
|
this.saveRowTable();
|
},
|
|
//保存
|
saveRowTable() {
|
var me = this;
|
var operator_ = "save";//保存
|
if(me.iscommit) {
|
operator_ = "commit";//提交
|
|
let re_amt = true
|
if (this.tableData.length > 0) {
|
let discountTotal = 0
|
this.tableData.map(y => {
|
discountTotal += y.discount_amt? parseFloat(y.discount_amt) : 0
|
})
|
if (discountTotal != me.discountTotal) {
|
re_amt = false
|
}
|
}
|
if (!this.formData.invoice_type) {
|
Root.message({
|
type: 'warning',
|
message: '请填写发票类型'
|
});
|
|
return
|
}
|
if (!this.formData.business_type) {
|
Root.message({
|
type: 'warning',
|
message: '请填写商业属性'
|
});
|
|
return
|
}
|
if (this.formData.type == 'ro_invoice') {
|
if (!this.formData.revo_red_notifycation) {
|
Root.message({
|
type: 'warning',
|
message: '请填写红字通知单'
|
});
|
|
return
|
}
|
if (!this.formData.revo_red_date) {
|
Root.message({
|
type: 'warning',
|
message: '请填写红字通知单填开日期'
|
});
|
|
return
|
}
|
if (!this.formData2.attachment_redinvoice || this.formData2.attachment_redinvoice.length == 0) {
|
Root.message({
|
type: 'warning',
|
message: '请上传红字开票申请表'
|
});
|
|
return
|
}
|
}
|
if (!this.formData.manage_depart_code) {
|
Root.message({
|
type: 'warning',
|
message: '请填写业务线'
|
});
|
|
return
|
}
|
if (!re_amt) {
|
Root.message({
|
type: 'warning',
|
message: '请保证‘发货单折让金额汇总’与‘使用折让金额汇总’相等'
|
});
|
|
return
|
}
|
}
|
|
var entity_ = clone(this.formData);
|
var entity = {};
|
for (var r in entity_) {
|
if (entity_[r]) {
|
entity[r] = entity_[r];
|
}
|
}
|
|
var tableData_ = [];
|
this.tableData.map(r=>{
|
var row_ = {};
|
for (var k in r) {
|
if (r[k]) {
|
row_[k] = r[k];
|
}
|
}
|
tableData_.push(row_);
|
})
|
var tableData_2 = [];
|
this.tableData2.map(r=>{
|
var row_ = {};
|
for (var k in r) {
|
if (r[k]) {
|
row_[k] = r[k];
|
}
|
}
|
tableData_2.push(row_);
|
})
|
|
if (tableData_.length == 0 && this.formData.type != "fee_invoice") {
|
Root.message({
|
type: 'warning',
|
message: '请先添加发货单数据'
|
});
|
return
|
}
|
|
let do_invoice_file = []
|
if (me.formData2.attachment_file && me.formData2.attachment_file.length > 0) {
|
me.formData2.attachment_file.map(e => {
|
do_invoice_file.push({
|
id: e.id,
|
file_id: e.id,
|
file_name: e.file_name,
|
type: "attachment_file"
|
})
|
})
|
}
|
if (me.formData2.attachment_redinvoice && me.formData2.attachment_redinvoice.length > 0) {
|
me.formData2.attachment_redinvoice.map(e => {
|
do_invoice_file.push({
|
id: e.id,
|
file_id: e.id,
|
file_name: e.file_name,
|
type: "attachment_redinvoice"
|
})
|
})
|
}
|
if (me.formData2.attachment_discount && me.formData2.attachment_discount.length > 0) {
|
me.formData2.attachment_discount.map(e => {
|
do_invoice_file.push({
|
id: e.id,
|
file_id: e.file_id || e.id,
|
parent_id: e.parent_id || "",
|
file_name: e.file_name,
|
type: "attachment_discount"
|
})
|
})
|
}
|
|
let param = {
|
dataname: "pkg_invoice_order",
|
data: {
|
do_invoice_order: entity,
|
do_invoice_order_detail: tableData_,
|
do_invoice_order_fee: tableData_2,
|
do_invoice_file: do_invoice_file
|
},
|
}
|
Server.call("rootjemin/data/saveEntity", param, function(result) {
|
console.log(result);
|
if (result.success) {
|
if(me.iscommit){
|
me.iscommit = false;
|
me.doSubmit(entity.id)
|
}
|
else {
|
Root.message({
|
type: 'success',
|
message: '保存成功'
|
});
|
me.saveAfter();
|
}
|
}
|
});
|
},
|
doSubmit(id) {
|
let me = this
|
let param = {
|
dataName: "do_invoice_order",
|
id: id,
|
flow_id: "",
|
business_type: "openInvoice",
|
}
|
|
Server.call("rootjemin/data/Commit", param, function(result) {
|
if (result.success) {
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
me.saveAfter();
|
}
|
});
|
}
|
|
}
|
});
|
};
|
|
initVue();
|
</script>
|
|
<style>
|
.a:hover{
|
background-color: #FFFFFF;
|
}
|
.el-input__inner{
|
padding: 0 2px;
|
}
|
.header {
|
height: 21px;
|
}
|
.el-dialog_header {
|
padding: 10px 20px;
|
border-bottom: 1px solid #ccc;
|
right: 10px;
|
left: 10px;
|
top: 0px;
|
position: fixed;
|
}
|
.el-dialog_body{
|
padding: 20px;
|
|
overflow-y: auto;
|
right: 10px;
|
left: 10px;
|
top: 42px;
|
bottom: 50px;
|
position: fixed;
|
}
|
.el-dialog_footer {
|
padding: 10px 20px;
|
border-top: 1px solid #ccc;
|
right: 10px;
|
left: 10px;
|
bottom: 0px;
|
position: fixed;
|
background-color: #fff;
|
z-index: 10;
|
text-align: right;
|
}
|
html{
|
overflow-y: hidden;
|
}
|
|
.h_table {
|
margin-top: 30px;
|
}
|
</style>
|
|
</body>
|
</html>
|