页面修改,新增表

jg-waiwang-pro
XI_TENG\xixi_ 3 months ago
parent 093a6f3c75
commit a33062bb8f

@ -0,0 +1,7 @@
<?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.ContractRelationMapper">
</mapper>

@ -41,6 +41,9 @@
<result column="f_last_modify_user_id" property="lastModifyUserId"></result>
<result column="realName" property="realName"></result>
<result column="productName" property="productName"></result>
<result column="productCode" property="productCode"></result>
<result column="unitId" property="unitId"></result>
<result column="proportionNum" property="proportionNum"></result>
<result column="yunguan_mark" property="yunguanMark"/>
<result column="yunguan_massage" property="yunguanMassage"/>
<result column="yunguan_time" property="yunguanTime"/>
@ -137,14 +140,18 @@
a.*,
b.NAME AS businessfactory ,
c.NAME AS businessName,
d.f_real_name AS realName
d.f_real_name AS realName,
f.proportion_num AS proportionNum,
f.unit_id AS unitId,
e.name AS productName,
e.code AS productCode
FROM
jg_work_order a
LEFT JOIN jg_business_line b ON a.businessfactory_id = b.id
LEFT JOIN jg_business_line c ON a.business_id = c.id
LEFT JOIN base_user d ON a.f_creator_user_id = d.f_id
LEFT JOIN jg_product e ON a.product_id = e.id
LEFT JOIN jg_work_order_product f ON a.id = f.work_id
${ew.customSqlSegment}
GROUP BY
a.id

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.ContractRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* contractRelation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
*/
public interface ContractRelationMapper extends BaseMapper<ContractRelationEntity> {
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.contractrelation.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* contractRelation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
*/
public interface ContractRelationService extends IService<ContractRelationEntity> {
List<ContractRelationEntity> getList(ContractRelationPagination contractRelationPagination);
List<ContractRelationEntity> getTypeList(ContractRelationPagination contractRelationPagination,String dataType);
ContractRelationEntity getInfo(String id);
void delete(ContractRelationEntity entity);
void create(ContractRelationEntity entity);
boolean update(String id, ContractRelationEntity entity);
//子表方法
//副表数据方法
String checkForm(ContractRelationForm form,int i);
void saveOrUpdate(ContractRelationForm contractRelationForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,258 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.ContractRelationMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.contractrelation.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* contractRelation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
*/
@Service
public class ContractRelationServiceImpl extends ServiceImpl<ContractRelationMapper, ContractRelationEntity> implements ContractRelationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<ContractRelationEntity> getList(ContractRelationPagination contractRelationPagination){
return getTypeList(contractRelationPagination,contractRelationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<ContractRelationEntity> getTypeList(ContractRelationPagination contractRelationPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? ContractRelationConstant.getAppColumnData() : ContractRelationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int contractRelationNum =0;
QueryWrapper<ContractRelationEntity> contractRelationQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(contractRelationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = contractRelationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<ContractRelationEntity> contractRelationSuperWrapper = new QueryWrapper<>();
contractRelationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(contractRelationSuperWrapper,ContractRelationEntity.class,queryJson,"0"));
int contractRelationNum1 = contractRelationSuperWrapper.getExpression().getNormal().size();
if (contractRelationNum1>0){
List<String> contractRelationList =this.list(contractRelationSuperWrapper).stream().map(ContractRelationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(contractRelationList);
intersectionSuperList.add(contractRelationList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<ContractRelationEntity> contractRelationSuperWrapper = new QueryWrapper<>();
contractRelationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(contractRelationSuperWrapper,ContractRelationEntity.class,ruleJson,"0"));
int contractRelationNum1 = contractRelationSuperWrapper.getExpression().getNormal().size();
if (contractRelationNum1>0){
List<String> contractRelationList =this.list(contractRelationSuperWrapper).stream().map(ContractRelationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(contractRelationList);
intersectionRuleList.add(contractRelationList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object contractRelationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(contractRelationQueryWrapper,ContractRelationEntity.class,contractRelationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(contractRelationObj)){
return new ArrayList<>();
} else {
contractRelationQueryWrapper = (QueryWrapper<ContractRelationEntity>)contractRelationObj;
if( contractRelationQueryWrapper.getExpression().getNormal().size()>0){
contractRelationNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object contractRelationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(contractRelationQueryWrapper,ContractRelationEntity.class,contractRelationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(contractRelationObj)){
return new ArrayList<>();
} else {
contractRelationQueryWrapper = (QueryWrapper<ContractRelationEntity>)contractRelationObj;
if( contractRelationQueryWrapper.getExpression().getNormal().size()>0){
contractRelationNum++;
}
}
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
contractRelationQueryWrapper.lambda().in(ContractRelationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
contractRelationQueryWrapper.lambda().and(t->t.in(ContractRelationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
contractRelationQueryWrapper.lambda().and(t->t.in(ContractRelationEntity::getId, finalAllRuleIDlist));
}
//假删除标志
contractRelationQueryWrapper.lambda().isNull(ContractRelationEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(contractRelationPagination.getSidx())){
contractRelationQueryWrapper.lambda().orderByDesc(ContractRelationEntity::getId);
}else{
try {
String sidx = contractRelationPagination.getSidx();
String[] strs= sidx.split("_name");
ContractRelationEntity contractRelationEntity = new ContractRelationEntity();
Field declaredField = contractRelationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
contractRelationQueryWrapper="asc".equals(contractRelationPagination.getSort().toLowerCase())?contractRelationQueryWrapper.orderByAsc(value):contractRelationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<ContractRelationEntity> page=new Page<>(contractRelationPagination.getCurrentPage(), contractRelationPagination.getPageSize());
IPage<ContractRelationEntity> userIPage=this.page(page, contractRelationQueryWrapper);
return contractRelationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<ContractRelationEntity> list = new ArrayList();
return contractRelationPagination.setData(list, list.size());
}
}else{
return this.list(contractRelationQueryWrapper);
}
}
@Override
public ContractRelationEntity getInfo(String id){
QueryWrapper<ContractRelationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(ContractRelationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(ContractRelationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, ContractRelationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(ContractRelationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(ContractRelationForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
return countRecover;
}
/**
* ()
* @param id
* @param contractRelationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(ContractRelationForm contractRelationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
contractRelationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(ContractRelationConstant.getFormData(),contractRelationForm),ContractRelationForm.class);
ContractRelationEntity entity = JsonUtil.getJsonToBean(contractRelationForm, ContractRelationEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,191 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.contractrelation.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* contractRelation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Slf4j
@RestController
@Tag(name = "contractRelation" , description = "scm")
@RequestMapping("/api/scm/ContractRelation")
public class ContractRelationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ContractRelationService contractRelationService;
/**
*
*
* @param contractRelationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ContractRelationPagination contractRelationPagination)throws IOException{
List<ContractRelationEntity> list= contractRelationService.getList(contractRelationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ContractRelationEntity entity : list) {
Map<String, Object> contractRelationMap=JsonUtil.entityToMap(entity);
contractRelationMap.put("id", contractRelationMap.get("id"));
//副表数据
//子表数据
realList.add(contractRelationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContractRelationConstant.getFormData(), ContractRelationConstant.getColumnData(), contractRelationPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(contractRelationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param contractRelationForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContractRelationForm contractRelationForm) {
String b = contractRelationService.checkForm(contractRelationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
contractRelationService.saveOrUpdate(contractRelationForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param contractRelationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ContractRelationForm contractRelationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
contractRelationForm.setId(id);
if (!isImport) {
String b = contractRelationService.checkForm(contractRelationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
ContractRelationEntity entity= contractRelationService.getInfo(id);
if(entity!=null){
try{
contractRelationService.saveOrUpdate(contractRelationForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
ContractRelationEntity entity= contractRelationService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
contractRelationService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
ContractRelationEntity entity= contractRelationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contractRelationMap=JsonUtil.entityToMap(entity);
contractRelationMap.put("id", contractRelationMap.get("id"));
//副表数据
//子表数据
contractRelationMap = generaterSwapUtil.swapDataDetail(contractRelationMap,ContractRelationConstant.getFormData(),"582532950638231493",false);
return ActionResult.success(contractRelationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
ContractRelationEntity entity= contractRelationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contractRelationMap=JsonUtil.entityToMap(entity);
contractRelationMap.put("id", contractRelationMap.get("id"));
//副表数据
//子表数据
contractRelationMap = generaterSwapUtil.swapDataForm(contractRelationMap,ContractRelationConstant.getFormData(),ContractRelationConstant.TABLEFIELDKEY,ContractRelationConstant.TABLERENAMES);
return ActionResult.success(contractRelationMap);
}
}

@ -0,0 +1,63 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Data
@TableName("jg_contract_relation")
public class ContractRelationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "BUSINESS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessId;
@TableField("PURCHASE_CONTRACT_CODE")
private String purchaseContractCode;
@TableField("PURCHASE_CONTRACT_NAME")
private String purchaseContractName;
@TableField("PURCHASE_CONTRACT_NO")
private String purchaseContractNo;
@TableField("SUPPLIER_NAME")
private String supplierName;
@TableField("SALE_CONTRACT_CODE")
private String saleContractCode;
@TableField("SALE_CONTRACT_NAME")
private String saleContractName;
@TableField("CUSTOMER_NAME")
private String customerName;
@TableField("SALE_CONTRACT_NO")
private String saleContractNo;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_VERSION")
private Integer version;
}

@ -92,7 +92,13 @@ public class WorkOrderEntity {
private String realName;
@TableField(exist = false)
private String prodcutName;
private String proportionNum;
@TableField(exist = false)
private String unitId;
@TableField(exist = false)
private String productName;
@TableField(exist = false)
private String productCode;
@TableField(exist = false)
private List<ProductWarehouseEntity> productWarehouseEntityList;

@ -0,0 +1,41 @@
package jnpf.model.contractrelation;
import jnpf.util.JsonUtil;
import java.util.Map;
/**
* contractRelationjson
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
public class ContractRelationConstant{
/** 数据库链接 */
public static final String DBLINKID = "0";
/** 表别名 map */
public static final Map<String,String> TABLERENAMES = JsonUtil.getJsonToBean("{\"jg_contract_relation\":\"contractRelation\"}",Map.class);
/** 子表model map */
public static final Map<String,String> TABLEFIELDKEY = JsonUtil.getJsonToBean("{}",Map.class);
/** 整个表单配置json */
public static final String getFormData(){
StringBuilder sb = new StringBuilder();
sb.append("{\"popupType\":\"general\",\"idGlobal\":101,\"formBtns\":false,\"labelWidth\":100,\"classNames\":[],\"className\":[],\"fullScreenWidth\":\"100%\",\"hasConfirmAndAddBtn\":false,\"labelPosition\":\"right\",\"printId\":\"\",\"disabled\":false,\"formModel\":\"dataForm\",\"cancelButtonText\":\"取 消\",\"confirmButtonText\":\"确 定\",\"hasCancelBtn\":true,\"primaryKeyPolicy\":1,\"confirmAndAddText\":\"确定并继续操作\",\"hasPrintBtn\":false,\"concurrencyLock\":true,\"classJson\":\"\",\"drawerWidth\":\"600px\",\"printButtonText\":\"打 印\",\"formRef\":\"formRef\",\"gutter\":15,\"logicalDelete\":true,\"size\":\"small\",\"formRules\":\"rules\",\"generalWidth\":\"1000px\",\"hasConfirmBtn\":true,\"formStyle\":\"\",\"fields\":[{\"clearable\":true,\"suffixIcon\":\"\",\"addonAfter\":\"\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"businessId\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"span\":24}"); return sb.toString();
}
/** 列表字段配置json */
public static final String getColumnData(){
StringBuilder sb = new StringBuilder();
sb.append("{\"showSummary\":false,\"hasPage\":true,\"searchList\":[],\"treeInterfaceId\":\"\",\"treePropsValue\":\"id\",\"ruleList\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"childTableStyle\":1,\"columnOptions\":[{\"clearable\":true,\"suffixIcon\":\"\",\"fullName\":\"业务主表id合同\",\"addonAfter\":\"\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"businessId\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"businessId\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"treePropsChildren\":\"children\",\"type\":1,\"columnBtnsList\":[{\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"value\":\"edit\"},{\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"value\":\"remove\"},{\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"value\":\"detail\"}],\"thousandsField\":[],\"treeTitle\":\"左侧标题\",\"defaultColumnList\":[{\"suffixIcon\":\"\",\"align\":\"left\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"businessId\",\"showWordLimit\":false,\"__vModel__\":\"businessId\",\"checked\":true,\"disabled\":false,\"id\":\"businessId\",\"placeholder\":\"请输入\",\"addonBefore\":\"\",\"clearable\":true,\"jnpfKey\":\"input\",\"fullName\":\"业务主表id合同\",\"label\":\"业务主表id合同\",\"sortable\":false,\"addonAfter\":\"\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"prefixIcon\":\"\"}],\"treeTemplateJson\":[],\"treePropsName\":\"\",\"useColumnPermission\":false,\"treePropsUrl\":\"\",\"treeRelation\":\"\",\"treeSynType\":0,\"btnsList\":[{\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\"}],\"useDataPermission\":false,\"columnList\":[{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"业务主表id合同\",\"label\":\"业务主表id合同\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"businessId\",\"showWordLimit\":false,\"width\":0,\"__vModel__\":\"businessId\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"businessId\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"sort\":\"desc\",\"thousands\":false,\"hasSuperQuery\":true,\"summaryField\":[],\"parentField\":\"\",\"treePropsLabel\":\"fullName\",\"treeDataSource\":\"dictionary\",\"groupField\":\"\",\"printIds\":[],\"uploaderTemplateJson\":{},\"treeDictionary\":\"\",\"hasTreeQuery\":false,\"useFormPermission\":false,\"customBtnsList\":[],\"complexHeaderList\":[],\"useBtnPermission\":false,\"treeInterfaceName\":\"\",\"defaultSidx\":\"\"}"); return sb.toString();
}
/** app列表字段配置json */
public static final String getAppColumnData(){
StringBuilder sb = new StringBuilder();
sb.append("{\"hasPage\":true,\"useColumnPermission\":false,\"searchList\":[],\"btnsList\":[{\"icon\":\"icon-ym icon-ym-btn-add\",\"label\":\"新增\",\"value\":\"add\"}],\"useDataPermission\":false,\"ruleListApp\":{\"conditionList\":[],\"matchLogic\":\"and\"},\"columnList\":[{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"业务主表id合同\",\"label\":\"业务主表id合同\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"businessId\",\"showWordLimit\":false,\"width\":0,\"__vModel__\":\"businessId\",\"showPassword\":false,\"fixed\":\"none\",\"style\":{\"width\":\"100%\"},\"disabled\":false,\"id\":\"businessId\",\"placeholder\":\"请输入\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"columnOptions\":[{\"clearable\":true,\"suffixIcon\":\"\",\"fullName\":\"业务主表id合同\",\"addonAfter\":\"\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"showWordLimit\":false,\"__vModel__\":\"businessId\",\"showPassword\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"id\":\"businessId\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"pageSize\":20,\"sort\":\"desc\",\"thousands\":false,\"columnBtnsList\":[{\"icon\":\"icon-ym icon-ym-btn-edit\",\"label\":\"编辑\",\"value\":\"edit\"},{\"icon\":\"icon-ym icon-ym-btn-clearn\",\"label\":\"删除\",\"value\":\"remove\"},{\"icon\":\"icon-ym icon-ym-generator-menu\",\"label\":\"详情\",\"value\":\"detail\"}],\"loading\":false,\"hasSuperQuery\":false,\"thousandsField\":[],\"defaultColumnList\":[{\"clearable\":true,\"jnpfKey\":\"input\",\"suffixIcon\":\"\",\"fullName\":\"业务主表id合同\",\"label\":\"业务主表id合同\",\"sortable\":false,\"align\":\"left\",\"addonAfter\":\"\",\"__config__\":{\"formId\":101,\"visibility\":[\"pc\",\"app\"],\"jnpfKey\":\"input\",\"noShow\":false,\"tipLabel\":\"\",\"dragDisabled\":false,\"className\":[],\"label\":\"业务主表id合同\",\"trigger\":\"blur\",\"showLabel\":true,\"required\":false,\"tableName\":\"jg_contract_relation\",\"renderKey\":1721023058050,\"layout\":\"colFormItem\",\"tagIcon\":\"icon-ym icon-ym-generator-input\",\"unique\":false,\"tag\":\"JnpfInput\",\"regList\":[],\"span\":24},\"readonly\":false,\"prop\":\"businessId\",\"showWordLimit\":false,\"__vModel__\":\"businessId\",\"showPassword\":false,\"checked\":false,\"style\":{\"width\":\"100%\"},\"disabled\":false,\"placeholder\":\"请输入\",\"id\":\"businessId\",\"prefixIcon\":\"\",\"addonBefore\":\"\"}],\"sortList\":[],\"useFormPermission\":false,\"customBtnsList\":[],\"useBtnPermission\":false,\"defaultSidx\":\"\"}"); return sb.toString();
}
/** 表列表 */
public static final String getTableList(){
StringBuilder sb = new StringBuilder();
sb.append("[{\"relationField\":\"\",\"relationTable\":\"\",\"table\":\"jg_contract_relation\",\"tableName\":\"合同对应关系表\",\"tableField\":\"\",\"typeId\":\"1\",\"fields\":[{\"columnName\":\"id\",\"field\":\"id\",\"fieldName\":\"ID\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":1,\"allowNull\":0,\"autoIncrement\":0},{\"columnName\":\"business_id\",\"field\":\"businessId\",\"fieldName\":\"业务主表id合同\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"purchase_contract_code\",\"field\":\"purchaseContractCode\",\"fieldName\":\"采购合同编码\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"purchase_contract_name\",\"field\":\"purchaseContractName\",\"fieldName\":\"采购合同名称\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"purchase_contract_no\",\"field\":\"purchaseContractNo\",\"fieldName\":\"采购合同对方合同号\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"supplier_name\",\"field\":\"supplierName\",\"fieldName\":\"供应商名称\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"sale_contract_code\",\"field\":\"saleContractCode\",\"fieldName\":\"销售合同编码\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"sale_contract_name\",\"field\":\"saleContractName\",\"fieldName\":\"销售合同名称\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"customer_name\",\"field\":\"customerName\",\"fieldName\":\"客户名称\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"sale_contract_no\",\"field\":\"saleContractNo\",\"fieldName\":\"销售合同对方合同号\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_creator_time\",\"field\":\"creatorTime\",\"fieldName\":\"创建时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_creator_user_id\",\"field\":\"creatorUserId\",\"fieldName\":\"创建用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_last_modify_time\",\"field\":\"lastModifyTime\",\"fieldName\":\"修改时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_last_modify_user_id\",\"field\":\"lastModifyUserId\",\"fieldName\":\"修改用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_delete_time\",\"field\":\"deleteTime\",\"fieldName\":\"删除时间\",\"dataType\":\"datetime\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_delete_user_id\",\"field\":\"deleteUserId\",\"fieldName\":\"删除用户\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_delete_mark\",\"field\":\"deleteMark\",\"fieldName\":\"删除标志\",\"dataType\":\"int\",\"dataLength\":\"默认\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_tenant_id\",\"field\":\"tenantId\",\"fieldName\":\"租户id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"company_id\",\"field\":\"companyId\",\"fieldName\":\"公司id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"department_id\",\"field\":\"departmentId\",\"fieldName\":\"部门id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"organize_json_id\",\"field\":\"organizeJsonId\",\"fieldName\":\"组织id\",\"dataType\":\"varchar\",\"dataLength\":\"1000\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0},{\"columnName\":\"f_flow_id\",\"field\":\"flowId\",\"fieldName\":\"流程id\",\"dataType\":\"varchar\",\"dataLength\":\"50\",\"primaryKey\":0,\"allowNull\":1,\"autoIncrement\":0}]}]"); return sb.toString();
}
}

@ -0,0 +1,26 @@
package jnpf.model.contractrelation;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* contractRelation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Data
public class ContractRelationForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 业务主表id合同 **/
@JsonProperty("businessId")
private String businessId;
}

@ -0,0 +1,30 @@
package jnpf.model.contractrelation;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* contractRelation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
*/
@Data
public class ContractRelationPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
}

@ -231,6 +231,9 @@ export default {
}, {
"fullName": "二级",
"id": "2"
}, {
"fullName": "三级",
"id": "3"
}],
calssifyProps: {
"label": "fullName",

@ -91,8 +91,21 @@
</el-table-column>
<el-table-column prop="bomName" label="商品名称" align="center" min-width="120" fixed="left"
<el-table-column prop="bomName" label="BOM名称" align="center" min-width="200" fixed="left"
sortable>
<template #default="scope">
<el-row>
<el-col>
{{ scope.row.bomName }}
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column prop="productName" label="商品名称" align="center" min-width="180"
fixed="left" sortable>
<template #default="scope">
<el-row>
@ -102,6 +115,19 @@
</el-row>
</template>
</el-table-column>
<el-table-column prop="productCode" label="商品编码" align="center" min-width="230"
fixed="left" sortable>
<template #default="scope">
<el-row>
<el-col>
{{ scope.row.productCode }}
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column prop="productTypeId" label="类型" align="center" min-width="120">
<template slot-scope="scope">
{{ scope.row.productTypeId }}

@ -39,6 +39,11 @@
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<!-- <el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addContractList() ">合同关联
</el-button> -->
<!-- <el-button
type="text"
icon="icon-ym icon-ym-btn-clearn"
@ -162,6 +167,17 @@
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row, scope.row.flowState)">详情</el-button>
<!-- <el-button
v-if="scope.row.contractType == '采购合同' && scope.row.procurementModel == '以销定采' "
type="text" @click="addContractList(scope.row)" v-has="'btn_edit'">采购合同关联
</el-button>
<el-button
v-if="scope.row.contractType == '销售合同' && scope.row.procurementModel == '以采定销' "
type="text" @click="addContractList(scope.row)" v-has="'btn_edit'">销售合同关联
</el-button> -->
</template>
</el-table-column>
</JNPF-table>
@ -187,6 +203,8 @@
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ContractList v-if="contractListVisible" ref="ContractList" @refresh="initData" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@ -213,6 +231,8 @@ import SuperQuery from "@/components/SuperQuery";
import superQueryJson from "./superQueryJson";
import JNPFFormSet from "../contractSetPriceFormula/form";
import dayjs from "dayjs";
import ContractList from '@/views/scm/contractLRelation/formContractBatch.vue'
export default {
components: {
@ -220,7 +240,8 @@ export default {
FlowBox,
ExportBox,
ToFormDetail,
SuperQuery
SuperQuery,
ContractList,
},
data() {
return {
@ -232,6 +253,7 @@ export default {
columnOptions: [],
mergeList: [],
exportList: [],
contractListVisible: false,
columnList,
superQueryVisible: false,
@ -253,6 +275,7 @@ export default {
listLoading: false,
multipleSelection: [],
total: 0,
multipleSelectionItem: [],
queryData: {},
listQuery: {
superQueryJson: "",
@ -343,6 +366,25 @@ export default {
this.fnDataSet();
},
methods: {
addContractList() {
debugger
if (!this.multipleSelectionItem.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const selectData = this.multipleSelectionItem
this.contractListVisible = true
this.$nextTick(() => {
this.$refs.ContractList.initContractData(selectData)
})
},
fnDataSet() {
const query = {};
// -
@ -557,6 +599,7 @@ export default {
async initSearchData() { },
initData() {
this.listLoading = true;
this.contractListVisible = false;
let _query = {
...this.listQuery,
...this.query,
@ -607,6 +650,7 @@ export default {
});
},
handleSelectionChange(val) {
this.multipleSelectionItem = val
const res = val.map(item => item.id);
this.multipleSelection = res;
},

@ -0,0 +1,990 @@
<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-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<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">
<jnpf-form-tip-item>
<JnpfGroupTitle content="基础信息" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="凭证类型" prop="voucherType">
<JnpfSelect v-model="dataForm.voucherType" @change="changeData('voucherType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}'
:options="voucherTypeOptions" :props="voucherTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="合同名称" prop="contractName">
<JnpfInput v-model="dataForm.contractName" @change="changeData('contractName', -1)"
placeholder="请输入" clearable :style="{ width: '100%' }">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="制单时间" prop="preparationTime">
<JnpfDatePicker v-model="dataForm.preparationTime"
@change="changeData('preparationTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="配送方式" prop="deliveryType">
<JnpfSelect v-model="dataForm.deliveryType" @change="changeData('deliveryType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}'
:options="deliveryTypeOptions" :props="deliveryTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item>
<JnpfGroupTitle content="凭证信息" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="发货单位" prop="supplierId">
<JnpfPopupSelect v-model="dataForm.supplierId" @change="changeData('supplierId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.supplierId"
placeholder="请选择" propsValue="f_id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='f_full_name' field='supplierId'
interfaceId="522729853024209157" :pageSize="20"
:columnOptions="supplierIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="收货单位" prop="customerId">
<JnpfPopupSelect v-model="dataForm.customerId" @change="changeData('customerId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.customerId"
placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' field='customerId'
interfaceId="522693551289534725" :pageSize="20"
:columnOptions="customerIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.voucherProductBatchList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="订单序号" prop="orderNo" width="200">
<template slot="header" v-if="false">
<span class="required-sign">*</span>订单序号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.orderNo"
@change="changeData('voucherproduct-spec',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="productId" width="300">
<template slot="header" v-if="true">
<span class="required-sign">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('voucherproduct-productId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.voucherproductproductId" placeholder="请选择"
disabled propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
interfaceId="529919666429100229" :pageSize="20"
:columnOptions="voucherproductproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="规格" prop="spec" width="200">
<template slot="header" v-if="false">
<span class="required-sign">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec"
@change="changeData('voucherproduct-spec',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="单位" prop="unit" width="100">
<template slot="header" v-if="false">
<span class="required-sign">*</span>单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.unit"
@change="changeData('voucherproduct-unit',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}' disabled>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="毛重" prop="grossWeight" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>毛重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.grossWeight"
@change="changeData('voucherproduct-grossWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="皮重" prop="tareWeight" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>皮重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.tareWeight"
@change="changeData('voucherproduct-tareWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="扣重" prop="buckleWeight" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>扣重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.buckleWeight"
@change="changeData('voucherproduct-buckleWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算量" prop="netWeight" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>结算量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.netWeight"
@change="changeData('voucherproduct-netWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="净重" prop="netWeight" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>净重
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.clearWeight"
@change="changeData('voucherproduct-netWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="运费" prop="freight" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>运费
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.freight"
@change="changeData('voucherproduct-remark',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="车牌号" prop="vehicleId" width="180">
<template slot="header" v-if="true">
<span class="required-sign">*</span>车牌号
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.vehicleId"
@change="changeData('voucherproduct-printTime',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.voucherproductprintTime" placeholder="请选择"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='vehicle_number' :field="'printTime'+scope.$index"
interfaceId="529920852288864453" :pageSize="20"
:columnOptions="voucherproductprintTimecolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="驾驶员名称" prop="driverName" width="160">
<template slot="header" v-if="false">
<span class="required-sign">*</span>驾驶员名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.driverName"
@change="changeData('voucherproduct-receiptUnit',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="磅单编号" prop="poundCode" width="250">
<template slot="header" v-if="false">
<span class="required-sign">*</span>磅单编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.poundCode"
@change="changeData('voucherproduct-tenantId',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="运输方式" prop="modeTransport" width="150">
<template slot="header" v-if="true">
<span class="required-sign">*</span>运输方式
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.modeTransport"
@change="changeData('voucherproduct-cargoId',scope.$index)"
placeholder="请选择" clearable :style='{"width":"100%"}'
:options="voucherproductcargoIdOptions" :props="voucherproductcargoIdProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="承运方式" prop="transportationMethod" width="150">
<template slot="header" v-if="true">
<span class="required-sign">*</span>承运方式
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.transportationMethod"
@change="changeData('voucherproduct-receiptNum',scope.$index)"
placeholder="请选择" clearable :style='{"width":"100%"}'
:options="voucherproductreceiptNumOptions"
:props="voucherproductreceiptNumProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="承运商" prop="carrier" width="150">
<template slot="header" v-if="false">
<span class="required-sign">*</span>承运商
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.carrier"
@change="changeData('voucherproduct-batchNo',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="起运地" prop="placeDispatch" width="250">
<template slot="header" v-if="true">
<span class="required-sign">*</span>起运地
</template>
<template slot-scope="scope">
<JnpfAreaSelect v-model="scope.row.placeDispatch"
@change="changeData('voucherproduct-deliveryUnit',scope.$index)"
placeholder="请选择" selectType="all" clearable :style='{"width":"100%"}'
:level="2">
</JnpfAreaSelect>
</template>
</el-table-column>
<el-table-column label="到达地" prop="destination" width="250">
<template slot="header" v-if="true">
<span class="required-sign">*</span>到达地
</template>
<template slot-scope="scope">
<JnpfAreaSelect v-model="scope.row.destination"
@change="changeData('voucherproduct-deliveryNum',scope.$index)"
placeholder="请选择" selectType="all" clearable :style='{"width":"100%"}'
:level="2">
</JnpfAreaSelect>
</template>
</el-table-column>
<el-table-column label="销售合同编号" prop="saleContractNo" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>销售合同编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.saleContractNo"
@change="changeData('voucherproduct-remark',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="销售额" prop="saleAmount" width="180">
<template slot="header" v-if="false">
<span class="required-sign">*</span>销售额
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.saleAmount"
@change="changeData('voucherproduct-remark',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</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="delvoucherproductList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <div class="table-actions" @click="addvoucherproductList()">
<el-button type="text" icon="el-icon-plus">添加</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>
</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"
export default {
components: {},
props: [],
data() {
return {
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: {
voucherProductBatchList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
voucherProductBatchList: {
productId: '',
productIdOptions: [],
spec: '',
specOptions: [],
unit: '',
unitOptions: [],
grossWeight: '',
grossWeightOptions: [],
tareWeight: '',
tareWeightOptions: [],
buckleWeight: '',
buckleWeightOptions: [],
netWeight: '',
netWeightOptions: [],
remark: '',
remarkOptions: [],
printTime: '',
printTimeOptions: [],
receiptUnit: '',
receiptUnitOptions: [],
tenantId: '',
tenantIdOptions: [],
cargoIdOptions: [],
receiptNumOptions: [],
batchNo: '',
batchNoOptions: [],
deliveryUnit: [],
deliveryUnitOptions: [],
deliveryNum: [],
deliveryNumOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
voucherType: undefined,
preparationTime: undefined,
deliveryType: undefined,
supplierId: undefined,
customerId: undefined,
documentType: "2",
voucherStatus: "2",
businessType: "2",
voucherProductBatchList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
voucherType: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
preparationTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
deliveryType: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
supplierId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
customerId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
},
voucherTypeOptions: [{ "fullName": "磅单", "id": "1" }, { "fullName": "收据", "id": "2" }, { "fullName": "其他", "id": "3" }],
voucherTypeProps: { "label": "fullName", "value": "id" },
deliveryTypeOptions: [{ "fullName": "仓配", "id": "1" }, { "fullName": "直送", "id": "2" }],
deliveryTypeProps: { "label": "fullName", "value": "id" },
supplierIdcolumnOptions: [{ "label": "机构编码", "value": "f_en_code" }, { "label": "机构名称", "value": "f_full_name" }],
customerIdcolumnOptions: [{ "label": "客户名称", "value": "name" }, { "label": "国家", "value": "country" }, { "label": "地址", "value": "address" }, { "label": "电话", "value": "phone" }],
documentTypeOptions: [{ "fullName": "收货凭证", "id": "1" }, { "fullName": "发货凭证", "id": "2" }],
documentTypeProps: { "label": "fullName", "value": "id" },
voucherStatusOptions: [{ "fullName": "待提交", "id": "1" }, { "fullName": "待审核", "id": "2" }, { "fullName": "待质检", "id": "3" }, { "fullName": "已完成", "id": "4" }, { "fullName": "已关闭", "id": "5" }],
voucherStatusProps: { "label": "fullName", "value": "id" },
businessTypeOptions: [{ "fullName": "采购", "id": "1" }, { "fullName": "销售", "id": "2" }],
businessTypeProps: { "label": "fullName", "value": "id" },
voucherproductproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
voucherproductprintTimecolumnOptions: [{ "label": "车牌号", "value": "vehicle_number" }, { "label": "驾驶员", "value": "name" }, { "label": "电话", "value": "mobile" }],
voucherproductcargoIdOptions: [{ "fullName": "公路", "id": "1" }, { "fullName": "铁路", "id": "2" }, { "fullName": "轮船", "id": "3" }, { "fullName": "空运", "id": "4" }, { "fullName": "无", "id": "5" }],
voucherproductcargoIdProps: { "label": "fullName", "value": "id" },
voucherproductreceiptNumOptions: [{ "fullName": "仓库承运(DC)", "id": "1" }, { "fullName": "承运商", "id": "2" }, { "fullName": "供应商", "id": "3" }, { "fullName": "自提", "id": "4" }],
voucherproductreceiptNumProps: { "label": "fullName", "value": "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
voucherType: [],
preparationTime: [],
deliveryType: [],
supplierId: [],
customerId: [],
documentType: [],
voucherStatus: [],
businessType: [],
voucherproductproductId: [],
voucherproductspec: [],
voucherproductunit: [],
voucherproductgrossWeight: [],
voucherproducttareWeight: [],
voucherproductbuckleWeight: [],
voucherproductnetWeight: [],
voucherproductremark: [],
voucherproductprintTime: [],
voucherproductreceiptUnit: [],
voucherproducttenantId: [],
voucherproductcargoId: [],
voucherproductreceiptNum: [],
voucherproductbatchNo: [],
voucherproductdeliveryUnit: [],
voucherproductdeliveryNum: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
//
initContractData(selectData) {
const data = selectData
if (!data) {
return
}
let id
data.forEach(item => {
id = item.id
});
request({
url: `/api/scm/ContractL/getList`,
method: 'post',
data: id
}).then(res => {
var voucherInfo = res.data;
this.dataForm = voucherInfo
this.dataForm.voucherProductBatchList = voucherInfo.voucherProductList
this.dataForm.supplierId = voucherInfo.customerId
this.dataForm.customerId = ''
})
},
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/Voucher/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refresh', 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() {
},
voucherproductExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.voucherProductBatchList.length; i++) {
const e = this.dataForm.voucherProductBatchList[i];
var tareWeight = e.tareWeight;//
var grossWeight = e.grossWeight;//
var buckleWeight = e.buckleWeight;//
var netWeight = e.netWeight;//
if (!e.productId) {
this.$message({
message: '商品名称不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.vehicleId) {
this.$message({
message: '车牌号不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.modeTransport) {
this.$message({
message: '运输方式不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.transportationMethod) {
this.$message({
message: '承运方式不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.placeDispatch.length) {
this.$message({
message: '起运地不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.destination.length) {
this.$message({
message: '到达地不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (grossWeight < this.jnpf.floatAdd(this.jnpf.floatAdd(tareWeight, buckleWeight), netWeight)) {
this.$message({
message: '毛重不得小于皮重+扣重+净重',
type: 'error',
duration: 1000
})
isOk = false
break
}
// if (buckleWeight >= netWeight) {
// this.$message({
// message: '',
// type: 'error',
// duration: 1000
// })
// isOk = false
// break
// }
if (buckleWeight >= grossWeight) {
this.$message({
message: '扣重不得大于毛重',
type: 'error',
duration: 1000
})
isOk = false
break
}
}
return isOk;
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
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/Voucher/' + 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) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
if (!this.voucherproductExist()) return
this.request()
}
})
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
// if (!this.dataForm.id) {
request({
url: '/api/scm/Voucher/batchCreate',
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/Voucher/' + 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
// })
// }
},
addvoucherproductList() {
let item = {
productId: '',
spec: undefined,
unit: undefined,
grossWeight: undefined,
tareWeight: undefined,
buckleWeight: undefined,
netWeight: undefined,
freight: undefined,
vehicleId: '',
driverName: undefined,
poundCode: undefined,
modeTransport: '',
transportationMethod: '',
carrier: undefined,
placeDispatch: undefined,
destination: undefined,
}
this.getvoucherproductList(item)
},
delvoucherproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.voucherProductBatchList.splice(index, 1);
}).catch(() => {
});
},
getvoucherproductList(value) {
let item = { ...this.tableRows.voucherProductBatchList, ...value }
this.dataForm.voucherProductBatchList.push(item)
this.childIndex = this.dataForm.voucherProductBatchList.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.voucherProductBatchList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -693,6 +693,7 @@ export default {
}
},
createSaleDeliveryVoucher() {
debugger
if (!this.multipleSelectionItem.length) {
this.$message({
type: 'error',

@ -258,7 +258,7 @@ const columnList = [{
"renderKey": 1707042861597,
"layout": "colFormItem",
"tagIcon": "icon-ym icon-ym-generator-documents",
"ruleName": "物料编码",
"ruleName": "客户",
"tag": "JnpfInput",
"span": 8
},

@ -69,12 +69,21 @@
custom-column border @selection-change="handleSelectionChange"
:span-method="arraySpanMethod">
<el-table-column prop="businessfactory" label="工厂名称" align="center" sortable fixed="left"
<el-table-column prop="businessfactory" label="工厂名称" align="center" sortable
width="200px">
</el-table-column>
<el-table-column prop="code" label="单据编号" align="center sortable" fixed="left"
<el-table-column prop="code" label="单据编号" align="center sortable" width="200px">
</el-table-column>
<el-table-column prop="productName" label="物料名称" align="center sortable" width="200px">
</el-table-column>
<el-table-column prop="productCode" label="物料编码" align="center sortable" fixed="left"
width="200px">
</el-table-column>
<el-table-column prop="unitId" label="单位" align="center sortable" width="100px">
</el-table-column>
<!-- <el-table-column prop="businessId" label="生产线" align="center" fixed="left">
</el-table-column> -->
<el-table-column prop="businessName" label="生产线" align="center" fixed="left">

Loading…
Cancel
Save