开票申请表体编辑及其相关源码

This commit is contained in:
lj 2025-03-20 16:02:19 +08:00
parent 34fe1dc962
commit e5eb67a758
812 changed files with 50663 additions and 4 deletions

View File

@ -1,12 +1,12 @@
{
"buildEntryPath": [
"./src/uapbd/refer/pub/MaterialGridRef/index.js",
"./src/mmpac/mmpac/issue/*/index.js"
"./src/sscivm/invoiceApplication/*/*/index.js"
],
"proxyJson": false,
"proxy": "http://127.0.0.1:9080/",
"buildWithoutHTML": [
"uap/refer"
"uap/refer",
"uapbd/refer"
],
"devPort": 3001,
"patch": {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<title> Application </title>
<link rel="stylesheet" href="../../../../platform/api/index.css" />
<link rel="stylesheet" href="../../../../platform/base/index.css" />
<link rel="stylesheet" href="../../../../platform/components/index.css" />
<link rel="stylesheet" href="../../../../platform/form/index.css" />
<link rel="stylesheet" href="../../../../platform/table-core/index.css" />
<link rel="stylesheet" href="../../../../platform/simple-table/index.css" />
<link rel="stylesheet" href="../../../../platform/edit-table/index.css" />
<link rel="stylesheet" href="../../../../platform/card-table/index.css" />
<link rel="stylesheet" href="../../../../platform/transfer-table/index.css" />
<link rel="stylesheet" href="../../../../platform/tree-table/index.css" />
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front.css" />
<script type="text/javascript" src="../../../../platform/resource/yonyou-yyy.js"></script>
</head>
<body>
<div id="app"></div>
<script src="../../../../platform/resource/polyfill.js"></script>
<script src="../../../../platform/library/index.js"></script>
<script src="../../../../platform/resource/ca/ca0.js"></script>
<script src="../../../../platform/resource/ca/ca1.js"></script>
<script src="../../../../platform/resource/ca/ca2.js"></script>
<script src="../../../../platform/resource/ca/nccsign.js"></script>
<script src="../../../../platform/resource/ca/sha256.js"></script>
<script src="../../../../platform/api/index.js"></script>
<script src="../../../../platform/base/index.js"></script>
<script src="../../../../platform/template/index.js"></script>
<script src="../../../../platform/form/index.js"></script>
<script src="../../../../platform/table-core/index.js"></script>
<script src="../../../../platform/simple-table/index.js"></script>
<script src="../../../../platform/edit-table/index.js"></script>
<script src="../../../../platform/card-table/index.js"></script>
<script src="../../../../platform/transfer-table/index.js"></script>
<script src="../../../../platform/tree-table/index.js"></script>
<script src="../../../../platform/components/index.js"></script>
<script src="../../../../platform/nc-lightapp-front.js"></script>
<script type="text/javascript" src="../../../../sscivm/basesetting/mergeRule/pages/index.08613b30.js"></script></body>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<title> Application </title>
<link rel="stylesheet" href="../../../../platform/api/index.css" />
<link rel="stylesheet" href="../../../../platform/base/index.css" />
<link rel="stylesheet" href="../../../../platform/components/index.css" />
<link rel="stylesheet" href="../../../../platform/form/index.css" />
<link rel="stylesheet" href="../../../../platform/table-core/index.css" />
<link rel="stylesheet" href="../../../../platform/simple-table/index.css" />
<link rel="stylesheet" href="../../../../platform/edit-table/index.css" />
<link rel="stylesheet" href="../../../../platform/card-table/index.css" />
<link rel="stylesheet" href="../../../../platform/transfer-table/index.css" />
<link rel="stylesheet" href="../../../../platform/tree-table/index.css" />
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front.css" />
<script type="text/javascript" src="../../../../platform/resource/yonyou-yyy.js"></script>
</head>
<body>
<div id="app"></div>
<script src="../../../../platform/resource/polyfill.js"></script>
<script src="../../../../platform/library/index.js"></script>
<script src="../../../../platform/resource/ca/ca0.js"></script>
<script src="../../../../platform/resource/ca/ca1.js"></script>
<script src="../../../../platform/resource/ca/ca2.js"></script>
<script src="../../../../platform/resource/ca/nccsign.js"></script>
<script src="../../../../platform/resource/ca/sha256.js"></script>
<script src="../../../../platform/api/index.js"></script>
<script src="../../../../platform/base/index.js"></script>
<script src="../../../../platform/template/index.js"></script>
<script src="../../../../platform/form/index.js"></script>
<script src="../../../../platform/table-core/index.js"></script>
<script src="../../../../platform/simple-table/index.js"></script>
<script src="../../../../platform/edit-table/index.js"></script>
<script src="../../../../platform/card-table/index.js"></script>
<script src="../../../../platform/transfer-table/index.js"></script>
<script src="../../../../platform/tree-table/index.js"></script>
<script src="../../../../platform/components/index.js"></script>
<script src="../../../../platform/nc-lightapp-front.js"></script>
<script type="text/javascript" src="../../../../sscivm/basesetting/splitMergePlan/pages/index.c389a917.js"></script></body>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<title> Application </title>
<link rel="stylesheet" href="../../../../platform/api/index.css" />
<link rel="stylesheet" href="../../../../platform/base/index.css" />
<link rel="stylesheet" href="../../../../platform/components/index.css" />
<link rel="stylesheet" href="../../../../platform/form/index.css" />
<link rel="stylesheet" href="../../../../platform/table-core/index.css" />
<link rel="stylesheet" href="../../../../platform/simple-table/index.css" />
<link rel="stylesheet" href="../../../../platform/edit-table/index.css" />
<link rel="stylesheet" href="../../../../platform/card-table/index.css" />
<link rel="stylesheet" href="../../../../platform/transfer-table/index.css" />
<link rel="stylesheet" href="../../../../platform/tree-table/index.css" />
<link rel="stylesheet" href="../../../../platform/nc-lightapp-front.css" />
<script type="text/javascript" src="../../../../platform/resource/yonyou-yyy.js"></script>
</head>
<body>
<div id="app"></div>
<script src="../../../../platform/resource/polyfill.js"></script>
<script src="../../../../platform/library/index.js"></script>
<script src="../../../../platform/resource/ca/ca0.js"></script>
<script src="../../../../platform/resource/ca/ca1.js"></script>
<script src="../../../../platform/resource/ca/ca2.js"></script>
<script src="../../../../platform/resource/ca/nccsign.js"></script>
<script src="../../../../platform/resource/ca/sha256.js"></script>
<script src="../../../../platform/api/index.js"></script>
<script src="../../../../platform/base/index.js"></script>
<script src="../../../../platform/template/index.js"></script>
<script src="../../../../platform/form/index.js"></script>
<script src="../../../../platform/table-core/index.js"></script>
<script src="../../../../platform/simple-table/index.js"></script>
<script src="../../../../platform/edit-table/index.js"></script>
<script src="../../../../platform/card-table/index.js"></script>
<script src="../../../../platform/transfer-table/index.js"></script>
<script src="../../../../platform/tree-table/index.js"></script>
<script src="../../../../platform/components/index.js"></script>
<script src="../../../../platform/nc-lightapp-front.js"></script>
<script type="text/javascript" src="../../../../sscivm/basesetting/splitRule/pages/index.9c81eaf6.js"></script></body>

View File

@ -0,0 +1,112 @@
/*c6feVgHks+LyJTmQx3O1fl1cwYsozyxOl9Q9wszTHUnxe0bBK9DpO42N1Lkdlsh/*/
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { createPage, ajax, base } from 'nc-lightapp-front';
let { Message } = base;
const { NCBreadcrumb } = base;
const NCBreadcrumbItem = NCBreadcrumb.NCBreadcrumbItem;
import {setForm} from 'ssccommon/utils/setComponentUsed';
import {initTemplate, afterEvent/**, searchBtnClick, pageInfoClick,tableModelConfirm**/ } from './events';
import './index.less';
class SSCIVAExtendAttribute extends Component {
constructor(props) {
super(props);
this.props = props;
//表单meta信息
this.state = {
};
setForm(props, 'extendAttribute');
initTemplate.call(this,props);
}
//请求列表数据
showData = (billID) => {
let stat=this.setExtendPaneStat();
if(billID instanceof Event){
billID=""
}
if(stat==='cancel'){
this.props.form.cancel('extendAttribute');
}else if(stat==='add'){
this.props.form.EmptyAllFormValue("extendAttribute");
this.props.form.setFormItemsValue("extendAttribute",{"status":{"value":0,"display":null}});
this.props.form.setFormStatus('extendAttribute','edit');
}else if(billID!=null && billID.length>0){
let _this=this;
ajax({
url: '/nccloud/sscivm/ivsale/SscIvaExtendAttrAction.do',
data: {
pk_billtypecode: billID,
appcode:'105802JYLX',
pagecode:'105802SSCIVA_TransType'
},
success: (res) => {
let { success, data } = res;
if (success) {
let meta = data.head.extendAttribute;
_this.props.form.EmptyAllFormValue("extendAttribute");
_this.props.form.setAllFormValue({"extendAttribute": meta});
_this.props.form.setFormItemsValue("extendAttribute",{"status":{"value":0,"display":null}});
_this.props.form.setFormStatus('extendAttribute',stat);
_this.state.isLoad=false;
}else{
_this.props.form.EmptyAllFormValue("extendAttribute");
}
}
});
}
};
componentDidMount() {
if(document.getElementById('extInfo').onclick!=null){
document.getElementById('extInfo').onclick(this.showData);
}
if(document.getElementById('extInfo').method!=null){
document.getElementById('extInfo').method(this.props.form.getAllFormValue);
}
}
setExtendPaneStat(){
let extendStat=document.getElementById('extInfo').getAttribute('extendStat');
return extendStat;
}
getExtendData(extendAttribute){
let obj = this.props.form.getAllFormValue('extendAttribute');
return obj;
}
render() {
/**领域适配 扩展属性需要是form 如果是其他的在一起讨论*/
let { form } = this.props;
let multiLang = this.props.MutiInit.getIntl(1058); //this.moduleId
const { createForm } = form;
return (
<div id="finance-reva-pobdoc-list">
<div className="title-button-area">
{}
<div className="title-area">{''}</div>
</div>
<div className="table-area">
{createForm('extendAttribute', {
onAfterEvent: afterEvent
})}
</div>
</div>
);
}
}
SSCIVAExtendAttribute = createPage({
mutiLangCode: '1058'
})(SSCIVAExtendAttribute);
export default SSCIVAExtendAttribute;
/*c6feVgHks+LyJTmQx3O1fl1cwYsozyxOl9Q9wszTHUnxe0bBK9DpO42N1Lkdlsh/*/

View File

@ -0,0 +1,3 @@
{
"hash": false
}

View File

@ -0,0 +1,10 @@
/*DncIqBreQz6WZRX+v7Ozgeb2GiCyBhLZSg5Wq33Dvjk=*/
import requestApi from '../requestApi';
export default function (props, id, key, value, data, index) {
if (!value || Object.keys(value).length === 0) {
return;
}
}
/*DncIqBreQz6WZRX+v7Ozgeb2GiCyBhLZSg5Wq33Dvjk=*/

View File

@ -0,0 +1,8 @@
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/
// import buttonClick from './buttonClick';
import initTemplate from './initTemplate';
import afterEvent from './afterEvent';
// import tableModelConfirm from './tableModelConfirm';
export { initTemplate, afterEvent};
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/

View File

@ -0,0 +1,21 @@
/*2kFYPys7dcTdBIA5Qvd/fMngg8oja2B5tYXRPvJDP58=*/
import {base, high, ajax} from 'nc-lightapp-front';
import 'ssccommon/components/globalPresetVar';
import requestApi from '../requestApi';
export default function (props) {
const statusVar = window.presetVar.status;
props.createUIDom(
{
pagecode: '105802SSCIVA_TransType',//页面编码
appcode:'105802JYLX'//小应用编码
}, (data) => {
let meta = data.template;
// presetVar.pageId = meta.pageid;
//设置区域模板
props.meta.setMeta(meta);
}
)
}
/*2kFYPys7dcTdBIA5Qvd/fMngg8oja2B5tYXRPvJDP58=*/

View File

@ -0,0 +1,8 @@
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import SSCIVAExtendAttribute from './SSCIVAExtendAttribute';
ReactDOM.render(<SSCIVAExtendAttribute/>, document.querySelector('#transtypebusi'));
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/

View File

@ -0,0 +1 @@
@import "~ssccommon/less/base";

View File

@ -0,0 +1,26 @@
/*NfbwZuhGuJXM+2qP8b1Tl2OD0XFf/EhoEYwVvkqTzWE=*/
/**
* 全局变量设置文件
*/
import 'ssccommon/components/globalPresetVar';
//全局变量尽量配置在presetVar中防止全局变量污染。也方便统一管理。
window.presetVar = {
...window.presetVar,
pageId: '',
pageCode: '',
//表头(主表)变量配置
head: {
head1: 'head',
head2: ''
},
//表体(子表)变量配置
body: {
body1: '',
body2: ''
},
//搜索模板变量配置
search: {}
};
/*NfbwZuhGuJXM+2qP8b1Tl2OD0XFf/EhoEYwVvkqTzWE=*/

View File

@ -0,0 +1,13 @@
/*Mq+ry/aXt/6nN0mNqW5qEGRL+kTvjr8avDrc0tsezZo=*/
import requestApi from "ssccommon/components/requestApi";
import {ajax } from 'nc-lightapp-front';
let requestDomain = '';
let requestApiOverwrite = {
...requestApi,
}
export default requestApiOverwrite;
/*Mq+ry/aXt/6nN0mNqW5qEGRL+kTvjr8avDrc0tsezZo=*/

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,12 @@
/*PALygF/oi04Lp67yfEkAXPJFX/q4S3DNWaZCEmIXcek=*/
import {getTranstype} from 'ssccommon/utils/contextUtils';
import presetVar from '../presetVar';
export default function () {
let transtypecode = getTranstype(this.props).code;
if (!transtypecode) {
transtypecode = (this.props.form.getFormItemsValue(presetVar.formAreaId, 'transtypecode') || {}).value;
}
return transtypecode;
}
/*PALygF/oi04Lp67yfEkAXPJFX/q4S3DNWaZCEmIXcek=*/

View File

@ -0,0 +1,64 @@
/*QJ/6Ak/S7AzMJg2nz7kLf18f7V9BxyYd9IuXj69bLg4=*/
import getBillType from './getBillType'
import presetVar from '../presetVar'
export default function () {
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 过滤表体空行
this.props.cardTable.filterEmptyRows(presetVar.bodyAreaId, ['xmjshj'], 'include');
this.props.cardTable.filterEmptyRows(presetVar.body2AreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
//修改新增表体行给新增行的pk_ivapplication赋值
bodyData.rows.forEach( (item)=>{
item.values.pk_ivapplication = formData.rows[0].values.pk_ivapplication
})
// 特殊票种明细子表数据
let specialbodyData = this.props.cardTable.getAllData(presetVar.body2AreaId);
if( specialbodyData && specialbodyData.rows ){
// 过滤复制完数据之后,删除的特殊票种明细数据
if(this.props.form.getFormStatus(presetVar.formAreaId)===presetVar.status.add){
specialbodyData.rows=specialbodyData.rows.filter(ele=>{
return ele.status!=='3'
})
}
//修改新增表体行给新增行的pk_ivapplication赋值
specialbodyData.rows.forEach( (item)=>{
if(item.status==='2'){
item.values.pk_ivapplication = formData.rows[0].values.pk_ivapplication;
item.values.pk_ivappdetail = bodyData.rows[0].values.pk_ivappdetail;
}
})
}
// 组装用户数据
let userjson = {
appcode: this.props.getSearchParam('c'),
pagecode: this.props.getSearchParam('p'),
templateid: this.props.meta.getMeta().pageid,
tradetype: getBillType.call(this),
uistatus: this.props.getUrlParam('status'),
assingUsers: this.assingUsers
}
// 组装发送数据
let sendData = {
pageid: this.props.getSearchParam('p'),
head: {
[presetVar.formAreaId]: formData,
userjson: JSON.stringify(userjson)
},
body: {
[presetVar.bodyAreaId]: bodyData
}
}
// 模板中存在特殊票种明细表体才传此区域数据
if(this.isHasSpecialInvoiceArea){
sendData.grandSons={
[presetVar.body2AreaId]: specialbodyData
}
}
return sendData;
}
/*QJ/6Ak/S7AzMJg2nz7kLf18f7V9BxyYd9IuXj69bLg4=*/

View File

@ -0,0 +1,18 @@
/*IaRlBpN2hlw0dVMIs0txbKB4WudpWOEd2XK1g0zNdBg=*/
/**
* 初始化所有表单可编辑性根据共享中心
*/
export default function (moduleId) {
// 取得选择的共享中心
const sscUnit = this.props.form.getFormItemsValue(moduleId, 'pk_org');
if (sscUnit && sscUnit.value) {
// 共享中心有选择
// 恢复其他字段可编辑性
this.props.resMetaAfterPkorgEdit();
} else {
// 共享中心没有选择
// 控制其他字段不可编辑
this.props.initMetaByPkorg();
}
}
/*IaRlBpN2hlw0dVMIs0txbKB4WudpWOEd2XK1g0zNdBg=*/

View File

@ -0,0 +1,297 @@
/*WAp8MAXVHOVnUnl/ZfUcIYB/a0YBD7LLfkbpC2MUUsg=*/
import { cardCache } from "nc-lightapp-front";
import { get } from 'lodash'
let { setDefData, getDefData } = cardCache;
import getDefDataFromMeta from 'ssccommon/utils/getDefDataFromMeta';
import getPageData from '../common/getPageData'
import getBillType from './getBillType'
import requestApi from '../requestApi'
import presetVar from '../presetVar'
/**
* 取得用户默认数据
*/
export default function (pageStatus, meta, callbackfunction, loadDataCallBackFunction) {
// 为了能够不刷新页面,立即体现组织参数的修改,去掉缓存方案
// let newData = getDefData(presetVar.loadDataData, presetVar.dataSource);
// if (newData) {
// if (loadDataCallBackFunction) {
// loadDataCallBackFunction.call(this, newData);
// } else {
// loadDataCallBack.call(this, meta, newData, false, callbackfunction,);
// }
// return;
// }
let billData = {};
switch (pageStatus) {
case presetVar.status.add:
billData = getDefDataFromMeta(meta, null, 'body', presetVar.bodyAreaId);
if(this.isHasSpecialInvoiceArea){
billData.grandSons=getDefDataFromMeta(meta, null, 'grandSons', presetVar.body2AreaId).grandSons;
}
break;
case presetVar.status.edit:
billData = getPageData.call(this);
break;
default:
billData = getDefDataFromMeta(meta, null, 'body', presetVar.bodyAreaId);
if(this.isHasSpecialInvoiceArea){
billData.grandSons=getDefDataFromMeta(meta, null, 'grandSons', presetVar.body2AreaId).grandSons;
}
break;
}
// 组装用户数据
let userjson = {
appcode: this.props.getSearchParam('c'),
pagecode: presetVar.cardPagecode,
templateid: meta.pageid,
tradetype: getBillType.call(this),
uistatus: pageStatus
}
// 组装发送数据
let sendData = {
head: {
...billData.head,
userjson: JSON.stringify(userjson)
},
bodys: billData.body,
}
// 模板中存在特殊票种明细表体才传此区域数据
if(this.isHasSpecialInvoiceArea){
sendData.grandSons=billData.grandSons
}
requestApi.loadData({
data: sendData,
success: (data) => {
let pageMeta=this.props.meta.getMeta();
if (loadDataCallBackFunction) {
loadDataCallBackFunction.call(this, data);
} else {
loadDataCallBack.call(this, pageMeta, data, false, callbackfunction);
}
}
})
}
/**
* loadData回掉方法
* @param {*} data
*/
function loadDataCallBack(meta, data, isEdit, callbackfunction) {
setInitialvalue.call(this, meta, data);
setRefQueryCondition.call(this, meta);
// setFieldEnable.call(this, meta, data);
// 为了能够不刷新页面,立即体现组织参数的修改,去掉缓存方案
// setDefData(presetVar.loadDataData, presetVar.dataSource, data);
callbackfunction && callbackfunction.call(this, meta, data);
}
// /**
// * 控制单据可编辑性
// * @param {*} meta
// * @param {*} data
// */
// function setFieldEnable(meta, data){
// debugger
// if(data && data.userjson){
// let userjson = JSON.parse(data.userjson);
// let {editProperties} = userjson;
// if(editProperties && editProperties.length>0){
// }else{
// }
// }
// }
/**
* 设置默认值
* @param {*} meta
* @param {*} data
*/
function setInitialvalue(meta, data) {
let bodyData = data.body[presetVar.bodyAreaId].rows[0].values;
let specialbodyData = get(data,['grandSons',[presetVar.body2AreaId],"rows[0]","values"],{});
// 设置表体默认值
meta[presetVar.bodyAreaId].items.forEach((item, index) => {
let attrcode = item.attrcode;
if (bodyData[attrcode] && bodyData[attrcode].value) {
item.initialvalue = {
value: bodyData[attrcode].value,
display: bodyData[attrcode].display == null ? bodyData[attrcode].value : bodyData[attrcode].display
};
}
})
// 设置侧拉表体默认值
meta[presetVar.bodyAreaId + '_childform2'] && meta[presetVar.bodyAreaId + '_childform2'].items.forEach((item, index) => {
let attrcode = item.attrcode;
if (bodyData[attrcode] && bodyData[attrcode].value != null) {
item.initialvalue = {
value: bodyData[attrcode].value,
display: bodyData[attrcode].display == null ? bodyData[attrcode].value : bodyData[attrcode].display
};
}
})
// 设置特殊票种明细表体默认值
if(get(meta,[presetVar.body2AreaId,'items'],undefined)){
meta[presetVar.body2AreaId].items.forEach((item, index) => {
let attrcode = item.attrcode;
if (specialbodyData[attrcode] && specialbodyData[attrcode].value) {
item.initialvalue = {
value: specialbodyData[attrcode].value,
display: specialbodyData[attrcode].display == null ? specialbodyData[attrcode].value : specialbodyData[attrcode].display
};
}
})
}
}
/**
* 设置参照过滤条件
* @param {*} meta
*/
function setRefQueryCondition(meta) {
let PublicDefaultRefFilterPath = 'nccloud.web.sscivm.ivrec.ref.sqlbuilder.PublicDefaultRefSqlBuilder';//公共
// 设置表头参照过滤条件
meta[presetVar.formAreaId].items.forEach((item, index) => {
if (item.attrcode == 'pk_org') {
item.queryCondition = (obj) => {
return {
pk_group: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_group').value,
TreeRefActionExt: 'nccloud.web.sscivm.ivrec.ref.sqlbuilder.FinanceOrgRefSqlBuilder',
DataPowerOperationCode: 'fi',
isDataPowerEnable: 'Y',
appcode: this.props.getSearchParam('c')
};
};
}else if (item.attrcode == 'pk_org_v') {
item.queryCondition = (obj) => {
return {
pk_group: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_group').value,
TreeRefActionExt: 'nccloud.web.refer.sqlbuilder.PrimaryOrgVersionSqlBuilder',
DataPowerOperationCode: 'fi',
isDataPowerEnable: 'Y',
AppCode: this.props.getSearchParam('c')
};
};
}else if(item.attrcode == 'tspz'){
item.queryCondition = (obj) => {
return {
GridRefActionExt: 'nccloud.web.sscivm.ivrec.ref.sqlbuilder.ApplicationTspzSqlBuilder',
appcode: this.props.getSearchParam('c')
};
};
} else if (item.itemtype == 'refer') {
item.queryCondition = (obj) => {
let refconfig = {
pk_org: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_org').value
}
if (!obj) {
if (refconfig.TreeRefActionExt == null || refconfig.TreeRefActionExt == undefined || refconfig.TreeRefActionExt.length == 0) {
refconfig.TreeRefActionExt = PublicDefaultRefFilterPath;
}
} else if (obj.refType == 'grid') {
if (refconfig.GridRefActionExt == null || refconfig.GridRefActionExt == undefined || refconfig.GridRefActionExt.length == 0) {
refconfig.GridRefActionExt = PublicDefaultRefFilterPath;
}
} else if (obj.refType == 'tree') {
if (refconfig.TreeRefActionExt == null || refconfig.TreeRefActionExt == undefined || refconfig.TreeRefActionExt.length == 0) {
refconfig.TreeRefActionExt = PublicDefaultRefFilterPath;
}
} else if (obj.refType == 'gridTree') {
if (refconfig.GridRefActionExt == null || refconfig.GridRefActionExt == undefined || refconfig.GridRefActionExt.length == 0) {
refconfig.GridRefActionExt = PublicDefaultRefFilterPath;
}
}
return refconfig;
};
}
if (item.attrcode == 'gmf_zh') {
item.queryCondition = (obj) => {
let res={
GridRefActionExt: PublicDefaultRefFilterPath,
pk_org: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_org').value,
}
if(this.props.getAppCode()===presetVar.sgAppcode){
// 收购开票申请页面需要传供应商的值作为参照过滤条件
res.pk_cust=this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_supplier').value
}else{
// 开票申请页面需要传客户的值作为参照过滤条件
res.pk_cust=this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_customer').value
}
return res;
};
}
// 散户
if (item.attrcode == 'pk_freecustom') {
item.queryCondition = (obj) => {
if(this.props.getAppCode()===presetVar.sgAppcode){
let aaa=this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_supplier').value;
return {
pk_customsupplier: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_supplier').value,
customSupplier:this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_supplier').value
}
}
return {
pk_customsupplier: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_customer').value,
customSupplier:this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_customer').value
};
};
}
})
// 设置表体参照过滤条件
meta[presetVar.bodyAreaId].items.forEach((item, index) => {
if (item.attrcode == 'pk_org' || item.attrcode == 'pk_org_v') {
item.queryCondition = () => {
return {
pk_group: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_group').value,
DataPowerOperationCode: 'fi',
isDataPowerEnable: 'Y',
appcode: this.props.getSearchParam('c')
};
};
} else if (item.attrcode == 'taxcode') {
item.queryCondition = () => {
return {
GridRefActionExt: 'nccloud.web.sscivm.ivrec.ref.sqlbuilder.TaxcodeGridSqlBuilder'
};
};
} else if (item.itemtype == 'refer') {
item.queryCondition = () => {
return {
pk_org: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_org').value
};
};
}
})
// 设置表体侧拉参照过滤条件
meta[presetVar.bodyAreaId + '_childform2'].items.forEach((item, index) => {
if (item.attrcode == 'pk_org' || item.attrcode == 'pk_org_v') {
item.queryCondition = () => {
return {
pk_group: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_group').value,
DataPowerOperationCode: 'fi',
isDataPowerEnable: 'Y',
appcode: this.props.getSearchParam('c')
};
};
} else if (item.attrcode == 'taxcode') {
item.queryCondition = () => {
return {
GridRefActionExt: 'nccloud.web.sscivm.ivrec.ref.sqlbuilder.TaxcodeGridSqlBuilder'
};
};
} else if (item.itemtype == 'refer') {
item.queryCondition = () => {
return {
pk_org: this.props.form.getFormItemsValue(presetVar.formAreaId, 'pk_org').value
};
};
}
})
}
export { loadDataCallBack }
/*WAp8MAXVHOVnUnl/ZfUcIYB/a0YBD7LLfkbpC2MUUsg=*/

View File

@ -0,0 +1,392 @@
/*7Qi4TxJna0vD/xYGyTdh0/XwQQgzIBaBeDD+oThdyLA=*/
import presetVar from '../presetVar'
import { getscene, sceneEnmu } from 'ssccommon/utils/scene';
function setBtnVisable(status, data) {
// 设置按钮显示状态
let btnVisable = {};
let btndisable = {};
switch (status) {
case presetVar.status.browse:
let billstatus = data.rows[0].values['billstatus'].value;
let kpzt = data.rows[0].values['kpzt'].value;
//修改按钮
let isRed = data.rows[0].values['hzfp'].value;
let isInvalid = data.rows[0].values['zffp'].value;
if (isRed || isInvalid) {
btnVisable[presetVar.headBtns.Edit] = false;
}
// 设置翻页按钮
this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', true);
// 基础按钮
// 新增、删除
btnVisable[presetVar.headBtns.Add] = true;
if (billstatus == presetVar.billstatusEnum.Free) {
btnVisable[presetVar.headBtns.Delete] = true;
} else {
btnVisable[presetVar.headBtns.Delete] = false;
}
// 修改
if (billstatus == presetVar.billstatusEnum.Approved) {
// 已审批时,不可见
btnVisable[presetVar.headBtns.Edit] = false;
} else if (billstatus == presetVar.billstatusEnum.Free) {
// 自由态
if (getscene(this.props).scene == sceneEnmu.MAKEBILL) {
// 制单场景可见
btnVisable[presetVar.headBtns.Edit] = true;
} else {
// 其他场景不可见
btnVisable[presetVar.headBtns.Edit] = false;
}
} else {
// 自由、以审批以外
if (getscene(this.props).scene == sceneEnmu.APPROVESCE) {
// 审批场景可见
btnVisable[presetVar.headBtns.Edit] = true;
} else {
// 其他场景不可见
btnVisable[presetVar.headBtns.Edit] = false;
}
}
btnVisable[presetVar.headBtns.Copy] = true;
btnVisable[presetVar.headBtns.refresh] = true;
btnVisable[presetVar.headBtns.Save] = false;
btnVisable[presetVar.headBtns.Cancel] = false;
// 导入导出相关按钮
btnVisable[presetVar.headBtns.Import] = true;
btnVisable[presetVar.headBtns.Export] = true;
btnVisable[presetVar.headBtns.ExportTemplate] = true;
// 开票预览按钮
btnVisable[presetVar.headBtns.MakeInvoicePreview] = true;
// 提交按钮
// btnVisable[presetVar.headBtns.CommitGroup] = true;
if (billstatus == presetVar.billstatusEnum.Free) {
btnVisable[presetVar.headBtns.Commit] = true;
} else {
btnVisable[presetVar.headBtns.Commit] = false;
}
// 收回按钮控制
if (billstatus == presetVar.billstatusEnum.Commit) {
btnVisable[presetVar.headBtns.Uncommit] = true;
} else if (billstatus == presetVar.billstatusEnum.Approved) {
if (kpzt) {
btnVisable[presetVar.headBtns.Uncommit] = false;
} else {
btnVisable[presetVar.headBtns.Uncommit] = true;
}
} else {
btnVisable[presetVar.headBtns.Uncommit] = false;
}
// 取消开票功能按钮
let invoiceing_jshj = data.rows[0].values['invoiceing_jshj'].value || 0;
let invoiced_jshj = data.rows[0].values['invoiced_jshj'].value || 0;
btnVisable[presetVar.headBtns.CancelMakeInvoice] = true;
if (+invoiceing_jshj != 0) {
// 显示 :在途金额(invoiceing_jshj)<>0
btndisable[presetVar.headBtns.CancelMakeInvoice] = false;
} else {
btndisable[presetVar.headBtns.CancelMakeInvoice] = true;
}
// 开票功能按钮、开票预览按钮 caninvoice_jshj可开价税合计
let caninvoice_jshj = data.rows[0].values['caninvoice_jshj'].value || 0;
btnVisable[presetVar.headBtns.MakeInvoice] = true;
// 审批通过且可开价税合计!=0,开票按钮可用,开票预览按钮可用
if (+caninvoice_jshj != 0 && billstatus == presetVar.billstatusEnum.Approved) {
// 显示可开金额caninvoice_jshj<>0
btndisable[presetVar.headBtns.MakeInvoice] = false;
btnVisable[presetVar.headBtns.MakeInvoicePreview] = true;
} else {
btndisable[presetVar.headBtns.MakeInvoice] = true;
btnVisable[presetVar.headBtns.MakeInvoicePreview] = false;
}
// 如果开票和取消开票按钮都不显示
if (btndisable[presetVar.headBtns.CancelMakeInvoice] == true && btndisable[presetVar.headBtns.MakeInvoice] == true) {
btnVisable[presetVar.headBtns.CancelMakeInvoice] = false;
btnVisable[presetVar.headBtns.MakeInvoice] = false;
}
// 开票情况
if ((+invoiceing_jshj != 0 || +invoiced_jshj != 0) && billstatus == presetVar.billstatusEnum.Approved) {
// 显示 :在途金额(invoiceing_jshj)<>0 || 已开金额invoiced_jshj<>0
btnVisable[presetVar.headBtns.InvSituation] = true;
} else {
btnVisable[presetVar.headBtns.InvSituation] = false;
}
// 联查按钮
//
if (+invoiced_jshj != 0) {
btnVisable[presetVar.headBtns.LinkInvoice] = true;
} else {
btnVisable[presetVar.headBtns.LinkInvoice] = false;
}
// 来源单据
let src_pkbusibill = data.rows[0].values['src_pkbusibill'].value;
// 控制联查单据按钮
if (src_pkbusibill) {
btnVisable[presetVar.headBtns.LinkBill] = true;
} else {
btnVisable[presetVar.headBtns.LinkBill] = false;
}
// 控制联查审批情况按钮
if (billstatus != presetVar.billstatusEnum.Free) {
btnVisable[presetVar.headBtns.LinkAprove] = true;
} else {
btnVisable[presetVar.headBtns.LinkAprove] = false;
}
// 控制联查按钮
if (btnVisable[presetVar.headBtns.LinkInvoice] || btnVisable[presetVar.headBtns.LinkBill] || btnVisable[presetVar.headBtns.LinkAprove]) {
btnVisable[presetVar.headBtns.LinkGroup] = true;
} else {
btnVisable[presetVar.headBtns.LinkGroup] = false;
}
// 附件按钮
btnVisable[presetVar.headBtns.Options] = true;
// 打印按钮
btnVisable[presetVar.headBtns.Print] = true;
// 表体按钮
btnVisable[presetVar.cardBodyBtns.AddLine] = false;
btnVisable[presetVar.cardBodyBtns.DelLineBatch] = false;
btnVisable[presetVar.cardBodyBtns.CopyLineBatch] = false;
btnVisable[presetVar.cardBodyBtns.PasteToEnd] = false;
btnVisable[presetVar.cardBodyBtns.PasteCancel] = false;
btnVisable[presetVar.bodyInnerBtns.DelLine] = false;
btnVisable[presetVar.bodyInnerBtns.CopyLine] = false;
btnVisable[presetVar.bodyInnerBtns.InsertLine] = false;
btnVisable[presetVar.bodyInnerBtns.PasteToNext] = false;
// 特殊票种明细表体
btnVisable[presetVar.card2BodyBtns.AddLine] = false;
btnVisable[presetVar.card2BodyBtns.DelLineBatch] = false;
btnVisable[presetVar.card2BodyBtns.CopyLineBatch] = false;
btnVisable[presetVar.card2BodyBtns.PasteToEnd] = false;
btnVisable[presetVar.card2BodyBtns.PasteCancel] = false;
btnVisable[presetVar.body2InnerBtns.CopyLine] = false;
btnVisable[presetVar.body2InnerBtns.InsertLine] = false;
btnVisable[presetVar.body2InnerBtns.PasteToNext] = false;
break;
case presetVar.status.add:
// 设置翻页按钮不显示
this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', false);
// 调用编辑场景按钮控制
serEditScene4ButtonVisible(btnVisable);
break;
case presetVar.status.edit:
// 设置翻页按钮不显示
this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', false);
// 调用编辑场景按钮控制
serEditScene4ButtonVisible(btnVisable);
break;
case 'copy':
break;
default:
// 设置翻页按钮不显示
this.props.cardPagination.setCardPaginationVisible('cardPaginationBtn', false);
// 调用编辑场景按钮控制
serEditScene4ButtonVisible(btnVisable);
break;
}
// 设置按钮显示隐藏
this.props.button.setButtonVisible(btnVisable);
// 设置按钮活性
this.props.button.setButtonDisabled(btndisable);
}
/**
* 设置编辑场景按钮显示控制逻辑
* @param {*} btnVisable 按钮显示控制对象{按钮编码是否显示true/false}
*/
function serEditScene4ButtonVisible(btnVisable) {
// 页面设计默认场景为编辑态
// 基础按钮
btnVisable[presetVar.headBtns.Add] = false;
btnVisable[presetVar.headBtns.Edit] = false;
btnVisable[presetVar.headBtns.Delete] = false;
btnVisable[presetVar.headBtns.Copy] = false;
btnVisable[presetVar.headBtns.Save] = true;
btnVisable[presetVar.headBtns.Cancel] = true;
// 提交按钮
// btnVisable[presetVar.headBtns.CommitGroup] = false;
btnVisable[presetVar.headBtns.Commit] = false;
btnVisable[presetVar.headBtns.Uncommit] = false;
// 开票功能按钮
btnVisable[presetVar.headBtns.MakeInvoice] = false;
btnVisable[presetVar.headBtns.InvSituation] = false;
// 开票预览按钮
btnVisable[presetVar.headBtns.MakeInvoicePreview] = false;
// 联查按钮
btnVisable[presetVar.headBtns.LinkGroup] = false;
btnVisable[presetVar.headBtns.LinkInvoice] = false;
btnVisable[presetVar.headBtns.LinkBill] = false;
btnVisable[presetVar.headBtns.LinkAprove] = false;
// 附件按钮
btnVisable[presetVar.headBtns.Options] = false;
// 打印按钮
btnVisable[presetVar.headBtns.Print] = false;
// 刷新按钮
btnVisable[presetVar.headBtns.refresh] = false;
// 导入导出相关按钮
btnVisable[presetVar.headBtns.Import] = false;
btnVisable[presetVar.headBtns.Export] = false;
btnVisable[presetVar.headBtns.ExportTemplate] = false;
// 表体按钮
btnVisable[presetVar.cardBodyBtns.AddLine] = true;
btnVisable[presetVar.cardBodyBtns.DelLineBatch] = true;
btnVisable[presetVar.cardBodyBtns.CopyLineBatch] = true;
btnVisable[presetVar.cardBodyBtns.PasteToEnd] = false;
btnVisable[presetVar.cardBodyBtns.PasteCancel] = false;
btnVisable[presetVar.bodyInnerBtns.DelLine] = true;
btnVisable[presetVar.bodyInnerBtns.CopyLine] = true;
btnVisable[presetVar.bodyInnerBtns.InsertLine] = true;
btnVisable[presetVar.bodyInnerBtns.PasteToNext] = false;
// 特殊票种明细表体按钮
btnVisable[presetVar.card2BodyBtns.AddLine] = true;
btnVisable[presetVar.card2BodyBtns.DelLineBatch] = true;
btnVisable[presetVar.card2BodyBtns.CopyLineBatch] = true;
btnVisable[presetVar.card2BodyBtns.PasteToEnd] = false;
btnVisable[presetVar.card2BodyBtns.PasteCancel] = false;
btnVisable[presetVar.body2InnerBtns.CopyLine] = true;
btnVisable[presetVar.body2InnerBtns.InsertLine] = true;
btnVisable[presetVar.body2InnerBtns.PasteToNext] = false;
}
/**
* 设置复制粘贴场景表体按钮状态
* @param btnVisable 按钮显示控制对象{按钮编码是否显示true/false}
* @param copyStatus 复制状态{true/false}
*/
function setCopyOrPasteSceneButtonVisible(copyStatus,bodyAreaId) {
let btnVisable = {};
if (copyStatus === 'Copied') {//已复制状态
if(bodyAreaId===presetVar.bodyAreaId){
btnVisable[presetVar.cardBodyBtns.AddLine] = false;
btnVisable[presetVar.cardBodyBtns.DelLineBatch] = false;
btnVisable[presetVar.cardBodyBtns.CopyLineBatch] = false;
btnVisable[presetVar.cardBodyBtns.PasteToEnd] = true;
btnVisable[presetVar.cardBodyBtns.PasteCancel] = true;
btnVisable[presetVar.bodyInnerBtns.Edit] = false;
btnVisable[presetVar.bodyInnerBtns.CopyLine] = false;
btnVisable[presetVar.bodyInnerBtns.InsertLine] = false;
btnVisable[presetVar.bodyInnerBtns.DelLine] = false;
btnVisable[presetVar.bodyInnerBtns.PasteToNext] = true;
}else{
// 特殊票种明细表体行
btnVisable[presetVar.card2BodyBtns.AddLine] = false;
btnVisable[presetVar.card2BodyBtns.DelLineBatch] = false;
btnVisable[presetVar.card2BodyBtns.CopyLineBatch] = false;
btnVisable[presetVar.card2BodyBtns.PasteToEnd] = true;
btnVisable[presetVar.card2BodyBtns.PasteCancel] = true;
btnVisable[presetVar.body2InnerBtns.CopyLine] = false;
btnVisable[presetVar.body2InnerBtns.InsertLine] = false;
btnVisable[presetVar.body2InnerBtns.PasteToNext] = true;
}
} else {
if(bodyAreaId===presetVar.bodyAreaId){
btnVisable[presetVar.cardBodyBtns.AddLine] = true;
btnVisable[presetVar.cardBodyBtns.DelLineBatch] = true;
btnVisable[presetVar.cardBodyBtns.CopyLineBatch] = true;
btnVisable[presetVar.cardBodyBtns.PasteToEnd] = false;
btnVisable[presetVar.cardBodyBtns.PasteCancel] = false;
btnVisable[presetVar.bodyInnerBtns.Edit] = true;
btnVisable[presetVar.bodyInnerBtns.CopyLine] = true;
btnVisable[presetVar.bodyInnerBtns.InsertLine] = true;
btnVisable[presetVar.bodyInnerBtns.DelLine] = true;
btnVisable[presetVar.bodyInnerBtns.PasteToNext] = false;
}else{
// 特殊票种明细表体行
btnVisable[presetVar.card2BodyBtns.AddLine] = true;
btnVisable[presetVar.card2BodyBtns.DelLineBatch] = true;
btnVisable[presetVar.card2BodyBtns.CopyLineBatch] = true;
btnVisable[presetVar.card2BodyBtns.PasteToEnd] = false;
btnVisable[presetVar.card2BodyBtns.PasteCancel] = false;
btnVisable[presetVar.body2InnerBtns.CopyLine] = true;
btnVisable[presetVar.body2InnerBtns.InsertLine] = true;
btnVisable[presetVar.body2InnerBtns.PasteToNext] = false;
}
}
// 设置按钮显示隐藏
this.props.button.setButtonVisible(btnVisable);
}
function setAllBtnUnVisable() {
let btnVisable = {};
// 基础按钮
btnVisable[presetVar.headBtns.Add] = false;
btnVisable[presetVar.headBtns.Edit] = false;
btnVisable[presetVar.headBtns.Delete] = false;
btnVisable[presetVar.headBtns.Copy] = false;
btnVisable[presetVar.headBtns.Save] = false;
btnVisable[presetVar.headBtns.Cancel] = false;
btnVisable[presetVar.headBtns.LinkGroup] = false;
// 提交按钮
// btnVisable[presetVar.headBtns.CommitGroup] = false;
btnVisable[presetVar.headBtns.Commit] = false;
btnVisable[presetVar.headBtns.Uncommit] = false;
// 开票功能按钮
btnVisable[presetVar.headBtns.MakeInvoice] = false;
btnVisable[presetVar.headBtns.InvSituation] = false;
// 联查按钮
// btnVisable[presetVar.headBtns.LinkGroup] = false;
btnVisable[presetVar.headBtns.LinkInvoice] = false;
btnVisable[presetVar.headBtns.LinkBill] = false;
btnVisable[presetVar.headBtns.LinkAprove] = false;
// 附件按钮
btnVisable[presetVar.headBtns.Options] = false;
// 打印按钮
btnVisable[presetVar.headBtns.Print] = false;
// 开票预览按钮
btnVisable[presetVar.headBtns.MakeInvoicePreview] = false;
// 表体按钮
btnVisable[presetVar.cardBodyBtns.AddLine] = false;
btnVisable[presetVar.bodyInnerBtns.DelLine] = false;
btnVisable[presetVar.cardBodyBtns.DelLineBatch] = false;
btnVisable[presetVar.cardBodyBtns.CopyLineBatch] = false;
btnVisable[presetVar.cardBodyBtns.PasteToEnd] = false;
btnVisable[presetVar.cardBodyBtns.PasteCancel] = false;
btnVisable[presetVar.bodyInnerBtns.CopyLine] = false;
btnVisable[presetVar.bodyInnerBtns.InsertLine] = false;
btnVisable[presetVar.bodyInnerBtns.PasteToNext] = false;
// 特殊票种明细表体行
btnVisable[presetVar.card2BodyBtns.AddLine] = false;
btnVisable[presetVar.card2BodyBtns.DelLineBatch] = false;
btnVisable[presetVar.card2BodyBtns.CopyLineBatch] = false;
btnVisable[presetVar.card2BodyBtns.PasteToEnd] = false;
btnVisable[presetVar.card2BodyBtns.PasteCancel] = false;
btnVisable[presetVar.body2InnerBtns.CopyLine] = false;
btnVisable[presetVar.body2InnerBtns.InsertLine] = false;
btnVisable[presetVar.body2InnerBtns.PasteToNext] = false;
// 设置按钮显示隐藏
this.props.button.setButtonVisible(btnVisable);
}
export { setBtnVisable, setAllBtnUnVisable, setCopyOrPasteSceneButtonVisible }
/*7Qi4TxJna0vD/xYGyTdh0/XwQQgzIBaBeDD+oThdyLA=*/

View File

@ -0,0 +1,127 @@
/*Jls4r0vkndmI+8pS8OCIWJ75bgomVJLViFA8ynyze3g=*/
import presetVar from '../presetVar'
export default function (data) {
let meta = this.props.meta.getMeta();
// 恢复开票方式枚举项
meta[presetVar.formAreaId].items.find(one => {
if (one.attrcode == 'kpfs') {
one.options = JSON.parse(this.kpfs_options);
return;
}
})
// 取得数据
let formData = (((data || {}).rows || [{}])[0].values || {});
if (getValue(formData, 'src_billno')) {
if (data.rows[0].values && (
data.rows[0].values.hzfp.value // 红字发票
|| data.rows[0].values.zffp.value // 作废发票
)) {
meta[presetVar.formAreaId].items.find(one => {
if (one.attrcode == 'kpfs') {
// 开票方式只能选择直联开票
one.options = one.options.filter(one => {
return (one.value == '1');
})
return true;
}
})
}
// 修改字段控制规则,仅控制业务信息字段不可修改,其他字段均可修改
// 不可修改字段包含:申请组织(pk_org)、申请部门(pk_dept)、申请人(sqr)、客户(pk_customer\pk_customer_v)
// 物料(pk_materiel)、数量(xmsl)、单价(xmdj)、税率(sl)、无税金额(xmje)、税额(se)、价税合计(xmjshj)、折扣金额(zkje)。
// 设置表头项目可编辑性
this.props.form.setFormItemsDisabled(presetVar.formAreaId, {
pk_org: true,
pk_dept: true,
sqr: true,
pk_customer: true,
pk_customer_v: true,
});
console.log("到这里来了吗")
// 设置表体项目可编辑性
// this.props.cardTable.setColEditableByKey(presetVar.bodyAreaId, ['pk_materiel','xmsl','xmdj','sl','xmje','se','xmjshj','zkje'], true);
// 设置表体相关按钮不显示
this.props.button.setButtonVisible({
[presetVar.cardBodyBtns.AddLine]: true,
[presetVar.bodyInnerBtns.DelLine]: true
});
} else if ((data.rows[0].values && data.rows[0].values.billstatus.value == '-1'
&& (
data.rows[0].values.hzfp.value // 红字发票
|| data.rows[0].values.zffp.value // 作废发票
))
) {
// 只能修改开票方式字段
let disabledField = {};
meta[presetVar.formAreaId].items.forEach(one => {
if (one.attrcode == 'kpfs') {
// 开票方式只能选择直联开票
one.options = one.options.filter(one => {
return (one.value == '1');
})
} else {
disabledField[one.attrcode] = true;
}
})
// 设置表头项目可编辑性
this.props.form.setFormItemsDisabled(presetVar.formAreaId, disabledField);
// 设置表体不可编辑
this.props.cardTable.setStatus(presetVar.bodyAreaId, presetVar.status.browse);
// 设置表体相关按钮不显示
this.props.button.setButtonVisible({
[presetVar.cardBodyBtns.AddLine]: false,
[presetVar.bodyInnerBtns.DelLine]: false
});
} else {
// 设置表头项目可编辑性
this.props.form.setFormItemsDisabled(presetVar.formAreaId, this.pageHeadDisabled);
// 设置表体项目可编辑性
this.props.cardTable.setColEditableByKey(presetVar.bodyAreaId, ['pk_materiel','xmsl','xmdj','sl','xmje','xmjshj','zkje'], false);
this.props.cardTable.setColEditableByKey(presetVar.bodyAreaId, 'zkje', this.zkjeIsDisabled);
// 修改时财务组织不可修改
let pageStatus = this.props.getUrlParam('status');
if (pageStatus == presetVar.status.add) {
this.props.form.setFormItemsDisabled(presetVar.formAreaId, { pk_org: false, pk_org_v: false });
} else {
this.props.form.setFormItemsDisabled(presetVar.formAreaId, { pk_org: true, pk_org_v: true });
}
// 原蓝字发票号码、原蓝字发票代码-红字时不可空
if (getValue(formData, 'hzfp')) {
this.props.form.setFormItemsRequired(presetVar.formAreaId, {
fpdm: true,
fphm: true
})
} else {
this.props.form.setFormItemsRequired(presetVar.formAreaId, {
fpdm: false,
fphm: false
})
}
// 发票类型为“数电票(增值税专用发票)”或“数电票(普通发票)”时,字段“数电特殊票种”可编辑
if(getValue(formData, 'fplx') == '4'||getValue(formData, 'fplx') == '32'){
this.props.form.setFormItemsDisabled(presetVar.formAreaId, { tspz: false });
}
// 红字信息申请表-红字且增值税专用发票时不可空
if (getValue(formData, 'hzfp') && (getValue(formData, 'fplx') == '4' || getValue(formData, 'fplx') == '11')) {
this.props.form.setFormItemsRequired(presetVar.formAreaId, {
hzxxsqb: true
})
} else {
this.props.form.setFormItemsRequired(presetVar.formAreaId, {
hzxxsqb: false
})
}
}
this.props.meta.setMeta(meta);
}
function getValue(formData, key) {
return (formData[key] || {}).value;
}
/*Jls4r0vkndmI+8pS8OCIWJ75bgomVJLViFA8ynyze3g=*/

View File

@ -0,0 +1,46 @@
/*O6WTuWcE1UtwnQM4MNu/0qiJYFOw2ZKgX65R4TJwt6w=*/
import presetVar from '../presetVar'
export default function (status) {
this.props.setUrlParam({status: status});
let showBack = false;
// 设置页面编辑状态
switch (status) {
case presetVar.status.browse:
// 设置返回按钮状态
showBack = true;
// this.setState({showBack: true});
// 设置表单状态
this.props.form.setFormStatus(presetVar.formAreaId, presetVar.status.browse);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.bodyAreaId, presetVar.status.browse);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.body2AreaId, presetVar.status.browse);
break;
case presetVar.status.edit:
// 设置返回按钮状态
showBack = false;
// this.setState({showBack: false});
// 设置表单状态
this.props.form.setFormStatus(presetVar.formAreaId, presetVar.status.edit);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.bodyAreaId, presetVar.status.edit);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.body2AreaId, presetVar.status.edit);
break;
case presetVar.status.add:
default:
// 设置返回按钮状态
showBack = false;
// this.setState({showBack: false});
// 设置表单状态
this.props.form.setFormStatus(presetVar.formAreaId, presetVar.status.add);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.bodyAreaId, presetVar.status.edit);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.body2AreaId, presetVar.status.edit);
break;
}
this.setState({pagestatus: status, showBack});
}
/*O6WTuWcE1UtwnQM4MNu/0qiJYFOw2ZKgX65R4TJwt6w=*/

