开票申请卡片批量粘贴编辑事件2
This commit is contained in:
		
							parent
							
								
									6118908f94
								
							
						
					
					
						commit
						b63550c178
					
				| 
						 | 
					@ -2,6 +2,7 @@
 | 
				
			||||||
import {get} from 'lodash'
 | 
					import {get} from 'lodash'
 | 
				
			||||||
import presetVar from '../presetVar'
 | 
					import presetVar from '../presetVar'
 | 
				
			||||||
import requestApi from '../requestApi'
 | 
					import requestApi from '../requestApi'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * pk_org:申请组织,
 | 
					 * pk_org:申请组织,
 | 
				
			||||||
 * pk_customer:客户,
 | 
					 * pk_customer:客户,
 | 
				
			||||||
| 
						 | 
					@ -20,7 +21,7 @@ import requestApi from '../requestApi'
 | 
				
			||||||
 * xsf_khh:销售方开户行
 | 
					 * xsf_khh:销售方开户行
 | 
				
			||||||
 * pk_freecustom: 散户
 | 
					 * 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"];
 | 
					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:单价
 | 
					 * xmdj:单价
 | 
				
			||||||
 * sl:税率
 | 
					 * sl:税率
 | 
				
			||||||
| 
						 | 
					@ -33,8 +34,12 @@ const headKeys = ['pk_org', 'pk_customer', 'gmf_zh', 'pk_customer_v','gmf_dz','g
 | 
				
			||||||
 * fphxz:发票行性质
 | 
					 * fphxz:发票行性质
 | 
				
			||||||
 * taxcode:税码
 | 
					 * taxcode:税码
 | 
				
			||||||
 * spbm:税收分类编码
 | 
					 * spbm:税收分类编码
 | 
				
			||||||
 | 
					 * sl:税率
 | 
				
			||||||
 | 
					 * xmjshj:价税合计
 | 
				
			||||||
 | 
					 * def1:合同销售订单编号
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
const bodyKeys = ['xmdj', 'sl', 'xmje', 'se', 'xmsl', 'xmjshj', 'pk_materiel', 'zkje', 'fphxz', 'taxcode', 'spbm'];
 | 
					const bodyKeys = ['xmdj', 'sl', 'xmje', 'se', 'xmsl', 'xmjshj', 'pk_materiel',
 | 
				
			||||||
 | 
					    'zkje', 'fphxz', 'taxcode', 'spbm', 'sl', 'xmjshj', 'def1'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default function (moduleId, key, value, changedrows, index, record) {
 | 
					export default function (moduleId, key, value, changedrows, index, record) {
 | 
				
			||||||
    // console.log('valueChange', moduleId, key, value, changedrows, index);
 | 
					    // console.log('valueChange', moduleId, key, value, changedrows, index);
 | 
				
			||||||
| 
						 | 
					@ -43,6 +48,9 @@ export default function (moduleId, key, value, changedrows, index, record) {
 | 
				
			||||||
        (moduleId == presetVar.bodyAreaId && bodyKeys.indexOf(key) > -1)) {
 | 
					        (moduleId == presetVar.bodyAreaId && bodyKeys.indexOf(key) > -1)) {
 | 
				
			||||||
        hasChange = true;
 | 
					        hasChange = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // if (bodyKeys.includes(key)) {
 | 
				
			||||||
 | 
					    //     debugger;
 | 
				
			||||||
 | 
					    // }
 | 
				
			||||||
    if (hasChange) {
 | 
					    if (hasChange) {
 | 
				
			||||||
        // 取得表头数据
 | 
					        // 取得表头数据
 | 
				
			||||||
        let headBodyData;
 | 
					        let headBodyData;
 | 
				
			||||||
| 
						 | 
					@ -64,10 +72,12 @@ export default function (moduleId, key, value, changedrows, index, record) {
 | 
				
			||||||
            checkrule: 'true',
 | 
					            checkrule: 'true',
 | 
				
			||||||
            templateid: this.props.meta.getMeta().pageid
 | 
					            templateid: this.props.meta.getMeta().pageid
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        // console.log('sendData = ', sendData);
 | 
				
			||||||
        requestApi.valueChange({
 | 
					        requestApi.valueChange({
 | 
				
			||||||
            data: sendData,
 | 
					            data: sendData,
 | 
				
			||||||
            success: (data) => {
 | 
					            success: (data) => {
 | 
				
			||||||
                data.head && data.head[presetVar.formAreaId] && this.props.form.setAllFormValue(data.head);
 | 
					                data.head && data.head[presetVar.formAreaId] && this.props.form.setAllFormValue(data.head);
 | 
				
			||||||
 | 
					                // console.log('data.body = ', data.body);
 | 
				
			||||||
                data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.updateDataByRowId(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
 | 
					                data.body && data.body[presetVar.bodyAreaId] && this.props.cardTable.updateDataByRowId(presetVar.bodyAreaId, data.body[presetVar.bodyAreaId]);
 | 
				
			||||||
                if (moduleId == presetVar.bodyAreaId && key == 'zkje') {
 | 
					                if (moduleId == presetVar.bodyAreaId && key == 'zkje') {
 | 
				
			||||||
                    // 折扣金额编辑后可能增加折扣行
 | 
					                    // 折扣金额编辑后可能增加折扣行
 | 
				
			||||||
| 
						 | 
					@ -75,13 +85,13 @@ export default function (moduleId, key, value, changedrows, index, record) {
 | 
				
			||||||
                    addRow && this.props.cardTable.addRow(presetVar.bodyAreaId, index + 1, addRow.values, false);
 | 
					                    addRow && this.props.cardTable.addRow(presetVar.bodyAreaId, index + 1, addRow.values, false);
 | 
				
			||||||
                    // 删除不要得折扣行
 | 
					                    // 删除不要得折扣行
 | 
				
			||||||
                    const allRows = this.props.cardTable.getAllRows(presetVar.bodyAreaId);
 | 
					                    const allRows = this.props.cardTable.getAllRows(presetVar.bodyAreaId);
 | 
				
			||||||
                    allRows.find((one)=>{
 | 
					                    allRows.find((one) => {
 | 
				
			||||||
                        const pk_ivappdetail = get(one, 'values.pk_ivappdetail.value');
 | 
					                        const pk_ivappdetail = get(one, 'values.pk_ivappdetail.value');
 | 
				
			||||||
                        const rowid = get(one, 'rowid');
 | 
					                        const rowid = get(one, 'rowid');
 | 
				
			||||||
                        if(one.status == '3' && (pk_ivappdetail == null || pk_ivappdetail == '')){
 | 
					                        if (one.status == '3' && (pk_ivappdetail == null || pk_ivappdetail == '')) {
 | 
				
			||||||
                            this.props.cardTable.delRowByRowId(presetVar.bodyAreaId, rowid, null, true);
 | 
					                            this.props.cardTable.delRowByRowId(presetVar.bodyAreaId, rowid, null, true);
 | 
				
			||||||
                            return true;
 | 
					                            return true;
 | 
				
			||||||
                        }else if(one.status == '3' && pk_ivappdetail){
 | 
					                        } else if (one.status == '3' && pk_ivappdetail) {
 | 
				
			||||||
                            this.props.cardTable.delRowByRowId(presetVar.bodyAreaId, rowid, null, false);
 | 
					                            this.props.cardTable.delRowByRowId(presetVar.bodyAreaId, rowid, null, false);
 | 
				
			||||||
                            return true;
 | 
					                            return true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,11 +3,12 @@
 | 
				
			||||||
 * @PageInfo: 开票申请卡片批量粘贴编辑事件
 | 
					 * @PageInfo: 开票申请卡片批量粘贴编辑事件
 | 
				
			||||||
 * @Date: 2025-05-07 16:30:44
 | 
					 * @Date: 2025-05-07 16:30:44
 | 
				
			||||||
 * @Last Modified by: mzr
 | 
					 * @Last Modified by: mzr
 | 
				
			||||||
 * @Last Modified time: 2025-05-07 16:30:44
 | 
					 * @Last Modified time: 2025-05-08 15:50:44
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {cloneDeep} from "lodash";
 | 
					import {cloneDeep} from "lodash";
 | 
				
			||||||
import bodyAfterEvent from "./bodyAfterEvent";
 | 
					import presetVar from "../presetVar";
 | 
				
			||||||
 | 
					import valueChange from "../common/valueChange";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const BATCHITEM = [
 | 
					const BATCHITEM = [
 | 
				
			||||||
    'spbm', // 税收分类编码
 | 
					    'spbm', // 税收分类编码
 | 
				
			||||||
| 
						 | 
					@ -83,7 +84,8 @@ export default async function batchEvents(param) {
 | 
				
			||||||
    }).then((res) => {
 | 
					    }).then((res) => {
 | 
				
			||||||
        let {props, changedrows, indexs, key} = res
 | 
					        let {props, changedrows, indexs, key} = res
 | 
				
			||||||
        //执行业务的批量编辑后事件
 | 
					        //执行业务的批量编辑后事件
 | 
				
			||||||
        bodyAfterEvent.call(self, areaCode, attrcode, newValue, changedrows);
 | 
					        // bodyAfterEvent.call(self, presetVar.bodyAreaId, attrcode, newValue, changedrows, indexs);
 | 
				
			||||||
 | 
					        valueChange.call(self, presetVar.bodyAreaId, attrcode, null, changedrows, indexs, null);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue