部分加工单问题优化

jg-waiwang-pro
CJYXTX\27961 7 months ago
parent 4d8803abf4
commit 322788b756

@ -48,10 +48,13 @@
AND t6.f_delete_mark
IS NULL LEFT JOIN jg_product_unitwarehouse t7 ON t6.product_unitwarehouse_id = t7.id
AND t7.f_delete_mark IS NULL
${ew.customSqlSegment} AND t1.f_delete_mark is null
${ew.customSqlSegment}
GROUP BY
t1.id
<if test="bomPagination.sidx != null and bomPagination.sidx != ''">
ORDER BY ${bomPagination.sidx} ${bomPagination.sort}
</if>
</select>

@ -3,5 +3,64 @@
<mapper namespace="jnpf.mapper.WorkOrderMapper">
<resultMap id="workOrderBom" type="jnpf.entity.BomEntity">
<id column="id" property="id"></id>
<result column="bomCode" property="bomCode"></result>
<result column="bomName" property="bomName"></result>
<result column="productId" property="productId"></result>
</resultMap>
<resultMap id="workOrderBomProduct" type="jnpf.entity.ProductWarehouseEntity">
<id column="id" property="id"></id>
<result column="productId" property="productId"></result>
<result column="name" property="name"></result>
<result column="spec" property="spec"></result>
<result column="barCode" property="barCode"></result>
<result column="inventoryType" property="inventoryType"></result>
<result column="inventoryUnitIds" property="inventoryUnitIds"></result>
</resultMap>
<select id="queryworkOrderBom" resultMap="workOrderBom">
SELECT
a.id,
a.bom_code AS bomCode,
a.bom_name AS bomName,
b.product_id AS productId
FROM
jg_bom a
LEFT JOIN jg_bom_item b ON a.id = b.bom_id
LEFT JOIN flow_task c ON a.id = c.f_process_id
WHERE
a.f_delete_mark IS NULL
AND c.f_status = 2
AND b.product_id = #{id}
</select>
<select id="queryworkOrderBomProduct" resultMap="workOrderBomProduct">
SELECT
a.id,
a.id AS productId,
a.name AS name,
a.spec,
a.bar_code AS barCode,
CASE
a.inventory_type
WHEN 1 THEN
'原材料'
WHEN 2 THEN
'半成品'
WHEN 3 THEN
'产成品'
END AS inventoryType,
JgFnUnitName ( a.inventory_unit_id ) AS inventoryUnitIds
FROM
jg_product a
WHERE
a.f_delete_mark IS NULL
AND a.id = #{id}
</select>
</mapper>

@ -344,6 +344,7 @@ public class UserController extends SuperController<UserService, UserEntity> {
vo.setType("user");
vo.setIcon("icon-ym icon-ym-tree-user2");
vo.setHeadIcon(UploaderUtil.uploaderImg(vo.getHeadIcon()));
vo.setMobilePhone(entity.getMobilePhone());
List<UserRelationEntity> listByUserId = userRelationService.getListByUserId(entity.getId()).stream().filter(t -> t != null && PermissionConst.ORGANIZE.equals(t.getObjectType())).collect(Collectors.toList());
StringJoiner stringJoiner = new StringJoiner(",");
listByUserId.forEach(t -> {

@ -36,4 +36,5 @@ public class UserSelectorVO {
private String organize;
private Integer gender;
private Integer isAdministrator;
private String mobilePhone;
}

@ -1,8 +1,14 @@
package jnpf.mapper;
import jnpf.entity.BomEntity;
import jnpf.entity.ProductWarehouseEntity;
import jnpf.entity.WorkOrderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.model.businessorder.ProductByContractModel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* workOrder
@ -13,4 +19,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface WorkOrderMapper extends BaseMapper<WorkOrderEntity> {
//加工单根据商品成品查询bom带出原材料1
List<BomEntity> queryworkOrderBom(@Param("id") String id);
//加工单根据商品成品查询bom带出原材料2
List<ProductWarehouseEntity> queryworkOrderBomProduct(@Param("id") String id);
}

@ -42,4 +42,7 @@ public interface WarehousingReceiveService extends IService<WarehousingReceiveEn
String queryReceiveNumber(String id);
BigDecimal queryTransitInventory(InventoryEntity entity);
void saveOrUpdateWorkOrder(WarehousingReceiveForm warehousingReceiveForm,String id, boolean isSave) throws Exception;
}

@ -39,5 +39,11 @@ public interface WorkOrderService extends IService<WorkOrderEntity> {
String checkForm(WorkOrderForm form,int i);
void saveOrUpdate(WorkOrderForm workOrderForm,String id, boolean isSave) throws Exception;
//加工单根据商品成品查询bom带出原材料
List<BomEntity> getWorkBom(String id);
List<ProductWarehouseEntity> getWorkBomProduct(String id);
}

@ -254,6 +254,19 @@ public class ProcessClassificationServiceImpl extends ServiceImpl<ProcessClassif
if(StringUtil.isEmpty(form.getCategoryName())){
return "工序分类名称不能为空";
}
if(StringUtil.isNotEmpty(form.getCategoryName())){
form.setCategoryName(form.getCategoryName().trim());
QueryWrapper<ProcessClassificationEntity> categoryNameWrapper=new QueryWrapper<>();
categoryNameWrapper.lambda().eq(ProcessClassificationEntity::getCategoryName,form.getCategoryName());
//假删除标志
categoryNameWrapper.lambda().isNull(ProcessClassificationEntity::getDeleteMark);
if (isUp){
categoryNameWrapper.lambda().ne(ProcessClassificationEntity::getId, id);
}
if((int) this.count(categoryNameWrapper)>0){
countRecover = "工序分类名称不能重复";
}
}
return countRecover;
}
/**

@ -484,7 +484,9 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
if(isSave){
String mainId = id ;
entity.setDocumentNo(generaterSwapUtil.getBillNumber("chukudanbianhao", false));
if (entity.getWarehousingOutboundType().equals("14")){
mainId =RandomUtil.uuId();
}entity.setDocumentNo(generaterSwapUtil.getBillNumber("chukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);

@ -454,4 +454,53 @@ public class WarehousingReceiveServiceImpl extends ServiceImpl<WarehousingReceiv
public BigDecimal queryTransitInventory(InventoryEntity entity) {
return warehousingReceiveMapper.queryTransitInventory(entity);
}
@Override
public void saveOrUpdateWorkOrder(WarehousingReceiveForm warehousingReceiveForm, String id, boolean isSave) throws Exception {
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingReceiveForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingReceiveConstant.getFormData(),warehousingReceiveForm),WarehousingReceiveForm.class);
WarehousingReceiveEntity entity = JsonUtil.getJsonToBean(warehousingReceiveForm, WarehousingReceiveEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setReceiveCode(generaterSwapUtil.getBillNumber("warehousingReceive", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingReceiveForm.getFlowId());
entity.setVersion(0);
entity.setUsedreturnTime(DateUtil.getNowDate());
}else{
entity.setReceiveCode(generaterSwapUtil.getBillNumber("warehousingReceive", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingReceiveForm.getFlowId());
entity.setUsedreturnTime(DateUtil.getNowDate());
}
this.saveOrUpdate(entity);
//WarehousingReceiveProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingReceiveProductEntity> WarehousingReceiveProductqueryWrapper = new QueryWrapper<>();
WarehousingReceiveProductqueryWrapper.lambda().eq(WarehousingReceiveProductEntity::getReceiveId, entity.getId());
warehousingReceiveProductService.remove(WarehousingReceiveProductqueryWrapper);
}
if (warehousingReceiveForm.getWarehousingReceiveProductList()!=null){
List<WarehousingReceiveProductEntity> tableField116 = JsonUtil.getJsonToList(warehousingReceiveForm.getWarehousingReceiveProductList(),WarehousingReceiveProductEntity.class);
for(WarehousingReceiveProductEntity entitys : tableField116){
entitys.setId(RandomUtil.uuId());
entitys.setReceiveId(entity.getId());
if(isSave){
}else{
}
warehousingReceiveProductService.saveOrUpdate(entitys);
}
}
}
}

@ -481,6 +481,9 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
if(isSave){
String mainId = id ;
if (entity.getWarehousingStorageType().equals("14")){
mainId =RandomUtil.uuId();
}
entity.setDocumentNo(generaterSwapUtil.getBillNumber("rukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());

@ -30,6 +30,9 @@ import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
/**
*
* workOrder
@ -50,6 +53,8 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
private WorkOrderProductService workOrderProductService;
@Autowired
private WorkOrderPrimaryService workOrderPrimaryService;
@Resource
private WorkOrderMapper workOrderMapper;
@Override
public List<WorkOrderEntity> getList(WorkOrderPagination workOrderPagination){
return getTypeList(workOrderPagination,workOrderPagination.getDataType());
@ -440,6 +445,11 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
entity.setCode(generaterSwapUtil.getBillNumber("workOrder", false));
entity.setFlowId(workOrderForm.getFlowId());
}
// if (entity.getType().equals("1")){
// entity.setStatus("4");
// }else if (entity.getType().equals("2")){
// entity.setStatus("2");
// }
this.saveOrUpdate(entity);
//WorkOrderProduct子表数据新增修改
@ -477,4 +487,14 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
}
}
}
@Override
public List<BomEntity> getWorkBom(String id) {
return workOrderMapper.queryworkOrderBom(id);
}
@Override
public List<ProductWarehouseEntity> getWorkBomProduct(String id) {
return workOrderMapper.queryworkOrderBomProduct(id);
}
}

@ -143,7 +143,7 @@ public class ProductWarehouseController {
realList.add(productWarehouseMap);
}
//数据转换
// realList = generaterSwapUtil.swapDataList(realList, ProductWarehouseConstant.getFormData(), ProductWarehouseConstant.getColumnData(), productWarehousePagination.getModuleId(),false);
realList = generaterSwapUtil.swapDataList(realList, ProductWarehouseConstant.getFormData(), ProductWarehouseConstant.getColumnData(), productWarehousePagination.getModuleId(),false);
//流程状态添加
// for(Map<String, Object> vo:realList){
// FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);

@ -440,4 +440,26 @@ public class WarehousingReceiveController {
return ActionResult.success(warehousingReceiveMap);
}
/**
*
*
* @param warehousingReceiveForm
* @return
*/
@PostMapping("/{idssWork}")
@Operation(summary = "创建")
public ActionResult createWorkOrder(@PathVariable("id") String id, @RequestBody @Valid WarehousingReceiveForm warehousingReceiveForm) {
String b = warehousingReceiveService.checkForm(warehousingReceiveForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
warehousingReceiveService.saveOrUpdateWorkOrder(warehousingReceiveForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
}

@ -2,6 +2,7 @@ package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tencentcloudapi.iot.v20180123.models.ProductEntry;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
@ -10,6 +11,14 @@ import jnpf.engine.entity.FlowTaskNodeEntity;
import jnpf.engine.service.FlowTaskNodeService;
import jnpf.engine.service.FlowTaskService;
import jnpf.exception.DataException;
import jnpf.model.businessorder.ProductByContractModel;
import jnpf.model.warehousingoutbound.WarehousingOutboundForm;
import jnpf.model.warehousingoutbound.WarehousingOutboundProductModel;
import jnpf.model.warehousingreceive.WarehousingReceiveForm;
import jnpf.model.warehousingreceive.WarehousingReceiveProductModel;
import jnpf.model.warehousingstorage.WarehousingStorageForm;
import jnpf.model.warehousingstorage.WarehousingStoragePoundlistModel;
import jnpf.model.warehousingstorage.WarehousingStorageProductModel;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
@ -17,6 +26,7 @@ import jnpf.util.*;
import jnpf.model.workorder.*;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -79,6 +89,11 @@ public class WorkOrderController {
private WorkOrderProductService workOrderProductService;
@Autowired
private WorkOrderPrimaryService workOrderPrimaryService;
@Autowired
private WarehousingStorageController warehousingStorageController;
@Autowired WarehousingReceiveController warehousingReceiveController;
@Autowired
private WarehousingOutboundController warehousingOutboundController;
@Autowired
@ -89,6 +104,12 @@ public class WorkOrderController {
@Autowired
private FlowTaskNodeService flowTaskNodeService;
@Autowired
private BomItemValueService bomItemValueService;
@Autowired
private ProductWarehouseService productWarehouseService;
@Autowired
private WarehousingReceiveService warehousingReceiveService;
/**
*
*
@ -390,14 +411,87 @@ public class WorkOrderController {
try{
workOrderService.saveOrUpdate(workOrderForm,id,false);
FlowTaskEntity flowTaskEntity = flowTaskService.getById(id);
QueryWrapper<FlowTaskNodeEntity> flowTaskNodeEntityQueryWrapper = new QueryWrapper<>();
flowTaskNodeEntityQueryWrapper.lambda().eq(FlowTaskNodeEntity::getNodeCode, flowTaskEntity.getThisStepId());
flowTaskNodeEntityQueryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, flowTaskEntity.getId());
List<FlowTaskNodeEntity> flowTaskNodeEntityList = flowTaskNodeService.list(flowTaskNodeEntityQueryWrapper);
if(flowTaskNodeEntityList != null && "end".equals(flowTaskNodeEntityList.get(0).getNodeNext())){
//审核通过
workOrderForm.setStatus("2");
workOrderService.saveOrUpdate(workOrderForm,id,false);
if (flowTaskEntity!=null){
QueryWrapper<FlowTaskNodeEntity> flowTaskNodeEntityQueryWrapper = new QueryWrapper<>();
flowTaskNodeEntityQueryWrapper.lambda().eq(FlowTaskNodeEntity::getNodeCode, flowTaskEntity.getThisStepId());
flowTaskNodeEntityQueryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, flowTaskEntity.getId());
List<FlowTaskNodeEntity> flowTaskNodeEntityList = flowTaskNodeService.list(flowTaskNodeEntityQueryWrapper);
if(flowTaskNodeEntityList != null && "end".equals(flowTaskNodeEntityList.get(0).getNodeNext())){
//审核通过
if (workOrderForm.getType().equals("1")){
workOrderForm.setStatus("4");
} else if (workOrderForm.getType().equals("2")){
workOrderForm.setStatus("2");
}
workOrderService.saveOrUpdate(workOrderForm,id,false);
if (workOrderForm.getType().equals("1")){
//成品生成入库单
WarehousingStorageForm warehousingStorageForm=new WarehousingStorageForm();
warehousingStorageForm.setWarehousingStorageType("14");
warehousingStorageForm.setWarehousingId(workOrderForm.getId());
warehousingStorageForm.setWarehouseId(workOrderForm.getWarehouseId());
List<WarehousingStorageProductModel> list =new ArrayList<>();
for (WorkOrderProductModel workOrderProductModel:workOrderForm.getWorkOrderProductList()){
WarehousingStorageProductModel warehousingStorageProductModel=new WarehousingStorageProductModel();
warehousingStorageProductModel.setProductId(workOrderProductModel.getProductId());
warehousingStorageProductModel.setStorageAreaId(workOrderProductModel.getCargoId());
warehousingStorageProductModel.setStorageUnit(workOrderProductModel.getUnitId()); //加工单位
warehousingStorageProductModel.setStorageNumber(workOrderProductModel.getProportionNum());
list.add(warehousingStorageProductModel);
warehousingStorageForm.setWarehousingStorageProductList(list);
}
warehousingStorageController.create(id,warehousingStorageForm);
//原材料生成领用单和出库单
//领用单
WarehousingReceiveForm warehousingReceiveForm=new WarehousingReceiveForm();
warehousingReceiveForm.setWarehouseId(workOrderForm.getWarehouseId()); //仓库
warehousingReceiveForm.setUsedreturnStatus("4");
warehousingReceiveForm.setUsedreturnReason("8");
warehousingReceiveForm.setBusinessId(workOrderForm.getId()); //关联单据 加工单
warehousingReceiveForm.setRemark(workOrderForm.getRemark());
List<WarehousingReceiveProductModel> warehousingReceiveList =new ArrayList<>();
String unit=workOrderForm.getWorkOrderProductList().get(0).getUnitId();
for (WorkOrderPrimaryModel WorkOrderPrimaryModel:workOrderForm.getWorkOrderPrimaryList()){
WarehousingReceiveProductModel warehousingReceiveProductModel=new WarehousingReceiveProductModel();
warehousingReceiveProductModel.setProductId(WorkOrderPrimaryModel.getProductId());
warehousingReceiveProductModel.setCargoId(WorkOrderPrimaryModel.getCargoId());
warehousingReceiveProductModel.setUsedreturnUnit(unit); //加工单位
warehousingReceiveProductModel.setUsedreturnNumber(WorkOrderPrimaryModel.getRealityNum()); //实际发货量
warehousingReceiveList.add(warehousingReceiveProductModel);
warehousingReceiveForm.setWarehousingReceiveProductList(warehousingReceiveList);
}
warehousingReceiveController.createWorkOrder(id,warehousingReceiveForm);
//出库单
WarehousingOutboundForm warehousingOutboundForm=new WarehousingOutboundForm();
// WarehousingReceiveEntity receiveentity= warehousingReceiveService.getInfo(warehousingOutboundForm.getId());
QueryWrapper<WarehousingReceiveEntity> receiveWrapper = new QueryWrapper<>();
receiveWrapper.lambda().eq(WarehousingReceiveEntity::getBusinessId, id);
// flowTaskNodeEntityQueryWrapper.lambda().eq(WarehousingReceiveEntity::getTaskId, flowTaskEntity.getId());
List<WarehousingReceiveEntity> warehousingReceiveEntityList = warehousingReceiveService.list(receiveWrapper);
warehousingOutboundForm.setWarehousingOutboundType("14");
warehousingOutboundForm.setWarehousingId(warehousingReceiveEntityList.get(0).getId());
warehousingOutboundForm.setWarehouseId(warehousingReceiveForm.getWarehouseId());
List<WarehousingOutboundProductModel> warehousingOutboundProductModelList =new ArrayList<>();
for (WarehousingReceiveProductModel warehousingReceiveProductModel1:warehousingReceiveList){
WarehousingOutboundProductModel warehousingOutboundProductModel=new WarehousingOutboundProductModel();
warehousingOutboundProductModel.setProductId(warehousingReceiveProductModel1.getProductId());
warehousingOutboundProductModel.setOutboundAreaId(warehousingReceiveProductModel1.getCargoId());
warehousingOutboundProductModel.setOutboundUnit(unit); //加工单位
warehousingOutboundProductModel.setOutboundNumber(warehousingReceiveProductModel1.getUsedreturnNumber()); //实际发货量
warehousingOutboundProductModelList.add(warehousingOutboundProductModel);
warehousingOutboundForm.setWarehousingOutboundProductList(warehousingOutboundProductModelList);
}
warehousingOutboundController.create(id,warehousingOutboundForm);
}
}
}
}catch(Exception e){
@ -505,4 +599,33 @@ public class WorkOrderController {
}
}
/**
* bombom
*
* @return
*/
@Operation(summary = "获取bom和bom下的所有商品列表")
@GetMapping("/getWorkOrderBomList")
public ActionResult workOrderBomList(@RequestParam("productIds") String id) throws IOException{
List<BomEntity> workBomlist= workOrderService.getWorkBom(id);
for (BomEntity bomEntity:workBomlist){
QueryWrapper<BomItemValueEntity> bomEntityQueryWrapper = new QueryWrapper<>();
bomEntityQueryWrapper.lambda().eq(BomItemValueEntity::getBomId,bomEntity.getId());
List<BomItemValueEntity> bomItemValueEntityList = bomItemValueService.list(bomEntityQueryWrapper);
bomEntity.setBomItemValueEntityList(bomItemValueEntityList);
List<ProductWarehouseEntity> productList =new ArrayList<>();
for (BomItemValueEntity bomItemValueEntity : bomItemValueEntityList){
List<ProductWarehouseEntity> productWarehouseEntityList=workOrderService.getWorkBomProduct(bomItemValueEntity.getProductId());
productList.addAll(productWarehouseEntityList);
}
bomEntity.setProductWarehouseEntityList(productList);
}
return ActionResult.success(workBomlist);
}
}

@ -3,6 +3,8 @@ package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* BOM
*
@ -79,8 +81,16 @@ public class BomEntity {
private String productSpec;
@TableField(exist = false)
private String categoryName;
@TableField(exist = false)
private String productTypeId;
@TableField(exist = false)
private String productId;
//bom原材料
@TableField(exist = false)
private List<BomItemValueEntity> bomItemValueEntityList;
@TableField(exist = false)
private List<ProductWarehouseEntity> productWarehouseEntityList;
}

@ -263,4 +263,6 @@ public class ProductWarehouseEntity {
private String salesOrderQuantityUppers;
@TableField(exist = false)
private String salesOrderMultiples;
@TableField(exist = false)
private String productId;
}

@ -56,4 +56,8 @@ public class WarehousingReceiveForm {
/** 修改用户 **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 单据类型 **/
@JsonProperty("usedreturnStatus")
private String usedreturnStatus;
}

@ -1,8 +1,8 @@
<template>
<div :style="{ margin: '0 auto', width: '100%' }">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px"
label-position="right" :disabled="setting.readonly">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px" label-position="right"
:disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24">
@ -14,25 +14,22 @@
<el-col :span="8" v-if="judgeShow('bomCode')">
<jnpf-form-tip-item label="BOM编号" v-if="judgeShow('bomCode')" prop="bomCode">
<JnpfInput v-model="dataForm.bomCode" @change="changeData('bomCode', -1)"
placeholder="系统自动生成" :disabled="judgeWrite('bomCode')" readonly
:style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.bomCode" @change="changeData('bomCode', -1)" placeholder="系统自动生成"
:disabled="judgeWrite('bomCode')" readonly :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('bomName')">
<jnpf-form-tip-item label="BOM名称" v-if="judgeShow('bomName')" prop="bomName">
<JnpfInput v-model="dataForm.bomName" @change="changeData('bomName', -1)"
placeholder="请输入" :disabled="judgeWrite('bomName')" clearable
:style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.bomName" @change="changeData('bomName', -1)" placeholder="请输入"
:disabled="judgeWrite('bomName')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('bomNm')">
<jnpf-form-tip-item label="BOM简称" v-if="judgeShow('bomNm')" prop="bomNm">
<JnpfInput v-model="dataForm.bomNm" @change="changeData('bomNm', -1)"
placeholder="请输入" :disabled="judgeWrite('bomNm')" clearable
:style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.bomNm" @change="changeData('bomNm', -1)" placeholder="请输入"
:disabled="judgeWrite('bomNm')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -49,79 +46,67 @@
</div>
<el-table :data="dataForm.bomItemList" size='mini' border>
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column label="商品名称" v-if="judgeShow('bomitem-productId')" align="center"
fixed="left" prop="productId">
<el-table-column label="商品名称" v-if="judgeShow('bomitem-productId')" align="center" fixed="left"
prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemList-productId')">*</span>商品名称
<span class="required-sign" v-if="judgeRequired('bomitemList-productId')">*</span>
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" @change="productSelect"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.bomitemproductId" placeholder="请选择"
:disabled="judgeWrite('bomitemList') || judgeWrite('bomitemList-productId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据商品"
popupType="dialog" relationField='name' :field="'productId' + scope.$index"
interfaceId="519505017699307077" :pageSize="20"
:columnOptions="bomitemproductIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
<JnpfPopupSelect v-model="scope.row.productId" @change="productSelect" :rowIndex="scope.$index"
:formData="dataForm" :templateJson="interfaceRes.bomitemproductId" placeholder="请选择"
:disabled="judgeWrite('bomitemList') || judgeWrite('bomitemList-productId')" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据商品" popupType="dialog" relationField='name'
:field="'productId' + scope.$index" interfaceId="519505017699307077" :pageSize="20"
:columnOptions="bomitemproductIdcolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="商品规格" v-if="judgeShow('bomitem-creatorTime')" align="center"
prop="creatorTime">
<el-table-column label="商品规格" v-if="judgeShow('bomitem-creatorTime')" align="center" prop="creatorTime">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemList-creatorTime')">*</span>商品规格
<span class="required-sign" v-if="judgeRequired('bomitemList-creatorTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec"
@change="changeData('bomitem-creatorTime', scope.$index)" placeholder="请输入"
disabled clearable :style='{ "width": "100%" }'>
<JnpfInput v-model="scope.row.spec" @change="changeData('bomitem-creatorTime', scope.$index)"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="类型" v-if="judgeShow('bomitem-creatorUserId')" align="center"
prop="creatorUserId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemList-creatorUserId')">*</span>类型
<span class="required-sign" v-if="judgeRequired('bomitemList-creatorUserId')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.productTypeIds"
@change="changeData('bomitem-creatorUserId', scope.$index)" placeholder="请输入"
disabled clearable :style='{ "width": "100%" }'>
@change="changeData('bomitem-creatorUserId', scope.$index)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位" v-if="judgeShow('bomitem-lastModifyTime')"
align="center" prop="lastModifyTime">
<el-table-column label="库存单位" v-if="judgeShow('bomitem-lastModifyTime')" align="center"
prop="lastModifyTime">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemList-lastModifyTime')">*</span>库存单位
<span class="required-sign" v-if="judgeRequired('bomitemList-lastModifyTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.inventoryUnitIds"
@change="changeData('bomitem-lastModifyTime', scope.$index)" placeholder="请输入"
disabled clearable :style='{ "width": "100%" }'>
@change="changeData('bomitem-lastModifyTime', scope.$index)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="销售单位" v-if="judgeShow('bomitem-deleteMark')" align="center"
prop="deleteMark">
<el-table-column label="销售单位" v-if="judgeShow('bomitem-deleteMark')" align="center" prop="deleteMark">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemList-deleteMark')">*</span>销售单位
<span class="required-sign" v-if="judgeRequired('bomitemList-deleteMark')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.salesMainUnitIds"
@change="changeData('bomitem-deleteMark', scope.$index)" placeholder="请输入"
disabled clearable :style='{ "width": "100%" }'>
@change="changeData('bomitem-deleteMark', scope.$index)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('bomitemList')"
align="center">
<el-table-column label="操作" width="50" v-if="!judgeWrite('bomitemList')" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbomitemList(scope.$index)">删除</el-button>
@ -132,8 +117,7 @@
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div> -->
<div class="table-actions" @click="choice()" v-if="!judgeWrite('bomitemList')"
align="center">
<div class="table-actions" @click="choice()" v-if="!judgeWrite('bomitemList')" align="center">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
@ -151,118 +135,103 @@
</div>
<el-table :data="dataForm.bomItemValueList" size='mini' border="">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column label="商品名称" v-if="judgeShow('bomitemvalue-productId')"
align="center" fixed="left" prop="productId">
<el-table-column label="商品名称" v-if="judgeShow('bomitemvalue-productId')" align="center" fixed="left"
prop="productId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-productId')">*</span>商品名称
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-productId')">*</span>
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" @change="productBomSelect"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.bomitemvalueproductId" placeholder="请选择"
:disabled="judgeWrite('bomitemvalueList') || judgeWrite('bomitemvalueList-productId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据商品"
popupType="dialog" relationField='name' :field="'productId' + scope.$index"
interfaceId="519505017699307077" :pageSize="20"
:columnOptions="bomitemvalueproductIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
<JnpfPopupSelect v-model="scope.row.productId" @change="productBomSelect" :rowIndex="scope.$index"
:formData="dataForm" :templateJson="interfaceRes.bomitemvalueproductId" placeholder="请选择"
:disabled="judgeWrite('bomitemvalueList') || judgeWrite('bomitemvalueList-productId')" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据商品" popupType="dialog" relationField='name'
:field="'productId' + scope.$index" interfaceId="519505017699307077" :pageSize="20"
:columnOptions="bomitemvalueproductIdcolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="存货类型" v-if="judgeShow('bomitemvalue-creatorTime')"
align="center" prop="creatorTime">
<el-table-column label="存货类型" v-if="judgeShow('bomitemvalue-creatorTime')" align="center"
prop="creatorTime">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-creatorTime')">*</span>存货类型
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-creatorTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.inventoryType" @change="productBomSelect"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
<JnpfInput v-model="scope.row.inventoryType" @change="productBomSelect" placeholder="请输入" disabled
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="规格" v-if="judgeShow('bomitemvalue-creatorUserId')"
align="center" prop="creatorUserId">
<el-table-column label="规格" v-if="judgeShow('bomitemvalue-creatorUserId')" align="center"
prop="creatorUserId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-creatorUserId')">*</span>规格
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-creatorUserId')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.spec"
@change="changeData('bomitemvalue-creatorUserId', scope.$index)"
<JnpfInput v-model="scope.row.spec" @change="changeData('bomitemvalue-creatorUserId', scope.$index)"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位" v-if="judgeShow('bomitemvalue-lastModifyUserId')"
align="center" prop="lastModifyUserId">
<el-table-column label="库存单位" v-if="judgeShow('bomitemvalue-lastModifyUserId')" align="center"
prop="lastModifyUserId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-lastModifyUserId')">*</span>库存单位
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-lastModifyUserId')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.inventoryUnitIds"
@change="changeData('bomitemvalue-lastModifyUserId', scope.$index)"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
@change="changeData('bomitemvalue-lastModifyUserId', scope.$index)" placeholder="请输入" disabled
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="条码" v-if="judgeShow('bomitemvalue-deleteUserId')"
align="center" prop="deleteUserId">
<el-table-column label="条码" v-if="judgeShow('bomitemvalue-deleteUserId')" align="center"
prop="deleteUserId">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-deleteUserId')">*</span>条码
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-deleteUserId')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.barCode"
@change="changeData('bomitemvalue-deleteUserId', scope.$index)"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
@change="changeData('bomitemvalue-deleteUserId', scope.$index)" placeholder="请输入" disabled
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作单位" v-if="judgeShow('bomitemvalue-unit')" prop="unit"
align="center">
<el-table-column label="操作单位" v-if="judgeShow('bomitemvalue-unit')" prop="unit" align="center">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-unit')">*</span>操作单位
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-unit')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.operateUnitIds"
@change="changeData('bomitemvalue-unit', scope.$index)" placeholder="请输入"
disabled clearable :style='{ "width": "100%" }'>
@change="changeData('bomitemvalue-unit', scope.$index)" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="比例数量" v-if="judgeShow('bomitemvalue-proportionNum')"
align="center" prop="proportionNum">
<el-table-column label="比例数量" v-if="judgeShow('bomitemvalue-proportionNum')" align="center"
prop="proportionNum">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-proportionNum')">*</span>比例数量
<span class="required-sign" v-if="judgeRequired('bomitemvalueList-proportionNum')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.proportionNum"
@change="changeData('bomitemvalue-proportionNum', scope.$index)"
placeholder="请输入"
@change="changeData('bomitemvalue-proportionNum', scope.$index)" placeholder="请输入"
:disabled="judgeWrite('bomitemvalueList') || judgeWrite('bomitemvalueList-proportionNum')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('bomitemvalueList')"
align="center">
<el-table-column label="操作" width="50" v-if="!judgeWrite('bomitemvalueList')" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbomitemvalueList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="choiceRaw()"
v-if="!judgeWrite('bomitemvalueList')">
<div class="table-actions" @click="choiceRaw()" v-if="!judgeWrite('bomitemvalueList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
<!-- <div class="table-actions" @click="addbomitemvalueList()">
@ -273,15 +242,14 @@
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible = false" />
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
<BomProductGoodsBox v-if="BomgoodsBoxVisible" ref="BomGoodsBox" @refreshDataList="initList" />
<BomProductRawGoodsBox v-if="BomgoodsBoxRawVisible" ref="BomGoodsRawBox"
@refreshDataList="initRawList" />
<BomProductGoodsBoxOnly v-if="BomgoodsBoxVisible" ref="BomGoodsBox" @refreshDataList="initList" />
<BomProductRawGoodsBox v-if="BomgoodsBoxRawVisible" ref="BomGoodsRawBox" @refreshDataList="initRawList" />
</div>
</template>
@ -298,12 +266,12 @@ 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 BomProductGoodsBox from '@/views/scm/publicPopup/BomProductGoodsBox'
import BomProductGoodsBoxOnly from '@/views/scm/publicPopup/BomProductGoodsBoxOnly'
import BomProductRawGoodsBox from '@/views/scm/publicPopup/BomProductGoodsBox'
export default {
mixins: [comMixin],
components: { BomProductGoodsBox, BomProductRawGoodsBox },
components: { BomProductGoodsBoxOnly, BomProductRawGoodsBox },
props: [],
data() {
return {
@ -607,42 +575,53 @@ export default {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
choice() {
this.BomgoodsBoxVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.bomItemList.length; i++) {
if(this.dataForm.bomItemList.length>0){
this.$alert('请先删除后选择', '单选唯一提示', {
confirmButtonText: '确定',
});
}else{
this.BomgoodsBoxVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.bomItemList.length; i++) {
excludeIdList.push(this.dataForm.bomItemList[i].productId);
}
this.$nextTick(() => {
}
this.$nextTick(() => {
this.$refs.BomGoodsBox.init(excludeIdList)
})
})
}
},
initList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
let item = {
productId: e.id,
name: e.name,
spec: e.spec,
inventoryType: e.inventoryType,
inventoryUnitIds: e.inventoryUnitIds,
salesMainUnitIds: e.salesMainUnitIds,
barCode: e.barCode,
productTypeIds: e.productTypeId,
productId: list.id,
name: list.name,
spec: list.spec,
inventoryType: list.inventoryType,
inventoryUnitIds: list.inventoryUnitIds,
salesMainUnitIds: list.salesMainUnitIds,
barCode: list.barCode,
productTypeIds: list.productTypeId,
}
this.dataForm.bomItemList.push(item)
}
},
choiceRaw() {
this.BomgoodsBoxRawVisible = true
let excludeIdList = [];
if(this.dataForm.bomItemList.length<=0){
this.$alert('请先选择加工成品', '提示', {
confirmButtonText: '确定',
});
} else{
this.BomgoodsBoxRawVisible = true
let excludeIdList = [this.dataForm.bomItemList[0].productId];
for (let i = 0; i < this.dataForm.bomItemValueList.length; i++) {
excludeIdList.push(this.dataForm.bomItemValueList[i].productId);
}
this.$nextTick(() => {
this.$refs.BomGoodsRawBox.init(excludeIdList)
})
}
},
initRawList(list) {
for (let i = 0; i < list.length; i++) {

@ -1,9 +1,8 @@
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<template>
<div :style="{ margin: '0 auto', width: '100%' }">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px"
label-position="right" :disabled="setting.readonly">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px" label-position="right"
:disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24">
@ -14,65 +13,62 @@
</el-col>
<el-col :span="8" v-if="judgeShow('code')">
<jnpf-form-tip-item label="生产线编号" v-if="judgeShow('code')" prop="code">
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('code')" readonly
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.code" @change="changeData('code', -1)" placeholder="系统自动生成"
:disabled="judgeWrite('code')" readonly :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('name')">
<jnpf-form-tip-item label="生产线名称" v-if="judgeShow('name')" prop="name">
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
:disabled="judgeWrite('name')" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.name" @change="changeData('name', -1)" placeholder="请输入"
:disabled="judgeWrite('name')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('simpleName')">
<jnpf-form-tip-item label=" 简称/英文名" v-if="judgeShow('simpleName')" prop="simpleName">
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName',-1)"
placeholder="请输入" :disabled="judgeWrite('simpleName')" clearable
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName', -1)" placeholder="请输入"
:disabled="judgeWrite('simpleName')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('type')">
<jnpf-form-tip-item label="类型" v-if="judgeShow('type')" prop="type">
<JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" placeholder="请选择"
:disabled="judgeWrite('type')" clearable :style='{"width":"100%"}'
:options="typeOptions" :props="typeProps">
<JnpfSelect v-model="dataForm.type" @change="changeData('type', -1)" placeholder="请选择"
:disabled="judgeWrite('type')" clearable :style='{ "width": "100%" }' :options="typeOptions"
:props="typeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('parentId')">
<jnpf-form-tip-item label="所属工厂" v-if="judgeShow('parentId')" prop="parentId">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)"
placeholder="请选择" :disabled="judgeWrite('parentId')" clearable
:style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId', -1)" placeholder="请选择"
:disabled="judgeWrite('parentId')" clearable :style='{ "width": "100%" }' :options="parentIdOptions"
:props="parentIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('workshopId')">
<jnpf-form-tip-item label="所属车间" v-if="judgeShow('workshopId')" prop="workshopId">
<JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId',-1)"
placeholder="请选择" :disabled="judgeWrite('workshopId')" clearable
:style='{"width":"100%"}' :options="workshopIdOptions" :props="workshopIdProps">
<JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId', -1)" placeholder="请选择"
:disabled="judgeWrite('workshopId')" clearable :style='{ "width": "100%" }' :options="workshopIdOptions"
:props="workshopIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('status')">
<jnpf-form-tip-item label="状态" v-if="judgeShow('status')" prop="status">
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
:disabled="judgeWrite('status')" optionType="button" direction="horizontal"
:style='{"width":"100%"}' size="large" :options="statusOptions"
:props="statusProps">
<JnpfRadio v-model="dataForm.status" @change="changeData('status', -1)" :disabled="judgeWrite('status')"
optionType="button" direction="horizontal" :style='{ "width": "100%" }' size="large"
:options="statusOptions" :props="statusProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('description')">
<jnpf-form-tip-item label="描述" v-if="judgeShow('description')" prop="description">
<JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" :disabled="judgeWrite('description')" clearable
:style='{"width":"100%"}' :autosize='{"minRows":4,"maxRows":4}'>
<JnpfTextarea v-model="dataForm.description" @change="changeData('description', -1)" placeholder="请输入"
:disabled="judgeWrite('description')" clearable :style='{ "width": "100%" }'
:autosize='{ "minRows": 4, "maxRows": 4 }'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
@ -87,26 +83,23 @@
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.businessContact1List" size='mini' border="">
<el-table :data="dataForm.businessContactList" size='mini' border="">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
align="center" fixed="left" prop="contactType">
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')" align="center" fixed="left"
prop="contactType">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-contactType')">*</span>类型
<span class="required-sign" v-if="judgeRequired('businesscontactList-contactType')">*</span>
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.contactType"
@change="changeData('businesscontact1-contactType',scope.$index)"
placeholder="请选择"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-contactType')"
clearable :style='{"width":"100%"}'
:options="businesscontact1contactTypeOptions"
@change="changeData('businesscontact1-contactType', scope.$index)" placeholder="请选择"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-contactType')"
clearable :style='{ "width": "100%" }' :options="businesscontact1contactTypeOptions"
:props="businesscontact1contactTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name"
<!-- <el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name"
align="center" fixed="left">
<template slot="header">
<span class="required-sign"
@ -119,65 +112,70 @@
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name" align="center">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontact1-name')">*</span>
</template>
<template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.name" @change="changeData('businesscontact1-name', scope.$index)"
placeholder="请选择" selectType="all" :ableIds="ableAll.businesscontact1nameableIds" clearable
:style='{ "width": "100%" }'>
</JnpfUserSelect>
</template>
</el-table-column>
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')"
align="center" prop="phone">
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')" align="center" prop="phone">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-phone')">*</span>手机号
<span class="required-sign" v-if="judgeRequired('businesscontactList-phone')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.phone"
@change="changeData('businesscontact1-phone',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-phone')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.phone" @change="changeData('businesscontact1-phone', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-phone')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')"
align="center" prop="landline">
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')" align="center"
prop="landline">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-landline')">*</span>座机
<span class="required-sign" v-if="judgeRequired('businesscontactList-landline')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.landline"
@change="changeData('businesscontact1-landline',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-landline')"
clearable :style='{"width":"100%"}'>
@change="changeData('businesscontact1-landline', scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-landline')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email"
align="center">
<el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email" align="center">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-email')">*</span>邮箱
<span class="required-sign" v-if="judgeRequired('businesscontactList-email')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.email"
@change="changeData('businesscontact1-email',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-email')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.email" @change="changeData('businesscontact1-email', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-email')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax"
align="center">
<el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax" align="center">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-fax')">*</span>传真
<span class="required-sign" v-if="judgeRequired('businesscontactList-fax')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.fax"
@change="changeData('businesscontact1-fax',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-fax')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.fax" @change="changeData('businesscontact1-fax', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-fax')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')"
<!-- <el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')"
align="center" prop="lastModifyTime">
<template slot="header">
<span class="required-sign"
@ -191,25 +189,40 @@
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')"
</el-table-column> -->
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')" prop="lastModifyTime"
align="center">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontact1-lastModifyTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.lastModifyTime"
@change="changeData('businesscontact1-lastModifyTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1-lastModifyTime')"
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbusinessContact1List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addbusinessContact1List()"
v-if="!judgeWrite('businesscontactList')">
<div class="table-actions" @click="addbusinessContact1List()" v-if="!judgeWrite('businesscontactList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
@ -250,13 +263,13 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businessContact1List: {
businessContactList: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -287,7 +300,7 @@ export default {
diffFlag: "5",
description: undefined,
businessContact1List: [],
businessContactList: [],
version: 0,
},
tableRequiredData: {},
@ -471,8 +484,8 @@ export default {
},
businesscontact1Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businessContact1List.length; i++) {
const e = this.dataForm.businessContact1List[i];
for (let i = 0; i < this.dataForm.businessContactList.length; i++) {
const e = this.dataForm.businessContactList[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -591,7 +604,7 @@ export default {
landline: undefined,
email: undefined,
fax: undefined,
lastModifyTime: undefined,
lastModifyTime: new Date().getTime(),
}
this.getbusinessContact1List(item)
},
@ -599,14 +612,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businessContact1List.splice(index, 1);
this.dataForm.businessContactList.splice(index, 1);
}).catch(() => {
});
},
getbusinessContact1List(value) {
let item = { ...this.tableRows.businessContact1List, ...value }
this.dataForm.businessContact1List.push(item)
this.childIndex = this.dataForm.businessContact1List.length - 1
let item = { ...this.tableRows.businessContactList, ...value }
this.dataForm.businessContactList.push(item)
this.childIndex = this.dataForm.businessContactList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -699,7 +712,7 @@ export default {
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.businessContact1List.length; i++) {
for (let i = 0; i < _dataAll.businessContactList.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -1,13 +1,9 @@
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<template>
<div :style="{ margin: '0 auto', width: '100%' }">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px"
label-position="right" :disabled="setting.readonly">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px" label-position="right"
:disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24">
@ -18,65 +14,61 @@
</el-col>
<el-col :span="8" v-if="judgeShow('code')">
<jnpf-form-tip-item label="车间编号" v-if="judgeShow('code')" prop="code">
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('code')" readonly
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.code" @change="changeData('code', -1)" placeholder="系统自动生成"
:disabled="judgeWrite('code')" readonly :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('name')">
<jnpf-form-tip-item label="车间名称" v-if="judgeShow('name')" prop="name">
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
:disabled="judgeWrite('name')" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.name" @change="changeData('name', -1)" placeholder="请输入"
:disabled="judgeWrite('name')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('simpleName')">
<jnpf-form-tip-item label=" 简称/英文名" v-if="judgeShow('simpleName')" prop="simpleName">
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName',-1)"
placeholder="请输入" :disabled="judgeWrite('simpleName')" clearable
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName', -1)" placeholder="请输入"
:disabled="judgeWrite('simpleName')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('type')">
<jnpf-form-tip-item label="类型" v-if="judgeShow('type')" prop="type">
<JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" placeholder="请选择"
:disabled="judgeWrite('type')" clearable :style='{"width":"100%"}'
:options="typeOptions" :props="typeProps">
<JnpfSelect v-model="dataForm.type" @change="changeData('type', -1)" placeholder="请选择"
:disabled="judgeWrite('type')" clearable :style='{ "width": "100%" }' :options="typeOptions"
:props="typeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('parentId')">
<jnpf-form-tip-item label="所属工厂/基地" v-if="judgeShow('parentId')" prop="parentId">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)"
placeholder="请选择" :disabled="judgeWrite('parentId')" clearable
:style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId', -1)" placeholder="请选择"
:disabled="judgeWrite('parentId')" clearable :style='{ "width": "100%" }' :options="parentIdOptions"
:props="parentIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('workshopArea')">
<jnpf-form-tip-item label="车间面积" v-if="judgeShow('workshopArea')" prop="workshopArea">
<JnpfInput v-model="dataForm.workshopArea" @change="changeData('workshopArea',-1)"
placeholder="请输入" :disabled="judgeWrite('workshopArea')" clearable
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.workshopArea" @change="changeData('workshopArea', -1)" placeholder="请输入"
:disabled="judgeWrite('workshopArea')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('status')">
<jnpf-form-tip-item label="状态" v-if="judgeShow('status')" prop="status">
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
:disabled="judgeWrite('status')" optionType="button" direction="horizontal"
:style='{"width":"100%"}' size="large" :options="statusOptions"
:props="statusProps">
<JnpfRadio v-model="dataForm.status" @change="changeData('status', -1)" :disabled="judgeWrite('status')"
optionType="button" direction="horizontal" :style='{ "width": "100%" }' size="large"
:options="statusOptions" :props="statusProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('description')">
<jnpf-form-tip-item label="描述" v-if="judgeShow('description')" prop="description">
<JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" :disabled="judgeWrite('description')" clearable
:style='{"width":"100%"}' :autosize='{"minRows":4,"maxRows":4}'>
<JnpfTextarea v-model="dataForm.description" @change="changeData('description', -1)" placeholder="请输入"
:disabled="judgeWrite('description')" clearable :style='{ "width": "100%" }'
:autosize='{ "minRows": 4, "maxRows": 4 }'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
@ -91,129 +83,130 @@
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.businessContact1List" size='mini' border="">
<el-table :data="dataForm.businessContactList" size='mini' border="">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
align="center" fixed="left" prop="contactType">
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')" align="center" fixed="left"
prop="contactType">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-contactType')">*</span>类型
<span class="required-sign" v-if="judgeRequired('businesscontact1List-contactType')">*</span>
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.contactType"
@change="changeData('businesscontact1-contactType',scope.$index)"
placeholder="请选择"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-contactType')"
clearable :style='{"width":"100%"}'
:options="businesscontact1contactTypeOptions"
@change="changeData('businesscontact1-contactType', scope.$index)" placeholder="请选择"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1List-contactType')"
clearable :style='{ "width": "100%" }' :options="businesscontact1contactTypeOptions"
:props="businesscontact1contactTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name"
align="center">
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name" align="center">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-name')">*</span>姓名
<span class="required-sign" v-if="judgeRequired('businesscontact1-name')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.name"
@change="changeData('businesscontact1-name',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-name')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
<JnpfUserSelect v-model="scope.row.name" @change="changeData('businesscontact1-name', scope.$index)"
placeholder="请选择" selectType="all" :ableIds="ableAll.businesscontact1nameableIds" clearable
:style='{ "width": "100%" }'>
</JnpfUserSelect>
</template>
</el-table-column>
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')"
align="center" prop="phone">
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')" align="center" prop="phone">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-phone')">*</span>手机号
<span class="required-sign" v-if="judgeRequired('businesscontact1List-phone')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.phone"
@change="changeData('businesscontact1-phone',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-phone')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.phone" @change="changeData('businesscontact1-phone', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1List-phone')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')"
align="center" prop="landline">
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')" align="center"
prop="landline">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-landline')">*</span>座机
<span class="required-sign" v-if="judgeRequired('businesscontact1List-landline')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.landline"
@change="changeData('businesscontact1-landline',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-landline')"
clearable :style='{"width":"100%"}'>
@change="changeData('businesscontact1-landline', scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1List-landline')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email"
align="center">
<el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email" align="center">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-email')">*</span>邮箱
<span class="required-sign" v-if="judgeRequired('businesscontact1List-email')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.email"
@change="changeData('businesscontact1-email',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-email')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.email" @change="changeData('businesscontact1-email', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1List-email')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax"
align="center">
<el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax" align="center">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-fax')">*</span>传真
<span class="required-sign" v-if="judgeRequired('businesscontact1List-fax')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.fax"
@change="changeData('businesscontact1-fax',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-fax')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.fax" @change="changeData('businesscontact1-fax', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1List-fax')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')"
align="center" prop="lastModifyTime">
<!-- <el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')" align="center"
prop="lastModifyTime">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontact1List-lastModifyTime')">*</span>更新时间
<span class="required-sign" v-if="judgeRequired('businesscontact1List-lastModifyTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyTime"
@change="changeData('businesscontact1-lastModifyTime',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontact1List')||judgeWrite('businesscontact1List-lastModifyTime')"
clearable :style='{"width":"100%"}'>
@change="changeData('businesscontact1-lastModifyTime', scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1List-lastModifyTime')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontact1List')"
</el-table-column> -->
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')" prop="lastModifyTime"
align="center">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontact1-lastModifyTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.lastModifyTime"
@change="changeData('businesscontact1-lastModifyTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1-lastModifyTime')"
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontact1List')" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbusinesscontact1List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addbusinesscontact1List()"
v-if="!judgeWrite('businesscontact1List')">
<div class="table-actions" @click="addbusinesscontact1List()" v-if="!judgeWrite('businesscontact1List')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
@ -254,13 +247,13 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businessContact1List: {
businessContactList: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -290,7 +283,7 @@ export default {
difflag: "3",
diffFlag: "3",
description: undefined,
businessContact1List: [],
businessContactList: [],
version: 0,
},
tableRequiredData: {},
@ -464,8 +457,8 @@ export default {
},
businesscontact1Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businessContact1List.length; i++) {
const e = this.dataForm.businessContact1List[i];
for (let i = 0; i < this.dataForm.businessContactList.length; i++) {
const e = this.dataForm.businessContactList[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -559,7 +552,7 @@ export default {
landline: undefined,
email: undefined,
fax: undefined,
lastModifyTime: undefined,
lastModifyTime: new Date().getTime(),
}
this.getbusinesscontact1List(item)
},
@ -567,14 +560,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businessContact1List.splice(index, 1);
this.dataForm.businessContactList.splice(index, 1);
}).catch(() => {
});
},
getbusinesscontact1List(value) {
let item = { ...this.tableRows.businessContact1List, ...value }
this.dataForm.businessContact1List.push(item)
this.childIndex = this.dataForm.businessContact1List.length - 1
let item = { ...this.tableRows.businessContactList, ...value }
this.dataForm.businessContactList.push(item)
this.childIndex = this.dataForm.businessContactList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -667,7 +660,7 @@ export default {
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.businessContact1List.length; i++) {
for (let i = 0; i < _dataAll.businessContactList.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -1,10 +1,8 @@
div -1
div -1
-2
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<template>
<div :style="{ margin: '0 auto', width: '100%' }">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="default" label-width="100px"
label-position="left" :disabled="setting.readonly">
@ -19,65 +17,62 @@ div -1
</el-col>
<el-col :span="8" v-if="judgeShow('code')">
<jnpf-form-tip-item label="生产线编号" v-if="judgeShow('code')" prop="code">
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="系统自动生成" :disabled="judgeWrite('code')" readonly
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.code" @change="changeData('code', -1)" placeholder="系统自动生成"
:disabled="judgeWrite('code')" readonly :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('name')">
<jnpf-form-tip-item label="生产线名称" v-if="judgeShow('name')" prop="name">
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
:disabled="judgeWrite('name')" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.name" @change="changeData('name', -1)" placeholder="请输入"
:disabled="judgeWrite('name')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('simpleName')">
<jnpf-form-tip-item label=" 简称/英文名" v-if="judgeShow('simpleName')" prop="simpleName">
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName',-1)"
placeholder="请输入" :disabled="judgeWrite('simpleName')" clearable
:style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName', -1)" placeholder="请输入"
:disabled="judgeWrite('simpleName')" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('type')">
<jnpf-form-tip-item label="类型" v-if="judgeShow('type')" prop="type">
<JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" placeholder="请选择"
:disabled="judgeWrite('type')" clearable :style='{"width":"100%"}'
:options="typeOptions" :props="typeProps">
<JnpfSelect v-model="dataForm.type" @change="changeData('type', -1)" placeholder="请选择"
:disabled="judgeWrite('type')" clearable :style='{ "width": "100%" }' :options="typeOptions"
:props="typeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('parentId')">
<jnpf-form-tip-item label="所属工厂" v-if="judgeShow('parentId')" prop="parentId">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)"
placeholder="请选择" :disabled="judgeWrite('parentId')" clearable
:style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId', -1)" placeholder="请选择"
:disabled="judgeWrite('parentId')" clearable :style='{ "width": "100%" }' :options="parentIdOptions"
:props="parentIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('workshopId')">
<jnpf-form-tip-item label="所属车间" v-if="judgeShow('workshopId')" prop="workshopId">
<JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId',-1)"
placeholder="请选择" :disabled="judgeWrite('workshopId')" clearable
:style='{"width":"100%"}' :options="workshopIdOptions" :props="workshopIdProps">
<JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId', -1)" placeholder="请选择"
:disabled="judgeWrite('workshopId')" clearable :style='{ "width": "100%" }' :options="workshopIdOptions"
:props="workshopIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('status')">
<jnpf-form-tip-item label="状态" v-if="judgeShow('status')" prop="status">
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
:disabled="judgeWrite('status')" optionType="button" direction="horizontal"
:style='{"width":"100%"}' size="large" :options="statusOptions"
:props="statusProps">
<JnpfRadio v-model="dataForm.status" @change="changeData('status', -1)" :disabled="judgeWrite('status')"
optionType="button" direction="horizontal" :style='{ "width": "100%" }' size="large"
:options="statusOptions" :props="statusProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('description')">
<jnpf-form-tip-item label="描述" v-if="judgeShow('description')" prop="description">
<JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" :disabled="judgeWrite('description')" clearable
:style='{"width":"100%"}' :autosize='{"minRows":4,"maxRows":4}'>
<JnpfTextarea v-model="dataForm.description" @change="changeData('description', -1)" placeholder="请输入"
:disabled="judgeWrite('description')" clearable :style='{ "width": "100%" }'
:autosize='{ "minRows": 4, "maxRows": 4 }'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
@ -92,108 +87,123 @@ div -1
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.businessContact1List" size='mini'>
<el-table :data="dataForm.businessContactList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
prop="contactType">
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')" prop="contactType">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-contactType')">*</span>类型
<span class="required-sign" v-if="judgeRequired('businesscontactList-contactType')">*</span>
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.contactType"
@change="changeData('businesscontact1-contactType',scope.$index)"
placeholder="请选择"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-contactType')"
clearable :style='{"width":"100%"}'
:options="businesscontact1contactTypeOptions"
@change="changeData('businesscontact1-contactType', scope.$index)" placeholder="请选择"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-contactType')"
clearable :style='{ "width": "100%" }' :options="businesscontact1contactTypeOptions"
:props="businesscontact1contactTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name">
<!-- <el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-name')">*</span>姓名
<span class="required-sign" v-if="judgeRequired('businesscontactList-name')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.name"
@change="changeData('businesscontact1-name',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-name')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.name" @change="changeData('businesscontact1-name', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-name')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name" align="center">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontact1-name')">*</span>
</template>
<template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.name" @change="changeData('businesscontact1-name', scope.$index)"
placeholder="请选择" selectType="all" :ableIds="ableAll.businesscontact1nameableIds" clearable
:style='{ "width": "100%" }'>
</JnpfUserSelect>
</template>
</el-table-column>
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')"
prop="phone">
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')" prop="phone">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-phone')">*</span>手机号
<span class="required-sign" v-if="judgeRequired('businesscontactList-phone')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.phone"
@change="changeData('businesscontact1-phone',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-phone')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.phone" @change="changeData('businesscontact1-phone', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-phone')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')"
prop="landline">
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')" prop="landline">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-landline')">*</span>座机
<span class="required-sign" v-if="judgeRequired('businesscontactList-landline')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.landline"
@change="changeData('businesscontact1-landline',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-landline')"
clearable :style='{"width":"100%"}'>
@change="changeData('businesscontact1-landline', scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-landline')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-email')">*</span>邮箱
<span class="required-sign" v-if="judgeRequired('businesscontactList-email')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.email"
@change="changeData('businesscontact1-email',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-email')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.email" @change="changeData('businesscontact1-email', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-email')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-fax')">*</span>传真
<span class="required-sign" v-if="judgeRequired('businesscontactList-fax')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.fax"
@change="changeData('businesscontact1-fax',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-fax')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="scope.row.fax" @change="changeData('businesscontact1-fax', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-fax')" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')"
prop="lastModifyTime">
<!-- <el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')" prop="lastModifyTime">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('businesscontactList-lastModifyTime')">*</span>更新时间
<span class="required-sign" v-if="judgeRequired('businesscontactList-lastModifyTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyTime"
@change="changeData('businesscontact1-lastModifyTime',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-lastModifyTime')"
clearable :style='{"width":"100%"}'>
@change="changeData('businesscontact1-lastModifyTime', scope.$index)" placeholder="请输入"
:disabled="judgeWrite('businesscontactList') || judgeWrite('businesscontactList-lastModifyTime')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')" prop="lastModifyTime">
<template slot="header">
<span class="required-sign" v-if="judgeRequired('businesscontact1-lastModifyTime')">*</span>
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.lastModifyTime"
@change="changeData('businesscontact1-lastModifyTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择"
:disabled="judgeWrite('businesscontact1List') || judgeWrite('businesscontact1-lastModifyTime')"
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@ -201,16 +211,15 @@ div -1
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addbusinesscontact1List()"
v-if="!judgeWrite('businesscontactList')">
<div class="table-actions" @click="addbusinesscontact1List()" v-if="!judgeWrite('businesscontactList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
@ -251,13 +260,13 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businessContact1List: {
businessContactList: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -288,7 +297,7 @@ export default {
diffFlag: "5",
description: undefined,
businessContact1List: [],
businessContactList: [],
version: 0,
},
tableRequiredData: {},
@ -472,8 +481,8 @@ export default {
},
businesscontact1Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businessContact1List.length; i++) {
const e = this.dataForm.businessContact1List[i];
for (let i = 0; i < this.dataForm.businessContactList.length; i++) {
const e = this.dataForm.businessContactList[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -592,7 +601,7 @@ export default {
landline: undefined,
email: undefined,
fax: undefined,
lastModifyTime: undefined,
lastModifyTime: new Date().getTime(),
}
this.getbusinesscontact1List(item)
},
@ -600,14 +609,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businessContact1List.splice(index, 1);
this.dataForm.businessContactList.splice(index, 1);
}).catch(() => {
});
},
getbusinesscontact1List(value) {
let item = { ...this.tableRows.businessContact1List, ...value }
this.dataForm.businessContact1List.push(item)
this.childIndex = this.dataForm.businessContact1List.length - 1
let item = { ...this.tableRows.businessContactList, ...value }
this.dataForm.businessContactList.push(item)
this.childIndex = this.dataForm.businessContactList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -700,7 +709,7 @@ export default {
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.businesscontact1List.length; i++) {
for (let i = 0; i < _dataAll.businessContactList.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -14,60 +14,57 @@
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="班组编号" prop="teamCode">
<JnpfInput v-model="dataForm.teamCode" @change="changeData('teamCode', -1)"
placeholder="系统自动生成" readonly :style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.teamCode" @change="changeData('teamCode', -1)" placeholder="系统自动生成" readonly
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="班组名称" prop="teamName">
<JnpfInput v-model="dataForm.teamName" @change="changeData('teamName', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.teamName" @change="changeData('teamName', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="班组简称" prop="teamNm">
<JnpfInput v-model="dataForm.teamNm" @change="changeData('teamNm', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.teamNm" @change="changeData('teamNm', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="类型" prop="type">
<JnpfSelect v-model="dataForm.type" @change="changeData('type', -1)" placeholder="请选择"
clearable :style='{ "width": "100%" }' :options="typeOptions" :props="typeProps">
<JnpfSelect v-model="dataForm.type" @change="changeData('type', -1)" placeholder="请选择" clearable
:style='{ "width": "100%" }' :options="typeOptions" :props="typeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="所属工厂" prop="parentId">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' :options="parentIdOptions"
:props="parentIdProps">
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId', -1)" placeholder="请选择" clearable
:style='{ "width": "100%" }' :options="parentIdOptions" :props="parentIdProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="所属车间" prop="parentIds">
<JnpfSelect v-model="dataForm.parentIds" @change="changeData('parentIds', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }' :options="parentIdsOptions"
:props="parentIdsProps">
<JnpfSelect v-model="dataForm.parentIds" @change="changeData('parentIds', -1)" placeholder="请选择" clearable
:style='{ "width": "100%" }' :options="parentIdsOptions" :props="parentIdsProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="班组状态" prop="teamStatus">
<JnpfRadio v-model="dataForm.teamStatus" @change="changeData('teamStatus', -1)"
optionType="default" direction="horizontal" size="medium"
:options="teamStatusOptions" :props="teamStatusProps">
<JnpfRadio v-model="dataForm.teamStatus" @change="changeData('teamStatus', -1)" optionType="default"
direction="horizontal" size="medium" :options="teamStatusOptions" :props="teamStatusProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="描述" prop="remark">
<JnpfInput v-model="dataForm.remark" @change="changeData('remark', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
<JnpfInput v-model="dataForm.remark" @change="changeData('remark', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -81,21 +78,19 @@
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.businessContactTeamList" size='mini' border="">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
<el-table-column label="联系人类型" prop="contactType" width="150px" align="center"
fixed="left">
<el-table-column label="联系人类型" prop="contactType" width="150px" align="center" fixed="left">
<template slot="header" v-if="true">
<span class="required-sign">*</span>联系人类型
</template>
<template slot-scope="scope">
<JnpfSelect v-model="scope.row.contactType"
@change="changeData('businesscontactteam-contactType', scope.$index)"
placeholder="请选择" clearable :style='{ "width": "100%" }'
:options="businesscontactteamcontactTypeOptions"
@change="changeData('businesscontactteam-contactType', scope.$index)" placeholder="请选择" clearable
:style='{ "width": "100%" }' :options="businesscontactteamcontactTypeOptions"
:props="businesscontactteamcontactTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="姓名" prop="name" width="150px" align="center" fixed="left">
<!-- <el-table-column label="姓名" prop="name" width="150px" align="center" fixed="left">
<template slot="header" v-if="true">
<span class="required-sign">*</span>姓名
</template>
@ -105,14 +100,26 @@
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="姓名" v-if="true" prop="name" fixed="left" align="center" width="210px">
<template slot="header">
<span class="required-sign">*</span>姓名
</template>
<template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.name"
@change="changeData('businesscontactteam-name', scope.$index)" placeholder="请选择" selectType="all"
:ableIds="ableAll.businesscontactteamnameableIds" clearable :style='{ "width": "100%" }'>
</JnpfUserSelect>
</template>
</el-table-column>
<el-table-column label="手机号" prop="phone" width="200px" align="center">
<template slot="header" v-if="true">
<span class="required-sign">*</span>手机号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.phone"
@change="changeData('businesscontactteam-phone', scope.$index)"
<JnpfInput v-model="scope.row.phone" @change="changeData('businesscontactteam-phone', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
@ -123,8 +130,8 @@
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.landline"
@change="changeData('businesscontactteam-landline', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
@change="changeData('businesscontactteam-landline', scope.$index)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
@ -133,8 +140,7 @@
<span class="required-sign">*</span>邮箱
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.email"
@change="changeData('businesscontactteam-email', scope.$index)"
<JnpfInput v-model="scope.row.email" @change="changeData('businesscontactteam-email', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
@ -144,23 +150,39 @@
<span class="required-sign">*</span>传真
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.fax"
@change="changeData('businesscontactteam-fax', scope.$index)"
<JnpfInput v-model="scope.row.fax" @change="changeData('businesscontactteam-fax', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="修改时间" prop="lastModifyTime" width="200px" align="center">
<!-- <el-table-column label="修改时间" prop="lastModifyTime" width="200px" align="center">
<template slot="header" v-if="false">
<span class="required-sign">*</span>修改时间
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyTime"
@change="changeData('businesscontactteam-lastModifyTime', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
@change="changeData('businesscontactteam-lastModifyTime', scope.$index)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="修改时间" prop="lastModifyTime" width="200px"
align="center">
<template slot="header">
<span class="required-sign" >*</span>修改时间
</template>
<template slot-scope="scope">
<JnpfDatePicker v-model="scope.row.lastModifyTime"
@change="changeData('businesscontactteam-lastModifyTime', scope.$index)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择"
disabled
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@ -181,7 +203,7 @@
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.classTeamUseList" size='mini' border="">
<el-table :data="dataForm.classTeamUseList" size='mini' border>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="员工姓名" prop="belongUserId" align="center">
<template slot="header" v-if="false">
@ -189,9 +211,8 @@
</template>
<template slot-scope="scope">
<JnpfUserSelect v-model="scope.row.belongUserId" @change="changeDataList"
placeholder="请选择" selectType="all"
:ableIds="ableAll.classteamusebelongUserIdableIds" clearable
<JnpfUserSelect v-model="scope.row.belongUserId" @change="changeDataList" placeholder="请选择"
selectType="all" :ableIds="ableAll.classteamusebelongUserIdableIds" clearable
:style='{ "width": "100%" }'>
</JnpfUserSelect>
</template>
@ -234,8 +255,8 @@
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible = false" />
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-row>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
@ -310,7 +331,9 @@ export default {
enabledmark: undefined
},
classTeamUseList: {
account: undefined,
belongUserIdOptions: [],
enabledmark: undefined
},
},
@ -450,9 +473,17 @@ export default {
this.$emit('refreshDataList', true)
},
changeDataList(model, row) {
// request({
// url: '/api/permission/Users/'+model,
// method: 'get'
// }).then(res => {
// console.log(res.data.account);
// this.dataForm.classTeamUseList.account=res.data.account
// console.log(this.dataForm.classTeamUseList.account);
// });
// console.log(model, row);
// this.dataForm.mobilePhone = row.mobilePhone
// this.dataForm.organize = row.organize
row.belongUserId = row.id
this.dataForm.classTeamUseList.push(row)
this.dataForm.classTeamUseList.splice(-2, 1)
@ -723,7 +754,7 @@ export default {
landline: undefined,
email: undefined,
fax: undefined,
lastModifyTime: undefined,
lastModifyTime: new Date().getTime(),
}
this.getbusinesscontactteamList(item)
},

File diff suppressed because it is too large Load Diff

@ -1,8 +1,5 @@
<template>
<el-dialog :title="!dataForm.id ? '新建工序库' :'编辑工序库'" :close-on-click-modal="false" append-to-body
<template>
<el-dialog :title="!dataForm.id ? '新建工序库' : '编辑工序库'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px"
@ -38,7 +35,7 @@
<el-col :span="24">
<jnpf-form-tip-item label="工序类型" prop="type">
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" optionType="button"
<JnpfRadio v-model="dataForm.type" @change="changeData('type', -1)" optionType="button"
direction="horizontal" size="small" :options="typeOptions" :props="typeProps">
</JnpfRadio>
</jnpf-form-tip-item>
@ -51,49 +48,47 @@
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="工序编号" prop="productionCode">
<JnpfInput v-model="dataForm.productionCode" @change="changeData('productionCode',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.productionCode" @change="changeData('productionCode', -1)"
placeholder="系统自动生成" readonly :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="工序名称" prop="productionName">
<JnpfInput v-model="dataForm.productionName" @change="changeData('productionName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.productionName" @change="changeData('productionName', -1)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="工序分类" prop="processId">
<JnpfPopupSelect v-model="dataForm.processId" @change="changeData('processId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.processId"
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='category_name' field='processId'
interfaceId="522368175543690373" :pageSize="20"
:columnOptions="processIdcolumnOptions" clearable :style='{"width":"100%"}'>
<JnpfPopupSelect v-model="dataForm.processId" @change="changeData('processId', -1)" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.processId" placeholder="请选择" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='category_name' field='processId'
interfaceId="522368175543690373" :pageSize="20" :columnOptions="processIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="负责人员" prop="responsibleOfficer">
<JnpfUserSelect v-model="dataForm.responsibleOfficer"
@change="changeData('responsibleOfficer',-1)" placeholder="请选择" selectType="all"
:ableIds="ableAll.responsibleOfficerableIds" clearable :style='{"width":"100%"}'>
<JnpfUserSelect v-model="dataForm.responsibleOfficer" @change="changeData('responsibleOfficer', -1)"
placeholder="请选择" selectType="all" :ableIds="ableAll.responsibleOfficerableIds" clearable
:style='{ "width": "100%" }'>
</JnpfUserSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="状态" prop="status">
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
optionType="button" direction="horizontal" size="small" :options="statusOptions"
:props="statusProps">
<JnpfRadio v-model="dataForm.status" @change="changeData('status', -1)" optionType="button"
direction="horizontal" size="small" :options="statusOptions" :props="statusProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="备注" prop="remark">
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.remark" @change="changeData('remark', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -105,37 +100,35 @@
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="其他图纸" prop="drawingInformation">
<JnpfUploadImg v-model="dataForm.drawingInformation"
@change="changeData('drawingInformation',-1)" :fileSize="10" sizeUnit="MB"
:limit="9" pathType="defaultPath" :isAccount="0">
<JnpfUploadImg v-model="dataForm.drawingInformation" @change="changeData('drawingInformation', -1)"
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0">
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="其他文件" prop="otherDocuments">
<JnpfUploadFile v-model="dataForm.otherDocuments"
@change="changeData('otherDocuments',-1)" :fileSize="10" sizeUnit="MB" :limit="9"
pathType="defaultPath" :isAccount="0" buttonText="点击上传">
<JnpfUploadFile v-model="dataForm.otherDocuments" @change="changeData('otherDocuments', -1)" :fileSize="10"
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-row>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{'上一条'}}
{{ '上一条' }}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{'下一条'}}
{{ '下一条' }}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-button>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span>
@ -382,6 +375,7 @@ export default {
},
//
initDefaultData() {
this.dataForm.responsibleOfficer = this.userInfo.userId
},
//

@ -0,0 +1,160 @@
<template>
<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>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list"
@current-change="clickRow" highlight-current-row ref="tablelistref" :border="false">
<el-table-column prop="name" label="商品名称" align="left">
</el-table-column>
<el-table-column prop="code" label="商品编码" align="left">
</el-table-column>
<el-table-column prop="productTypeId" label="商品类型" align="left">
</el-table-column>
<el-table-column prop="shortName" label="商品简称" align="left">
</el-table-column>
<el-table-column prop="spec" label="商品规格" align="left">
</el-table-column>
<el-table-column prop="barCode" label="商品条码" align="left">
</el-table-column>
<el-table-column prop="inventoryType" label="存货类型" align="left">
</el-table-column>
<!-- <el-table-column prop="brandId" label="品牌" align="left">
</el-table-column> -->
<!-- <el-table-column prop="productCategoryId" label="商品分类" align="left">
</el-table-column> -->
<!-- <el-table-column prop="area" label="产地" align="left">
</el-table-column>
<el-table-column prop="firstSupplierId" label="首选供应商" align="left">
</el-table-column> -->
<!-- <el-table-column prop="deliveryType" label="配送方式" align="left">
</el-table-column> -->
<!-- <el-table-column prop="salesMainUnitIds" label="销售单位" align="left">
</el-table-column> -->
<el-table-column prop="inventoryUnitIds" label="库存单位" align="left">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: [],
multipleTable: []
}
},
methods: {
init(excludeIdList, val) {
this.visible = true
this.listLoading = true
if (excludeIdList) {
this.excludeIdList = excludeIdList;
}
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
dataType: 0,
id: val,
}
/* GoodsList(query).then(res => {
this.list = res.data.list
this.listLoading = false
}) */
request({
url: `/api/scm/ProductWarehouse/getBomProductlist`,
method: 'post',
data: query
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.pagination.total
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
select() {
this.visible = false
// console.log('this.checked',this.checked);
this.$emit('refreshDataList', this.checked)
},
clickRow(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

@ -0,0 +1,149 @@
<template>
<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>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
</el-tooltip>
</div>
</el-row>
<!-- <JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false"> -->
<JNPF-table v-loading="listLoading" :data="list"
@current-change="clickRow" highlight-current-row ref="tablelistref" :border="false">
<el-table-column prop="documentType1" label="单据类型" align="left">
</el-table-column>
<el-table-column prop="voucherCode" label="凭证编号" align="left">
</el-table-column>
<el-table-column prop="voucherType1" label="凭证类型" align="left">
</el-table-column>
<el-table-column prop="poundCode" label="磅单编号" align="left">
</el-table-column>
<el-table-column prop="vehicleName" label="车牌号" align="left">
</el-table-column>
<el-table-column prop="supplierName" label="供应商名字" align="left">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: []
}
},
methods: {
init(excludeIdList, val) {
this.visible = true
this.listLoading = true
if (excludeIdList) {
this.excludeIdList = excludeIdList;
}
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
dataType: 0,
documentType: val,
}
/* GoodsList(query).then(res => {
this.list = res.data.list
this.listLoading = false
}) */
request({
url: `/api/scm/Voucher/getList`,
method: 'post',
data: query
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.pagination.total
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
select() {
this.visible = false
this.$emit('refreshDataList', this.checked)
},
clickRow(val) {
this.checked = val
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

@ -502,7 +502,7 @@
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
<InspectionVoucher v-if="inspectionVoucherVisible" ref="inspectionVoucherBox"
<InspectionVoucherOnly v-if="inspectionVoucherVisible" ref="inspectionVoucherBox"
@refreshDataList="initList" />
<BomProductGoodsBox v-if="BomgoodsBoxVisible" ref="BomGoodsBox"
@refreshDataList="initProductList" />
@ -521,12 +521,12 @@ 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 InspectionVoucher from '@/views/scm/publicPopup/InspectionVoucher'
import InspectionVoucherOnly from '@/views/scm/publicPopup/InspectionVoucherOnly'
import BomProductGoodsBox from '@/views/scm/publicPopup/BomProductGoodsBox'
export default {
mixins: [comMixin],
components: { InspectionVoucher, BomProductGoodsBox },
components: { InspectionVoucherOnly, BomProductGoodsBox },
props: [],
data() {
return {
@ -850,34 +850,43 @@ export default {
},
choice(val) {
// console.log(val);
this.inspectionVoucherVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.warehousingInspectionVoucherList.length; i++) {
excludeIdList.push(this.dataForm.warehousingInspectionVoucherList[i].voucheId);
if (this.dataForm.inspectionType == null) {
this.$alert('请先选择质检类型', {
confirmButtonText: '确定',
});
} else {
if (this.dataForm.warehousingInspectionVoucherList.length > 0) {
this.$alert('请先删除后选择', '单选唯一提示', {
confirmButtonText: '确定',
});
} else {
this.inspectionVoucherVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.warehousingInspectionVoucherList.length; i++) {
excludeIdList.push(this.dataForm.warehousingInspectionVoucherList[i].voucheId);
}
this.$nextTick(() => {
this.$refs.inspectionVoucherBox.init(excludeIdList, val)
})
}
}
this.$nextTick(() => {
this.$refs.inspectionVoucherBox.init(excludeIdList, val)
})
},
initList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
let item = {
voucheId: e.id,
productId: e.productId,
voucherCode: e.voucherCode,
documentType: e.documentType1,
voucherType: e.voucherType1,
poundCode: e.poundCode,
vehicleName: e.vehicleNumber,
grossWeight: e.grossWeight,
tareWeight: e.tareWeight,
buckleWeight: e.buckleWeight,
}
this.dataForm.warehousingInspectionVoucherList.push(item)
console.log(this.dataForm.warehousingInspectionVoucherList[0].productId);
let item = {
voucheId: list.id,
productId: list.productId,
voucherCode: list.voucherCode,
documentType: list.documentType1,
voucherType: list.voucherType1,
poundCode: list.poundCode,
vehicleName: list.vehicleNumber,
grossWeight: list.grossWeight,
tareWeight: list.tareWeight,
buckleWeight: list.buckleWeight,
}
this.dataForm.warehousingInspectionVoucherList.push(item)
},
@ -913,7 +922,8 @@ export default {
//
initDefaultData() {
this.dataForm.belongUserId = this.userInfo.userId
this.dataForm.inspectionTime = new Date().getTime()
},
addwarehousinginspectionvoucherList() {
if (this.dataForm.warehousingInspectionVoucherList.length > 0) {

@ -570,7 +570,7 @@ export default {
},
],
},
warehousingOutboundTypeOptions: [{ "fullName": "全部", "id": "1" }, { "fullName": "盘盈入库", "id": "2" }, { "fullName": "采购入库", "id": "3" }, { "fullName": "调拨入库", "id": "4" }, { "fullName": "退货入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }, { "fullName": "差异调整入库", "id": "7" }, { "fullName": "领用返库", "id": "8" }, { "fullName": "货权转移入库", "id": "9" }, { "fullName": "其他出库", "id": "10" }, { "fullName": "库存初始化", "id": "11" }, { "fullName": "调拨出库撤回", "id": "12" }, { "fullName": "其他出库撤回", "id": "13" }],
warehousingOutboundTypeOptions: [{ "fullName": "全部", "id": "1" }, { "fullName": "盘盈入库", "id": "2" }, { "fullName": "采购入库", "id": "3" }, { "fullName": "调拨入库", "id": "4" }, { "fullName": "退货入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }, { "fullName": "差异调整入库", "id": "7" }, { "fullName": "领用返库", "id": "8" }, { "fullName": "货权转移入库", "id": "9" }, { "fullName": "其他出库", "id": "10" }, { "fullName": "库存初始化", "id": "11" }, { "fullName": "调拨出库撤回", "id": "12" }, { "fullName": "其他出库撤回", "id": "13" }, { "fullName": "领用出库", "id": "14" }],
warehousingOutboundTypeProps: { "label": "fullName", "value": "id" },
warehousingIdcolumnOptions: [{ "label": "通知编号", "value": "warehousing_code" }, { "label": "供应商", "value": "subject_basic_id" }, { "label": "仓库", "value": "warehouse_id" },],
warehouseIdcolumnOptions: [{ "label": "仓库编号", "value": "code" }, { "label": "仓库名称", "value": "name" }, { "label": "仓库简称", "value": "simple_name" },],

@ -578,7 +578,7 @@ export default {
},
],
},
warehousingStorageTypeOptions: [{ "fullName": "全部", "id": "1" }, { "fullName": "盘盈入库", "id": "2" }, { "fullName": "采购入库", "id": "3" }, { "fullName": "调拨入库", "id": "4" }, { "fullName": "退货入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }, { "fullName": "差异调整入库", "id": "7" }, { "fullName": "领用返库", "id": "8" }, { "fullName": "货权转移入库", "id": "9" }, { "fullName": "其他出库", "id": "10" }, { "fullName": "库存初始化", "id": "11" }, { "fullName": "调拨出库撤回", "id": "12" }, { "fullName": "其他出库撤回", "id": "13" }],
warehousingStorageTypeOptions: [{ "fullName": "全部", "id": "1" }, { "fullName": "盘盈入库", "id": "2" }, { "fullName": "采购入库", "id": "3" }, { "fullName": "调拨入库", "id": "4" }, { "fullName": "退货入库", "id": "5" }, { "fullName": "其他入库", "id": "6" }, { "fullName": "差异调整入库", "id": "7" }, { "fullName": "领用返库", "id": "8" }, { "fullName": "货权转移入库", "id": "9" }, { "fullName": "其他出库", "id": "10" }, { "fullName": "库存初始化", "id": "11" }, { "fullName": "调拨出库撤回", "id": "12" }, { "fullName": "其他出库撤回", "id": "13" }, { "fullName": "加工入库", "id": "14" }],
warehousingStorageTypeProps: { "label": "fullName", "value": "id" },
warehousingIdcolumnOptions: [{ "label": "通知编号", "value": "warehousing_code" }, { "label": "供应商名称", "value": "subjectName" }, { "label": "仓库名称", "value": "businessName" },],
warehouseIdcolumnOptions: [{ "label": "仓库编号", "value": "code" }, { "label": "仓库名称", "value": "name" }, { "label": "仓库简称", "value": "simple_name" },],

@ -81,7 +81,7 @@
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.businessId"
placeholder="请选择" :disabled="judgeWrite('businessId')" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name'
field='businessId' interfaceId="517979330417001669" :pageSize="20"
field='businessId' interfaceId="543324446463638853" :pageSize="20"
:columnOptions="businessIdcolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
@ -231,30 +231,43 @@
</template>
</el-table-column>
<el-table-column label="加工单位" v-if="judgeShow('workorderproduct-unitId')"
align="center" prop="unitId" width="150px">
<!-- <el-table-column label="加工单位" v-if="judgeShow('workorderproduct-unitId')" align="center" prop="unitId"
width="150px">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderproductList-unitId')">*</span>加工单位
<span class="required-sign" v-if="judgeRequired('workorderproductList-unitId')">*</span>
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.unitId"
@change="changeData('workorderproduct-unitId', scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductunitId" placeholder="请选择"
@change="changeData('workorderproduct-unitId', scope.$index)" :rowIndex="scope.$index"
:formData="dataForm" :templateJson="interfaceRes.workorderproductunitId" placeholder="请选择"
:disabled="judgeWrite('workorderproductList') || judgeWrite('workorderproductList-unitId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='unit_name' :field="'unitId' + scope.$index"
interfaceId="523054191598383685" :pageSize="20"
:columnOptions="workorderproductunitIdcolumnOptions" clearable
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='unit_name' :field="'unitId' + scope.$index" interfaceId="523054191598383685"
:pageSize="20" :columnOptions="workorderproductunitIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
</el-table-column> -->
<el-table-column label="加工单位" v-if="judgeShow('workorderproduct-unitId')"
align="center" prop="unitId" width="180px">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderproductList-unitId')">*</span>加工单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.unitId"
@change="changeData('workorderproduct-unitId', scope.$index)"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="加工数量" v-if="judgeShow('workorderproduct-proportionNum')"
align="center" prop="proportionNum" width="180px">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderproductList-proportionNum')">*</span>加工数量
@ -276,13 +289,12 @@
v-if="judgeRequired('workorderproductList-bomId')">*</span>BOM
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.bomId"
@change="changeData('workorderproduct-bomId', scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductbomId" placeholder="请选择"
<JnpfPopupSelect v-model="scope.row.bomId" @change="changeDataBom"
:formData="dataForm" :templateJson="interfaceRes.workorderproductbomId"
placeholder="请选择"
:disabled="judgeWrite('workorderproductList') || judgeWrite('workorderproductList-bomId')"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='bom_name' :field="'bomId' + scope.$index"
popupType="dialog" relationField='bomName' :field="'bomId' + scope.$index"
interfaceId="523054588681531973" :pageSize="20"
:columnOptions="workorderproductbomIdcolumnOptions" clearable
:style='{ "width": "100%" }'>
@ -401,6 +413,20 @@
</JnpfPopupSelect>
</template>
</el-table-column>
<!-- <el-table-column label="商品" prop="name" width="300px" align="center">
<template slot="header">
<span class="required-sign">*</span>商品
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.name" placeholder="请输入" disabled clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="存货类型" prop="inventoryType" align="center">
<template slot="header">
@ -539,7 +565,8 @@
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
<BomProductGoodsBox v-if="BomgoodsBoxVisible" ref="BomGoodsBox" @refreshDataList="initList" />
<BomProductGoodsBoxOnly v-if="BomgoodsBoxVisible" ref="BomGoodsBox"
@refreshDataList="initList" />
<BomProductRawGoodsBox v-if="BomgoodsBoxRawVisible" ref="BomGoodsRawBox"
@refreshDataList="initRawList" />
@ -557,13 +584,13 @@ 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 BomProductGoodsBox from '@/views/scm/publicPopup/BomProductGoodsBox'
import BomProductGoodsBoxOnly from '@/views/scm/publicPopup/BomProductGoodsBoxOnly'
import BomProductRawGoodsBox from '@/views/scm/publicPopup/BomProductGoodsBox'
export default {
mixins: [comMixin],
components: { BomProductGoodsBox, BomProductRawGoodsBox },
components: { BomProductGoodsBoxOnly, BomProductRawGoodsBox },
props: [],
data() {
return {
@ -625,6 +652,7 @@ export default {
Vmodel: "",
currVmodel: "",
dataForm: {
productIds: undefined,
type: undefined,
code: undefined,
businessfactoryId: undefined,
@ -704,7 +732,7 @@ export default {
workorderproductproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
workorderproductunitIdcolumnOptions: [{ "label": "单位名称", "value": "unit_name" },],
workorderproductbomIdcolumnOptions: [{ "label": "bom名称", "value": "bom_name" }, { "label": "bom编码", "value": "bom_code" },],
workorderproductbomIdcolumnOptions: [{ "label": "bom名称", "value": "bomName" }, { "label": "bom编码", "value": "bomCode" },],
workorderproductcargoIdcolumnOptions: [{ "label": "货区名称", "value": "cargo_name" },],
workorderprimaryproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
workorderprimarycargoIdcolumnOptions: [{ "label": "货区名称", "value": "cargo_name" },],
@ -724,7 +752,21 @@ export default {
workorderproductproductId: [],
workorderproductunitId: [],
workorderproductproportionNum: [],
workorderproductbomId: [],
productIds: [],
// workorderproductbomId: [],
workorderproductbomId: [
{
fieldName: "",
field: "productIds",
defaultValue: "",
jnpfKey: "popupSelect",
dataType: "varchar",
id: "AyAmdw1",
required: "0",
relationField: "productIds",
},
],
workorderproductcost: [],
workorderproductcargoId: [{ "fieldName": "", "field": "businessOrganizeId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "AyAmdw1", "relationField": "warehouseId", "required": "0" }],
workorderproductremark: [],
@ -752,6 +794,8 @@ export default {
mounted() { },
methods: {
changeDataProductList(model, row) {
row.productId = row.id
// this.dataForm.spec = row.spec
// this.dataForm.inventoryType = row.inventory_types
// this.dataForm.inventoryUnitIds = row.inventory_unit_ids
@ -774,7 +818,10 @@ export default {
this.dataForm.workOrderPrimaryList.splice(-2, 1)
},
changeDataBom(model, index) {
this.dataForm.workOrderPrimaryList = index.productWarehouseEntityList
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
@ -930,31 +977,36 @@ export default {
},
choice() {
this.BomgoodsBoxVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.workOrderProductList.length; i++) {
excludeIdList.push(this.dataForm.workOrderProductList[i].productId);
if (this.dataForm.workOrderProductList.length > 0) {
this.$alert('请先完成后选择', {
confirmButtonText: '确定',
});
} else {
this.BomgoodsBoxVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.workOrderProductList.length; i++) {
excludeIdList.push(this.dataForm.workOrderProductList[i].productId);
}
this.$nextTick(() => {
this.$refs.BomGoodsBox.init(excludeIdList)
})
}
this.$nextTick(() => {
this.$refs.BomGoodsBox.init(excludeIdList)
})
},
initList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
let item = {
productId: e.id,
name: e.name,
spec: e.spec,
inventoryType: e.inventoryType,
inventoryUnitIds: e.inventoryUnitIds,
salesMainUnitIds: e.salesMainUnitIds,
barCode: e.barCode,
operateUnitIds: e.operateUnitId,
productTypeIds: e.productTypeId,
}
this.dataForm.workOrderProductList.push(item)
let item = {
productId: list.id,
name: list.name,
spec: list.spec,
inventoryType: list.inventoryType,
inventoryUnitIds: list.inventoryUnitIds,
salesMainUnitIds: list.salesMainUnitIds,
barCode: list.barCode,
unitId: list.operateUnitIds,
productTypeIds: list.productTypeId,
}
this.dataForm.workOrderProductList.push(item)
this.dataForm.productIds = item.productId
},
choiceRaw() {
@ -988,7 +1040,7 @@ export default {
//
initDefaultData() {
this.dataForm.workTime = new Date().getTime()
},
addworkorderproductList() {

@ -0,0 +1,925 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<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="24">
<jnpf-form-tip-item>
<JnpfText
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":12,"line-height":32,"font-style":"normal","text-align":"left"}'
content=" 不同的单据类型,需要选择不同的收货信息">
</JnpfText>
</jnpf-form-tip-item>
</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">
</JnpfRadio>
</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="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="businessfactoryId">
<JnpfPopupSelect v-model="dataForm.businessfactoryId"
@change="changeData('businessfactoryId',-1)" :rowIndex="null" :formData="dataForm"
:templateJson="interfaceRes.businessfactoryId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' field='businessfactoryId' interfaceId="521651055751075845"
:pageSize="20" :columnOptions="businessfactoryIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="生产线" prop="businessId">
<JnpfPopupSelect v-model="dataForm.businessId" @change="changeData('businessId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.businessId"
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' field='businessId'
interfaceId="543324446463638853" :pageSize="20"
:columnOptions="businessIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="加工时间" prop="workTime">
<JnpfDatePicker v-model="dataForm.workTime" @change="changeData('workTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime"
format="yyyy-MM-dd HH:mm:ss">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="外部单据编号" prop="businessCode">
<JnpfInput v-model="dataForm.businessCode" @change="changeData('businessCode',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="生产班组" prop="teamId">
<JnpfPopupSelect v-model="dataForm.teamId" @change="changeData('teamId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.teamId"
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' field='teamId'
interfaceId="523050983727575621" :pageSize="20" :columnOptions="teamIdcolumnOptions"
clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="10">
<jnpf-form-tip-item label="仓库名称" prop="warehouseId">
<JnpfPopupSelect v-model="dataForm.warehouseId" @change="changeData('warehouseId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.warehouseId"
placeholder="请选择" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' field='warehouseId'
interfaceId="529573170819104773" :pageSize="20"
:columnOptions="warehouseIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="备注" prop="remark">
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</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="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.workOrderProductList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品名称" prop="productId">
<template slot="header" v-if="true">
<span class="required-sign">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('workorderproduct-productId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductproductId" placeholder="请选择"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
interfaceId="519505017699307077" :pageSize="20"
:columnOptions="workorderproductproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="加工单位" prop="unitId">
<template slot="header" v-if="true">
<span class="required-sign">*</span>加工单位
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.unitId"
@change="changeData('workorderproduct-unitId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductunitId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='unit_name' :field="'unitId'+scope.$index"
interfaceId="523054191598383685" :pageSize="20"
:columnOptions="workorderproductunitIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="加工数量" prop="proportionNum">
<template slot="header" v-if="true">
<span class="required-sign">*</span>加工数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.proportionNum"
@change="changeData('workorderproduct-proportionNum',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="BOM" prop="bomId">
<template slot="header" v-if="true">
<span class="required-sign">*</span>BOM
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.bomId"
@change="changeData('workorderproduct-bomId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductbomId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='bom_name' :field="'bomId'+scope.$index"
interfaceId="523054588681531973" :pageSize="20"
:columnOptions="workorderproductbomIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="参考成本价" prop="cost">
<template slot="header" v-if="false">
<span class="required-sign">*</span>参考成本价
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.cost"
@change="changeData('workorderproduct-cost',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="货区名称" prop="cargoId">
<template slot="header" v-if="false">
<span class="required-sign">*</span>货区名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.cargoId"
@change="changeData('workorderproduct-cargoId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderproductcargoId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='cargo_name' :field="'cargoId'+scope.$index"
interfaceId="530700536261903749" :pageSize="20"
:columnOptions="workorderproductcargoIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template slot="header" v-if="false">
<span class="required-sign">*</span>备注
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.remark"
@change="changeData('workorderproduct-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="delworkorderproductList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addworkorderproductList()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</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="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>设计子表</h2>
</div>
<el-table :data="dataForm.workOrderPrimaryList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="商品id" prop="productId">
<template slot="header" v-if="true">
<span class="required-sign">*</span>商品id
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('workorderprimary-productId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderprimaryproductId" placeholder="请选择"
hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' :field="'productId'+scope.$index"
interfaceId="519505017699307077" :pageSize="20"
:columnOptions="workorderprimaryproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="理论发料量" prop="theoryNum">
<template slot="header" v-if="false">
<span class="required-sign">*</span>理论发料量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.theoryNum"
@change="changeData('workorderprimary-theoryNum',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="实际发料量" prop="realityNum">
<template slot="header" v-if="false">
<span class="required-sign">*</span>实际发料量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.realityNum"
@change="changeData('workorderprimary-realityNum',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="货区名称" prop="cargoId">
<template slot="header" v-if="false">
<span class="required-sign">*</span>货区名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.cargoId"
@change="changeData('workorderprimary-cargoId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.workorderprimarycargoId" placeholder="请选择" hasPage
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='cargo_name' :field="'cargoId'+scope.$index"
interfaceId="530700536261903749" :pageSize="20"
:columnOptions="workorderprimarycargoIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</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="delworkorderprimaryList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addworkorderprimaryList()">
<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>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{'上一条'}}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{'下一条'}}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span>
</el-dialog>
</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: {
workOrderProductList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
workOrderPrimaryList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
workOrderProductList: {
productId: '',
productIdOptions: [],
unitId: '',
unitIdOptions: [],
proportionNum: '',
proportionNumOptions: [],
bomId: '',
bomIdOptions: [],
cost: '',
costOptions: [],
cargoId: '',
cargoIdOptions: [],
remark: '',
remarkOptions: [],
enabledmark: undefined
},
workOrderPrimaryList: {
productId: '',
productIdOptions: [],
theoryNum: '',
theoryNumOptions: [],
realityNum: '',
realityNumOptions: [],
cargoId: '',
cargoIdOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
type: undefined,
code: undefined,
businessfactoryId: undefined,
businessId: undefined,
workTime: 1711987199000,
businessCode: undefined,
teamId: undefined,
warehouseId: "520922296513201285",
remark: undefined,
creatorUserId: undefined,
creatorTime: undefined,
lastModifyUserId: undefined,
lastModifyTime: undefined,
workOrderProductList: [],
workOrderPrimaryList: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
type: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
businessfactoryId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
businessId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
workTime: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
teamId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
},
typeOptions: [{ "fullName": "完工入库", "id": "1" }, { "fullName": "计划加工", "id": "2" }, { "fullName": "其他加工", "id": "3" }],
typeProps: { "label": "fullName", "value": "id" },
businessfactoryIdcolumnOptions: [{ "label": "工厂编码", "value": "code" }, { "label": "工厂名称", "value": "name" },],
businessIdcolumnOptions: [{ "label": "生产线编码", "value": "code" }, { "label": "生产线名称", "value": "name" },],
teamIdcolumnOptions: [{ "label": "班组编码", "value": "team_code" }, { "label": "班组名称", "value": "team_name" },],
warehouseIdcolumnOptions: [{ "label": "仓库名称", "value": "name" }, { "label": "仓库编码", "value": "code" },],
workorderproductproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
workorderproductunitIdcolumnOptions: [{ "label": "单位名称", "value": "unit_name" },],
workorderproductbomIdcolumnOptions: [{ "label": "bom名称", "value": "bom_name" }, { "label": "bom编码", "value": "bom_code" },],
workorderproductcargoIdcolumnOptions: [{ "label": "货区名称", "value": "cargo_name" },],
workorderprimaryproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
workorderprimarycargoIdcolumnOptions: [{ "label": "货区名称", "value": "cargo_name" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
type: [],
code: [],
businessfactoryId: [],
businessId: [],
workTime: [],
businessCode: [],
teamId: [],
warehouseId: [],
remark: [],
creatorUserId: [],
creatorTime: [],
lastModifyUserId: [],
lastModifyTime: [],
workorderproductproductId: [],
workorderproductunitId: [],
workorderproductproportionNum: [],
workorderproductbomId: [{ "fieldName": "", "field": "productId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "Wldr122", "relationField": "workorderproductList-productId", "required": "0" }],
workorderproductcost: [],
workorderproductcargoId: [{ "fieldName": "", "field": "businessOrganizeId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "AyAmdw1", "relationField": "warehouseId", "required": "0" }],
workorderproductremark: [],
workorderprimaryproductId: [],
workorderprimarytheoryNum: [],
workorderprimaryrealityNum: [],
workorderprimarycargoId: [{ "fieldName": "", "field": "businessOrganizeId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "AyAmdw1", "relationField": "warehouseId", "required": "0" }],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
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/WorkOrder/' + 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() {
},
workorderproductExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.workOrderProductList.length; i++) {
const e = this.dataForm.workOrderProductList[i];
if (!e.productId) {
this.$message({
message: '商品名称不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.unitId) {
this.$message({
message: '加工单位不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.proportionNum) {
this.$message({
message: '加工数量不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.bomId) {
this.$message({
message: 'BOM不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
workorderprimaryExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.workOrderPrimaryList.length; i++) {
const e = this.dataForm.workOrderPrimaryList[i];
if (!e.productId) {
this.$message({
message: '商品id不能为空',
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/WorkOrder/' + 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.workorderproductExist()) return
if (!this.workorderprimaryExist()) 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/WorkOrder',
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/WorkOrder/' + 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
})
}
},
addworkorderproductList() {
let item = {
productId: '',
unitId: '',
proportionNum: undefined,
bomId: '',
cost: undefined,
cargoId: '',
remark: undefined,
}
this.getworkorderproductList(item)
},
delworkorderproductList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.workOrderProductList.splice(index, 1);
}).catch(() => {
});
},
getworkorderproductList(value) {
let item = { ...this.tableRows.workOrderProductList, ...value }
this.dataForm.workOrderProductList.push(item)
this.childIndex = this.dataForm.workOrderProductList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
addworkorderprimaryList() {
let item = {
productId: '',
theoryNum: undefined,
realityNum: undefined,
cargoId: '',
}
this.getworkorderprimaryList(item)
},
delworkorderprimaryList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.workOrderPrimaryList.splice(index, 1);
}).catch(() => {
});
},
getworkorderprimaryList(value) {
let item = { ...this.tableRows.workOrderPrimaryList, ...value }
this.dataForm.workOrderPrimaryList.push(item)
this.childIndex = this.dataForm.workOrderPrimaryList.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.workOrderProductList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.workOrderPrimaryList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -96,12 +96,12 @@
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 2" type="text" @click="addOstarts(scope.row.id)"
v-has="'btn_starts'">加工
<el-button v-if="scope.row.status == 2 && scope.row.type == ''" type="text"
@click="addOstarts(scope.row.id)" v-has="'btn_starts'">加工
</el-button>
<el-button v-if="scope.row.status == 3" type="text"
@click="addOstartsEnd(scope.row.id)" v-has="'btn_starts'">完成
<el-button v-if="scope.row.status == 3 && scope.row.type == '' " type="text"
@click="addOrUpdateHandleOver(scope.row)" v-has="'btn_starts'">完成
</el-button>
<el-button v-if="scope.row.status == 3 || scope.row.status == 2" type="text"
@ -125,6 +125,8 @@
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<JNPF-FormOver v-if="formVisibleOver" ref="JNPFFormOver" @refresh="refreshOver" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
@ -149,6 +151,7 @@
<script>
import JNPFFormOver from './formOver'
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
@ -168,6 +171,7 @@ import superQueryJson from './superQueryJson'
export default {
components: {
JNPFFormOver,
FlowBox,
ExportBox, ToFormDetail, SuperQuery
},
@ -210,8 +214,10 @@ export default {
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
formVisible: false,
formVisibles: false,
formVisibleOver: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
@ -263,6 +269,10 @@ export default {
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
this.$nextTickOver(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
@ -523,26 +533,36 @@ export default {
})
.catch(() => { });
},
addOstartsEnd(id, status) {
this.$confirm("此操作将完成加工, 是否继续?", "提示", {
type: "warning",
// addOstartsEnd(id, status) {
// this.$confirm(", ?", "", {
// type: "warning",
// })
// .then(() => {
// status = '4',
// request({
// url: `/api/scm/WorkOrder/closestatus/${id}/${status}`,
// method: "Post",
// }).then((res) => {
// this.$message({
// type: "success",
// message: res.msg,
// onClose: () => {
// this.initData();
// },
// });
// });
// })
// .catch(() => { });
// },
addOstartsEnd(row, isDetail) {
// debugger
let id = row ? row.id : ""
this.formVisibles = true
this.$nextTick(() => {
console.log('-----');
this.$refs.JNPFForm.init(id, isDetail)
})
.then(() => {
status = '4',
request({
url: `/api/scm/WorkOrder/closestatus/${id}/${status}`,
method: "Post",
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
},
});
});
})
.catch(() => { });
},
addOstartsRescind(id, status) {
@ -586,6 +606,15 @@ export default {
this.updateHandle(row, flowState)
}
},
addOrUpdateHandleOver(row, isDetail) {
let id = row ? row.id : ""
this.formVisibleOver = true
this.$nextTick(() => {
this.$refs.JNPFFormOver.init(id, isDetail, this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
@ -664,6 +693,12 @@ export default {
this.formVisible = false
if (isrRefresh) this.reset()
},
refreshOver(isrRefresh) {
this.formVisibleOver = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()

Loading…
Cancel
Save