View File

@ -0,0 +1,20 @@
/*uM5a8ioVsn2I1Rch9MVFPFSl3CSda+7vWH+iKiQWG3A=*/
import {toast} from 'nc-lightapp-front';
export default function (userjson) {
if (userjson.failNum == '0' && userjson.successNum != '0') {
toast({content: this.multiLangJson['1058-SQ-0009'] + userjson.successNum + this.multiLangJson['1058-SQ-0010']});
} else if (userjson.failNum != '0') {
let rowMsg = userjson.failData.map(one => {
return (this.multiLangJson['1058-SQ-0013']) + one.billNo + (this.multiLangJson['1058-SQ-0014']) + one.msg;
})
toast({
color: "danger",
groupOperation: true,
TextArr: [this.multiLangJson['1058-SQ-0006'], this.multiLangJson['1058-SQ-0007'], this.multiLangJson['1058-SQ-0008']],
content: this.multiLangJson['1058-SQ-0009'] + userjson.successNum + this.multiLangJson['1058-SQ-0011'] + userjson.failNum + this.multiLangJson['1058-SQ-0010'],
groupOperationMsg: [this.multiLangJson['1058-SQ-0012'], ...rowMsg],
});
}
}
/*uM5a8ioVsn2I1Rch9MVFPFSl3CSda+7vWH+iKiQWG3A=*/

