jg-waiwang-pro
胡川虎 3 months ago
parent 5b24df2f8d
commit c5d2b658cf

@ -366,7 +366,6 @@
url: '/api/scm/BusinessEnterpriseRelational/getHomePage',
method: 'get'
}).then(res => {
debugger
let _info = res.data[0];
this.homeInfo = _info;
}).catch(() => {})

@ -90,7 +90,7 @@
更多<u-icon name="arrow-down" size="24"></u-icon>
</u-button> -->
<u-button class="buttom-btn" type="warning " v-if="config.opType == 1&&properties.hasTransferBtn"
@click.stop="eventReceiver({}, 'transfer')">转审
@click.stop="eventReceiver({}, 'transfer')" :disabled="btnDisabled">转审
</u-button>
<template
v-if="(config.type === 1 && (config.jurisdictionType === 'btn_edit' || config.jurisdictionType === 'btn_add') && config.opType=='-1')|| (config.type !== 1 && config.opType=='-1')">
@ -109,7 +109,7 @@
</u-button>
</template>
<u-button class="buttom-btn" type="primary" v-if="config.opType == 1&&properties.hasAuditBtn"
@click.stop="eventLauncher('audit')">通过
@click.stop="eventLauncher('audit')" :disabled="btnDisabled">通过
</u-button>
<u-button class="buttom-btn" type="error" @click.stop="eventReceiver({},'recall')"
v-if="config.opType == 2 && properties.hasRevokeBtn">
@ -117,7 +117,7 @@
</u-button>
<!-- <u-button class="buttom-btn" @click.stop="jnpf.goBack()">取消</u-button> -->
<u-button class="buttom-btn" type="error " v-if="config.opType == 1&&properties.hasRejectBtn"
@click.stop="eventReceiver({}, 'reject')">拒绝
@click.stop="eventReceiver({}, 'reject')" :disabled="btnDisabled">拒绝
</u-button>
</view>
<u-select :list="flowUrgentList" v-model="showFlowUrgent" @confirm="seltConfirm"
@ -188,6 +188,7 @@
},
data() {
return {
btnDisabled: false,
userSelectShow: false,
actionListLength: false,
downOption: {
@ -740,10 +741,12 @@
}
},
eventLauncher(eventType) {
this.btnDisabled = true;
this.$refs.child && this.$refs.child.$refs.form && this.$refs.child
.$refs.form.submit(eventType, this.selectflowUrgent.value)
},
eventReceiver(formData, eventType) {
this.btnDisabled = true;
this.formData = {
...formData
};
@ -986,7 +989,7 @@
const ids = e.map(o => o.id)
const id = ids.join()
Transfer(this.config.taskId, {
id
freeApproverUserId: id
}).then(res => {
this.toastAndBack(res.msg, true)
})

@ -34,6 +34,8 @@
<result column="realName" property="realName"/>
<result column="realNameA" property="realNameA"/>
<result column="settlement_sum" property="settlementSum"/>
<result column="apply_state" property="applyState"/>
<result column="invoice_amount" property="invoiceAmount"/>
<result column="yunguan_mark" property="yunguanMark"/>
<result column="yunguan_massage" property="yunguanMassage"/>
<result column="yunguan_time" property="yunguanTime"/>

@ -1,7 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.PaymentApplicationMapper">
<select id="queryOrderAmount1" resultType="java.math.BigDecimal">
SELECT IFNULL(SUM(a.settlable_amount - a.apply_amount),0) orderAmount from jg_cw_settlement a
LEFT JOIN jg_cw_settlement_subject b on a.id = b.settlement_id
where b.subject_id = #{subjectBasicId} and a.apply_state = '部分申请'
</select>
<select id="queryOrderAmount2" resultType="java.math.BigDecimal">
SELECT IFNULL(SUM(tax_count),0) orderAmount from jg_business_order_product_relational where business_order_id in
(SELECT id from jg_business_order where code in (SELECT c.business_code from jg_cw_settlement a
LEFT JOIN jg_cw_settlement_subject b on a.id = b.settlement_id
LEFT JOIN jg_cw_settlement_summary c on a.id = c.settlement_id
where b.subject_id = #{subjectBasicId} and a.apply_state = '未申请' ))
</select>
<select id="queryOrderAmount3" resultType="java.math.BigDecimal">
SELECT IFNULL(SUM(tax_count),0) orderAmount from jg_business_order_product_relational where business_order_id in (
SELECT id from jg_business_order where first_subject_basic_id = '572681988834590789' and business_type = '1' and code not in (SELECT c.business_code from jg_cw_settlement a
LEFT JOIN jg_cw_settlement_subject b on a.id = b.settlement_id
LEFT JOIN jg_cw_settlement_summary c on a.id = c.settlement_id
where b.subject_id = #{subjectBasicId}))
</select>
</mapper>

@ -3,6 +3,9 @@ package jnpf.mapper;
import jnpf.entity.PaymentApplicationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
/**
* PaymentApplication
@ -13,4 +16,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface PaymentApplicationMapper extends BaseMapper<PaymentApplicationEntity> {
BigDecimal queryOrderAmount1(@Param("subjectBasicId") String subjectBasicId);
BigDecimal queryOrderAmount2(@Param("subjectBasicId") String subjectBasicId);
BigDecimal queryOrderAmount3(@Param("subjectBasicId") String subjectBasicId);
}

@ -4,6 +4,7 @@ import jnpf.model.paymentapplication.*;
import jnpf.entity.*;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -39,4 +40,10 @@ public interface PaymentApplicationService extends IService<PaymentApplicationEn
void saveOrUpdate(PaymentApplicationForm paymentApplicationForm,String id, boolean isSave) throws Exception;
void getPaymentDocPdf(String id) throws IOException;
BigDecimal queryOrderAmount1(String id);
BigDecimal queryOrderAmount2(String id);
BigDecimal queryOrderAmount3(String id);
}

@ -469,6 +469,12 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
cwsettlementQueryWrapper.eq("a.type",cwsettlementPagination.getType());
}
if(ObjectUtil.isNotEmpty(cwsettlementPagination.getApplyState())){
cwsettlementNum++;
List<String> applyList = Arrays.asList(cwsettlementPagination.getApplyState().split(","));
cwsettlementQueryWrapper.in("a.apply_state", applyList);
}
if(ObjectUtil.isNotEmpty(cwsettlementPagination.getBusinessType())){
cwsettlementNum++;

@ -77,7 +77,8 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
private UserService userService;
@Autowired
private SubjectbasicService subjectbasicService;
@Autowired
private CwsettlementService cwsettlementService;
@Autowired
private PaymentapplicationsettlementService paymentapplicationsettlementService;
@Override
@ -446,6 +447,18 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
if(!isSave){
QueryWrapper<PaymentapplicationsettlementEntity> PaymentapplicationsettlementqueryWrapper = new QueryWrapper<>();
PaymentapplicationsettlementqueryWrapper.lambda().eq(PaymentapplicationsettlementEntity::getPaymentApplicationId, entity.getId());
List<PaymentapplicationsettlementEntity> paymentapplicationsettlementEntityList = paymentapplicationsettlementService.list(PaymentapplicationsettlementqueryWrapper);
for (PaymentapplicationsettlementEntity paymentapplicationsettlementEntity : paymentapplicationsettlementEntityList) {
//更新结算单表
CwsettlementEntity cwsettlementEntity = cwsettlementService.getById(paymentapplicationsettlementEntity.getSettlementId());
cwsettlementEntity.setApplyAmount(cwsettlementEntity.getApplyAmount().subtract(paymentapplicationsettlementEntity.getDistributionAmount()));
if(cwsettlementEntity.getApplyAmount().compareTo(new BigDecimal("0")) == 0){
cwsettlementEntity.setApplyState("未申请");
}else{
cwsettlementEntity.setApplyState("部分申请");
}
cwsettlementService.updateById(cwsettlementEntity);
}
paymentapplicationsettlementService.remove(PaymentapplicationsettlementqueryWrapper);
}
if (paymentApplicationForm.getPaymentapplicationsettlementList()!=null){
@ -457,6 +470,17 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
}else{
}
paymentapplicationsettlementService.saveOrUpdate(entitys);
//更新结算单表
CwsettlementEntity cwsettlementEntity = cwsettlementService.getById(entitys.getSettlementId());
cwsettlementEntity.setApplyAmount(cwsettlementEntity.getApplyAmount().add(entitys.getDistributionAmount()));
if(cwsettlementEntity.getApplyAmount().compareTo(cwsettlementEntity.getSettlableAmount()) < 0){
cwsettlementEntity.setApplyState("部分申请");
}else if(cwsettlementEntity.getApplyAmount().compareTo(cwsettlementEntity.getSettlableAmount()) >= 0){
cwsettlementEntity.setApplyState("已申请");
}else{
cwsettlementEntity.setApplyState("未申请");
}
cwsettlementService.updateById(cwsettlementEntity);
}
}
}
@ -594,4 +618,19 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
}
log.warn("pdf文件生成成功");
}
@Override
public BigDecimal queryOrderAmount1(String id) {
return baseMapper.queryOrderAmount1(id);
}
@Override
public BigDecimal queryOrderAmount2(String id) {
return baseMapper.queryOrderAmount2(id);
}
@Override
public BigDecimal queryOrderAmount3(String id) {
return baseMapper.queryOrderAmount3(id);
}
}

@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
@ -53,10 +54,13 @@ public class PaymentApplicationController {
@Autowired
private PaymentApplicationService paymentApplicationService;
@Autowired
private ContractLService contractLService;
@Autowired
private PaymentapplicationsettlementService paymentapplicationsettlementService;
@Autowired
private SubjectbasicService subjectbasicService;
@Autowired
private UserService userService;
/**
@ -85,6 +89,9 @@ public class PaymentApplicationController {
//副表数据
//子表数据
List<PaymentapplicationsettlementEntity> paymentapplicationsettlementList = paymentApplicationService.getPaymentapplicationsettlementList(entity.getId(),paymentApplicationPagination);
if(paymentapplicationsettlementList == null || paymentapplicationsettlementList.size() == 0){
paymentapplicationsettlementList = new ArrayList<>();
}
paymentApplicationMap.put("tableField113",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(paymentapplicationsettlementList)));
realList.add(paymentApplicationMap);
}
@ -237,21 +244,67 @@ public class PaymentApplicationController {
paymentApplicationMap = generaterSwapUtil.swapDataForm(paymentApplicationMap,PaymentApplicationConstant.getFormData(),PaymentApplicationConstant.TABLEFIELDKEY,PaymentApplicationConstant.TABLERENAMES);
return ActionResult.success(paymentApplicationMap);
}
/**
*
* BFS
* @param id
* @return
*/
@Operation(summary = "结案")
@GetMapping("closeCase/{id}")
@Operation(summary = "上传BFS")
@GetMapping("uploadBFS/{id}")
@Transactional
public ActionResult closeCase(@PathVariable("id") String id){
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
if(entity!=null){
entity.setDocState("2");//已完成
paymentApplicationService.update(id,entity);
entity.setBfsFlag("2");
entity.setBfsMessage("上传BFS成功");
paymentApplicationService.updateById(entity);
return ActionResult.success("上传BFS成功");
}
/**
* BFS
* @param id
* @return
*/
@Operation(summary = "上传BFS校验")
@GetMapping("uploadBFSJY/{id}")
@Transactional
public ActionResult uploadBFSJY(@PathVariable("id") String id){
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
ContractLEntity contractLEntity = contractLService.getById(entity.getContractId());
SubjectbasicEntity subjectbasicEntity = subjectbasicService.getById(entity.getSubjectId());
if("1".equals(contractLEntity.getAdvance()) && !"1".equals(subjectbasicEntity.getSettlementMethod())){
//垫资
BigDecimal underpaymentAmount = new BigDecimal("0");
if("1".equals(subjectbasicEntity.getUnderpaymentMethod())){
//按金额
underpaymentAmount = underpaymentAmount.add(new BigDecimal(subjectbasicEntity.getApplyForUnderpaymentRatio()));
}else{
//按比例
underpaymentAmount = underpaymentAmount.add(entity.getApplyAmount().multiply(new BigDecimal(subjectbasicEntity.getApplyForUnderpaymentRatio())).divide(new BigDecimal("100")));
}
if(underpaymentAmount.compareTo(new BigDecimal("0")) == 0){
return ActionResult.success("1");
}else{
BigDecimal orderAmount = new BigDecimal("0");
//已开收付款申请,没有全部开,剩余部分金额
BigDecimal orderAmount1 = paymentApplicationService.queryOrderAmount1(subjectbasicEntity.getId());
//已开结算单,未进行付款申请
BigDecimal orderAmount2 = paymentApplicationService.queryOrderAmount2(subjectbasicEntity.getId());
//已做采购订单,未开结算单
BigDecimal orderAmount3 = paymentApplicationService.queryOrderAmount3(subjectbasicEntity.getId());
orderAmount = orderAmount.add(orderAmount2).add(orderAmount3);
if(underpaymentAmount.compareTo(orderAmount) > 0){
Map<String, BigDecimal> map = new HashMap();
map.put("underpaymentAmount", underpaymentAmount);
map.put("orderAmount", orderAmount);
return ActionResult.success("2", map);
}
}
}else {
return ActionResult.success("1");
}
return ActionResult.success("结案成功");
return ActionResult.success("1");
}
/**

@ -1,5 +1,6 @@
package jnpf.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
@ -29,19 +30,19 @@ public class PaymentapplicationsettlementEntity {
private BigDecimal settlementAmount;
@TableField(value = "ORDER_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String orderCode;
@TableField("F_CREATOR_TIME")
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@ -49,12 +50,37 @@ public class PaymentapplicationsettlementEntity {
private String flowId;
@TableField("F_VERSION")
private Integer version;
@TableField("COMPANY_ID")
@TableField(value = "COMPANY_ID" , fill = FieldFill.INSERT)
private String companyId;
@TableField("DEPARTMENT_ID")
@TableField(value = "DEPARTMENT_ID" , fill = FieldFill.INSERT)
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
@TableField(value = "ORGANIZE_JSON_ID" , fill = FieldFill.INSERT)
private String organizeJsonId;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField("settlement_subject_name")
private String settlementSubjectName;
@TableField("settlement_sum")
private BigDecimal settlementSum;
@TableField("contract_code")
private String contractCode;
@TableField("settlable_amount")
private BigDecimal settlableAmount;
@TableField("payable_amount")
private BigDecimal payableAmount;
@TableField("type")
private String type;
@TableField("apply_amount")
private BigDecimal applyAmount;
@TableField("assignable_amount")
private BigDecimal assignableAmount;
@TableField("distribution_amount")
private BigDecimal distributionAmount;
@TableField("apply_state")
private String applyState;
@TableField("invoice_amount")
private BigDecimal invoiceAmount;
}

@ -58,4 +58,6 @@ public class CwsettlementPagination extends Pagination {
@JsonProperty("contractNo")
private Object contractNo;
@JsonProperty("applyState")
private String applyState;
}

@ -1,5 +1,6 @@
package jnpf.model.paymentapplication;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.util.List;
import java.util.Date;
@ -21,6 +22,8 @@ public class PaymentapplicationsettlementModel {
/** 结算单id **/
@JSONField(name = "settlementId")
private String settlementId;
@JSONField(name = "paymentApplicationCode")
private String paymentApplicationCode;
/** 结算单编号 **/
@JSONField(name = "settlementCode")
private String settlementCode;
@ -30,4 +33,27 @@ public class PaymentapplicationsettlementModel {
/** 订单编号 **/
@JSONField(name = "orderCode")
private String orderCode;
@JSONField(name = "settlementSubjectName")
private String settlementSubjectName;
@JSONField(name = "settlementSum")
private BigDecimal settlementSum;
@JSONField(name = "contractCode")
private String contractCode;
@JSONField(name = "settlableAmount")
private BigDecimal settlableAmount;
@JSONField(name = "payableAmount")
private BigDecimal payableAmount;
@JSONField(name = "type")
private String type;
@JSONField(name = "applyAmount")
private BigDecimal applyAmount;
@JSONField(name = "assignableAmount")
private BigDecimal assignableAmount;
@JSONField(name = "distributionAmount")
private BigDecimal distributionAmount;
@JSONField(name = "applyState")
private String applyState;
@JSONField(name = "invoiceAmount")
private BigDecimal invoiceAmount;
}

@ -42,7 +42,7 @@
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row
@row-click="rowClick" :hasNO="false">
@row-click="rowClick" :hasNO="false" @row-dblclick="dbRowClick">
<el-table-column width="35">
<template slot-scope="scope">
<el-radio :label="scope.row[propsValue]" v-model="checked">&nbsp;</el-radio>
@ -337,9 +337,20 @@ export default {
this.visible = false;
},
rowClick(row) {
if(this.checked == row[this.propsValue]){
this.select();
}else{
this.checked = row[this.propsValue];
this.checkedTxt = row[this.relationField];
this.checkedRow = row;
}
},
dbRowClick(row){
this.checked = row[this.propsValue];
this.checkedTxt = row[this.relationField];
this.checkedRow = row;
this.select();
},
setDefault() {
if (this.value) {

@ -202,6 +202,7 @@ export default {
}
},
created() {
const aaa = this.$store.state.settings.useCache;
this.getColumnList(), this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},

@ -28,14 +28,6 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品名称">
<el-input v-model="query.productName" placeholder="请输入" clearable>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同编码">
<el-input v-model="query.contractName" placeholder="请输入" clearable>
@ -49,7 +41,13 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="申请状态">
<JnpfSelect v-model="query.applyState" placeholder="请选择" clearable :options="applyStateOptions"
:props="applyStateProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
@ -88,15 +86,6 @@
{{ scope.row.type}}
</template>
</el-table-column> -->
<el-table-column prop="type" fixed="left" label="业务类型" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag type="warning" v-if="scope.row.type==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.type==2">销售结算</el-tag>
<el-tag type="danger" v-else-if="scope.row.type==3">其他结算</el-tag>
</template>
</el-table-column>
<el-table-column prop="businessType" fixed="left" label="业务类型" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag type="warning" v-if="scope.row.businessType==1"></el-tag>
@ -105,15 +94,14 @@
<el-tag type="info" v-else-if="scope.row.businessType==4">销售退供</el-tag>
</template>
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100" align="center">
<!-- <el-table-column prop="type" fixed="left" label="业务类型" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
<el-tag type="warning" v-if="scope.row.type==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.type==2">销售结算</el-tag>
<el-tag type="danger" v-else-if="scope.row.type==3">其他结算</el-tag>
</template>
</el-table-column> -->
<el-table-column prop="applyState" label="申请状态" align="center" width="150">
</el-table-column>
<el-table-column prop="paymentState" label="付款状态" width="100" align="center">
<template slot-scope="scope">
@ -134,24 +122,53 @@
</el-table-column>
<el-table-column prop="settlementSubjectName" label="结算主体名称" align="center" width="250">
</el-table-column>
<el-table-column prop="settlableAmount" label="可结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="applyAmount" label="已申请金额" align="center" width="150">
</el-table-column>
<el-table-column prop="settledAmount" label="已结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="docmentNum" label="单据数" align="center" width="150">
</el-table-column>
<el-table-column prop="settlementAmount" label="应收/应付合计(含税)" align="center" width="150">
<el-table-column prop="yunguanMark" label="运管返回状态" align="center" width="100">
</el-table-column>
<el-table-column prop="yunguanMassage" label="运管返回信息" align="center" width="100">
</el-table-column>
<el-table-column prop="yunguanTime" label="运管返回时间" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.yunguanTime | toDate("yyyy-MM-dd") }}
</template>
</el-table-column>
<!-- <el-table-column prop="settlementAmount" label="应收/应付合计(含税)" align="center" width="150">
</el-table-column> -->
<!-- <el-table-column prop="paymentAmount" label="已付金额" align="center" width="150">
</el-table-column>
<el-table-column prop="prepaidDeductionAmount" label="预付抵扣" align="center" width="150">
</el-table-column>
<el-table-column prop="returnAmount" label="退回金额" align="center" width="150">
</el-table-column> -->
<el-table-column prop="payableAmount" label="应结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="settledAmount" label="已结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="settlableAmount" label="可结金额" align="center" width="150">
<!-- <el-table-column prop="payableAmount" label="应结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="completionDate" label="完成时间" align="center" width="200">
</el-table-column>
</el-table-column> -->
<!-- <el-table-column prop="creatorUserId" label="创建用户" align="center" width="200">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="center" width="200">
@ -179,15 +196,7 @@
<el-table-column prop="realNameA" label="修改用户" align="center">
</el-table-column>
<el-table-column prop="yunguanMark" label="运管返回状态" align="center" width="100">
</el-table-column>
<el-table-column prop="yunguanMassage" label="运管返回信息" align="center" width="100">
</el-table-column>
<el-table-column prop="yunguanTime" label="运管返回时间" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.yunguanTime | toDate("yyyy-MM-dd") }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="250" align="center">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@ -305,6 +314,7 @@ export default {
productName: undefined,
contractName: undefined,
contractNo: undefined,
applyState: undefined,
},
treeProps: {
children: 'children',
@ -344,6 +354,20 @@ export default {
"label": "fullName",
"value": "id"
},
applyStateOptions: [{
"fullName": "未申请",
"id": "1"
}, {
"fullName": "部分申请",
"id": "2"
}, {
"fullName": "已申请",
"id": "3"
}],
applyStateProps: {
"label": "fullName",
"value": "id"
},
settlementTypeOptions: [{
"fullName": "增加(+",
"id": "1"

@ -11,30 +11,34 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="据编号">
<el-form-item label="申请单号">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="收款方">
<el-form-item label="供应商">
<el-input v-model="query.payee" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="付款方">
<el-input v-model="query.payer" placeholder="请输入" clearable> </el-input>
<el-form-item label="付款状态">
<JnpfSelect v-model="query.paymentState" placeholder="请选择" clearable :options="paymentStateOptions"
:props="paymentStateProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="申请重量">
<el-input v-model="query.applyWeight" placeholder="请输入" clearable> </el-input>
<el-form-item label="单据状态">
<JnpfSelect v-model="query.docState" placeholder="请选择" clearable :options="docStateOptions"
:props="docStateProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="提交人">
<el-input v-model="query.creatorUserName" placeholder="请输入" clearable> </el-input>
<!-- <el-col :span="6">
<el-form-item label="付款方">
<el-input v-model="query.payer" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
@ -63,29 +67,69 @@
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod" border>
<el-table-column label="类型" prop="type" align="center" width="150" fixed="left">
<el-table-column prop="bfsFlag" label="是否上传BFS" width="150" align="center" fixed="left">
<template slot-scope="scope">
{{ scope.row.type}}
<el-tag v-if="scope.row.bfsFlag==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.bfsFlag==2"></el-tag>
</template>
</el-table-column>
<el-table-column prop="bfsMessage" label="BFS返回信息" align="center" width="200" fixed="left">
</el-table-column>
<el-table-column prop="code" label="单据编号" align="center" width="200" fixed="left">
</el-table-column>
<el-table-column prop="applyAmount" label="申请金额" align="center" width="200">
<template slot-scope="scope" v-if="scope.row.applyAmount">
<JnpfNumber v-model="scope.row.applyAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="applyWeight" label="申请重量" align="center" width="200">
</el-table-column>
<el-table-column prop="paymentAmount" label="已支付金额" align="center" width="200">
<template slot-scope="scope" v-if="scope.row.paymentAmount">
<JnpfNumber v-model="scope.row.paymentAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="paymentState" label="付款状态" width="150" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.paymentState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.paymentState==2">部分付款</el-tag>
<el-tag type="danger" v-else-if="scope.row.paymentState==3">已付款</el-tag>
</template>
</el-table-column>
<el-table-column prop="docState" label="单据状态" width="150" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.docState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.docState==2">已完成</el-tag>
</template>
</el-table-column>
<el-table-column prop="settlementState" label="结算单状态" width="150" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.settlementState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.settlementState==2">部分匹配</el-tag>
<el-tag type="danger" v-else-if="scope.row.settlementState==3">已匹配</el-tag>
</template>
</el-table-column>
<el-table-column prop="settlementAmount" label="结算金额" align="center" width="200">
<template slot-scope="scope" v-if="scope.row.settlementAmount">
<JnpfNumber v-model="scope.row.settlementAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="subjectId" label="供应商" align="center" width="300">
</el-table-column>
<el-table-column prop="paymentDate" label="收付款日期" align="center" width="300">
</el-table-column>
<el-table-column label="订单类型" prop="type" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.type}}
</template>
</el-table-column>
<el-table-column prop="contractId" label="合同" align="center" width="300">
</el-table-column>
<el-table-column prop="payee" label="收款方" align="center" width="250">
</el-table-column>
<el-table-column prop="payer" label="付款方" align="center" width="500">
</el-table-column>
<el-table-column prop="applyAmount" label="申请金额" align="center" width="200">
<template slot-scope="scope" v-if="scope.row.applyAmount">
<JnpfNumber v-model="scope.row.applyAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="applyWeight" label="申请重量" align="center" width="150">
</el-table-column>
<el-table-column prop="creatorUserName" label="提交人" align="center" width="150">
<el-table-column prop="creatorUserName" label="申请人" align="center" width="150">
</el-table-column>
<el-table-column prop="currUserName" label="当前审批人" align="center" width="150">
</el-table-column>
@ -101,7 +145,7 @@
</el-table-column>
<el-table-column prop="caseStatus" label="付款状态" align="center" width="150">
</el-table-column>
<el-table-column label="操作" fixed="right" width="250" align="center">
<el-table-column label="操作" fixed="right" width="350" align="center">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
@ -113,7 +157,9 @@
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
<el-button size="mini" type="text" @click="downPayment(scope.row.id)"></el-button>
<el-button type="text" @click="closeCaseHandle(scope.row)" v-has="'btn_edit'">
<el-button type="text" v-if="scope.row.tableField113.length > 0 && scope.row.bfsFlag == 1" @click="uploadBFSHandle(scope.row.id)" v-has="'btn_edit'">BFS
</el-button>
<el-button type="text" @click="settlementHandle(scope.row)" v-has="'btn_edit'">
</el-button>
</template>
</el-table-column>
@ -181,7 +227,7 @@ import {
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import { getToken } from "@/utils/auth";
import JNPFForm from './caseCloseForm'
import JNPFForm from './settlementForm'
export default {
components: {
@ -213,8 +259,8 @@ export default {
payee: undefined,
payer: undefined,
preparationTime: undefined,
applyWeight: undefined,
creatorUserName: undefined
paymentState: undefined,
docState: undefined
},
treeProps: {
children: 'children',
@ -246,6 +292,31 @@ export default {
"label": "fullName",
"value": "id"
},
paymentStateOptions: [{
"fullName": "未付款",
"id": "1"
},{
"fullName": "部分付款",
"id": "2"
},{
"fullName": "已付款",
"id": "3"
}],
paymentStateProps: {
"label": "fullName",
"value": "id"
},
docStateOptions: [{
"fullName": "未完成",
"id": "1"
},{
"fullName": "已完成",
"id": "2"
}],
docStateProps: {
"label": "fullName",
"value": "id"
},
caseStatusOptions: [{
"fullName": "正常",
"id": "1"
@ -594,12 +665,59 @@ export default {
this.$refs.FlowBox.init(data)
})
},
closeCaseHandle(row, isDetail) {
let id = row ? row.id : ""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list)
//
settlementHandle(row, isDetail) {
let id = row?row.id:""
this.formVisible = true
if(row.bfsFlag == 2){
isDetail = true
}else{
isDetail = false
}
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list)
})
},
//BFS
uploadBFSHandle(id) {
request({
url: `/api/scm/PaymentApplication/uploadBFSJY/${id}`,
method: 'GET'
}).then(res => {
if(res.msg == '1'){
//BFS
request({
url: `/api/scm/PaymentApplication/uploadBFS/${id}`,
method: 'GET'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}else if(res.msg == '2'){
this.$confirm('该合同是垫资合同,压款' + res.data.underpaymentAmount + '大于剩余订单未结算金额' + res.data.orderAmount + ',是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/PaymentApplication/uploadBFS/${id}`,
method: 'GET'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => { });
}
})
},
toApprovalDetail(row) {
let data = {

@ -0,0 +1,872 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '关联结算单':'关联结算单'" />
<div class="options">
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'>
</el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">基础信息</span>
</div>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="类型" prop="type">
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" optionType="button"
direction="horizontal" size="medium" :options="typeOptions" :props="typeProps" :disabled="true">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="单据编号" prop="code">
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)" placeholder="系统自动生成" readonly
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="供应商" prop="subjectId">
<JnpfPopupSelect v-model="dataForm.subjectId" @change="changeData('subjectId',-1)" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.subjectId" placeholder="请选择" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='subjectId'
interfaceId="545165301679952325" :pageSize="20" :columnOptions="subjectIdcolumnOptions" clearable
:style='{"width":"100%"}' :disabled="true">
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="合同" prop="contractId">
<JnpfPopupSelect v-model="dataForm.contractId" @change="changeData('contractId',-1)" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.contractId" placeholder="请选择" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='contract_name'
field='contractId' interfaceId="545203391626777029" :pageSize="20"
:columnOptions="contractIdcolumnOptions" clearable :style='{"width":"100%"}' :disabled="true">
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">付款信息</span>
</div>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="支付日期" prop="paymentDate">
<JnpfDatePicker v-model="dataForm.paymentDate" @change="changeData('payer', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择"
:disabled="true" :style='{ "width": "100%" }' format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="币种" prop="currency">
<JnpfSelect v-model="dataForm.currency" @change="changeData('payer', -1)" placeholder="请选择"
:disabled="true" :style='{ "width": "100%" }' :options="currencyOptions"
:props="currencyProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="申请金额" prop="applyAmount">
<JnpfInputNumber v-model="dataForm.applyAmount" @change="changeData('applyAmount',-1)" placeholder="数字文本"
:disabled="true" isAmountChinese :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="申请重量" prop="applyWeight">
<JnpfInputNumber v-model="dataForm.applyWeight" @change="changeData('applyAmount',-1)" placeholder="数字文本"
:disabled="true" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">结算单信息</span>
</div>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.paymentapplicationsettlementList" size='mini' show-summary
:summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="结算单编号"
prop="settlementCode">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementCode"
@change="changeData('paymentapplicationsettlement-settlementCode',scope.$index)" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算主体名称"
prop="settlementSubjectName">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSubjectName" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算数量"
prop="settlementSum">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSum" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="合同编号"
prop="contractCode">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.contractCode" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="可结金额"
prop="settlableAmount">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlableAmount" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="应结金额"
prop="payableAmount">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.payableAmount" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="发票金额"
prop="invoiceAmount">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.invoiceAmount" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算类型"
prop="type">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.type" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="已申请金额"
prop="applyAmount">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.applyAmount" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="可分配金额"
prop="assignableAmount">
<template slot-scope="scope">
<JnpfInput v-model="scope.row.assignableAmount" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="分配金额"
prop="distributionAmount" width="250">
<template slot="header">
<span class="required-sign">*</span>分配金额
</template>
<template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.distributionAmount" placeholder="请输入"
clearable :style='{"width":"100%"}' :max="Number(scope.row.assignableAmount)" :min=0 :disabled='continueBtnLoading'>
</JnpfInputNumber>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delpaymentapplicationsettlementList(scope.$index)" :disabled='continueBtnLoading'>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions">
<el-button type="text" icon="el-icon-plus" @click="addpaymentapplicationsettlementList()" :disabled='continueBtnLoading'>添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible=false" />
</el-row>
<settlementList v-if="goodsBoxVisible" ref="goodsBox" @refreshDataList="initList" />
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getDefaultCurrentValueUserId
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentId
} from '@/api/permission/organize'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/Generator/utils/index.js'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import settlementList from '@/views/extend/paymentapplication/settlementList'
export default {
components: {settlementList},
props: [],
data() {
return {
goodsBoxVisible: false,
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {
paymentapplicationsettlementList: {
"popupType": "dialog",
"hasPage": true,
"popupTitle": "选择数据",
"pageSize": 20,
"columnOptions": [],
"interfaceId": "",
"interfaceName": "",
"relationOptions": [],
"templateJson": [],
"popupWidth": "800px"
},
},
//
ableAll: {},
tableRows: {
paymentapplicationsettlementList: {
settlementId: '',
settlementIdOptions: [],
settlementCode: '',
settlementCodeOptions: [],
settlementAmount: '',
settlementAmountOptions: [],
orderCode: '',
orderCodeOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
type: "1",
code: undefined,
subjectId: undefined,
contractId: undefined,
payee: undefined,
payer: undefined,
applyAmount: undefined,
caseStatus: "1",
remark: undefined,
closeCaseRemark: undefined,
annex: [],
paymentDate: undefined,
currency: '1',
applyAmount: undefined,
applyWeight: undefined,
paymentapplicationsettlementList: [],
version: 0,
},
tableRequiredData: {},
dataRule: {
type: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
subjectId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
contractId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
payee: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
payer: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
applyAmount: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
},],
distributionAmount: [{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
},
typeOptions: [{
"fullName": "采购付款",
"id": "1"
}, {
"fullName": "销售付款",
"id": "2"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
currencyOptions: [{
"fullName": "人民币",
"id": "1"
}],
currencyProps: {
"label": "fullName",
"value": "id"
},
subjectIdcolumnOptions: [{
"label": "名称",
"value": "name"
}, ],
contractIdcolumnOptions: [{
"label": "合同名称",
"value": "contract_name"
}, ],
caseStatusOptions: [{
"fullName": "正常",
"id": "1"
}, {
"fullName": "结案",
"id": "2"
}],
caseStatusProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
type: [],
code: [],
subjectId: [],
contractId: [{
"dataType": "varchar",
"defaultValue": "",
"field": "subjectId",
"fieldName": "",
"id": "HmoSU22",
"jnpfKey": "popupSelect",
"relationField": "subjectId",
"required": "1"
}, {
"dataType": "varchar",
"defaultValue": "",
"field": "contractType",
"fieldName": "",
"id": "QnvSU22",
"jnpfKey": "radio",
"relationField": "type",
"required": "1"
}],
payee: [],
payer: [],
applyAmount: [],
caseStatus: [],
remark: [],
closeCaseRemark: [],
annex: [],
paymentapplicationsettlementsettlementId: [],
paymentapplicationsettlementsettlementCode: [],
paymentapplicationsettlementsettlementAmount: [],
paymentapplicationsettlementorderCode: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
getSummaries(param) {
const summaryField = ["assignableAmount", "distributionAmount"];
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
if (!summaryField.includes(column.property)) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
const thousandsField = [];
if (thousandsField.includes(column.property)) {
sums[index] = thousandsFormat(sums[index]);
}
} else {
sums[index] = '';
}
});
return sums;
},
initList(list) {
for (let i = 0; i < list.length; i++) {
let e = {};
e.paymentApplicationId = this.dataForm.id;
e.paymentApplicationCode = this.dataForm.code;
e.settlementId = list[i].id;
e.settlementCode = list[i].code;
e.settlementAmount = list[i].payableAmount;
e.settlementSubjectName = list[i].settlementSubjectName;
e.settlementSum = list[i].settlementSum;
e.contractCode = list[i].contractCode;
e.settlableAmount = list[i].settlableAmount;
e.payableAmount = list[i].payableAmount;
e.invoiceAmount = list[i].invoiceAmount;
e.applyState = list[i].applyState;
e.type = list[i].type == 1 ? '采购结算' : '销售结算';
e.applyAmount = list[i].applyAmount;
e.assignableAmount = this.jnpf.floatSub(list[i].settlableAmount, list[i].applyAmount);
this.dataForm.paymentapplicationsettlementList.push(e)
}
},
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/scm/PaymentApplication/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {},
paymentapplicationsettlementExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.paymentapplicationsettlementList.length; i++) {
const e = this.dataForm.paymentapplicationsettlementList[i];
}
return isOk;
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
if(isDetail){
this.continueBtnLoading = true
}
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/scm/PaymentApplication/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
if(this.dataForm.paymentapplicationsettlementList && this.dataForm.paymentapplicationsettlementList.length > 0){
let distributionAmount = 0
let invoiceFlag = true;
for (let i = 0; i < this.dataForm.paymentapplicationsettlementList.length; i++) {
distributionAmount = this.jnpf.floatAdd(distributionAmount, this.dataForm.paymentapplicationsettlementList[i].distributionAmount);
if(this.jnpf.floatAdd(this.dataForm.paymentapplicationsettlementList[i].applyAmount, this.dataForm.paymentapplicationsettlementList[i].distributionAmount) > this.dataForm.paymentapplicationsettlementList[i].invoiceAmount){
invoiceFlag = false;
return
}
}
if(!invoiceFlag){
this.$message({
message: '付款申请金额大于发票金额,请确认!',
type: 'error',
duration: 1000
});
}
if(distributionAmount == this.dataForm.applyAmount){
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
if (!this.paymentapplicationsettlementExist()) return
this.request()
}
})
}else{
this.$message({
message: '申请金额没有分配完成,请确认!',
type: 'error',
duration: 1000
});
}
}else{
this.$message({
message: '至少关联一条结算单',
type: 'error',
duration: 1000
});
}
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/scm/PaymentApplication',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
} else {
request({
url: '/api/scm/PaymentApplication/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
addpaymentapplicationsettlementList() {
this.goodsBoxVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.paymentapplicationsettlementList.length; i++) {
excludeIdList.push(this.dataForm.paymentapplicationsettlementList[i].settlementId);
}
this.$nextTick(() => {
this.$refs.goodsBox.init(excludeIdList, this.dataForm.subjectId, this.dataForm.contractId)
})
},
delpaymentapplicationsettlementList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.paymentapplicationsettlementList.splice(index, 1);
}).catch(() => {});
},
getpaymentapplicationsettlementList(value) {
let item = {
...this.tableRows.paymentapplicationsettlementList,
...value
}
this.dataForm.paymentapplicationsettlementList.push(item)
this.childIndex = this.dataForm.paymentapplicationsettlementList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.paymentapplicationsettlementList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -1,11 +1,11 @@
<template>
<el-dialog title="选择对账单" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
<el-dialog title="选择结算单" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键">
<el-input v-model="keyword" placeholder="请输入关键查询" clearable @keyup.enter.native="search()" />
<el-form-item label="关键">
<el-input v-model="keyword" placeholder="请输入关键查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
@ -26,24 +26,9 @@
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="code" label="单据编号" align="center" width="200">
</el-table-column>
<el-table-column label="类型" prop="type" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.type}}
</template>
</el-table-column>
<el-table-column prop="businessType" label="业务类型" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag type="warning" v-if="scope.row.businessType==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.businessType==2">采购退供</el-tag>
<el-tag type="danger" v-else-if="scope.row.businessType==3">销售订单</el-tag>
<el-tag type="info" v-else-if="scope.row.businessType==4">销售退供</el-tag>
</template>
</el-table-column>
<el-table-column prop="settlementSubjectName" label="结算主体名称" align="center" width="250">
</el-table-column>
<el-table-column prop="docmentNum" label="单据数" align="center" width="150">
</el-table-column>
<el-table-column prop="settlementAmount" label="应收/应付合计(含税)" align="center" width="150">
<el-table-column prop="settlementSum" label="结算数量" align="center" width="150">
</el-table-column>
<!-- <el-table-column prop="paymentAmount" label="已付金额" align="center" width="150">
</el-table-column>
@ -51,11 +36,21 @@
</el-table-column>
<el-table-column prop="returnAmount" label="退回金额" align="center" width="150">
</el-table-column> -->
<el-table-column prop="payableAmount" label="应结金额" align="center" width="150">
<el-table-column prop="settlableAmount" label="可结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="settledAmount" label="已结金额" align="center" width="150">
<el-table-column prop="applyAmount" label="已申请金额" align="center" width="150">
</el-table-column>
<el-table-column prop="settlableAmount" label="可结金额" align="center" width="150">
<el-table-column prop="applyState" label="申请状态" align="center" width="150">
</el-table-column>
<el-table-column prop="businessType" label="业务类型" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag type="warning" v-if="scope.row.businessType==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.businessType==2">采购退供</el-tag>
<el-tag type="danger" v-else-if="scope.row.businessType==3">销售订单</el-tag>
<el-tag type="info" v-else-if="scope.row.businessType==4">销售退供</el-tag>
</template>
</el-table-column>
<el-table-column prop="realName" label="创建用户" align="center" width="150">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
@ -111,6 +106,7 @@ export default {
excludeIdList: this.excludeIdList,
subjectId: this.subjectId,
contractId: this.contractId,
applyState: '未申请,部分申请',
dataType: 0,
menuId: '532534180186188741',
queryFlowTaskPass: '1'//

@ -1209,3 +1209,17 @@ export default {
}
}
</script>
<style>
.el-table{
overflow: auto;
}
.el-table__header-wrapper,
.el-table__body-wrapper,
.el-table__footer-wrapper{
overflow:visible;
}
//线
.el-table::after{
position: relative;
}
</style>

Loading…
Cancel
Save