View File

@ -0,0 +1,112 @@
/*kuaYcGVzlX4fPqrT4ZVfjqChSOZ42BvuWq90jos77Js=*/
import { cardCache } from "nc-lightapp-front";
let { addCache, updateCache } = cardCache;
import setPageStatus from './setPageStatus'
import { setBtnVisable } from './setBtnVisable'
import presetVar from '../presetVar'
export default function (data, updateCacheFlag = true) {
if (data.head && data.head[presetVar.formAreaId]) {
// 更新表头数据
this.props.form.setAllFormValue(data.head);
// 更新表体数据
if (data.body && data.body[presetVar.bodyAreaId] && data.body[presetVar.bodyAreaId].rows && data.body[presetVar.bodyAreaId].rows.length > 0) {
if (!data.body[presetVar.bodyAreaId].rows[0].rowid) {
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let rowIdMap = {};
//let dataRowMap = {};
let delRowIndexs = [];
//修改新增表体行给新增行的pk_ivapplication赋值
bodyData.rows.forEach((item) => {
rowIdMap[item.values.pk_ivappdetail.value] = item.rowid;
})
data.body[presetVar.bodyAreaId].rows.forEach((rowOne) => {
rowOne.rowid = rowIdMap[rowOne.values.pk_ivappdetail.value];
//dataRowMap[rowOne.values.pk_ivappdetail.value] = rowIdMap[rowOne.values.pk_ivappdetail.value];
})
// 取得需要删除的行index
/* bodyData.rows.forEach((item, index) => {
if (!dataRowMap[item.values.pk_ivappdetail.value]) {
delRowIndexs.push(index);
}
})
if (delRowIndexs && delRowIndexs.length > 0) {
// 删除表体行数据
this.props.cardTable.delRowsByIndex(presetVar.bodyAreaId, delRowIndexs);
} */
} else {
// 取得表体数据
/* let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let dataRowIdMap = {};
let delRowIndexs = [];
data.body[presetVar.bodyAreaId].rows.forEach((rowOne) => {
dataRowIdMap[rowOne.rowid] = rowOne.rowid;
}) */
// 取得需要删除的行index
/* bodyData.rows.forEach((item, index) => {
if (!dataRowIdMap[item.rowid]) {
delRowIndexs.push(index);
}
})
if (delRowIndexs && delRowIndexs.length > 0) {
// 删除表体行数据
console.log('delRowIndexs:'+delRowIndexs);
this.props.cardTable.delRowsByIndex(presetVar.bodyAreaId, delRowIndexs, ()=>{
console.log('delRowsByIndex_callbackFunction _do');
setTimeout(()=>{
let newBodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
console.log((newBodyData.rows || []).length);
}, 1000);
}, true);
} */
}
//第三个参数为删除假删的行
this.props.cardTable.updateDataByRowId(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId], true);
}
// 更新表体数据
if (data.grandSons && data.grandSons[presetVar.body2AreaId] && data.grandSons[presetVar.body2AreaId].rows && data.grandSons[presetVar.body2AreaId].rows.length > 0) {
if (!data.grandSons[presetVar.body2AreaId].rows[0].rowid) {
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.body2AreaId);
let rowIdMap = {};
//修改新增表体行给新增行的pk_ivapplication赋值
bodyData.rows.forEach((item) => {
rowIdMap[item.values.pk_ivtspzsdetail.value] = item.rowid;
})
data.grandSons[presetVar.body2AreaId].rows.forEach((rowOne) => {
rowOne.rowid = rowIdMap[rowOne.values.pk_ivtspzsdetail.value];
})
}
//第三个参数为删除假删的行
this.props.cardTable.updateDataByRowId(presetVar.body2AreaId, data.grandSons[presetVar.body2AreaId], true);
}
// 取得新pk
let pk = data.head[presetVar.formAreaId].rows[0].values[presetVar.pkname].value;
// 更新缓存
if (this.props.getUrlParam('status') == presetVar.status.add) {
this.props.setUrlParam({ id: pk });
}
if (updateCacheFlag) {
// 更新缓存
if (this.props.getUrlParam('status') == presetVar.status.add) {
addCache(pk, data, presetVar.formAreaId, presetVar.dataSource);
this.props.cardPagination.setCardPaginationId({id: pk});
} else {
//修改保存返回的修改量,缓存更新需要传递全量数据
let billdataForFormula = this.props.createMasterChildData(presetVar.pagecode, presetVar.formAreaId, presetVar.bodyAreaId);
updateCache(presetVar.pkname, pk, billdataForFormula, presetVar.formAreaId, presetVar.dataSource);
}
}
// 更新页面状态
setPageStatus.call(this, presetVar.status.browse);
// 更新按钮显示状态
setBtnVisable.call(this, presetVar.status.browse, data.head[presetVar.formAreaId]);
}
}
/*kuaYcGVzlX4fPqrT4ZVfjqChSOZ42BvuWq90jos77Js=*/

View File

@ -0,0 +1,93 @@
/*JioT+qO4mP4R+mDgiabLRephl6ShZZnbmhIGdMpitGg=*/
import {get} from 'lodash'
import presetVar from '../presetVar'
import requestApi from '../requestApi'
/**
* pk_org申请组织,
* pk_customer客户,
* gmf_zh客户账户,
* pk_customer_v客户,
* gmf_dz购买方地址,
* gmf_dh购买方电话,
* gmf_yh购买方银行账号,
* pk_supplier供应商,
* pk_supplier_v供应商,
* xsf_dz销售方地址,
* xsf_dh销售方电话,
* xsf_yh销售方开户行,
* xsf_zhh销售方银行账号,
* xsf_zh销售方账号,
* xsf_khh销售方开户行
* pk_freecustom: 散户
*/
const headKeys = ['pk_org', 'pk_customer', 'gmf_zh', 'pk_customer_v','gmf_dz','gmf_dh','gmf_yh','gmf_zhh',"pk_supplier","pk_supplier_v","xsf_dz","xsf_dh","xsf_yh","xsf_zhh","xsf_zh","xsf_khh","pk_freecustom"];
/**
* xmdj:单价
* sl:税率
* xmje:无税金额
* se:税额
* xmsl:数量
* xmjshj:价税合计
* pk_materiel:物料
* zkje:折扣金额
* fphxz:发票行性质
* taxcode:税码
*/
const bodyKeys = ['xmdj', 'sl', 'xmje', 'se', 'xmsl', 'xmjshj', 'pk_materiel', 'zkje', 'fphxz', 'taxcode'];
export default function (moduleId, key, value, changedrows, index, record) {
let hasChange = false;
if ((moduleId == presetVar.formAreaId && headKeys.indexOf(key) > -1) ||
(moduleId == presetVar.bodyAreaId && bodyKeys.indexOf(key) > -1)) {
hasChange = true;
}
if (hasChange) {
// 取得表头数据
let headBodyData;
if (moduleId == presetVar.formAreaId) {
headBodyData = this.props.createHeadAfterEventData(presetVar.pagecode, presetVar.formAreaId, presetVar.bodyAreaId, moduleId, key, value);
} else {
headBodyData = this.props.createBodyAfterEventData(presetVar.pagecode, presetVar.formAreaId, presetVar.bodyAreaId, moduleId, key, changedrows)
}
headBodyData.templateid = this.props.meta.getMeta().pageid;
headBodyData.userjson = JSON.stringify({
appcode: this.props.getSearchParam('c'),
pagecode: this.props.getSearchParam('p'),
templateid: this.props.meta.getMeta().pageid,
checkrule: 'true'
});
// 组装发送数据
let sendData = {
...headBodyData,
checkrule: 'true',
templateid: this.props.meta.getMeta().pageid
}
requestApi.valueChange({
data: sendData,
success: (data) => {
data.head && data.head[presetVar.formAreaId] && this.props.form.setAllFormValue(data.head);
data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.updateDataByRowId(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
if (moduleId == presetVar.bodyAreaId && key == 'zkje') {
// 折扣金额编辑后可能增加折扣行
let addRow = data.body[presetVar.bodyAreaId].rows.find(one => !one.rowid);
addRow && this.props.cardTable.addRow(presetVar.bodyAreaId, index + 1, addRow.values, false);
// 删除不要得折扣行
const allRows = this.props.cardTable.getAllRows(presetVar.bodyAreaId);
allRows.find((one)=>{
const pk_ivappdetail = get(one, 'values.pk_ivappdetail.value');
const rowid = get(one, 'rowid');
if(one.status == '3' && (pk_ivappdetail == null || pk_ivappdetail == '')){
this.props.cardTable.delRowByRowId(presetVar.bodyAreaId, rowid, null, true);
return true;
}else if(one.status == '3' && pk_ivappdetail){
this.props.cardTable.delRowByRowId(presetVar.bodyAreaId, rowid, null, false);
return true;
}
})
}
}
});
}
}
/*JioT+qO4mP4R+mDgiabLRephl6ShZZnbmhIGdMpitGg=*/

View File

@ -0,0 +1,105 @@
/*AFolAoouXffw6m+tX6c/c8FKYcqqXVdWxzCoQ8XI3mQ=*/
import { cardCache } from "nc-lightapp-front";
import { get } from "lodash"
let { getCacheById, updateCache } = cardCache;
import requestApi from '../requestApi'
import presetVar from '../presetVar'
import specialAreaSetting from '../events/specialAreaSetting'
export default function (callbackFunction) {
let pkBill = this.props.getUrlParam('id');
if (pkBill) {
let fplx = "";//发票类型
let tspzCode="";//特殊票种编码
let zsfs = "";//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
let cardData = getCacheById(pkBill, presetVar.dataSource);
if (cardData) {
//控制单据编号
this.props.BillHeadInfo.setBillHeadInfoVisible({
showBillCode: true,
billCode: cardData.head[presetVar.formAreaId].rows[0].values['billno'].value || ''
});
this.props.form.setAllFormValue({ [presetVar.formAreaId]: cardData.head[presetVar.formAreaId] });
cardData.body && cardData.body[presetVar.bodyAreaId] && this.props.cardTable.setTableData(presetVar.bodyAreaId, cardData.body[presetVar.bodyAreaId]);
cardData.grandSons && cardData.grandSons[presetVar.body2AreaId] && this.props.cardTable.setTableData(presetVar.body2AreaId, cardData.grandSons[presetVar.body2AreaId]);
fplx = get(cardData,"head.head.rows[0].values.fplx.value","");//发票类型
tspzCode=get(cardData,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
zsfs = get(cardData,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this, {
fplx,
zsfs,
tspz: tspzCode,
tableRows: get(cardData, ["body", presetVar.bodyAreaId,"rows"], []),
});
callbackFunction && callbackFunction.call(this, cardData);
// const disabledUploader = cardData.head[presetVar.formAreaId].rows[0].values.billstatus.value === presetVar.billstatusEnum.Approved
// this.setState({ disabledUploader })
} else {
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let specialbodyData = this.props.cardTable.getAllData(presetVar.body2AreaId);
// 组装用户数据
let userjson = {
pagecode: this.props.getSearchParam('p'),
pk_ivapplication: pkBill
}
// 组装发送数据
let sendData = {
head: {
[presetVar.formAreaId]: formData,
userjson: JSON.stringify(userjson)
},
body: {
[presetVar.bodyAreaId]: bodyData
}
}
// 模板中存在特殊票种明细表体才传此区域数据
if(this.isHasSpecialInvoiceArea){
sendData.grandSons={
[presetVar.body2AreaId]: specialbodyData
}
}
requestApi.viewBill({
data: sendData,
success: (data) => {
if (data && data.head) {
// let billstatus = data.head.head.rows[0].values.billstatus.value;
// // //单据状态为已生效,不能修改附件
// // this.setState({ disabledUploader: billstatus === presetVar.billstatusEnum.Approved ? true : false })
//控制单据编号
this.props.BillHeadInfo.setBillHeadInfoVisible({
showBillCode: true,
billCode: data.head.head.rows[0].values['billno'].value || ''
});
this.openbillId = data.head.head.rows[0].values.src_pkbusibill.value;
this.tradetype = data.head.head.rows[0].values.src_tradetype.value;
this.pkbusibill = data.head.head.rows[0].values.src_pkbusibill;
updateCache(presetVar.pkname, pkBill, data, presetVar.formAreaId, presetVar.dataSource);
// 设置表头数据
this.props.form.setAllFormValue(data.head);
// 设置表体数据
data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.setTableData(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
data.grandSons && data.grandSons[presetVar.body2AreaId] && this.props.cardTable.setTableData(presetVar.body2AreaId, data.grandSons[presetVar.body2AreaId]);
fplx = get(data,"head.head.rows[0].values.fplx.value","");//发票类型
tspzCode=get(data,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
zsfs = get(data,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this, {
fplx,
zsfs,
tspz: tspzCode,
tableRows: get(data, ["body", presetVar.bodyAreaId,"rows"], []),
});
} else {
this.pubMessage.viewBillError();
}
callbackFunction && callbackFunction.call(this, data);
}
})
}
}
}
/*AFolAoouXffw6m+tX6c/c8FKYcqqXVdWxzCoQ8XI3mQ=*/

View File

@ -0,0 +1,10 @@
/*6Z/9eaUjZ0gHlRPudBRnSYs/SFiov/QUfZiwFPKTpNE=*/
import presetVar from '../presetVar'
export default function () {
this.props.pushTo("/list", {
pagecode: presetVar.listPagecode,
tradetype: this.props.getUrlParam("transtype")
})
}
/*6Z/9eaUjZ0gHlRPudBRnSYs/SFiov/QUfZiwFPKTpNE=*/

View File

@ -0,0 +1,7 @@
/*t062wrAbzsHyGvc+J5WsZIAprchAzhPCBLz+JrEfjIw=*/
import valueChange from '../common/valueChange'
export default function (props, moduleId, key, value, changedrows, index, record, type, method) {
valueChange.call(this, moduleId, key, null, changedrows, index, record);
}
/*t062wrAbzsHyGvc+J5WsZIAprchAzhPCBLz+JrEfjIw=*/

View File

@ -0,0 +1,22 @@
/*U41ajtHAnBXc4J9azvHa6Qwj5SSm8LH6xyYTxcVFDGc=*/
/**
* 列表编辑前事件
* @param {*} props
* @param {*} moduleId
* @param {*} item
* @param {*} index
* @param {*} value
* @param {*} record
*/
export default function (props, moduleId, item, index, value, record) {
if(item == 'zkje'){
if((record.values.xmmc || {}).value && (record.values.xmjshj || {}).value && Number((record.values.xmjshj || {}).value)>0){
return true;
}else{
return false;
}
}else{
return true;
}
}
/*U41ajtHAnBXc4J9azvHa6Qwj5SSm8LH6xyYTxcVFDGc=*/

View File

@ -0,0 +1,16 @@
/*2qVxOMkAjdw9MLPipJePpuPQfjGrczC3wuXK2GVgFgs=*/
// 表体展开点击删行后事件
import requestApi from '../requestApi'
import getPageData from '../common/getPageData'
export default function (props) {
// 删行后重新计算表单数据并更新表单
requestApi.PasteToNext({
data: getPageData.call(this),
success: (data) => {
// 更新表头数据
props.form.setAllFormValue(data.head);
}
})
}
/*2qVxOMkAjdw9MLPipJePpuPQfjGrczC3wuXK2GVgFgs=*/

View File

@ -0,0 +1,117 @@
/*PFX5kEidSR9Hnx7I97Aa2BQjlLWwwduD6JtwpAF3oEY=*/
import {cardCache} from 'nc-lightapp-front';
import presetVar from '../presetVar'
import valueChange from '../common/valueChange'
import { setCopyOrPasteSceneButtonVisible } from '../common/setBtnVisable';
import getPageData from '../common/getPageData'
import requestApi from '../requestApi'
import { cloneDeep } from 'lodash'
const {setDefData, getDefData} = cardCache;
let cacheKey = 'copyTableData';
export default function () {
let props = this.props;
return {
// 修改
[presetVar.bodyInnerBtns.Edit]: {
actionCode: 'BodyCardEdit'
},
// 删除
[presetVar.bodyInnerBtns.DelLine]: {
actionCode: 'BodyDelete',
afterClick: (clickedRow, index) => {
let bodyData = props.cardTable.getAllData(presetVar.bodyAreaId);
if (bodyData.rows.length == 0) {
props.form.setFormItemsValue(
presetVar.formAreaId,
{'jshj': {value: 0, display: null}},
{'hjje': {value: 0, display: null}},
{'hjse': {value: 0, display: null}}
)
} else {
let changedrows = [{
'rowid': clickedRow.rowid,
'newvalue': {'value': '0'},
'oldvalue': {'value': clickedRow.values['xmjshj'].value}
}];
valueChange.call(this, presetVar.bodyAreaId, 'xmjshj', null, changedrows)
}
let bodyCheckedData = props.cardTable.getCheckedRows(presetVar.bodyAreaId);
if(!bodyCheckedData.length){
// 删除选中数据之后禁用删行和复制行按钮
props.button.setButtonDisabled([presetVar.cardBodyBtns.CopyLineBatch, presetVar.cardBodyBtns.DelLineBatch], true);
}
}
},
// 复制
[presetVar.bodyInnerBtns.CopyLine]: {
actionCode: 'CopyLine',
afterClick: (clickedRow, index) => {
setCopyOrPasteSceneButtonVisible.call(this,'Copied',presetVar.bodyAreaId)
let copyData=[ { data:clickedRow } ];
setDefData(cacheKey, presetVar.dataSource, copyData);//将复制的数据存入缓存
}
},
// 插入行
[presetVar.bodyInnerBtns.InsertLine]: {
actionCode: 'BodyInsert'
},
// 粘贴至此
[presetVar.bodyInnerBtns.PasteToNext]: {
actionCode: 'PasteToNext',
afterClick: (clickedRow, index) => {
let copyTempData=cloneDeep(getDefData(cacheKey, presetVar.dataSource) || []);
setCopyOrPasteSceneButtonVisible.call(this,'',presetVar.bodyAreaId);
let insertIndex=index+1;
copyTempData.forEach(item=>{
if(item.data&&item.data.values){
//粘贴的数据状态修改为2新增清空主键
item.data.status='2';
item.data.values.pk_ivappdetail={values:''};
props.cardTable.addRow(presetVar.bodyAreaId, insertIndex, item.data.values);
insertIndex++;
}
})
// 粘贴后重新计算表单数据并更新表单
requestApi.PasteToNext({
data: getPageData.call(this),
success: (data) => {
// 更新表头数据
props.form.setAllFormValue(data.head);
}
})
}
},
// 特殊票种明细表体-复制
[presetVar.body2InnerBtns.CopyLine]: {
actionCode: 'CopyLine',
afterClick: (clickedRow, index) => {
setCopyOrPasteSceneButtonVisible.call(this,'Copied',presetVar.body2AreaId)
let copyData=[ { data:clickedRow } ];
setDefData(cacheKey, presetVar.dataSourceSpecial, copyData);//将复制的数据存入缓存
}
},
// 特殊票种明细表体-插入行
[presetVar.body2InnerBtns.InsertLine]: {
actionCode: 'BodyInsert'
},
// 特殊票种明细表体-粘贴至此
[presetVar.body2InnerBtns.PasteToNext]: {
actionCode: 'PasteToNext',
afterClick: (clickedRow, index) => {
let copyTempData=cloneDeep(getDefData(cacheKey, presetVar.dataSourceSpecial) || []);
setCopyOrPasteSceneButtonVisible.call(this,'');
let insertIndex=index+1;
copyTempData.forEach(item=>{
if(item.data&&item.data.values){
//粘贴的数据状态修改为2新增清空主键
item.data.status='2';
item.data.values.pk_ivappdetail={values:''};
props.cardTable.addRow(presetVar.body2AreaId, insertIndex, item.data.values);
insertIndex++;
}
})
}
}
}
}
/*PFX5kEidSR9Hnx7I97Aa2BQjlLWwwduD6JtwpAF3oEY=*/

View File

@ -0,0 +1,101 @@
/*CyksppcLdT7eDjJhXsO05opbBFOlclzcJMkyT+3qZNs=*/
import { toast } from 'nc-lightapp-front';
import { get } from "lodash"
import updataPage from '../common/updataPage'
import requestApi from '../requestApi'
import getBillType from '../common/getBillType'
import presetVar from "../presetVar";
import showListMessage from '../common/showListMessage'
import { setBtnVisable } from "../common/setBtnVisable";
import specialAreaSetting from './specialAreaSetting'
// 确认开票
export default function (isShowSlsmModal=false) {
// isShowSlsmModal是否显示税率说明弹窗
if(isShowSlsmModal&&this.state.selectedSLSMValue===''){
return this.setState({
isShowTips:true
})
}
let sendData = {
pagecode: this.props.getSearchParam('p'),
datas: [{
pk: this.props.getUrlParam('id'),
ts: (this.props.form.getFormItemsValue(presetVar.formAreaId, 'ts') || {}).value
}]
}
if(isShowSlsmModal){
sendData.slsm = this.state.selectedSLSMValue;
}
requestApi.MakeInvoice({
data: sendData,
success: (data) => {
isShowSlsmModal&&this.closeModal();
updataPage.call(this, data);
if (JSON.parse(data['105802SQ_card'].userjson).failData.length == 0 || (JSON.parse(data['105802SQ_card'].userjson).failData[0] && JSON.parse(data['105802SQ_card'].userjson).failData[0].kpbz)) {
// 开票成功后弹出开票情况
this.invoiceComponent.setApplicationParams({
pkApplication: this.props.getUrlParam('id'),
pkApplicationTypeCode: getBillType.call(this),
ssckpType:this.props.getSearchParam('c')===presetVar.sgAppcode?presetVar.ssckpTypeEnum.SGKP:presetVar.ssckpTypeEnum.KP,//用于判断请求开票情况模板的appcode,'KP':开票申请,'SGKP':收购开票申请
});
this.invoiceComponent.linkSituation.show();
} else {
// 提示消息
showListMessage.call(this, JSON.parse(data['105802SQ_card'].userjson));
}
this.invoiceComponent.setCallBackFunction(() => {
let pkBill = this.props.getUrlParam('id');
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
// 组装用户数据
let userjson = {
pagecode: this.props.getSearchParam('p'),
pk_ivapplication: pkBill
};
// 组装发送数据
let sendData = {
head: {
[presetVar.formAreaId]: formData,
userjson: JSON.stringify(userjson)
},
body: {
[presetVar.bodyAreaId]: bodyData
}
};
if (formData) {
requestApi.viewBill({
data: sendData,
success: (data) => {
if (data && data.head) {
// 设置表头数据
this.props.form.setAllFormValue(data.head);
// 设置表体数据
data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.setTableData(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
data.grandSons && data.grandSons[presetVar.body2AreaId] && this.props.cardTable.setTableData(presetVar.body2AreaId, data.grandSons[presetVar.body2AreaId]);
// 设置按钮状态
setBtnVisable.call(this, presetVar.status.browse, data.head.head);
let fplx = get(data,"head.head.rows[0].values.fplx.value","");//发票类型
let tspzCode=get(data,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(data,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this,{fplx,zsfs,tspz:tspzCode})
} else {
toast({
color: 'danger',
content: this.multiLangJson[presetVar.mutiLangCodeDetail.viewBillError]
});
}
}
})
}
});
},
error: (data)=>{
isShowSlsmModal&&this.closeModal();
toast({color:"danger", content: data.message});
}
})
}
/*CyksppcLdT7eDjJhXsO05opbBFOlclzcJMkyT+3qZNs=*/

View File

@ -0,0 +1,23 @@
/*JNnb7VnKIimhevxx9sWXRj+n03NLuQsUW6GPtd3kH8Q=*/
import viewBill from '../common/viewBill'
import {setBtnVisable} from '../common/setBtnVisable'
import presetVar from '../presetVar'
export default function (props, id) {
this.props.setUrlParam({id: id});
viewBill.call(this, (data) => {
setBtnVisable.call(this, presetVar.status.browse, data.head[presetVar.formAreaId]);
const saga_status = data.head.head.rows[0].values.saga_status;
const saga_gtxid = data.head.head.rows[0].values.saga_gtxid;
if(saga_status) {
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: saga_status.value === "1"
})
this.props.socket.showToast({
gtxid: saga_gtxid && saga_gtxid.value || "",
billpk: id
});
}
});
}
/*JNnb7VnKIimhevxx9sWXRj+n03NLuQsUW6GPtd3kH8Q=*/

View File

@ -0,0 +1,72 @@
/*9oNSQ86zYBKgm3JBJdBE6LnpikdaXkzpYo1VtwKhpHE=*/
import { toast } from 'nc-lightapp-front';
import valueChange from '../common/valueChange'
import setFieldStatus from '../common/setFieldStatus'
import initAllFormEditorial from '../common/initAllFormEditorial'
import presetVar from '../presetVar'
import { replace, get } from "lodash"
import specialAreaSetting from './specialAreaSetting'
export default function (props, moduleId, key, newValue, oldValue, value, formValues) {
valueChange.call(this, moduleId, key, newValue);
setFieldStatus.call(this, {
rows: [
{
values: formValues
}
]
});
if(moduleId == presetVar.formAreaId && key==='pk_org') {
initAllFormEditorial.call(this, moduleId);
}
let fplx = get(formValues,"fplx.value","");//发票类型
let fplxDisplay = get(formValues,"fplx.display","");//发票类型名称
let zsfs = get(formValues,"zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
let tspzCode=get(formValues,"tspz.display","").split('/')[0];;//特殊票种编码
// 修改表头中特殊票种字段值时,按需求更新页面数据
if(key==='tspz'||key==='fplx'||key==='zsfs'){
// 发票类型为“数电票(增值税专用发票):31”或“数电票(普通发票):32”且数电特殊票种为E06不动产租赁、E05不动产销售、E03建筑服务时,征税方式为差额开票时,发票明细表体行只允许一正常明细行,或一组折扣与被折扣行。
if (((fplx == "31" || fplx == "32") && (tspzCode === "E03" || tspzCode === "E05" || tspzCode === "E06")) || zsfs === "2"){
let bodyRows = this.props.cardTable.getAllRows(presetVar.bodyAreaId);
// 业务单据推式生成的开票申请如存在多行需报错提示XXXXX票种属于特定业务开具时不可多行开具
if(get(formValues,'src_pkbusibill.value','')&&bodyRows.length>1){
this.props.form.setFormItemsValue(presetVar.formAreaId,{[key]:oldValue});
// "1058-SQ-0029": "{a}票种属于特定业务,开具时不可多行开具!",
return toast({
color: "danger",
content:replace(this.multiLangJson['1058-SQ-0029'],'{a}',fplxDisplay),
});
}
let indexArr=[];//要删除的表体行index
if(bodyRows.length===0){
this.props.cardTable.addRow(presetVar.bodyAreaId, undefined, undefined, false);//新增一条空行
}else if(bodyRows.length>1){
let firstRowFphxz = get(bodyRows[0], "values.fphxz.value", ""); //fphxz 发票行性质 1:折扣行2被折扣行
let firstRowhh = get(bodyRows[0], "values.hh.value", ""); //hh 行号
let firstRowZkhhh = get(bodyRows[0], "values.zkhhh.value", ""); //zkhhh 折扣行行号
let zkhIndex = null;//折扣行index
let bzkhIndex = null;//被折扣行index
// 如果第一行数据为折扣行,则删除除被折扣行以外的表体行数据;
// 如果第一行数据为被折扣行,则删除除折扣行以外的表体行数据
if (firstRowFphxz === "1") {
bzkhIndex = get(bodyRows.find(ele=>{
return get(ele, "values.zkhhh.value", "")===firstRowhh
}),"dataIndex",null);
}else if(firstRowFphxz==='2'){
zkhIndex = get(bodyRows.find(ele=>{
return get(ele, "values.hh.value", "")===firstRowZkhhh
}),"dataIndex",null);
}
bodyRows.forEach((element,index) => {
if(index>0&&element.dataIndex!==bzkhIndex&&element.dataIndex!==zkhIndex){
indexArr.push(element.dataIndex)
}
});
// 删除表体行数据
this.props.cardTable.delRowsByIndex(presetVar.bodyAreaId,indexArr);
}
}
// 根据表单内容,修改页面数据状态
specialAreaSetting.call(this,{fplx,zsfs,tspz:tspzCode})
}
}
/*9oNSQ86zYBKgm3JBJdBE6LnpikdaXkzpYo1VtwKhpHE=*/

View File

@ -0,0 +1,175 @@
/*4prg4SsHcHRCMh7vQKzFQec7OmyO+NkvR6sAMZu6v2I=*/
import presetVar from '../presetVar'
import add from './headBtnEvents/add'
import edit from './headBtnEvents/edit'
import deleteBtn from './headBtnEvents/delete'
import save from './headBtnEvents/save'
import cancel from './headBtnEvents/cancel'
import commit from './headBtnEvents/commit'
import copy from './headBtnEvents/copy'
import uncommit from './headBtnEvents/uncommit'
import makeinvoice from './headBtnEvents/makeinvoice'
import cancelmakeinvoice from './headBtnEvents/cancelmakeinvoice'
import invsituation from './headBtnEvents/invsituation'
import linkaprove from './headBtnEvents/linkaprove'
import linkinvoice from './headBtnEvents/linkinvoice'
import linkbill from './headBtnEvents/linkbill'
import options from './headBtnEvents/options'
import print from './headBtnEvents/print'
import exportE from './headBtnEvents/Export'
import exportTemplate from './headBtnEvents/exportTemplate'
import makeInvoicePreview from './headBtnEvents/makeInvoicePreview'
import quickMerge from './headBtnEvents/quickMerge';
import quickSplit from './headBtnEvents/quickSplit'
/**
* 表头按钮事件
* @param {*} props
* @param {*} key 按钮KEY
*/
export default function (props, key) {
return {
// 取消
[presetVar.headBtns.Cancel]: {
actionCode: 'Cancel_List',
listPagecode: presetVar.listPagecode,
afterClick: (toListFlag) => {
if (!toListFlag) {
cancel.call(this);
}
}
},
// 新增
[presetVar.headBtns.Add]: {
click: () => {
add.call(this);
}
},
// 修改
[presetVar.headBtns.Edit]: {
click: () => {
edit.call(this);
}
},
[presetVar.headBtns.Add]: {
click: () => {
add.call(this);
}
},
// 删除
[presetVar.headBtns.Delete]: {
click: () => {
deleteBtn.call(this);
}
},
// 保存
[presetVar.headBtns.Save]: {
click: () => {
save.call(this);
}
},
// 提交
[presetVar.headBtns.Commit]: {
click: () => {
commit.call(this);
}
},
// 收回
[presetVar.headBtns.Uncommit]: {
click: () => {
uncommit.call(this);
}
},
// 复制
[presetVar.headBtns.Copy]: {
click: () => {
copy.call(this);
}
},
// 开票
[presetVar.headBtns.MakeInvoice]: {
click: () => {
makeinvoice.call(this);
}
},
// 取消开票
[presetVar.headBtns.CancelMakeInvoice]: {
click: () => {
cancelmakeinvoice.call(this);
}
},
// 开票情况
[presetVar.headBtns.InvSituation]: {
click: () => {
invsituation.call(this);
}
},
// 联查审批情况
[presetVar.headBtns.LinkAprove]: {
click: () => {
linkaprove.call(this);
}
},
// 联查发票
[presetVar.headBtns.LinkInvoice]: {
click: () => {
linkinvoice.call(this);
}
},
// 附件
[presetVar.headBtns.Options]: {
click: () => {
options.call(this);
}
},
// 打印
[presetVar.headBtns.Print]: {
click: () => {
print.call(this);
}
},
// 联查单据
[presetVar.headBtns.LinkBill]: {
click: () => {
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
let data = {
tradetype: formData.rows[0].values.src_tradetype.value,
openbillid: formData.rows[0].values.src_pkbusibill.value,
}
linkbill.call(this, data);
}
},
// 导出模板
[presetVar.headBtns.ExportTemplate]: {
click: () => {
exportTemplate.call(this);
}
},
// 导出
[presetVar.headBtns.Export]: {
click: () => {
exportE.call(this);
}
},
// 开票预览
[presetVar.headBtns.MakeInvoicePreview]: {
click: () => {
makeInvoicePreview.call(this);
}
},
// 快速拆分
[presetVar.headBtns.QuickSplit]: {
click: () => {
quickSplit.call(this);
}
},
// 快速合并
[presetVar.headBtns.QuickMerge]: {
click: () => {
quickMerge.call(this);
}
},
}
}
/*4prg4SsHcHRCMh7vQKzFQec7OmyO+NkvR6sAMZu6v2I=*/

View File

@ -0,0 +1,10 @@
/*S9xsc0mN3np6//+j1R5eUltbsiG1t8SNjjwgS6z/Mh4=*/
/**
* 导出按钮动作
*/
export default function () {
this.setState({ exportIds: [this.props.getUrlParam('id')], forceRender: false }, () => {
this.props.modal.show('exportFileModal');
})
}
/*S9xsc0mN3np6//+j1R5eUltbsiG1t8SNjjwgS6z/Mh4=*/

View File

@ -0,0 +1,61 @@
/*qKHUC86ErMu0iLpPlBQ8XQ==*/
import presetVar from '../../presetVar'
import setPageStatus from '../../common/setPageStatus'
import loadData from '../../common/loadData'
import { setBtnVisable } from '../../common/setBtnVisable'
import setFieldStatus from "../../common/setFieldStatus";
import { get } from 'lodash'
import initAllFormEditorial from '../../common/initAllFormEditorial'
export default function () {
// 设置页面状态标记
this.props.setUrlParam({ status: presetVar.status.add });
// 设置页面状态
setPageStatus.call(this, presetVar.status.add);
//控制单据编号
this.props.BillHeadInfo.setBillHeadInfoVisible({
showBillCode: true,
billCode: ''
});
loadData.call(this, presetVar.status.add, this.props.meta.getMeta(), (newMeta, data) => {
// 设置表头默认值
this.props.form.setAllFormValue(data.head);
this.props.cardTable.setTableData(presetVar.bodyAreaId, { rows: [] });
this.props.cardTable.setTableData(presetVar.body2AreaId, { rows: [] });
this.props.meta.setMeta(newMeta, () => {
this.props.cardTable.addRow(presetVar.bodyAreaId, undefined, undefined, false);
// 设置按钮状态
setBtnVisable.call(this, presetVar.status.add, data.head[presetVar.formAreaId]);
// 设置表单字段编辑性
setFieldStatus.call(this, data.head[presetVar.formAreaId]);
let onlyOneRow = false; //是否限制表体只能有一行数据,控制新增按钮禁用和表体按钮显示隐藏
let fplx = get(data,"head.head.rows[0].values.fplx.value","");//发票类型
let tspz=get(data,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(data,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
if (((fplx == "31" || fplx == "32") &&(tspz === "E03" || tspz === "E05" || tspz === "E06")) || zsfs === "2") {
let bodyRows = this.props.cardTable.getAllRows(presetVar.bodyAreaId);
bodyRows = bodyRows.filter((ele) => {
return ele.status !== "3";
});
if (bodyRows.length > 0) {
onlyOneRow=true;
}
}else{
if(get(data,'head.head.rows[0].values.src_pkbusibill.value','')){
onlyOneRow=true;
}
}
this.props.button.setButtonDisabled({
[presetVar.cardBodyBtns.AddLine]: onlyOneRow,
});
});
initAllFormEditorial.call(this,presetVar.formAreaId);
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: false
})
this.setState({ disabledUploader: false })
// 隐藏流程组件
this.billHead.ApproveProcessHide();
});
}
/*qKHUC86ErMu0iLpPlBQ8XQ==*/

View File

@ -0,0 +1,41 @@
/*zj6VKK2zjgdHDpBy9pfWAjEt8/p9+CUz5FVkyHr1RME=*/
import {get} from "lodash"
import presetVar from '../../presetVar'
import setPageStatus from '../../common/setPageStatus'
import { setBtnVisable } from '../../common/setBtnVisable'
export default function () {
// 设置页面状态
setPageStatus.call(this, presetVar.status.browse);
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
setBtnVisable.call(this, presetVar.status.browse, formData);
//控制单据编号
this.props.BillHeadInfo.setBillHeadInfoVisible({
showBillCode: true,
billCode: formData.rows[0].values['billno'].value || ''
});
const saga_status = formData.rows[0].values.saga_status;
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: saga_status && saga_status.value === "1"
})
let fplx = get(formData,"rows[0].values.fplx.value","");//发票类型
let zsfs = get(formData,"rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
let tspzCode=get(formData,"rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let specialInvoiceIsShow=false;//表体“特殊票种明细”是否可见
// 发票类型为“数电票(增值税专用发票):31”或“数电票(普通发票):32”时且特殊票种为E04货物运输、E09旅客运输或征税方式为2差额开票/全额开票=3时新扩展的表体行“特殊票种明细”可见。
if (
(fplx == "31" || fplx == "32") &&
(tspzCode === "E04" || tspzCode === "E09" || zsfs === "2" || zsfs === "3")
) {
specialInvoiceIsShow = true;
}
// 恢复特殊票种表体数据
this.props.cardTable.resetTableData(presetVar.body2AreaId);
const disabledUploader = formData.rows[0].values.billstatus.value === presetVar.billstatusEnum.Approved
this.setState({ disabledUploader, hideAdd: false, hideDel: false, specialInvoiceIsShow })
// 显示流程组件
this.billHead.ApproveProcessShow();
return;
}
/*zj6VKK2zjgdHDpBy9pfWAjEt8/p9+CUz5FVkyHr1RME=*/

View File

@ -0,0 +1,27 @@
/*pcP1Gm2+9NrmIHa4Ks/OoQHhiCC7BJRUJ62fWRWp/0w=*/
import { toast } from 'nc-lightapp-front';
import updataPage from '../../common/updataPage'
import requestApi from '../../requestApi'
import presetVar from "../../presetVar";
/**
* 开票按钮动作
*/
export default function () {
let sendData = {
pagecode: this.props.getSearchParam('p'),
datas: [{
pk: this.props.getUrlParam('id'),
ts: (this.props.form.getFormItemsValue(presetVar.formAreaId, 'ts') || {}).value
}]
}
requestApi.CancelMakeInvoice({
data: sendData,
success: (data) => {
updataPage.call(this, data);
// "1058-KP-0008": "取消开票成功",
toast({content: this.multiLangJson['1058-KP-0008']});
}
})
}
/*pcP1Gm2+9NrmIHa4Ks/OoQHhiCC7BJRUJ62fWRWp/0w=*/

View File

@ -0,0 +1,35 @@
/*Nj4lpTpkdRlAiYHw/+CxKpppeqtks0R7RMLAm80xiK8=*/
import getPageData from '../../common/getPageData'
import updataPage from '../../common/updataPage'
import requestApi from '../../requestApi'
/**
* 提交按钮动作
*/
export default function () {
requestApi.commit({
data: getPageData.call(this),
success: (data) => {
//设置了指派
if (data.workflow && (data.workflow == 'approveflow' || data.workflow == 'workflow')) {
this.setState({
compositedata: data,
compositedisplay: true,
disabledUploader: true,
});
} else {
this.setState({
compositedisplay: false,
disabledUploader: true,
});
this.assingUsers = []; // 提交成功后清空指派信息
updataPage.call(this, data);
// 操作成功提示
this.pubMessage.operateSuccess();
// 刷新流程组件
this.billHead.ApproveProcessRefresh();
}
}
})
}
/*Nj4lpTpkdRlAiYHw/+CxKpppeqtks0R7RMLAm80xiK8=*/

View File

@ -0,0 +1,88 @@
/*W1fQp2PwJm8cXwzJOe/svg==*/
import requestApi from '../../requestApi'
import presetVar from '../../presetVar'
import setPageStatus from "../../common/setPageStatus";
import { setBtnVisable } from "../../common/setBtnVisable";
import setFieldStatus from "../../common/setFieldStatus";
import loadData, { loadDataCallBack } from '../../common/loadData';
import {get} from "lodash"
import specialAreaSetting from '../specialAreaSetting'
/**
* 复制按钮动作
*/
export default function () {
/**
* 取得模板
*/
let getCopyData = new Promise((resolve, reject) => {
let sendData = {
pagecode: this.props.getSearchParam('p'),
pk: this.props.getUrlParam('id')
}
requestApi.copy({
data: sendData,
success: (data) => {
resolve(data);
}
});
})
/**
* 取得按钮
*/
let getLoadData = new Promise((resolve, reject) => {
loadData.call(this, presetVar.status.edit, this.props.meta.getMeta(), null, (data) => {
resolve(data);
});
})
Promise.all([getCopyData, getLoadData]).then((resultList) => {
let copyData = resultList[0];
let loadData = resultList[1];
let meta = this.props.meta.getMeta();
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: false
})
loadData.body[presetVar.bodyAreaId].rows[0].values['pk_group'] = copyData.head[presetVar.formAreaId].rows[0].values['pk_group'];
loadData.body[presetVar.bodyAreaId].rows[0].values['pk_org'] = copyData.head[presetVar.formAreaId].rows[0].values['pk_org'];
loadDataCallBack.call(this, meta, loadData, true, (newMeta) => {
// 设置页面状态URL参数
this.props.setUrlParam({ status: presetVar.status.add });
this.props.meta.setMeta(newMeta, () => {
let fplx = get(copyData,"head.head.rows[0].values.fplx.value","");//发票类型
let tspzCode=get(copyData,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(copyData,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
// 设置页面状态
setPageStatus.call(this, presetVar.status.add);
// 设置按钮状态
setBtnVisable.call(this, presetVar.status.add, copyData.head[presetVar.formAreaId]);
this.props.form.setAllFormValue({ [presetVar.formAreaId]: copyData.head[presetVar.formAreaId] });
this.props.cardTable.setTableData(presetVar.bodyAreaId, copyData.body[presetVar.bodyAreaId]);
// 模板中存在特殊票种明细表体才传此区域数据
if(this.isHasSpecialInvoiceArea){
this.props.cardTable.setTableData(presetVar.body2AreaId, get(copyData,['grandSons',[presetVar.body2AreaId]],[]))
}
// 设置表单字段编辑性
setFieldStatus.call(this, copyData.head[presetVar.formAreaId]);
// 根据页面数据,修改表头字段禁用和表体中按钮的禁用和显示隐藏,以及表体“特殊票种明细”是否可见
specialAreaSetting.call(this,{fplx,zsfs,tspz:tspzCode})
});
this.setState({ disabledUploader: false })
// 隐藏流程组件
this.billHead.ApproveProcessHide();
//控制单据编号
this.props.BillHeadInfo.setBillHeadInfoVisible({
showBillCode: false
});
});
});
}
/*W1fQp2PwJm8cXwzJOe/svg==*/

View File

@ -0,0 +1,56 @@
/*VxgugsDtZg6ePmFtm1nxQ4gGOeaXvTvQvdz3+KvfvZY=*/
import {cardCache, toast} from "nc-lightapp-front";
let {getNextId, deleteCacheById} = cardCache;
import handlePageInfoChange from '../handlePageInfoChange'
import requestApi from '../../requestApi'
import presetVar from '../../presetVar'
import add from './add'
export default function () {
let pk = this.props.getUrlParam('id');
let sendData = {
pagecode: this.props.getSearchParam('p'),
datas: [{
pk: pk,
ts: (this.props.form.getFormItemsValue(presetVar.formAreaId, 'ts') || {}).value
}]
}
requestApi.delete({
data: sendData,
success: (data) => {
if (data.successNum != 0) {
let nextId = getNextId(pk, presetVar.dataSource);
// 清除缓存,报账跳转进入的卡片页时,删除数据时不用清缓存
if(this.props.getUrlParam('scene') != 'bz'){
deleteCacheById(presetVar.pkname, pk, presetVar.dataSource);
}
if(this.props.getUrlParam('scene') == 'bz'){
this.pubMessage.deleteSuccess();
CloseWebPage();
}else if (nextId) {
this.pubMessage.deleteSuccess();
// 跳转至下一页
handlePageInfoChange.call(this, this.props, nextId);
} else {
// add.call(this);
//只有一条数据删除后回退到列表
this.props.pushTo("/list", {pagecode: presetVar.listPagecode})
this.pubMessage.deleteSuccess();
}
} else {
toast({color: "danger", content: data.failData[0].msg ? data.failData[0].msg : ''});
}
}
})
function CloseWebPage() {
if (navigator.userAgent.indexOf("Firefox") > 0) { //火狐浏览器
window.top.location.href = 'about:blank'
} else { //其他浏览器
window.top.opener = null
window.top.open('', '_self', '')
window.top.close()
}
}
}
/*VxgugsDtZg6ePmFtm1nxQ4gGOeaXvTvQvdz3+KvfvZY=*/

View File

@ -0,0 +1,59 @@
/*5glmTlz3b4cW2yLUjrmQHQ==*/
import presetVar from '../../presetVar'
import requestApi from '../../requestApi'
import setPageStatus from '../../common/setPageStatus'
import { setBtnVisable } from '../../common/setBtnVisable'
import loadData from '../../common/loadData'
import getBillType from '../../common/getBillType'
import setFieldStatus from "../../common/setFieldStatus";
import { get } from 'lodash'
import specialAreaSetting from '../specialAreaSetting'
export default function () {
// 判断是否可修改
requestApi.checkEdit({
data: {
billPk: this.props.getUrlParam('id'),
transTypeCode: getBillType.call(this)
},
success: (data) => {
this.props.setUrlParam({ status: presetVar.status.edit });
// 设置页面状态
setPageStatus.call(this, presetVar.status.edit);
// 设置页面默认数据
loadData.call(this, presetVar.status.edit, this.props.meta.getMeta(), (newMeta, data) => {
this.props.meta.setMeta(newMeta);
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 设置按钮状态
setBtnVisable.call(this, presetVar.status.edit, formData);
// 设置表单字段编辑性
setFieldStatus.call(this, formData, data);
let fplx = get(formData,"rows[0].values.fplx.value","");//发票类型
let tspzCode=get(formData,"rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(formData,"rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this,{fplx,zsfs,tspz:tspzCode})
if(get(formData,'rows[0].values.src_pkbusibill.value','') || get(formData,'rows[0].values.hzfp.value',false)){
// 红字发票不能操作表体金额数据,所以禁用表体操按钮
// let DelLineBatchIsVisible = !get(formData,'rows[0].values.hzfp.value',false);
this.props.button.setButtonVisible({
[presetVar.bodyInnerBtns.CopyLine]: false,
[presetVar.bodyInnerBtns.InsertLine]: false,
[presetVar.bodyInnerBtns.PasteToNext]: false,
[presetVar.bodyInnerBtns.DelLine]: false,
[presetVar.cardBodyBtns.DelLineBatch]: false,
[presetVar.cardBodyBtns.CopyLineBatch]: false,
});
this.setState({
hideAdd: true,
hideDel: true
})
}
// 隐藏流程组件
this.billHead.ApproveProcessHide();
})
}
})
}
/*5glmTlz3b4cW2yLUjrmQHQ==*/

View File

@ -0,0 +1,10 @@
/*PjU/+YUXpvtvMm9xl09Pjj12SLF++ORD2IJd8PWKGm4=*/
/**
* 导出模板按钮动作
*/
export default function () {
this.setState({exportIds: [], forceRender: false}, ()=>{
this.props.modal.show('exportFileModal');
})
}
/*PjU/+YUXpvtvMm9xl09Pjj12SLF++ORD2IJd8PWKGm4=*/

View File

@ -0,0 +1,17 @@
/*9aQW0qswdZAj9anJf7w0cilKWRdoLehMdarJvLpEeVA=*/
import getBillType from '../../common/getBillType'
import presetVar from '../../presetVar';
/**
* 联查开票情况
*/
export default function () {
this.invoiceComponent.setApplicationParams({
pkApplication: this.props.getUrlParam('id'),
pkApplicationTypeCode: getBillType.call(this),
ssckpType: this.props.getSearchParam('c') === presetVar.sgAppcode?presetVar.ssckpTypeEnum.SGKP:presetVar.ssckpTypeEnum.KP,//用于判断请求开票情况模板的appcode,KP:开票申请SGKP:收购开票申请
}, () => {
this.invoiceComponent.linkSituation.show();
});
}
/*9aQW0qswdZAj9anJf7w0cilKWRdoLehMdarJvLpEeVA=*/

View File

@ -0,0 +1,8 @@
/*zQvvcYrEeTey0ex4v+cS5oK4tX82wcQVylZX1yrSE/g=*/
/**
* 联查审批情况
*/
export default function () {
this.setState({showApproveDetail: true});
}
/*zQvvcYrEeTey0ex4v+cS5oK4tX82wcQVylZX1yrSE/g=*/

View File

@ -0,0 +1,22 @@
/*t9WIcNrVV51JQ8ZMSDI+VKnRFGykRLcGhNorbrcEElQ=*/
import {toast} from 'nc-lightapp-front';
import requestApi from '../../requestApi';
/**
* 联查单据
*/
export default function (data) {
let multiLang = this.props.MutiInit.getIntl(1058); //this.moduleId
if (data.openbillid && data.tradetype) {
requestApi.LinkBill({
data: data,
success: (data) => {
this.props.openTo(data.url, data.data);
}
})
} else {
// "1058-KP-0004": "该发票没有关联的单据",
toast({content: multiLang && multiLang.get('1058-KP-0004'), color: 'warning'});
}
}
/*t9WIcNrVV51JQ8ZMSDI+VKnRFGykRLcGhNorbrcEElQ=*/

View File

@ -0,0 +1,68 @@
/*wkIeZP/f+8mx3/nHYiHB//fiwMDY4zbGXCinL6fhmTA=*/
import { get } from "lodash"
import getBillType from '../../common/getBillType'
import presetVar from "../../../../linkSituation/list/presetVar";
import requestApi from "../../requestApi";
import selfPresetVar from '../../presetVar'
import specialAreaSetting from '../specialAreaSetting'
/**
* 联查发票
*/
export default function () {
this.invoiceComponent.setBillParams({
pkBill: this.props.getUrlParam('id'),
tradeType: getBillType.call(this),
billType: selfPresetVar.billtype,
}, () => {
this.invoiceComponent.linkInvoice.show();
// 弹框关闭刷新页面
this.invoiceComponent.setCallBackFunction(() => {
let pkBill = this.props.getUrlParam('id');
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
// 组装用户数据
let userjson = {
pagecode: this.props.getSearchParam('p'),
pk_ivapplication: pkBill
};
// 组装发送数据
let sendData = {
head: {
[presetVar.formAreaId]: formData,
userjson: JSON.stringify(userjson)
},
body: {
[presetVar.bodyAreaId]: bodyData
}
};
if (formData) {
requestApi.viewBill({
data: sendData,
success: (data) => {
if (data && data.head) {
// 设置表头数据
this.props.form.setAllFormValue(data.head);
// 设置表体数据
data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.setTableData(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
data.grandSons && data.grandSons[presetVar.body2AreaId] && this.props.cardTable.setTableData(presetVar.body2AreaId, data.grandSons[presetVar.body2AreaId]);
let fplx = get(data,"head.head.rows[0].values.fplx.value","");//发票类型
let tspzCode=get(data,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(data,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this,{fplx,zsfs,tspz:tspzCode})
} else {
toast({
color: 'danger',
content: this.multiLangJson[presetVar.mutiLangCodeDetail.viewBillError]
});
}
}
})
}
});
});
}
/*wkIeZP/f+8mx3/nHYiHB//fiwMDY4zbGXCinL6fhmTA=*/

View File

@ -0,0 +1,48 @@
/*QAYJJu58qtar9+K0/Yo5iOtEqEpvRcWCzi8ZMS2D/bo=*/
// import getSendData from '../../common/getSendData'
import { cardCache } from "nc-lightapp-front";
let { setDefData } = cardCache;
import presetVar from '../../presetVar'
import requestApi from '../../requestApi'
export default function () {
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let body2Data = this.props.cardTable.getAllData(presetVar.body2AreaId);
let pkBill = this.props.getUrlParam('id');
let catchData={
[presetVar.formAreaId]:formData,
[presetVar.bodyAreaId]:bodyData,
[presetVar.body2AreaId]:body2Data,
pkBill:pkBill
}
// 缓存选择的数据
setDefData(presetVar.MakeInvoicePreviewSourceKey, presetVar.dataSource, catchData);
if (formData) {
// this.props.pushTo("/makeInvoicePreview", {
// id: formData.rows[0].values.pk_ivapplication.value,
// ts: formData.rows[0].values.ts.value,
// scene:'cardTo'
// })
requestApi.loadMakeInvoicePreviewData({
data:{
pk_ivapplication:[pkBill]
},
success: (data) => {
if (!data.datas) { return; }
// 缓存页面的预览数据
setDefData(presetVar.MakeInvoicePreviewDataCacheKey, presetVar.dataSource, data);
// 打开开票预览
this.props.pushTo("/splitmergePreview", {
pagecode: data.pagecode, //目标页面页面编码
scene:"cardTo", //用于区分来源页面
id:pkBill,//列表页选中数据id
source:"cardTo",//用于判断根页面
isHideOneButtonRestore:1,//用于直接跳转至开票预览时隐藏一键还原按钮1隐藏0显示
});
},
})
}
}
/*QAYJJu58qtar9+K0/Yo5iOtEqEpvRcWCzi8ZMS2D/bo=*/

View File

@ -0,0 +1,34 @@
/*Inl9EB4W7Z1dZhp5Q3yhG2s6s8lhPVI6y0M2mk4uhoI=*/
import requestApi from '../../requestApi'
import presetVar from "../../presetVar";
import confirmMakeInvoice from'../confirmMakeInvoice'
/**
* 开票按钮动作
*/
export default function () {
let sendData = {
pagecode: this.props.getSearchParam('p'),
datas: [{
pk: this.props.getUrlParam('id'),
ts: (this.props.form.getFormItemsValue(presetVar.formAreaId, 'ts') || {}).value
}]
}
// 判断是否弹出税率说明弹窗
requestApi.CheckSLSM({
data: sendData,
success: (data) => {
if(data.show){
// 显示税率说明弹窗
this.setState({
showSlsmModal:true,
slsmRadioOptions:data.slsmEnum||[]
})
}else{
confirmMakeInvoice.call(this,false)
}
}
})
}
/*Inl9EB4W7Z1dZhp5Q3yhG2s6s8lhPVI6y0M2mk4uhoI=*/

View File

@ -0,0 +1,40 @@
/*OxK5VdsSAfhmmloPpsbXZhCvZiGZDlgQCnT/5ztmap8=*/
import requestApi from '../../requestApi'
import presetVar from '../../presetVar'
/**
* 附件管理动作
*/
export default function () {
// 从表单取得单据ID
let billId = this.props.form.getFormItemsValue(presetVar.formAreaId, presetVar.pkname);
// 如果单据ID存在则直接使用该单据ID
if (billId && billId.value) {
// 取得单据状态
let billstatus = (this.props.form.getFormItemsValue(presetVar.formAreaId, 'billstatus') || {}).value;
this.billId = billId.value;
this.setState({
showUploader: true,
disabledUploader: billstatus === presetVar.billstatusEnum.Approved ? true : false
})
} else {
// 如果单据ID不存在则下哦那个后端取得虚拟单据ID
requestApi.generatBillId({
data: {},
success: (data) => {
this.billId = data.pk;
this.setState({
showUploader: true,
disabledUploader: false
});
this.props.form.setFormItemsValue(presetVar.formAreaId, {
[presetVar.pkname]: {
value: data.pk,
display: data.pk
}
});
}
})
}
}
/*OxK5VdsSAfhmmloPpsbXZhCvZiGZDlgQCnT/5ztmap8=*/

View File

@ -0,0 +1,35 @@
/*6nuD5SdDvgzcfA9HZJmDelhFSIegv6kzIl3AQfomgCA=*/
import {toast, print} from "nc-lightapp-front";
import requestApi from '../../requestApi'
import getBillType from '../../common/getBillType'
/**
* 保存按钮动作
*/
export default function () {
let billType = getBillType.call(this);
let sendData = {
billId: this.props.getUrlParam('id'),
billType: billType
};
requestApi.print({
data: sendData,
success: (data) => {
if (!data.canPrint) {
toast({color: "info", content: data.errMesg});
} else {
print(
'pdf', //支持两类: 'html'为模板打印, 'pdf'为pdf打印
'/nccloud/sscivm/ivsale/ApplicationPrintAction.do', //后台服务url
{
billtype: billType,
funcode: this.props.getSearchParam('c'),
nodekey: this.props.getSearchParam("p"),
oids: [this.props.getUrlParam('id')], // 功能节点的数据主键
}
)
}
}
});
}
/*6nuD5SdDvgzcfA9HZJmDelhFSIegv6kzIl3AQfomgCA=*/

View File

@ -0,0 +1,28 @@
/*KjTFWATGUvvdit6M4mrX7CM6BZigO2mlmibXEugCLjM=*/
import { cardCache } from "nc-lightapp-front";
let { setDefData } = cardCache;
import presetVar from '../../presetVar'
import splitMergeCheck from '../splitMergeCheck'
// 快速合并
export default function () {
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let body2Data = this.props.cardTable.getAllData(presetVar.body2AreaId);
let pkBill = this.props.getUrlParam('id');
let catchData={
[presetVar.formAreaId]:formData,
[presetVar.bodyAreaId]:bodyData,
[presetVar.body2AreaId]:body2Data,
pkBill:pkBill
}
// 缓存选择的数据
setDefData(presetVar.MakeInvoicePreviewSourceKey, presetVar.dataSource, catchData);
setDefData(presetVar.splitmergeDataSourceKey, presetVar.dataSource, [{ pk:pkBill }]);
if (formData){
splitMergeCheck.call(this,"merge");
}
}
/*KjTFWATGUvvdit6M4mrX7CM6BZigO2mlmibXEugCLjM=*/

View File

@ -0,0 +1,29 @@
/*CTcFyllTQC0gyN/CbldANB+QRowxUy3J2Hvcg/KyPjQ=*/
import { cardCache } from "nc-lightapp-front";
let { setDefData } = cardCache;
import presetVar from '../../presetVar'
import splitMergeCheck from "../splitMergeCheck";
// 快速拆分
export default function () {
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let body2Data = this.props.cardTable.getAllData(presetVar.body2AreaId);
let pkBill = this.props.getUrlParam('id');
let catchData={
[presetVar.formAreaId]:formData,
[presetVar.bodyAreaId]:bodyData,
[presetVar.body2AreaId]:body2Data,
pkBill:pkBill
}
// 缓存选择的数据
setDefData(presetVar.MakeInvoicePreviewSourceKey, presetVar.dataSource, catchData);
setDefData(presetVar.splitmergeDataSourceKey, presetVar.dataSource, [{ pk:pkBill }]);
if (formData){
splitMergeCheck.call(this,"split");
}
}
/*CTcFyllTQC0gyN/CbldANB+QRowxUy3J2Hvcg/KyPjQ=*/

View File

@ -0,0 +1,70 @@
/*PEp/ehGbRtBjy0ps5I773pqFyQIhz3mqNVNG6oNV7pA=*/
import { toast, cardCache } from "nc-lightapp-front";
import { get } from "lodash"
let { updateCache } = cardCache;
import presetVar from "../../presetVar";
import requestApi from "../../requestApi";
import { setBtnVisable } from '../../common/setBtnVisable'
import specialAreaSetting from '../specialAreaSetting'
/**
* 刷新按钮动作
*/
export default function (callbackFunction, messageFlag = true) {
let pkBill = this.props.getUrlParam('id');
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
// 组装用户数据
let userjson = {
pagecode: this.props.getSearchParam('p'),
pk_ivapplication: pkBill
}
// 组装发送数据
let sendData = {
head: {
[presetVar.formAreaId]: formData,
userjson: JSON.stringify(userjson)
},
body: {
[presetVar.bodyAreaId]: bodyData
}
}
if (pkBill) {
requestApi.viewBill({
data: sendData,
success: (data) => {
if (data && data.head) {
updateCache(presetVar.pkname, pkBill, data, presetVar.formAreaId, presetVar.dataSource);
// 设置表头数据
this.props.form.setAllFormValue(data.head);
// 设置表体数据
data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.setTableData(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
data.grandSons && data.grandSons[presetVar.body2AreaId] && this.props.cardTable.setTableData(presetVar.body2AreaId, data.grandSons[presetVar.body2AreaId]);
// 设置按钮状态
setBtnVisable.call(this, presetVar.status.browse, data.head.head);
// 从开票预览页点击“开票”,成功后跳转至卡片页需提示:开票成功;从开票预览页点击“取消”跳转至卡片页,不做任何提示
if(this.props.getUrlParam('source')==='previewMakeInvoice'){
// 申请开票成功
toast({ content: this.multiLangJson['1058-invoice-0025'] });
}else if(this.props.getUrlParam('source')!=='previewMakeInvoiceCancel'){
if(messageFlag){
this.pubMessage.refreshSuccess();
}
}
let fplx = get(data,"head.head.rows[0].values.fplx.value","");//发票类型
let tspzCode=get(data,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(data,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this,{fplx,zsfs,tspz:tspzCode})
} else {
toast({ color: 'danger', content: this.multiLangJson[presetVar.mutiLangCodeDetail.viewBillError] });
}
callbackFunction && callbackFunction.call(this, data);
}
})
}
}
/*PEp/ehGbRtBjy0ps5I773pqFyQIhz3mqNVNG6oNV7pA=*/

View File

@ -0,0 +1,135 @@
/*QQolWSiOMeMoZaQWcWkOsQ==*/
import { toast } from "nc-lightapp-front";
import getPageData from '../../common/getPageData'
import updataPage from '../../common/updataPage'
import requestApi from '../../requestApi'
import presetVar from '../../presetVar'
//验证保存
function validateToSave() {
let billdataForFormula = this.props.createMasterChildData(presetVar.pagecode, presetVar.formAreaId, presetVar.bodyAreaId);
return new Promise((resolve, reject) => {
this.props.validateToSave(billdataForFormula, () => {
resolve();
})
})
}
/**
* 保存按钮动作
*/
export default async function () {
// 过滤表体空行(项目名称,规则型号,价税合计)
this.props.cardTable.filterEmptyRows(presetVar.bodyAreaId, ['xmmc','dw','xmjshj'], 'include');
this.props.cardTable.filterEmptyRows(presetVar.body2AreaId);
// 检查单据合规性
let checkRef = this.props.validatePageToToast([
{
name: [presetVar.formAreaId],
type: "form",
},
{
name: [presetVar.bodyAreaId],
type: "cardTable",
},
])
if((checkRef || {}).allPassed == false){
return
}
// if (!this.props.form.isCheckNow(presetVar.formAreaId)) {
// return;
// }
// 校验存在表体
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let visiabledData = this.props.cardTable.getVisibleRows(presetVar.bodyAreaId);
if (visiabledData.length == 0) {
this.props.button.setButtonDisabled({
[presetVar.cardBodyBtns.AddLine]: false,
});
this.props.button.setButtonVisible({
[presetVar.cardBodyBtns.AddLine]: true,
});
// "1058-SQ-0001": "价税合计不能为0",
toast({ color: "danger", content: this.multiLangJson['1058-SQ-0001'] });
return;
}
// 检查不存在数据为0的表体行
let zeroCheck = [];
bodyData.rows.map((one, index) => {
if (((one.values['xmjshj'] || {}).value || 0) == 0) {
zeroCheck.push(index + 1);
}
})
if (zeroCheck && zeroCheck.length > 0) {
// "1058-SQ-0002": "下列字段值不能为0",
// "1058-SQ-0003": "详细信息(页签:",
// "1058-SQ-0004": "第",
// "1058-SQ-0005": "行:[价税合计];",
// "1058-SQ-0006": "展开",
// "1058-SQ-0007": "收起",
// "1058-SQ-0008": "关闭",
let rowMsg = zeroCheck.map(one => {
return this.multiLangJson['1058-SQ-0004'] + one + this.multiLangJson['1058-SQ-0005']
})
toast({
color: "danger",
groupOperation: true,
TextArr: [this.multiLangJson['1058-SQ-0006'], this.multiLangJson['1058-SQ-0007'], this.multiLangJson['1058-SQ-0008']],
content: this.multiLangJson['1058-SQ-0002'],
groupOperationMsg: [this.multiLangJson['1058-SQ-0003'], ...rowMsg],
});
return;
}
// 检查特殊票种明细表体填写合规性
if (!this.props.cardTable.checkTableRequired(presetVar.body2AreaId)) {
return;
}
await validateToSave.call(this);
if (!this.props.getUrlParam('status') || this.props.getUrlParam('status') == presetVar.status.add) {
requestApi.save({
data: getPageData.call(this),
success: (data) => {
this.props.setUrlParam({'id': data.head[presetVar.formAreaId].rows[0].values[presetVar.pkname].value});
updataPage.call(this, data);
//控制单据编号
this.props.BillHeadInfo.setBillHeadInfoVisible({
showBillCode: true,
billCode: data.head[presetVar.formAreaId].rows[0].values['billno'].value || ''
});
//关闭侧拉
this.props.cardTable.closeModel(presetVar.bodyAreaId);
// 保存成功
toast({ content: this.multiLangJson[presetVar.mutiLangCodeDetail.saveSuccess] });
// 显示流程组件
this.billHead.ApproveProcessShow(data.head.head.rows[0].values.transtypecode.value, data.head.head.rows[0].values.pk_ivapplication.value);
this.setState({
hideAdd: false,
hideDel: false
})
}
})
} else if (this.props.getUrlParam('status') == presetVar.status.edit) {
requestApi.saveUpdate({
data: getPageData.call(this),
success: (data) => {
updataPage.call(this, data);
//关闭侧拉
this.props.cardTable.closeModel(presetVar.bodyAreaId);
// 保存成功
toast({ content: this.multiLangJson[presetVar.mutiLangCodeDetail.saveSuccess] });
// 显示流程组件
this.billHead.ApproveProcessShow(data.head.head.rows[0].values.transtypecode.value, data.head.head.rows[0].values.pk_ivapplication.value);
this.setState({
hideAdd: false,
hideDel: false
})
}
})
}
}
/*QQolWSiOMeMoZaQWcWkOsQ==*/

View File

@ -0,0 +1,22 @@
/*VDo0utFkHv8IrbqntUKDRWkqyYfyAeso0Zng8ICZb7I=*/
import getPageData from '../../common/getPageData'
import updataPage from '../../common/updataPage'
import requestApi from '../../requestApi'
/**
* 提交按钮动作
*/
export default function () {
requestApi.uncommit({
data: getPageData.call(this),
success: (data) => {
updataPage.call(this, data);
// 操作成功
this.pubMessage.operateSuccess();
this.setState({ disabledUploader: false })
// 刷新流程组件
this.billHead.ApproveProcessRefresh();
}
})
}
/*VDo0utFkHv8IrbqntUKDRWkqyYfyAeso0Zng8ICZb7I=*/

View File

@ -0,0 +1,260 @@
/*pmFWCFu5nhKkBzYmrkBakWl62ApRqd1KWolltSFOyTw=*/
import { getMultiLang,cardCache } from 'nc-lightapp-front';
import { setTableExtendCol } from 'ssccommon/components/bill';
import { setAllBtnUnVisable, setBtnVisable } from '../common/setBtnVisable'
import { setContext } from 'ssccommon/utils/contextUtils';
import setFieldStatus from '../common/setFieldStatus'
import bodyinnerBtnEvent from './bodyinnerBtnEvent'
import setPageStatus from '../common/setPageStatus'
import loadData from '../common/loadData'
import viewBill from '../common/viewBill'
import presetVar from '../presetVar'
import copy from '../events/headBtnEvents/copy'
import refresh from '../events/headBtnEvents/refresh'
import excelImportconfig from 'uap/common/components/excelImportconfig';
import initAllFormEditorial from '../common/initAllFormEditorial'
import specialAreaSetting from './specialAreaSetting'
let { setDefData,getDefData } = cardCache;
import { get } from 'lodash'
export default function (props) {
/**
* 取得模板
*/
let createUIDomPromise = new Promise((resolve, reject) => {
props.createUIDom(
{},
(data) => {
setContext(this.props, data.context);
resolve(data);
}
)
})
/**
* 取得多语
*/
this.getMultiLangPromise = new Promise((resolve, reject) => {
getMultiLang({
moduleId: presetVar.mutiLangCode,
domainName: presetVar.domainName,
currentLocale: presetVar.currentLocale,
callback: (json) => {
resolve(json);
}
});
})
Promise.all([createUIDomPromise, this.getMultiLangPromise]).then((resultList) => {
let data = resultList[0];
let json = resultList[1];
this.multiLangJson = json;
let button = data.button;
let meta = data.template;
meta[presetVar.formAreaId].items.forEach(one => {
this.pageHeadDisabled[one.attrcode] = one.disabled;
if (one.attrcode == 'kpfs') {
// 开票方式暂时不能使用“发票拆分合并开票”
one.options = one.options.filter(each => each.value != '3');
// 备份开票方式枚举项
this.kpfs_options = JSON.stringify(one.options);
} else if (one.attrcode === 'fplx') {
const codes = ['15', '16', '17', '18', '19', '20', '21',]
one.options = one.options.filter(each => !codes.includes(each.value))
}else if(one.attrcode == 'tspz'){
// 临时处理方式,等模板设置好之后删除
// 设置数电特殊票种字段默认为不可编辑
one.disabled=true;
this.pageHeadDisabled[one.attrcode] = one.disabled;
}
});
// 获取模板中折扣金额是否可编辑
meta[presetVar.bodyAreaId].items.forEach(one => {
if (one.attrcode == 'zkje') {
this.zkjeIsDisabled = one.disabled;
}
});
// 判断模板中是否存在特殊票种明细表体区域
if(meta[presetVar.body2AreaId]){
// 平台逻辑为字段全部不显示,则表格区域不显示,不满足产品需求,故手动将该区域修改为显示
meta[presetVar.body2AreaId].areaVisible=true;
this.isHasSpecialInvoiceArea=true;
}
// 设置表格扩展列
setTableExtendCol(props, meta, button, [{
tableAreaId: presetVar.bodyAreaId,
btnAreaId: presetVar.cardBodyInnerBtnAreaId,
onButtonClick: bodyinnerBtnEvent.bind(this),
buttonVisible: (record, index) => {
return [
presetVar.bodyInnerBtns.Edit,
presetVar.bodyInnerBtns.CopyLine,
presetVar.bodyInnerBtns.InsertLine,
presetVar.bodyInnerBtns.DelLine,
presetVar.bodyInnerBtns.PasteToNext
]
}
}]);
// 设置表格扩展列
setTableExtendCol(props, meta, button, [{
tableAreaId: presetVar.body2AreaId,
btnAreaId: presetVar.card2BodyInnerBtnAreaId,
onButtonClick: bodyinnerBtnEvent.bind(this),
buttonVisible: (record, index) => {
return [
presetVar.body2InnerBtns.CopyLine,
presetVar.body2InnerBtns.InsertLine,
presetVar.body2InnerBtns.PasteToNext
]
}
}]);
// 设置页面标题
// this.setState({pageTitle: this.props.getSearchParam('n')});
let pageStatus = this.props.getUrlParam('status');
let pkBill = this.props.getUrlParam('id');
props.meta.setMeta(meta);
// 设置页面状态
setPageStatus.call(this, pageStatus);
setAllBtnUnVisable.call(this);
// 设置按钮模板
props.button.setButtons(button);
// 导入导出按钮设置
let _excelImportconfig = excelImportconfig(props, 'sscivm', presetVar.billtype, true, '', {
appcode: props.getAppCode(),
pagecode: presetVar.cardPagecode,
}, (...params) => {
debugger
})
props.button.setUploadConfig(presetVar.headBtns.Import, _excelImportconfig);
switch (pageStatus) {
case presetVar.status.browse:
// 设置模版
props.meta.setMeta(meta);
/* 开票预览或者拆分合并开票预览点击返回返回卡片页时,// 制单场景,来源为预览,取缓存数据 */
if(props.getUrlParam('scene') == 'bz' && (props.getUrlParam('source')==='preview'||props.getUrlParam('source')==='splitmergePreview'||props.getUrlParam('source')==='toBeInvoicedDetailTo')){
// 更新页面
refresh.call(this, null, false);
// // 取得缓存数据
// let cdata = getDefData(presetVar.MakeInvoicePreviewSourceKey, presetVar.dataSource);
// setBtnVisable.call(this, pageStatus, cdata[presetVar.formAreaId]);
// // 设置翻页器
// props.cardPagination.setCardPaginationId({ status: 1, id: cdata.pkBill });// 显示流程组件
// this.billHead.ApproveProcessShow(cdata[presetVar.formAreaId].rows[0].values.transtypecode.value, cdata[presetVar.formAreaId].rows[0].values.pk_ivapplication.value);
// //控制单据编号
// props.BillHeadInfo.setBillHeadInfoVisible({
// showBillCode: true,
// showBackBtn: true,
// billCode: cdata[presetVar.formAreaId].rows[0].values['billno'].value || ''
// });
// props.form.setAllFormValue({ [presetVar.formAreaId]: cdata[presetVar.formAreaId] });
// cdata[presetVar.bodyAreaId] && props.cardTable.setTableData(presetVar.bodyAreaId, cdata[presetVar.bodyAreaId]);
// cdata[presetVar.body2AreaId] && props.cardTable.setTableData(presetVar.body2AreaId, cdata[presetVar.body2AreaId]);
}else if(props.getUrlParam('scene') == 'bz' && props.getUrlParam('source')==='previewMakeInvoice'){
/* 开票预览点击开票按钮开票成功后返回卡片页时,// 制单场景,来源为预览开票,更新页面 */
refresh.call(this);
}else{
viewBill.call(this, (data) => {
const saga_status = data.head.head.rows[0].values.saga_status;
const saga_gtxid = data.head.head.rows[0].values.saga_gtxid;
if (saga_status && saga_status.value === "1") {
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: true
})
this.props.socket.showToast({
gtxid: saga_gtxid && saga_gtxid.value || "",
billpk: pkBill
});
}
setBtnVisable.call(this, pageStatus, data.head[presetVar.formAreaId]);
// 设置翻页器
this.props.cardPagination.setCardPaginationId({ status: 1, id: this.props.getUrlParam('id') });
// 显示流程组件
this.billHead.ApproveProcessShow(data.head.head.rows[0].values.transtypecode.value, data.head.head.rows[0].values.pk_ivapplication.value);
});
}
break;
case presetVar.status.edit:
// 设置模版
props.meta.setMeta(meta);
viewBill.call(this, (data) => {
// 设置页面默认数据
loadData.call(this, presetVar.status.edit, meta, (newMeta) => {
this.props.meta.setMeta(newMeta);
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 设置按钮状态
setBtnVisable.call(this, presetVar.status.edit, formData);
// 设置表单字段编辑性
setFieldStatus.call(this, formData);
this.props.button.setButtonDisabled({
[presetVar.cardBodyBtns.CopyLineBatch]: true,
[presetVar.cardBodyBtns.DelLineBatch]: true,
[presetVar.card2BodyBtns.CopyLineBatch]: true,
[presetVar.card2BodyBtns.DelLineBatch]: true
});
// 编辑态设置完表格数据之后直接获取,获取不到表格行数据,所以此处重新设置一下按钮显隐
let fplx = get(data,"head.head.rows[0].values.fplx.value","");//发票类型
let tspzCode=get(data,"head.head.rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(data,"head.head.rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this, {
fplx,
zsfs,
tspz: tspzCode,
tableRows: get(
data,
["body", presetVar.bodyAreaId, "rows"],
[]
),
});
if(get(formData,'rows[0].values.src_pkbusibill.value','')){
this.props.button.setButtonVisible({
[presetVar.bodyInnerBtns.CopyLine]: false,
[presetVar.bodyInnerBtns.InsertLine]: false,
[presetVar.bodyInnerBtns.PasteToNext]: false,
[presetVar.bodyInnerBtns.DelLine]: false,
[presetVar.cardBodyBtns.DelLineBatch]: false,
[presetVar.cardBodyBtns.CopyLineBatch]: false,
[presetVar.card2BodyBtns.CopyLineBatch]: false,
[presetVar.card2BodyBtns.DelLineBatch]: false
});
this.setState({
hideAdd: true,
hideDel: true
})
}
});
});
break;
case presetVar.status.add:
default:
//针对我的报账点复制打开开票申请逻辑
if (pkBill) {
props.meta.setMeta(meta);
copy.call(this)
} else {
loadData.call(this, presetVar.status.add, meta, (newMeta, data) => {
// 设置表头默认值
this.props.form.setAllFormValue(data.head);
this.props.meta.setMeta(newMeta, () => {
this.props.cardTable.addRow(presetVar.bodyAreaId, undefined, undefined, false);
setBtnVisable.call(this, pageStatus, data.head[presetVar.formAreaId]);
});
initAllFormEditorial.call(this,presetVar.formAreaId)
this.props.button.setButtonDisabled({
[presetVar.cardBodyBtns.CopyLineBatch]: true,
[presetVar.cardBodyBtns.DelLineBatch]: true,
[presetVar.card2BodyBtns.CopyLineBatch]: true,
[presetVar.card2BodyBtns.DelLineBatch]: true
});
});
}
break;
}
})
}
/*pmFWCFu5nhKkBzYmrkBakWl62ApRqd1KWolltSFOyTw=*/

View File

@ -0,0 +1,52 @@
/*srx1I/cY+v1UYIEQY6gNktvseAWoUgmkCzepTZ7+q+A=*/
import presetVar from '../presetVar'
import { get } from "lodash";
let cacheKey = 'cardTableSelectedRow';
import specialAreaSetting from './specialAreaSetting'
function handleSelected(checked,btnAreaId) {
// 复制按钮可用标记
let copyBtnFlag = false;
// 删行按钮可用标记
let delLineBtnFlag = false;
if(checked.length){
copyBtnFlag=true;
delLineBtnFlag=true;
}else{
copyBtnFlag=false;
delLineBtnFlag=false;
}
this.props.button.setButtonDisabled({
[presetVar[btnAreaId].CopyLineBatch]: !copyBtnFlag,
[presetVar[btnAreaId].DelLineBatch]: !delLineBtnFlag,
});
}
/**
*
* @param {*} props
*/
export default function (cardAreaId,btnAreaId) {
let checked = this.props.cardTable.getCheckedRows(cardAreaId);
let tableRows = this.props.cardTable.getAllRows(cardAreaId);
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 发票类型为“数电票(增值税专用发票):31”或“数电票(普通发票):32”时且数电特殊票种为E06不动产租赁、E05不动产销售、E03建筑服务时或征税方式为差额开票:2时,
// 行按钮【增行】【删行】【复制行】【插入行】均不可使用,且发票明细表体行只允许一正常明细行,或一组折扣与被折扣行。
handleSelected.call(this, checked, btnAreaId)
if(btnAreaId==='cardBodyBtns'){
// 编辑态设置完表格数据之后直接获取,获取不到表格行数据,所以此处重新设置一下按钮显隐
let fplx = get(formData,"rows[0].values.fplx.value","");//发票类型
let tspzCode=get(formData,"rows[0].values.tspz.display","").split('/')[0];//特殊票种编码
let zsfs = get(formData,"rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
specialAreaSetting.call(this, {
fplx,
zsfs,
tspz: tspzCode,
});
}
}
export {handleSelected}
/*srx1I/cY+v1UYIEQY6gNktvseAWoUgmkCzepTZ7+q+A=*/

View File

@ -0,0 +1,63 @@
/*92wa+5jEJtnojWJWcKfwpic+evtDmrDaoI3Dlkql8zY=*/
import { toast, cardCache } from "nc-lightapp-front";
let { setDefData,getDefData } = cardCache;
import requestApi from "../requestApi";
import presetVar from "../presetVar";
// 获取快速拆分或者快速合并的页面数据
export default function (quickType) {
// quickTypesplit拆分merge合并
let catchData = getDefData(presetVar.MakeInvoicePreviewSourceKey, presetVar.dataSource);
let ids = catchData.pkBill||"";//拼接发生请求的id集合值
if (quickType === "split") {
// 请求快速拆分数据
requestApi.QueryQuickSplitData({
data: {
pk_ivapplication: [ids],
},
success: (data) => {
setPageDefData.call(this,quickType,ids,data);//缓存快速拆分页面数据并根据根据跳转页面
},
});
} else {
// 请求快速合并数据
requestApi.QueryQuickMergeData({
data: {
pk_ivapplication: [ids],
},
success: (data) => {
setPageDefData.call(this,quickType,ids,data);//缓存快速合并分页面数据并根据根据跳转页面
},
});
}
}
// 设置数据缓存并跳转到目标页面
function setPageDefData(quickType,id,data){
// quickTypesplit拆分merge合并
if(data.pagecode===presetVar.MakeInvoicePreviewPageCode){
// 缓存页面的预览数据
setDefData(presetVar.MakeInvoicePreviewDataCacheKey, presetVar.dataSource, data);
// 打开开票预览
this.props.pushTo("/splitmergePreview", {
pagecode: data.pagecode, //目标页面页面编码
quickType: quickType, //用于区分拆分还是合并
scene:"cardTo", //用于区分来源页面
id,//列表页选中数据id
source:"cardTo",//用于判断根页面
}
);
}else if(data.pagecode===presetVar.toBeInvoicedDetailPageCode){
// 缓存页面的待开票明细数据
setDefData(presetVar.toBeInvoicedDetailCacheKey, presetVar.dataSource, data);
// 打开待开票明细
this.props.pushTo("/toBeInvoicedDetail", {
pagecode: data.pagecode, //目标页面页面编码
quickType: quickType, //用于区分拆分还是合并
scene:"cardTo", //用于区分来源页面
id,//列表页选中数据id
source:"cardTo",//用于判断根页面
});
}
}
/*92wa+5jEJtnojWJWcKfwpic+evtDmrDaoI3Dlkql8zY=*/

View File

@ -0,0 +1,102 @@
/*lCTZjYudeeoR9TsNPtnOaHeupgMuGB1L8vJPJ6wPiYQ=*/
import { get } from 'lodash'
import presetVar from "../presetVar";
// 根据页面数据,修改表头字段禁用和表体中按钮的禁用和显示隐藏,以及表体“特殊票种明细”是否可见
export default function (params) {
let specialInvoiceIsShow = this.state.specialInvoiceIsShow; //表体“特殊票种明细”是否可见
let cardTableBodyIsAutoAdd = true; //表体是否自动增行,默认自动增行
let { fplx, zsfs, tspz, tableRows } = params; // fplx:发票类型zsfs征税方式tspz:特殊票种
let pageStatus = this.props.form.getFormStatus(presetVar.formAreaId);
// 发票类型为“数电票(增值税专用发票):31”或“数电票(普通发票):32”时且特殊票种为E04货物运输、E09旅客运输或征税方式为2差额开票/全额开票=3时新扩展的表体行“特殊票种明细”可见。
if (
(fplx == "31" || fplx == "32") &&
(tspz === "E04" || tspz === "E09" || zsfs === "2" || zsfs === "3")
) {
specialInvoiceIsShow = true;
}else{
specialInvoiceIsShow = false;
let bodyRows = tableRows?tableRows:this.props.cardTable.getAllRows(presetVar.body2AreaId);
let indexArr=bodyRows.map(ele=>{
return ele.dataIndex
})
this.props.cardTable.delRowsByIndex(presetVar.body2AreaId,indexArr)
}
if (pageStatus !== presetVar.status.browse) {
// 发票类型为“数电票(增值税专用发票):31”或“数电票(普通发票):32”时字段“数电特殊票种”可编辑
if (fplx == "31" || fplx == "32") {
this.props.form.setFormItemsDisabled(presetVar.formAreaId, { tspz: false });
}else{
this.props.form.setFormItemsValue(presetVar.formAreaId, { tspz:{ value: '', display:''} })
this.props.form.setFormItemsDisabled(presetVar.formAreaId, { tspz: true });
}
let onlyOneRow = false; //是否限制表体只能有一行数据,控制新增按钮禁用和表体按钮显示隐藏
let bodyBtnisDisabled = false; //表体头部批量删除和复制行按钮是否为禁用状态
let bodyCheckedRows = this.props.cardTable.getCheckedRows(
presetVar.bodyAreaId
); //表体选中行数据
bodyBtnisDisabled = bodyCheckedRows.length > 0 ? false:true;//表体行有选中数据时,表体头部批量删除和复制行按钮非禁用
let buttons=this.props.button.getButtons();
buttons=buttons.filter(ele=>{
return ele.area===presetVar.cardBodyBtnAreaId
})
let bodyHeadVisable=get(buttons[0],"visible",'');
let bodyHeadIsVisable=bodyHeadVisable?true:false;;//表体头部操作按钮原始显隐性
// 发票类型为“数电票(增值税专用发票):31”或“数电票(普通发票):32”且数电特殊票种为E06不动产租赁、E05不动产销售、E03建筑服务时或征税方式为差额开票:2时,
// 行按钮【增行】【删行】【复制行】【插入行】均不可使用,且发票明细表体行只允许一正常明细行,或一组折扣与被折扣行。
// 新增开票申请自动生成一开票申请表体行,维护内容后不再自动追加新的表体行
if (((fplx == "31" || fplx == "32") &&(tspz === "E03" || tspz === "E05" || tspz === "E06")) || zsfs === "2") {
cardTableBodyIsAutoAdd = false;//设置不自动增行
let bodyRows = tableRows?tableRows:this.props.cardTable.getAllRows(presetVar.bodyAreaId);
bodyRows = bodyRows.filter((ele) => {
return ele.status !== "3";
});
// 表体行至少一行时,不可再追加新行,禁用开票明细表体操作按钮
if (bodyRows.length > 0) {
// onlyOneRow=true;
// bodyBtnisDisabled = true;
}else{
// bodyBtnisDisabled=false;
}
}else{
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
if(get(formData,'rows[0].values.src_pkbusibill.value','')){
// onlyOneRow=true;
cardTableBodyIsAutoAdd = false;//设置不自动增行
}
}
// 设置表体操作按钮可见性
let setButtonVisibleObj={
[presetVar.bodyInnerBtns.Edit]: !onlyOneRow,
[presetVar.bodyInnerBtns.CopyLine]: !onlyOneRow,
[presetVar.bodyInnerBtns.InsertLine]: !onlyOneRow,
[presetVar.bodyInnerBtns.DelLine]: !onlyOneRow,
[presetVar.bodyInnerBtns.PasteToNext]: !onlyOneRow,
};
if(bodyHeadIsVisable){
setButtonVisibleObj = Object.assign(setButtonVisibleObj, {
[presetVar.cardBodyBtns.AddLine]: !onlyOneRow,
[presetVar.cardBodyBtns.DelLineBatch]: !onlyOneRow,
[presetVar.cardBodyBtns.CopyLineBatch]: !onlyOneRow,
});
}
this.props.button.setButtonVisible(setButtonVisibleObj);
this.props.button.setButtonDisabled({
[presetVar.cardBodyBtns.AddLine]: onlyOneRow,
[presetVar.cardBodyBtns.DelLineBatch]: onlyOneRow?onlyOneRow:bodyBtnisDisabled,
[presetVar.cardBodyBtns.CopyLineBatch]: onlyOneRow?onlyOneRow:bodyBtnisDisabled,
[presetVar.cardBodyBtns.PasteToEnd]: onlyOneRow?onlyOneRow:bodyBtnisDisabled,
[presetVar.cardBodyBtns.PasteCancel]: onlyOneRow?onlyOneRow:bodyBtnisDisabled,
});
}
this.setState({
specialInvoiceIsShow,
cardTableBodyIsAutoAdd,
},()=>{
this.props.button.setButtonDisabled({
[presetVar.card2BodyBtns.CopyLineBatch]: true,
[presetVar.card2BodyBtns.DelLineBatch]: true
});
});
}
/*lCTZjYudeeoR9TsNPtnOaHeupgMuGB1L8vJPJ6wPiYQ=*/

View File

@ -0,0 +1,30 @@
/*vVPWJ4tDcs1xHO7Ybx2mzhyWrQmVu6pV6UDTSFFo1OI=*/
import { cardCache } from "nc-lightapp-front";
let { getDefData } = cardCache;
import requestApi from "../requestApi";
import presetVar from "../presetVar";
import loadSplitMergeData from "./loadSplitMergeData";
// 拆分合并数据合规校验
export default function (quickType) {
let catchData = getDefData(presetVar.MakeInvoicePreviewSourceKey, presetVar.dataSource);
let sendData = {
datas: [
{
pk: catchData.pkBill,
ts: (
this.props.form.getFormItemsValue(presetVar.formAreaId, "ts") || {}
).value,
},
],
};
requestApi.CheckSplitMerge({
data: sendData,
success: (data) => {
if (data.success) {
loadSplitMergeData.call(this, quickType);
}
},
});
}
/*vVPWJ4tDcs1xHO7Ybx2mzhyWrQmVu6pV6UDTSFFo1OI=*/

View File

@ -0,0 +1,161 @@
/*/IFUt2VC0uy7lbWkR7M44kbEHd6txHGgEoGsaeSKeN0=*/
import {cardCache} from 'nc-lightapp-front';
import presetVar from '../presetVar'
import requestApi from '../requestApi'
import { setCopyOrPasteSceneButtonVisible } from '../common/setBtnVisable'
import getPageData from '../common/getPageData'
const {setDefData, getDefData} = cardCache;
import { cloneDeep,get } from 'lodash'
let cacheKey = 'copyTableData';
export default function() {
return {
[presetVar.cardBodyBtns.AddLine]: {
actionCode: 'BodyAdd',
afterClick: (props) => {
// 表体新增行之后
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
let fplx = get(formData,"rows[0].values.fplx.value","");//发票类型
let zsfs = get(formData,"rows[0].values.zsfs.value","");//征税方式,枚举值:普通征税=0,差额征税=2,全额开票=3
let tspzCode=get(formData,"rows[0].values.tspz.display","").split('/')[0];;//特殊票种编码
if (((fplx == "31" || fplx == "32") && (tspzCode === "E03" || tspzCode === "E05" || tspzCode === "E06")) || zsfs === "2"){
this.props.button.setButtonVisible({
[presetVar.cardBodyBtns.AddLine]: false,
[presetVar.cardBodyBtns.DelLineBatch]: false,
[presetVar.cardBodyBtns.CopyLineBatch]: false,
[presetVar.bodyInnerBtns.Edit]: false,
[presetVar.bodyInnerBtns.CopyLine]: false,
[presetVar.bodyInnerBtns.InsertLine]: false,
[presetVar.bodyInnerBtns.DelLine]: false,
[presetVar.bodyInnerBtns.PasteToNext]: false,
});
}
}
},
// 删行
[presetVar.cardBodyBtns.DelLineBatch]: {
actionCode: 'DelLineBatch',
click: (props) => {
let bodyCheckedData = props.cardTable.getCheckedRows(presetVar.bodyAreaId);
if (bodyCheckedData.length) {
let delRowIndex=bodyCheckedData.map(item => item.index);
props.cardTable.delRowsByIndex(presetVar.bodyAreaId,delRowIndex);
// 删除选中数据之后禁用删行和复制行按钮
props.button.setButtonDisabled([presetVar.cardBodyBtns.CopyLineBatch, presetVar.cardBodyBtns.DelLineBatch], true);
// 删行后重新计算表单数据并更新表单
requestApi.PasteToNext({
data: getPageData.call(this),
success: (data) => {
// 更新表头数据
props.form.setAllFormValue(data.head);
}
})
}
}
},
// 复制行
[presetVar.cardBodyBtns.CopyLineBatch]: {
actionCode: 'CopyLineBatch',
click: (props) => {
let bodyCheckedData = props.cardTable.getCheckedRows(presetVar.bodyAreaId);
if (bodyCheckedData.length) {
setDefData(cacheKey, presetVar.dataSource, bodyCheckedData);//将复制的数据存入缓存
setCopyOrPasteSceneButtonVisible.call(this,'Copied',presetVar.bodyAreaId)
}
}
},
// 粘贴至末行
[presetVar.cardBodyBtns.PasteToEnd]: {
actionCode: 'PasteToEnd',
click: (props) => {
let copyTempData=cloneDeep(getDefData(cacheKey, presetVar.dataSource) || []);
copyTempData.forEach(item=>{
if(item.data&&item.data.values){
//粘贴的数据状态修改为2新增清空主键
item.data.status='2';
item.data.values.pk_ivappdetail={values:''};
props.cardTable.addRow(presetVar.bodyAreaId, -1, item.data.values);
}
})
setDefData(cacheKey, presetVar.dataSource, []);//清空缓存数据
setCopyOrPasteSceneButtonVisible.call(this,'',presetVar.bodyAreaId)
// 粘贴后重新计算表单数据并更新表单
requestApi.PasteToNext({
data: getPageData.call(this),
success: (data) => {
// 更新表头数据
props.form.setAllFormValue(data.head);
}
})
}
},
// 取消
[presetVar.cardBodyBtns.PasteCancel]: {
actionCode: 'PasteCancel',
click: (props) => {
setDefData(cacheKey, presetVar.dataSource, []);//清空缓存数据
setCopyOrPasteSceneButtonVisible.call(this,'',presetVar.bodyAreaId)
}
},
[presetVar.card2BodyBtns.AddLine]: {
actionCode: 'BodyAdd'
},
// 特殊票种明细表体-删行
[presetVar.card2BodyBtns.DelLineBatch]: {
actionCode: 'DelLineBatch',
click: (props) => {
let bodyCheckedData = props.cardTable.getCheckedRows(presetVar.body2AreaId);
if (bodyCheckedData.length) {
let delRowIndex=bodyCheckedData.map(item => item.index);
props.cardTable.delRowsByIndex(presetVar.body2AreaId,delRowIndex);
// 删除选中数据之后禁用删行和复制行按钮
props.button.setButtonDisabled([presetVar.card2BodyBtns.CopyLineBatch, presetVar.card2BodyBtns.DelLineBatch], true);
}
}
},
// 特殊票种明细表体-复制行
[presetVar.card2BodyBtns.CopyLineBatch]: {
actionCode: 'CopyLineBatch',
click: (props) => {
let bodyCheckedData = props.cardTable.getCheckedRows(presetVar.body2AreaId);
if (bodyCheckedData.length) {
setDefData(cacheKey, presetVar.dataSourceSpecial, bodyCheckedData);//将复制的数据存入缓存
setCopyOrPasteSceneButtonVisible.call(this,'Copied')
}
}
},
// 特殊票种明细表体-粘贴至末行
[presetVar.card2BodyBtns.PasteToEnd]: {
actionCode: 'PasteToEnd',
click: (props) => {
let copyTempData=cloneDeep(getDefData(cacheKey, presetVar.dataSourceSpecial) || []);
copyTempData.forEach(item=>{
if(item.data&&item.data.values){
//粘贴的数据状态修改为2新增清空主键
item.data.status='2';
item.data.values.pk_ivappdetail={values:''};
props.cardTable.addRow(presetVar.body2AreaId, -1, item.data.values);
}
})
setDefData(cacheKey, presetVar.dataSourceSpecial, []);//清空缓存数据
setCopyOrPasteSceneButtonVisible.call(this)
// 粘贴后重新计算表单数据并更新表单
requestApi.PasteToNext({
data: getPageData.call(this),
success: (data) => {
// 更新表头数据
props.form.setAllFormValue(data.head);
}
})
}
},
// 特殊票种明细表体-取消
[presetVar.card2BodyBtns.PasteCancel]: {
actionCode: 'PasteCancel',
click: (props) => {
setDefData(cacheKey, presetVar.dataSourceSpecial, []);//清空缓存数据
setCopyOrPasteSceneButtonVisible.call(this)
}
}
}
}
/*/IFUt2VC0uy7lbWkR7M44kbEHd6txHGgEoGsaeSKeN0=*/

View File

@ -0,0 +1,12 @@
/*5glmTlz3b4cW2yLUjrmQHQ==*/
import presetVar from '../../presetVar'
export default function (props, key, text, record, index) {
if (props.cardTable.getStatus(presetVar.bodyAreaId) == presetVar.status.browse) {
props.cardTable.toggleRowView(presetVar.bodyAreaId, record);
// props.cardTable.toggleRowView(presetVar.body2AreaId, record);
} else {
props.cardTable.openModel(presetVar.bodyAreaId, 'edit', record, index);
}
}
/*5glmTlz3b4cW2yLUjrmQHQ==*/

View File

@ -0,0 +1,8 @@
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import InvoiceCardDom from './invoiceCard';
ReactDOM.render(<InvoiceCardDom/>, document.querySelector("#app"));
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/

View File

@ -0,0 +1,24 @@
#invoicecard {
.body-head {
height: 40px;
padding-top: 4px;
}
.body-title {
float: left;
margin-left: 20px;
margin-top: 3px;
font-size: 14px;
font-family: 'PingFangSC-Medium';
font-weight: 600;
color: rgba(17, 17, 17, 1);
line-height: 21px;
}
}
// .ssc-bill-card{
// overflow: auto;
// }
.su-wrapper{
margin-top: 0 !important;
margin-bottom: 4px !important;
}

View File

@ -0,0 +1,403 @@
/*ibwHuagm4SH5+rOVOaqHvq6PFvMIbflRwssh+yGUv2M=*/
import { Component } from "react";
import { createPage, getMultiLang, high, promptBox, cardCache, base } from "nc-lightapp-front";
import ExcelOutput from 'uap/common/components/ExcelOutput';
import { setCardTable, setForm } from 'ssccommon/utils/setComponentUsed';
import ApprovalTrans from 'ssccommon/platformcomponents/ApprovalTrans';
const { getCacheById, updateCache } = cardCache;
import "./index.less";
import PubMessage from 'ssccommon/utils/pubMessage';
import getBillType from './common/getBillType'
import initTemplate from "./events/initTemplate.js"
import headBtnClick from "./events/headBtnClick"
import headAfterEvent from "./events/headAfterEvent"
import bodyAfterEvent from "./events/bodyAfterEvent"
import bodyBeforeEvent from './events/bodyBeforeEvent'
import backBtnClick from "./events/backBtnClick"
import handlePageInfoChange from './events/handlePageInfoChange'
import save from './events/headBtnEvents/save'
import refresh from './events/headBtnEvents/refresh'
import listOnSelected from './events/listOnSelected'
import tableHeadBtnClick from './events/tableHeadBtnClick'
import bodyModelDelRow from './events/bodyModelDelRow'
import presetVar from './presetVar'
import InvoiceComponent from '../../../invoiceComponent/compoundComponent/component'
import SimplifiedUploader from 'ssccommon/platformcomponents/SimplifiedUploader';
import confirmMakeInvoice from'./events/confirmMakeInvoice'
import SlsmModal from '../common/components/slsmModal'
import {
BillStyle,
BillHead,
BillBody,
Form,
CardTable,
ButtonGroupListCard
} from 'ssccommon/components/bill';
class InvoiceCard extends Component {
constructor(props) {
super(props);
this.state = {
pagestatus: '',
pageTitle: '',
multiLang: {},
showUploader: false, //附件
linkSituationShow: false, //开票情况
linkInvoiceShow: false, //联查开票弹框
showApproveDetail: false, //审批详情弹框
showDelModel: false, //删除弹框
showBack: false, //回退按钮控制
disabledUploader: false, //是否启用附件弹框中点击上传功能
compositedata: '', //指派数据
compositedisplay: '', //控制指派框显示\
exportIds: [], // 导出ID列表
forceRender: true, // 初始设置不加载数据,控制页面打开流量
selectedSLSMValue:'',//税率说明单选值,默认第一个选项
showSlsmModal:false,//税率说明弹窗是否显示
isShowTips:false,//税率说明单选值为空且点击弹窗中开票
hideAdd:false,//侧拉删行按钮显隐
hideDel:false,//侧拉删行按钮显隐
slsmRadioOptions:[],//税率说明单选枚举值
specialInvoiceIsShow:false,//特殊票种表体是否显示
cardTableBodyIsAutoAdd:true,//表体行是否自动增行
};
this.billId = '';//上传附件单据id
this.pk = '';
this.openbillId = ''; //联查单据所需参数缓存
this.tradetype = ''; //联查单据所需参数缓存
this.pkbusibill = null; //上游单据标识
this.invoiceComponent = new InvoiceComponent('Application');
this.pubMessage = new PubMessage();
this.pageHeadDisabled = {};
/* 指派相关信息begin */
this.assingUsers = [];
this.sureAssign = false;
/* 指派相关信息end */
this.copyTableData = [];//用于粘贴的数据
//平台组件初始化
setCardTable(props, presetVar.bodyAreaId),
setForm(props, presetVar.formAreaId),
setCardTable(props, presetVar.body2AreaId),
initTemplate.call(this, props);
this.isHasSpecialInvoiceArea=false;//是否存在特殊票种表体区域
// 模板中折扣金额是否可编辑
this.zkjeIsDisabled=false;
}
componentDidMount() {
// 页面编辑态关闭增肌弹框提示
window.onbeforeunload = () => {
if (this.props.form.getFormStatus(presetVar.formAreaId) === 'edit' || this.props.form.getFormStatus(presetVar.formAreaId) === 'add') {
return ''
} else {
this.simUp.closeAllWindows();
}
}
}
componentWillUnmount() {
// 页面编辑态关闭增肌弹框提示
window.onbeforeunload = () => {
if (this.props.form.getFormStatus(presetVar.formAreaId) === 'edit' || this.props.form.getFormStatus(presetVar.formAreaId) === 'add') {
return ''
} else {
this.simUp.closeAllWindows();
}
}
}
//表体按钮事件
tableHeadBtnClick = (...params) => {
return tableHeadBtnClick.call(this, ...params)
};
//表头按钮事件
headBtnClick = (...params) => {
return headBtnClick.call(this, ...params)
};
//表单编辑后事件
headAfterEvent = (...params) => {
headAfterEvent.call(this, ...params)
};
//表体表格编辑后事件
bodyAfterEvent = (...params) => {
bodyAfterEvent.call(this, ...params)
};
//标题回退事件
backBtnClick = (...params) => {
backBtnClick.call(this, ...params)
};
//翻页事件
handlePageInfoChange = (...params) => {
handlePageInfoChange.call(this, ...params)
};
//保存事件
save = (...params) => {
save.call(this, ...params)
};
//刷新按钮事件
refresh = (...params) => {
refresh.call(this, ...params)
};
/** 列表选择事件 */
listOnSelected = (...params) => { listOnSelected.call(this, ...params) };
// 确定指派
getAssginUser = (value) => {
this.assingUsers = value;
this.sureAssign = true;
headBtnClick.call(this, this.props)[presetVar.headBtns.Commit].click();
}
// 取消指派
turnOff() {
this.setState({
compositedisplay: false
});
this.sureAssign = false;
this.assingUsers = [];
}
socketMesg = (props, mesg) => {
const refreshData = mesg.refreshData || [];
const pkBill = this.props.getUrlParam('id');
refreshData.forEach(data => {
if (data[presetVar.pkname] === pkBill) {
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: mesg.error
})
}
//更新cache
let cardData = getCacheById(pkBill, presetVar.dataSource);
if (cardData) {
cardData.head[presetVar.formAreaId].rows[0].values['saga_gtxid'] = { value: data.saga_gtxid }
cardData.head[presetVar.formAreaId].rows[0].values['saga_status'] = { value: data.saga_status }
updateCache(presetVar.pkname, pkBill, cardData, presetVar.formAreaId, presetVar.dataSource);
}
})
}
// 税率说明弹窗单选切换事件
handleRadioChange=(value)=>{
this.setState({
selectedSLSMValue:value,
isShowTips:value?false:true
})
}
// 关闭税率说明弹窗
closeModal=()=>{
this.setState({
selectedSLSMValue:'',
showSlsmModal:false,
isShowTips:false,
slsmRadioOptions:[]//税率说明单选枚举值
})
}
// 税率说明弹窗确认开票
beSureBtnClick=()=>{confirmMakeInvoice.call(this, true)}
// 侧拉删行后回调
modelDelRow= ({...params})=> {bodyModelDelRow.call(this,{...params})}
render() {
let multiLang = this.props.MutiInit.getIntl(presetVar.mutiLangCode);
let btnModalConfig = {
[presetVar.headBtns.Delete]: {
// "1058-COMMON-DELETE-0004": "确定要删除吗?",
title: multiLang && multiLang.get('1058-COMMON-DELETE-0004'),
content: '',
}
};
const { socket,modal: {createModal} } = this.props;
return [
socket.connectMesg({
headBtnAreaCode: presetVar.headBtnAreaId,
formAreaCode: presetVar.formAreaId,
onMessage: this.socketMesg, //监听消息
billtype: presetVar.billtype, //用于查询追溯
billpkname: presetVar.pkname, //用于查询追溯
dataSource: presetVar.dataSource,
// 本地前端调试请传ip和端口
// 打包到测试环境之前 去掉
// serverLocation: "172.16.86.11:8883"
}),
<BillStyle
{...{className:'ssc-bill-card', ...this.props}}
approveDetail={{
billtype: getBillType.call(this),
billid: this.props.getUrlParam('pk_bill') == undefined ? this.props.getUrlParam('id') : this.props.getUrlParam('pk_bill'),
show: this.state.showApproveDetail,
close: () => {
this.setState({
showApproveDetail: false
})
}
}}
showUploader={{
uploaderBtn: this.state.disabledUploader,
billid: this.billId,
show: this.state.showUploader,
close: () => {
this.setState({
showUploader: false
})
}
}}
>
<BillHead
ref={billHead => this.billHead = billHead}
title={this.props.getSearchParam('n')}
refreshButtonEvent={this.refresh}
pageInfoConfig={this.props.getUrlParam('scene') == 'listTo'||this.props.getUrlParam('scene') == 'bz' ? {
show: true,
handlePageInfoChange: this.handlePageInfoChange,
dataSource: presetVar.dataSource
} : {
show: false
}}
back={this.props.getUrlParam('scene') == 'listTo' && this.props.getUrlParam('status') == 'browse'||this.props.getUrlParam('scene') == 'bz' && this.props.getUrlParam('status') == 'browse' ? {
showBack: this.state.showBack,
listPagecode: presetVar.listPagecode
} : {
showBack: false
}}
>
<ButtonGroupListCard
areaId={presetVar.headBtnAreaId}
formAreaId={presetVar.formAreaId}
bodyAreaId={presetVar.bodyAreaId}
buttonEvent={this.headBtnClick}
modalConfig={btnModalConfig}
dataSource={presetVar.dataSource}
sagasButtonVisible={true}
/>
<Form
areaId={presetVar.formAreaId}
onAfterEvent={this.headAfterEvent}
/>
</BillHead>
<BillBody>
<CardTable
areaId={presetVar.bodyAreaId}
totalItemCode="xmjshj"
modelSave={this.save}
onAfterEvent={this.bodyAfterEvent}
onBeforeEvent={(...params) => { bodyBeforeEvent.call(this, ...params) }}
isAddRow={this.state.cardTableBodyIsAutoAdd}
showCheck={true}
adaptionHeight={true}
onSelected={()=>{
this.listOnSelected.call(this,presetVar.bodyAreaId,'cardBodyBtns')
}}
onSelectedAll={()=>{
this.listOnSelected.call(this,presetVar.bodyAreaId,'cardBodyBtns')
}}
selectedChange={()=>{
this.listOnSelected.call(this,presetVar.bodyAreaId,'cardBodyBtns')
}}
otherAreaHeight={this.state.pagestatus == 'browse' ? 48 : 0}
showToggleAngle={false}
hideAdd={this.state.hideAdd}
hideDel={this.state.hideDel}
modelDelRow={this.modelDelRow}
>
<ButtonGroupListCard
areaId={presetVar.cardBodyBtnAreaId}
bodyAreaId={presetVar.bodyAreaId}
buttonEvent={this.tableHeadBtnClick}
/>
</CardTable>
{this.state.specialInvoiceIsShow&&<CardTable
areaId={presetVar.body2AreaId}
// onAfterEvent={this.bodyAfterEvent}
// onBeforeEvent={(...params) => { bodyBeforeEvent.call(this, ...params) }}
isAddRow={true}
showCheck={true}
adaptionHeight={true}
otherAreaHeight={this.state.pagestatus == 'browse' ? 48 : 0}
onSelected={()=>{
this.listOnSelected.call(this,presetVar.body2AreaId,'card2BodyBtns')
}}
onSelectedAll={()=>{
this.listOnSelected.call(this,presetVar.body2AreaId,'card2BodyBtns')
}}
selectedChange={()=>{
this.listOnSelected.call(this,presetVar.body2AreaId,'card2BodyBtns')
}}
showToggleAngle={false}
>
<ButtonGroupListCard
areaId={presetVar.cardBody2BtnAreaId}
bodyAreaId={presetVar.body2AreaId}
buttonEvent={this.tableHeadBtnClick}
/>
</CardTable>}
{/* 联查发票组件 */}
{this.invoiceComponent.createComponent()}
{/*"1058-SQ-0016": "指派",*/}
{this.state.compositedisplay ? <ApprovalTrans
title={multiLang && multiLang.get('1058-SQ-0016')}
data={this.state.compositedata}
display={this.state.compositedisplay}
getResult={this.getAssginUser}
cancel={this.turnOff.bind(this)}
/> : ""}
{/* 附件组件 */}
{this.state.pagestatus == 'browse' && <SimplifiedUploader billId={this.props.getUrlParam('id')} ref={simUp => this.simUp = simUp}
changeVisStatus={() => {
this.props.cardTable && this.props.cardTable.refresh(presetVar.bodyAreaId);
}}
/>}
{/* 导入导出 */}
<ExcelOutput
{...Object.assign(this.props)}
moduleName='sscivm'
forceRender={this.state.forceRender}
billType={presetVar.billtype}
selectedPKS={this.state.exportIds}
exportTreeUrl={'/nccloud/sscivm/ivsale/ApplicationExportTreeAction.do'}
appcode={this.props.getAppCode()}
pagecode={presetVar.cardPagecode}
/>
{/* 税率说明 */}
{this.state.showSlsmModal&&<SlsmModal
multiLang={multiLang}
selectedSLSMValue={this.state.selectedSLSMValue}
close={this.closeModal}
modal={this.props.modal}
handleRadioChange={this.handleRadioChange}
beSureBtnClick={this.beSureBtnClick}
isShowTips={this.state.isShowTips}
slsmRadioOptions={this.state.slsmRadioOptions}
/>}
</BillBody>
</BillStyle>
];
}
}
let InvoiceCardDom = createPage({
orderOfHotKey: ['head', presetVar.bodyAreaId],
mutiLangCode: '1058',
billinfo: {
billtype: 'card',
pagecode: presetVar.pagecode,
headcode: presetVar.formAreaId,
bodycode: presetVar.bodyAreaId
},
})(InvoiceCard);
export default InvoiceCardDom;
/*ibwHuagm4SH5+rOVOaqHvq6PFvMIbflRwssh+yGUv2M=*/

View File

@ -0,0 +1,149 @@
/*NfbwZuhGuJXM+2qP8b1Tl2OD0XFf/EhoEYwVvkqTzWE=*/
import presetVarParent from '../../../public/common/presetVar'
export default {
...presetVarParent,
pagecode: '105802SQ_card',
sgAppcode:'105802SGSQ',//收购开票申请appcode
listPagecode: '105802SQ_list',
cardPagecode: '105802SQ_card',
dataSource: '105802SQ',
dataSourceSpecial: '105802SQ-special',
loadDataMeta: 'loadDataMeta',
loadDataData: 'loadDataData',
pkname: 'pk_ivapplication',
billtype: "SSCIVA",
tradetype: 'pk_tradetype',
linkSituationAreaId: 'linkSituation',
linkInvoiceAreaId: 'linkInvoice',
/** 拆分合并选择Key */
splitmergeDataSourceKey: 'splitmergeDataSourceKey',
/** 开票预览选择Key */
MakeInvoicePreviewSourceKey: 'MakeInvoicePreviewSourceKey',
formAreaId: 'head',
bodyAreaId: 'InvApplication_Body',
bodyAreaId1: 'InvApplication_Body_childform2',
headBtnAreaId: 'header',
cardBodyBtnAreaId: 'body',
cardBodyBtns: {
...presetVarParent.baseCardBodyBtns,
DelLineBatch:'DelLineBatch',
CopyLineBatch:'CopyLineBatch',
PasteToEnd:'PasteToEnd',
PasteCancel:'PasteCancel'
},
cardBodyInnerBtnAreaId: 'body_inner',
bodyInnerBtns: {
/**
* 展开
*/
Edit: 'Body_Edit',
CopyLine: 'CopyLine',
InsertLine:'InsertLine',
DelLine:'DelLine',
PasteToNext:'PasteToNext'
},
headBtns: {
...presetVarParent.baseHeadBtns,
AddGroup: 'group1',
CommitGroup: 'group2',
Commit: 'Submit',
Uncommit: 'Recall',
/**
* 开票
*/
MakeInvoice: 'MakeInvoice',
/**
* 取消开票
*/
CancelMakeInvoice: 'CancelMakeInvoice',
/**
* 开票情况
*/
InvSituation: 'InvSituation',
/**
* 附件
*/
Options: 'Options',
/**
* 联查按钮组
*/
LinkGroup: 'group3_more',
/**
* 联查发票
*/
LinkInvoice: 'LinkInvoice',
/**
* 联查单据
*/
LinkBill: 'LinkBill',
/**
* 联查审批情况
*/
LinkAprove: 'LinkAprove',
/**
* 刷新
*/
refresh: 'refresh',
/**
* 导入
*/
Import: 'Import',
/**
* 导出模板
*/
ExportTemplate: 'ExportTemplate',
/**
* 导出
*/
Export: 'Export',
/**
* 开票预览
*/
MakeInvoicePreview: 'MakeInvoicePreview',
/**
* 快速拆分
*/
QuickSplit:"QuickSplit",
/**
* 快速合并
*/
QuickMerge:"QuickMerge",
},
billnoField: 'billno',
billstatusEnum: {
Free: '-1',
Commit: '3',
Approved: '1',
Disapproved: '0',
Approving: '2'
},
// 开票预览页面编码
MakeInvoicePreviewPageCode:"105802SQ_KPConfirm",
// 待开票明细页面编码
toBeInvoicedDetailPageCode:"105802SQ_KPDetail",
/** 待开票明细数据缓存Key */
toBeInvoicedDetailCacheKey: 'toBeInvoicedDetailCacheKey',
/** 开票预览数据缓存Key */
MakeInvoicePreviewDataCacheKey: 'MakeInvoicePreviewDataCacheKey',
body2AreaId:'InvApplication_Tspz',
cardBody2BtnAreaId: 'tspz',
card2BodyBtns:{
AddLine:'AddLine_tspz',
DelLineBatch:'DelLineBatch_tspz',
CopyLineBatch:'CopyLineBatch_tspz',
PasteToEnd:'PasteToEnd_tspz',
PasteCancel:'PasteCancel_tspz'
},
card2BodyInnerBtnAreaId: 'tspz_inner',
body2InnerBtns: {
/**
* 展开
*/
CopyLine: 'CopyLine_tspz',
InsertLine:'InsertLine_tspz',
PasteToNext:'PasteToNext_tspz'
},
}
/*NfbwZuhGuJXM+2qP8b1Tl2OD0XFf/EhoEYwVvkqTzWE=*/

View File

@ -0,0 +1,281 @@
/*Mq+ry/aXt/6nN0mNqW5qEGRL+kTvjr8avDrc0tsezZo=*/
import {ajax} from 'nc-lightapp-front';
let requestApi = {
/**
* 加载默认数据
*/
loadData: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationDefDataAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 查询单据数据
*/
viewBill: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationViewBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 页面数据变更事件
*/
valueChange: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationValueChangedAction.do',
data: opt.data,
async: false,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 判断是否可编辑
*/
checkEdit: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationEditCheckFlowAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据新增保存
*/
save: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSaveBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据修改保存
*/
saveUpdate: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationUpdateBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据删除
*/
delete: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationDeleteBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据提交
*/
commit: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSubmitBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据收回
*/
uncommit: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationRecallBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 附件上传获取主键接口
*/
generatBillId: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/GeneratBillIdAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 打印接口
*/
print: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationPrintValidaAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 开票接口
*/
MakeInvoice: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationMakeInvoiceAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
},
error: opt.error
})
},
/**
* 取消开票接口
*/
CancelMakeInvoice: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationCancelMakeInvoiceAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 复制
*/
copy: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationCopyAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 联查单据
*/
LinkBill: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/AppInfoQueryAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 粘贴行
*/
PasteToNext: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationRowChangedAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 判断是否弹出税率说明
*/
CheckSLSM: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSLSMCheckAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 拆分合并数据合规校验
*/
CheckSplitMerge: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSplitMergeCheckAction.do',
data: opt.data,
success: (data) => {
opt.success(data);
}
})
},
/**
* 查询快速拆分数据
*/
QueryQuickSplitData: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationQuickSplitAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 查询快速合并数据
*/
QueryQuickMergeData: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationQuickMergeAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 查询发票数据开票预览数据
*/
loadMakeInvoicePreviewData: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationMakeInvoicePreviewAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
}
export default requestApi;
/*Mq+ry/aXt/6nN0mNqW5qEGRL+kTvjr8avDrc0tsezZo=*/

View File

@ -0,0 +1,85 @@
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/
import { Component } from "react";
import { base } from "nc-lightapp-front";
const { NCRadio } = base;
import "bee-layout/build/Layout.css";
import './index.less'
/**
* 税率说明确认弹窗
*/
class SlsmModal extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.modal.show("slsm-modal");
}
render() {
const {
props: {
multiLang,
selectedSLSMValue,
modal: { createModal },
close,
isShowTips,
slsmRadioOptions
},
} = this;
// "refer-XX-0006": "税率说明确认"
return (
<div id="slsm-modal-area">
{createModal("slsm-modal", {
title: multiLang&&multiLang.get("refer-XX-0006")||"税率说明确认",
userControl: true,
content: (
<div
style={{
position: "relative",
height:"100%"
}}
>
<NCRadio.NCRadioGroup
name="slsm"
selectedValue={selectedSLSMValue}
onChange={this.props.handleRadioChange.bind(this)}
>
{
slsmRadioOptions.map(ele=>{
return (<NCRadio value={ele.value} className="slsm-radio-item">
{ele.label}
</NCRadio>)
})
}
</NCRadio.NCRadioGroup>
{isShowTips && (
<span
className="tisp"
style={{ color: "red", position: "absolute", bottom: "0" }}
>
{multiLang&&multiLang.get("refer-XX-0010")}
</span>
)}
</div>
),
height:210,
width:640,
resizable:false,
noFooter: false,
leftBtnName: multiLang&&multiLang.get("refer-XX-0011")||"开票", // "refer-XX-0011": "开票"
validateCloseBtn: true,
closeModalEve: () => {
close && close();
},
beSureBtnClick: this.props.beSureBtnClick, //点击确定按钮事件
cancelBtnClick: () => {
close && close();
}, //取消按钮事件回调
})}
</div>
);
}
}
export default SlsmModal;
/*n8bddfc0ZL/azGxQSzhgT69CceXTkfq8IVwptkDxZsQ=*/

View File

@ -0,0 +1,3 @@
.slsm-radio-item{
margin-bottom: 12px;
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20" height="20" viewBox="0 0 20 20"><g><path d="M20,20L0,0L17,0C18.6569,0,20,1.34315,20,3L20,20ZM19,17.5858L2.41421,1L17,1Q17.8284,1,18.4142,1.58579Q19,2.17157,19,3L19,17.5858ZM13.5954,9.59151L18.6125,2.5339L17.39,1.66479L13.3689,7.32116L10.5134,4.63959L9.48657,5.73303L13.5954,9.59151Z" fill-rule="evenodd" fill="#E66F6A" fill-opacity="1"/></g></svg>

After

Width:  |  Height:  |  Size: 467 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_200_2358"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_200_2358)"><g><path d="M2.142198245239258,3.44110625L8.458038245239258,0.94140625L8.458038245239258,13.62290625L9.029058245239257,13.62290625L9.029058245239257,3.19372625L13.514148245239257,4.8452762499999995L13.514148245239257,13.62290625L14.375848245239258,13.62290625Q14.412748245239257,13.62290625,14.448948245239258,13.63010625Q14.485248245239259,13.63730625,14.519348245239257,13.65150625Q14.553448245239258,13.66560625,14.584148245239257,13.68610625Q14.614848245239259,13.70660625,14.640948245239258,13.73280625Q14.667148245239257,13.75890625,14.687648245239258,13.78960625Q14.708148245239258,13.82030625,14.722248245239259,13.85440625Q14.736448245239258,13.88850625,14.743648245239259,13.92480625Q14.750848245239258,13.96100625,14.750848245239258,13.99790625L14.750848245239258,14.20250625Q14.750848245239258,14.23940625,14.743648245239259,14.27560625Q14.736448245239258,14.31180625,14.722248245239259,14.34600625Q14.708148245239258,14.38010625,14.687648245239258,14.41080625Q14.667148245239257,14.44150625,14.640948245239258,14.46760625Q14.614848245239259,14.49370625,14.584148245239257,14.51430625Q14.553448245239258,14.53480625,14.519348245239257,14.54890625Q14.485248245239259,14.56310625,14.448948245239258,14.57030625Q14.412748245239257,14.57750625,14.375848245239258,14.57750625L1.4962482452392578,14.57750625Q1.4593142452392578,14.57750625,1.4230892452392578,14.57030625Q1.3868652452392578,14.56310625,1.352742245239258,14.54890625Q1.3186192452392578,14.53480625,1.2879092452392578,14.51430625Q1.2571992452392577,14.49370625,1.2310832452392577,14.46760625Q1.2049667452392578,14.44150625,1.1844471452392578,14.41080625Q1.163927545239258,14.38010625,1.1497934452392577,14.34600625Q1.1356592452392578,14.31180625,1.1284537652392579,14.27560625Q1.1212482452392578,14.23940625,1.1212482452392578,14.20250625L1.1212482452392578,13.99790625Q1.1212482452392578,13.96100625,1.1284537652392579,13.92480625Q1.1356592452392578,13.88850625,1.1497934452392577,13.85440625Q1.163927545239258,13.82030625,1.1844471452392578,13.78960625Q1.2049667452392578,13.75890625,1.2310832452392577,13.73280625Q1.2571992452392577,13.70660625,1.2879092452392578,13.68610625Q1.3186192452392578,13.66560625,1.352742245239258,13.65150625Q1.3868652452392578,13.63730625,1.4230892452392578,13.63010625Q1.4593142452392578,13.62290625,1.4962482452392578,13.62290625L2.142198245239258,13.62290625L2.142198245239258,3.44110625ZM7.073378245239258,4.99508625L3.255198245239258,4.99508625L3.255198245239258,6.26781625L7.073378245239258,6.26781625L7.073378245239258,4.99508625ZM3.255198245239258,7.55132625L7.073378245239258,7.55132625L7.073378245239258,8.82405625L3.255198245239258,8.82405625L3.255198245239258,7.55132625ZM9.695958245239257,7.55132625L12.587548245239258,7.55132625L12.587548245239258,8.82405625L9.695958245239257,8.82405625L9.695958245239257,7.55132625ZM7.073378245239258,10.10757625L3.255198245239258,10.10757625L3.255198245239258,11.38030625L7.073378245239258,11.38030625L7.073378245239258,10.10757625ZM12.587548245239258,10.10757625L9.695958245239257,10.10757625L9.695958245239257,11.38030625L12.587548245239258,11.38030625L12.587548245239258,10.10757625Z" fill-rule="evenodd" fill="#B0C2D3" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,45 @@
/*JioT+qO4mP4R+mDgiabLRephl6ShZZnbmhIGdMpitGg=*/
import presetVar from '../presetVar'
import requestApi from '../requestApi'
const headKeys = ['pk_org', 'pk_customer', 'gmf_zh'];
const bodyKeys = ['xmdj', 'sl', 'xmje', 'se', 'xmsl', 'xmjshj', 'pk_materiel'];
export default function (moduleId, key, value, changedrows) {
let hasChange = false;
if ((moduleId == presetVar.formAreaId && headKeys.indexOf(key) > -1) ||
(moduleId == presetVar.bodyAreaId && bodyKeys.indexOf(key) > -1)) {
hasChange = true;
}
if (hasChange) {
// 取得表头数据
let headBodyData;
if (moduleId == presetVar.formAreaId) {
headBodyData = this.props.createHeadAfterEventData(presetVar.pagecode, presetVar.formAreaId, presetVar.bodyAreaId, moduleId, key, value);
} else {
headBodyData = this.props.createBodyAfterEventData(presetVar.pagecode, presetVar.formAreaId, presetVar.bodyAreaId, moduleId, key, changedrows)
}
headBodyData.templateid = this.props.meta.getMeta().pageid;
headBodyData.userjson = JSON.stringify({
appcode: this.props.getSearchParam('c'),
pagecode: this.props.getSearchParam('p'),
templateid: this.props.meta.getMeta().pageid,
checkrule: 'true'
});
// 组装发送数据
let sendData = {
...headBodyData,
checkrule: 'true',
templateid: this.props.meta.getMeta().pageid
}
requestApi.valueChange({
data: sendData,
success: (data) => {
data.head && data.head[presetVar.formAreaId] && this.props.form.setAllFormValue(data.head);
data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.updateDataByRowId(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
}
});
}
}
/*JioT+qO4mP4R+mDgiabLRephl6ShZZnbmhIGdMpitGg=*/

View File

@ -0,0 +1,32 @@
/*AFolAoouXffw6m+tX6c/c8FKYcqqXVdWxzCoQ8XI3mQ=*/
import { toast,cardCache } from "nc-lightapp-front";
let { setDefData, getDefData } = cardCache;
import requestApi from '../requestApi'
import presetVar from '../presetVar'
export default function (callbackFunction) {
let sendData = getDefData(presetVar.makeinvoiceDataSourceKey, presetVar.dataSource);
requestApi.viewBill({
sence: this.props.getUrlParam('sence'),
data: sendData,
success: (data) => {
if (data.data && data.data.head) {
// 设置表头数据
this.props.form.setAllFormValue(data.data.head);
// 设置表体数据
data.data.body && data.data.body[presetVar.bodyAreaId] && this.props.cardTable.setTableData(presetVar.bodyAreaId, data.data.body[presetVar.bodyAreaId]);
// 待拆分页面选择行ID
this.selectRowids = (JSON.parse(data.data.userjson) || {selectRowids:[]}).selectRowids;
if (data.data.message){
toast({ title: data.data.message, duration: 5, color: 'danger', })
}
} else {
this.pubMessage.viewBillError();
}
callbackFunction && callbackFunction.call(this, data.data);
}
})
}
/*AFolAoouXffw6m+tX6c/c8FKYcqqXVdWxzCoQ8XI3mQ=*/

View File

@ -0,0 +1,174 @@
/*El/4VzJJGPMfLnWmU4KW0Ff0eTDNoLbsXLYOpvWSqpI=*/
import {Component} from "react";
import {createPage, getMultiLang, cardCache} from "nc-lightapp-front";
import { setCardTable, setForm} from 'ssccommon/utils/setComponentUsed';
const { getCacheById, updateCache } = cardCache;
import "./index.less";
import PubMessage from 'ssccommon/utils/pubMessage';
import initTemplate from "./events/initTemplate.js"
import headBtnClick from "./events/headBtnClick"
import presetVar from './presetVar'
import {
BillStyle,
BillHead,
BillBody,
Form,
CardTable,
ButtonGroupListCard
} from 'ssccommon/components/bill';
import confirmMakeInvoice from'./events/headBtnEvents/makeinvoice'
import SlsmModal from '../common/components/slsmModal'
class InvoiceCard extends Component {
constructor(props) {
super(props);
this.state = {
pageTitle: '',
multiLang: {},
selectedSLSMValue:'',//税率说明单选值
showSlsmModal:false,//税率说明弹窗是否显示
isShowTips:false,//税率说明单选值为空且点击弹窗中开票
slsmRadioOptions:[],//税率说明枚举值
};
this.pk = '';
this.pubMessage = new PubMessage();
this.pageHeadDisabled = {};
//平台组件初始化
setCardTable(props,presetVar.bodyAreaId);
setForm(props,presetVar.formAreaId);
initTemplate.call(this, props);
}
componentDidMount() {
// 页面编辑态关闭增肌弹框提示
window.onbeforeunload = () => {
if (this.props.form.getFormStatus(presetVar.formAreaId) === 'edit' || this.props.form.getFormStatus(presetVar.formAreaId) === 'add') { return '' }
}
}
//表头按钮事件
headBtnClick = (...params) => {
return headBtnClick.call(this, ...params)
};
socketMesg = (props, mesg) => {
const refreshData = mesg.refreshData || [];
const pkBill = this.props.getUrlParam('id');
refreshData.forEach(data => {
if(data[presetVar.pkname] === pkBill) {
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: mesg.error
})
}
//更新cache
let cardData = getCacheById(pkBill, presetVar.dataSource);
if (cardData) {
cardData.head[presetVar.formAreaId].rows[0].values['saga_gtxid'] = {value: data.saga_gtxid}
cardData.head[presetVar.formAreaId].rows[0].values['saga_status'] = {value: data.saga_status}
updateCache(presetVar.pkname, pkBill, cardData, presetVar.formAreaId, presetVar.dataSource);
}
})
}
// 税率说明弹窗单选切换事件
handleRadioChange=(value)=>{
this.setState({
selectedSLSMValue:value,
isShowTips:value?false:true
})
}
// 关闭税率说明弹窗
closeModal=()=>{
this.setState({
selectedSLSMValue:'',
showSlsmModal:false,
isShowTips:false,
slsmRadioOptions:[]
})
}
// 税率说明弹窗确认开票
beSureBtnClick=()=>{confirmMakeInvoice.call(this, true)}
render() {
const { socket } = this.props;
let multiLang = this.props.MutiInit.getIntl(presetVar.mutiLangCode);
return [
socket.connectMesg({
headBtnAreaCode: presetVar.headBtnAreaId,
formAreaCode: presetVar.formAreaId,
onMessage: this.socketMesg, //监听消息
billtype: presetVar.billtype, //用于查询追溯
billpkname: presetVar.pkname, //用于查询追溯
dataSource: presetVar.dataSource,
// 本地前端调试请传ip和端口
// 打包到测试环境之前 去掉
// serverLocation: "172.16.86.11:8883"
}),
<BillStyle
{...this.props}
>
{/* "1058-SQ-0021": "开票确认" */}
<BillHead
title={multiLang && multiLang.get('1058-SQ-0021')}
back={{
showBack: true,
onClick: ()=>{
this.props.pushTo("/splitmergelist", {
pagecode: presetVar.listPagecode,
sence: 'confirm'
});
}
}}
>
<ButtonGroupListCard
areaId={presetVar.headBtnAreaId}
formAreaId={presetVar.formAreaId}
bodyAreaId={presetVar.bodyAreaId}
buttonEvent={this.headBtnClick}
dataSource={presetVar.dataSource}
sagasButtonVisible={true}
/>
<Form
areaId={presetVar.formAreaId}
/>
</BillHead>
<BillBody>
<CardTable
areaId={presetVar.bodyAreaId}
totalItemCode="xmjshj"
adaptionHeight={true}
>
</CardTable>
{/* 税率说明 */}
{this.state.showSlsmModal&&<SlsmModal
multiLang={multiLang}
selectedSLSMValue={this.state.selectedSLSMValue}
close={this.closeModal}
modal={this.props.modal}
handleRadioChange={this.handleRadioChange}
beSureBtnClick={this.beSureBtnClick}
isShowTips={this.state.isShowTips}
slsmRadioOptions={this.state.slsmRadioOptions}
/>}
</BillBody>
</BillStyle>
];
}
}
let InvoiceCardDom = createPage({
mutiLangCode: '1058',
billinfo: {
billtype: 'card',
pagecode: presetVar.pagecode,
headcode: presetVar.formAreaId,
bodycode: presetVar.bodyAreaId
},
orderOfHotKey: [presetVar.headBtnAreaId, presetVar.formAreaId]
})(InvoiceCard);
export default InvoiceCardDom;
/*El/4VzJJGPMfLnWmU4KW0Ff0eTDNoLbsXLYOpvWSqpI=*/

View File

@ -0,0 +1,97 @@
/*CyksppcLdT7eDjJhXsO05opbBFOlclzcJMkyT+3qZNs=*/
import { cardCache,toast } from "nc-lightapp-front";
let { getDefData, setDefData, updateCache } = cardCache;
import presetVar from "../presetVar";
import requestApi from "../requestApi";
import { get } from "lodash";
/**
* 开票按钮动作
*/
export default function (isShowSlsmModal=false) {
// isShowSlsmModal是否显示税率说明弹窗
// 检查表头填写合规性
if (!this.props.form.isCheckNow(presetVar.formAreaId)) {
return;
}
if(isShowSlsmModal&&this.state.selectedSLSMValue===''){
return this.setState({
isShowTips:true
})
}
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 过滤表体空行
this.props.cardTable.filterEmptyRows(presetVar.bodyAreaId, ['xmjshj'], 'include');
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
if(!isShowSlsmModal){
// 小规则纳税人为是且发票表体行税率包含1%、3%的数据时,开票申请为蓝字发票、红字发票的,税率说明为空时,点击【开票】按钮弹窗确认税率说明
const isXGZNSR=get(formData,'rows[0].values.xgmnsr.value',false);
const slISMini=bodyData.rows.some(ele=>{
return get(ele,'values.sl.value','')==='1.00'||get(ele,'values.sl.value','')==='3.00'
})
if(isXGZNSR&&slISMini){
let checkslsmSendData = {
pagecode: this.props.getSearchParam('p'),
datas: [{
pk: "slsmenumeration",//特殊的pk值根据此值后端直接返回税率说明枚举值
ts: (this.props.form.getFormItemsValue(presetVar.formAreaId, 'ts') || {}).value
}]
}
// 获取税率说明枚举值
return requestApi.CheckSLSM({
data: checkslsmSendData,
success: (data) => {
// 显示税率说明弹窗
this.setState({
showSlsmModal:true,
slsmRadioOptions:data.slsmEnum||[]
})
}
})
}
}
let sendData = {
head: {
[presetVar.formAreaId]: formData
},
body: {
[presetVar.bodyAreaId]: bodyData
}
}
if(isShowSlsmModal){
sendData.slsm=this.state.selectedSLSMValue;
}
requestApi.MakeInvoice({
data: sendData,
success: (data) => {
isShowSlsmModal&&this.closeModal();
let splitmergelistDetails = data['105802SQ_KPDetail'];
let cData = getDefData(presetVar.makeinvoiceDataSourceKey, presetVar.dataSource);
let newRows = cData['details'].rows.filter((one) => {
if (this.selectRowids.indexOf(one.rowid) < 0) {
if(splitmergelistDetails&&splitmergelistDetails[one.values.pk_ivappdetail.value]){
one.values.ts.value = splitmergelistDetails[one.values.pk_ivappdetail.value];
}
return one;
}
})
setDefData(presetVar.makeinvoiceDataSourceKey, presetVar.dataSource, {
details: {
rows: newRows
}
});
this.props.pushTo("/splitmergelist", {
pagecode: presetVar.listPagecode,
sence: 'confirm',
handleflag: 'makeinvoice',
});
},
error: (data)=>{
isShowSlsmModal&&this.closeModal();
toast({color:"danger", content: data.message});
}
})
}
/*CyksppcLdT7eDjJhXsO05opbBFOlclzcJMkyT+3qZNs=*/

View File

@ -0,0 +1,36 @@
/*4prg4SsHcHRCMh7vQKzFQec7OmyO+NkvR6sAMZu6v2I=*/
import presetVar from '../presetVar'
import makeinvoice from './headBtnEvents/makeinvoice'
import reQueryFphm from './headBtnEvents/reQueryFphm'
/**
* 表头按钮事件
* @param {*} props
* @param {*} key 按钮KEY
*/
export default function (props, key) {
return {
// 取消
[presetVar.headBtns.Cancel]: {
click: () => {
this.props.pushTo("/splitmergelist", {
pagecode: presetVar.listPagecode,
sence: 'confirm'
});
}
},
// 开票
[presetVar.headBtns.MakeInvoice]: {
click: () => {
makeinvoice.call(this,false);
}
},
//发票号码重查
[presetVar.headBtns.ReQueryFphm]: {
click: () => {
reQueryFphm.call(this);
}
},
}
}
/*4prg4SsHcHRCMh7vQKzFQec7OmyO+NkvR6sAMZu6v2I=*/

View File

@ -0,0 +1,10 @@
/*Inl9EB4W7Z1dZhp5Q3yhG2s6s8lhPVI6y0M2mk4uhoI=*/
import confirmMakeInvoice from '../confirmMakeInvoice'
/**
* 开票按钮动作
*/
export default function (isShowSlsmModal) {
confirmMakeInvoice.call(this,isShowSlsmModal);
}
/*Inl9EB4W7Z1dZhp5Q3yhG2s6s8lhPVI6y0M2mk4uhoI=*/

View File

@ -0,0 +1,39 @@
/*0K22meb1Eh2yohjSKKMbZF3ZbJzrppfesCe3Yiexs4s=*/
import { cardCache,toast } from "nc-lightapp-front";
import { get } from "lodash";
let { getDefData, setDefData, updateCache } = cardCache;
import presetVar from "../../presetVar";
import requestApi from "../../requestApi"
/**
* 开票按钮动作
*/
export default function () {
// 检查表头填写合规性
if (!this.props.form.isCheckNow(presetVar.formAreaId)) {
return;
}
// 取得表头数据
let formData = this.props.form.getAllFormValue(presetVar.formAreaId);
// 过滤表体空行
this.props.cardTable.filterEmptyRows(presetVar.bodyAreaId, ['xmjshj'], 'include');
// 取得表体数据
let bodyData = this.props.cardTable.getAllData(presetVar.bodyAreaId);
let sendData = {
head: {
[presetVar.formAreaId]: formData
},
body: {
[presetVar.bodyAreaId]: bodyData
}
}
requestApi.queryFphm({
data: sendData,
success: (data) => {
if (data && data.ylfphm && data.ylfpdm){
this.props.form.setFormItemsValue(presetVar.formAreaId,{'ylfphm':{value:data.ylfphm,display:data.ylfphm},'ylfpdm':{value:data.ylfpdm,display:data.ylfpdm}});
}
}
})
}
/*0K22meb1Eh2yohjSKKMbZF3ZbJzrppfesCe3Yiexs4s=*/

View File

@ -0,0 +1,74 @@
/*pmFWCFu5nhKkBzYmrkBakWl62ApRqd1KWolltSFOyTw=*/
import { getMultiLang } from 'nc-lightapp-front';
import { setContext } from 'ssccommon/utils/contextUtils';
import viewBill from '../common/viewBill'
import presetVar from '../presetVar'
export default function (props) {
let that = this;
/**
* 取得模板
*/
let createUIDomPromise = new Promise((resolve, reject) => {
props.createUIDom(
{},
(data) => {
setContext(this.props, data.context);
resolve(data);
}
)
})
/**
* 取得多语
*/
this.getMultiLangPromise = new Promise((resolve, reject) => {
getMultiLang({
moduleId: presetVar.mutiLangCode,
domainName: presetVar.domainName,
currentLocale: presetVar.currentLocale,
callback: (json) => {
resolve(json);
}
});
})
Promise.all([createUIDomPromise, this.getMultiLangPromise]).then((resultList) => {
let data = resultList[0];
let json = resultList[1];
this.multiLangJson = json;
let button = data.button;
let meta = data.template;
// 设置页面标题
this.setState({ pageTitle: this.props.getSearchParam('n') });
let pageStatus = this.props.getUrlParam('status');
let pkBill = this.props.getUrlParam('id');
// 设置按钮模板
props.button.setButtons(button);
// 设置模版
props.meta.setMeta(meta);
viewBill.call(this, (data) => {
// 设置表单状态
this.props.form.setFormStatus(presetVar.formAreaId, presetVar.status.edit);
// 设置表格状态
this.props.cardTable.setStatus(presetVar.bodyAreaId, presetVar.status.edit);
const saga_status = data.head.head.rows[0].values.saga_status;
const saga_gtxid = data.head.head.rows[0].values.saga_gtxid;
if (saga_status && saga_status.value === "1") {
this.props.button.toggleErrorStatus(presetVar.headBtnAreaId, {
isError: true
})
this.props.socket.showToast({
gtxid: saga_gtxid && saga_gtxid.value || "",
billpk: pkBill
});
}
});
})
}
/*pmFWCFu5nhKkBzYmrkBakWl62ApRqd1KWolltSFOyTw=*/

View File

@ -0,0 +1,11 @@
/*/IFUt2VC0uy7lbWkR7M44kbEHd6txHGgEoGsaeSKeN0=*/
import presetVar from '../presetVar'
export default function () {
return {
[presetVar.cardBodyBtns.AddLine]: {
actionCode: 'BodyAdd'
}
}
}
/*/IFUt2VC0uy7lbWkR7M44kbEHd6txHGgEoGsaeSKeN0=*/

View File

@ -0,0 +1,16 @@
#invoicecard {
.body-head {
height: 40px;
padding-top: 4px;
}
.body-title {
float: left;
margin-left: 20px;
margin-top: 3px;
font-size: 14px;
font-family: 'PingFangSC-Medium';
font-weight: 600;
color: rgba(17, 17, 17, 1);
line-height: 21px;
}
}

View File

@ -0,0 +1,39 @@
/*NfbwZuhGuJXM+2qP8b1Tl2OD0XFf/EhoEYwVvkqTzWE=*/
import presetVarParent from '../../../public/common/presetVar'
export default {
...presetVarParent,
pagecode: '105802SQ_KPConfirm',
listPagecode: '105802SQ_KPDetail',
dataSource: '105802SQ',
dataSourceSM: '105802SQSM',
loadDataMeta: 'loadDataMeta',
loadDataData: 'loadDataData',
pkname: 'pk_ivapplication',
billtype: "SSCIVA",
tradetype: 'pk_tradetype',
linkSituationAreaId: 'linkSituation',
linkInvoiceAreaId: 'linkInvoice',
/** 开票选择Key */
makeinvoiceDataSourceKey: 'makeinvoiceDataSourceKey',
formAreaId: 'head',
bodyAreaId: 'body',
headBtnAreaId: 'headbtn',
headBtns: {
/**
* 开票
*/
MakeInvoice: 'MakeInvocie',
/**
* 取消
*/
Cancel: 'Cancel',
/**
* 发票号码重查
*/
ReQueryFphm : 'ReQueryFphm',
},
}
/*NfbwZuhGuJXM+2qP8b1Tl2OD0XFf/EhoEYwVvkqTzWE=*/

View File

@ -0,0 +1,242 @@
/*Mq+ry/aXt/6nN0mNqW5qEGRL+kTvjr8avDrc0tsezZo=*/
import {ajax} from 'nc-lightapp-front';
let requestApi = {
/**
* 发票号码重查
*/
queryFphm: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationReQueryFphmFpdmAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 加载默认数据
*/
loadData: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationDefDataAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 查询单据数据
*/
viewBill: (opt) => {
if(opt.sence == 'merge'){
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationMergerAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
}else{
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationMakeNewAggAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
}
},
/**
* 页面数据变更事件
*/
valueChange: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationValueChangedAction.do',
data: opt.data,
async: false,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 判断是否可编辑
*/
checkEdit: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationEditCheckFlowAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据新增保存
*/
save: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSaveBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据修改保存
*/
saveUpdate: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationUpdateBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据删除
*/
delete: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationDeleteBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据提交
*/
commit: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSubmitBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 单据收回
*/
uncommit: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationRecallBillAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 附件上传获取主键接口
*/
generatBillId: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/GeneratBillIdAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 打印接口
*/
print: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationPrintValidaAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 开票接口
*/
MakeInvoice: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSplitMergeMakeInvoiceAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
},
error: opt.error
})
},
/**
* 取消开票接口
*/
CancelMakeInvoice: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationCancelMakeInvoiceAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 复制
*/
copy: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationCopyAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 联查单据
*/
LinkBill: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/AppInfoQueryAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
/**
* 判断是否弹出税率说明
*/
CheckSLSM: (opt) => {
ajax({
url: '/nccloud/sscivm/ivsale/ApplicationSLSMCheckAction.do',
data: opt.data,
success: (data) => {
data = data.data;
opt.success(data);
}
})
},
}
export default requestApi;
/*Mq+ry/aXt/6nN0mNqW5qEGRL+kTvjr8avDrc0tsezZo=*/

View File

@ -0,0 +1,11 @@
/*V87f037I1Gs7S+8Kh5Nx7yKQREDHl8Eh/gDa7zuLwNA=*/
import {getsendDataBychecked} from 'ssccommon/utils/dataHandle4Table';
import presetVar from '../presetVar'
/**
* 取得列表选择数据
*/
export default function () {
return getsendDataBychecked(this.props, presetVar.tableAreaId, presetVar.pkname);
}
/*V87f037I1Gs7S+8Kh5Nx7yKQREDHl8Eh/gDa7zuLwNA=*/

View File

@ -0,0 +1,5 @@
/*s1mWFLp1lPp+z36fKLCZ+osRj//OiJgCGrDnOvb6VBk=*/
export default function(){
}
/*s1mWFLp1lPp+z36fKLCZ+osRj//OiJgCGrDnOvb6VBk=*/

View File

@ -0,0 +1,23 @@
/*BODYuBlWqvhqm/+VrIlcPmNB96nJSMX9Z+EKwJA8hCM=*/
import {toast} from 'nc-lightapp-front';
import requestApi from '../requestApi'
/**
* 联查单据
*/
export default function (data) {
let multiLang = this.props.MutiInit.getIntl(1058); //this.moduleId
if (data.openbillid && data.tradetype) {
requestApi.LinkBill({
data: data,
success: (_data) => {
this.props.openTo(_data.url, _data.data);
}
})
} else {
// "1058-KP-0004": "该发票没有关联的单据",
toast({content: multiLang && multiLang.get('1058-KP-0004'), color: 'warning'});
}
}
/*BODYuBlWqvhqm/+VrIlcPmNB96nJSMX9Z+EKwJA8hCM=*/

View File

@ -0,0 +1,15 @@
/*M9OashFl5isQGWCHKYePvgyd5aK9ZU3o2lCsrp7AGEo=*/
import presetVar from '../presetVar'
function pushToCardForEdit(pk_bill) {
this.props.pushTo("/card", {
status: presetVar.status.edit,
pagecode: presetVar.cardPagecode,
tradetype: this.props.getUrlParam("transtype"),
id: pk_bill,
scene: 'listTo'//列表跳转标识
})
}
export {pushToCardForEdit}
/*M9OashFl5isQGWCHKYePvgyd5aK9ZU3o2lCsrp7AGEo=*/

View File

@ -0,0 +1,60 @@
/*5T7qrLUr+sQppLUiuebcfTRPAWo3siPECsDzeHiY+sk=*/
import listOnSelected from '../events/listOnSelected'
import requestApi from '../requestApi'
import presetVar from '../presetVar'
export default function (props, searchVal, pageIndex, pageSize, scene) {
let pageInfo = this.props.table.getTablePageInfo(presetVar.tableAreaId);
pageInfo.pageIndex = pageIndex.toString();
pageInfo.pageSize = pageInfo.pageSize.toString();
let searchInfo = props.search.getQueryInfo(presetVar.searchAreaId);
let data = {
querycondition: this.searchVal,
pagecode: presetVar.pagecode,
areaid: presetVar.tableAreaId,
queryAreaCode: presetVar.searchAreaId,  //查询区编码
oid: (searchInfo || {}).oid || presetVar.queryOid,  //查询模板id
querytype: 'tree',
pageInfo: pageInfo
};
requestApi.queryData({
data: data,
success: (data) => {
let dataNum = data.pks ? data.pks.length : 0;
if (dataNum > 0) {
if (scene == 'refresh') {
this.pubMessage.refreshSuccess();
} else {
this.pubMessage.querySuccess(dataNum);
}
// toast({ color: 'success', content: this.multiLangJson[presetVar.mutiLangCodeDetail.querySuccess] });
let pageData = {
...data[presetVar.tableAreaId][presetVar.tableAreaId],
allpks: data.pks,
alltss: data.ts,
pageInfo: {
...pageInfo,
total: dataNum,
totalPage: Math.ceil(dataNum / pageInfo.pageSize)
}
}
props.table.setAllTableData(presetVar.tableAreaId, pageData);
} else {
// toast({ color: 'warning', content: this.multiLangJson[presetVar.mutiLangCodeDetail.queryNoData] });
this.pubMessage.querySuccess();
props.table.setAllTableData(presetVar.tableAreaId, {
rows: [],
pageInfo: {
pageIndex: '0',
pageSize: '10',
total: 0,
totalPage: 0,
},
});
}
listOnSelected.call(this);
}
})
}
/*5T7qrLUr+sQppLUiuebcfTRPAWo3siPECsDzeHiY+sk=*/

View File

@ -0,0 +1,33 @@
/*uM5a8ioVsn2I1Rch9MVFPFSl3CSda+7vWH+iKiQWG3A=*/
import {toast} from 'nc-lightapp-front';
export default function (userjson) {
if (userjson.failNum == '0' && userjson.successNum != '0') {
if (userjson.sucessData) {//销项发票成功提示
let msg = userjson.sucessData.msg ? userjson.sucessData.msg : JSON.stringify(userjson.sucessData);
toast({
content: this.multiLangJson['1058-SQ-0009'] + userjson.successNum + this.multiLangJson['1058-SQ-0010'] + this.multiLangJson['1058-SQ-0015'] + msg
});
} else {
toast({//开票申请成功提示
content: this.multiLangJson['1058-SQ-0009'] + userjson.successNum + this.multiLangJson['1058-SQ-0010']
});
}
} else if (userjson.failNum != '0') {
let rowMsg = userjson.failData.map(one => {
if (one.billNo) {
return this.multiLangJson['1058-SQ-0013'] + one.billNo + this.multiLangJson['1058-SQ-0014'] + one.msg;
} else {
return one.msg;
}
})
toast({
color: "danger",
groupOperation: true,
TextArr: [this.multiLangJson['1058-SQ-0006'], this.multiLangJson['1058-SQ-0007'], this.multiLangJson['1058-SQ-0008']],
content: this.multiLangJson['1058-SQ-0009'] + userjson.successNum + this.multiLangJson['1058-SQ-0011'] + userjson.failNum + this.multiLangJson['1058-SQ-0010'],
groupOperationMsg: [this.multiLangJson['1058-SQ-0012'], ...rowMsg],
});
}
}
/*uM5a8ioVsn2I1Rch9MVFPFSl3CSda+7vWH+iKiQWG3A=*/

View File

@ -0,0 +1,17 @@
/*m8B93TCdFd8qlmmtcAONoIiab7kFVZBcIRsgVRhlCuE=*/
import presetVar from '../presetVar'
//后台返回数据如果没有rowId则前端取表格数据的rowId补充
export default function (data) {
if (data[presetVar.tableAreaId]) {
let rowIdMap = {};
let tableData = this.props.table.getAllTableData(presetVar.tableAreaId);
tableData.rows.map(one => {
rowIdMap[one.values[presetVar.pkname].value] = one.rowId;
});
data[presetVar.tableAreaId][presetVar.tableAreaId].rows.map(one => {
one.rowId = rowIdMap[one.values[presetVar.pkname].value];
});
this.props.table.updateTableData(presetVar.tableAreaId, data[presetVar.tableAreaId][presetVar.tableAreaId]);
}
}
/*m8B93TCdFd8qlmmtcAONoIiab7kFVZBcIRsgVRhlCuE=*/

View File

@ -0,0 +1,45 @@
/*CyksppcLdT7eDjJhXsO05opbBFOlclzcJMkyT+3qZNs=*/
import { toast } from 'nc-lightapp-front';
import requestApi from '../requestApi'
import presetVar from '../presetVar'
import getSendData from '../common/getSendData'
import showListMessage from '../common/showListMessage'
import updataListData from '../common/updataListData'
import listOnSelected from './listOnSelected'
// 确认开票
export default function (isShowSlsmModal=false) {
// isShowSlsmModal是否显示税率说明弹窗
if(isShowSlsmModal&&this.state.selectedSLSMValue===''){
return this.setState({
isShowTips:true
})
}
let datas = getSendData.call(this);
if (datas) {
let sendData = {
pagecode: this.props.getSearchParam('p'),
areaid: presetVar.tableAreaId,
datas: datas,
}
if(isShowSlsmModal){
sendData.slsm = this.state.selectedSLSMValue;
}
requestApi.MakeInvoice({
data: sendData,
success: (data) => {
// 更新页面数据
updataListData.call(this, data);
// 更新页面按钮状态
listOnSelected.call(this);
// 提示消息
showListMessage.call(this, JSON.parse(data.userjson));
isShowSlsmModal&&this.closeModal();
},
error: (data)=>{
isShowSlsmModal&&this.closeModal();
toast({color:"danger", content: data.message});
}
})
}
}
/*CyksppcLdT7eDjJhXsO05opbBFOlclzcJMkyT+3qZNs=*/

View File

@ -0,0 +1,43 @@
/*JNnb7VnKIimhevxx9sWXRj+n03NLuQsUW6GPtd3kH8Q=*/
import {toast} from 'nc-lightapp-front';
import presetVar from '../presetVar'
import requestApi from '../requestApi'
export default function (props, config, pks) {
// // 设置按钮不可用
// props.button.setButtonDisabled({
// [presetVar.headBtns.Edit]: true,
// [presetVar.headBtns.Delete]: true,
// [presetVar.headBtns.Commit]: true,
// [presetVar.headBtns.Uncommit]: true,
// [presetVar.headBtns.SplitMerge]: true,
// [presetVar.headBtns.MakeInvoice]: true,
// [presetVar.headBtns.CancelMakeInvoices]: true,
// [presetVar.headBtns.Options]: true,
// [presetVar.headBtns.LinkGroup]: true,
// [presetVar.headBtns.LinkInvoice]: true,
// [presetVar.headBtns.LinkBill]: true,
// [presetVar.headBtns.Print]: true
// });
let sendData = {
// querycondition: this.searchVal,
pagecode: presetVar.pagecode,
areaid: presetVar.tableAreaId,
// queryAreaCode: presetVar.searchAreaId,  //查询区编码
// oid: presetVar.queryOid,  //查询模板id
// querytype: 'tree',
// pageInfo: this.props.table.getTablePageInfo(presetVar.tableAreaId),
pks: pks
};
requestApi.changePage({
data: sendData,
success: (data) => {
if (data) {
props.table.setAllTableData(presetVar.tableAreaId, data[presetVar.tableAreaId][presetVar.tableAreaId]);
} else {
toast({color: 'warning', content: this.multiLangJson[presetVar.mutiLangCodeDetail.queryNoData]});
}
}
});
}
/*JNnb7VnKIimhevxx9sWXRj+n03NLuQsUW6GPtd3kH8Q=*/

Some files were not shown because too many files have changed in this diff Show More