工厂/基地修改,bom修改

jg-waiwang-pro
XI_TENG\xixi_ 8 months ago
parent 6fbfd2bd5c
commit c5e36a2041

@ -3,5 +3,10 @@
<mapper namespace="jnpf.mapper.BusinessLine1Mapper">
<select id="queryWorkFactory" resultType="String">
select b.name AS workFactory from jg_business_line a
LEFT JOIN jg_business_line b ON a.id=b.parent_id
where b.id = #{id}
</select>
</mapper>

@ -13,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface BusinessLine1Mapper extends BaseMapper<BusinessLine1Entity> {
String queryWorkFactory(String id);
}

@ -36,4 +36,7 @@ public interface BusinessLine1Service extends IService<BusinessLine1Entity> {
void saveOrUpdate(BusinessLine1Form businessLine1Form,String id, boolean isSave) throws Exception;
//查询车间的父id工厂
String queryWorkFactory(String id);
}

@ -48,6 +48,8 @@ public class BusinessLine1ServiceImpl extends ServiceImpl<BusinessLine1Mapper, B
@Autowired
private BusinessContact1Service businessContact1Service;
@Autowired
private BusinessLine1Mapper businessLine1Mapper;
@Override
public List<BusinessLine1Entity> getList(BusinessLine1Pagination businessLine1Pagination){
return getTypeList(businessLine1Pagination,businessLine1Pagination.getDataType());
@ -458,4 +460,9 @@ public class BusinessLine1ServiceImpl extends ServiceImpl<BusinessLine1Mapper, B
}
}
}
@Override
public String queryWorkFactory(String id) {
return businessLine1Mapper.queryWorkFactory(id);
}
}

@ -90,7 +90,20 @@ public class BusinessLine1Controller {
List<BusinessLine1Entity> list= businessLine1Service.getList(businessLine1Pagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessLine1Entity entity : list) {
if (entity.getDifflag().equals("3")||entity.getDifflag().equals("5")){
//获取diff_flag=3和5的业务线
if (entity.getDifflag().equals("3")||entity.getDifflag().equals("5")||entity.getDifflag().equals("6")){
entity.setWorkFactory(businessLine1Service.queryWorkFactory(entity.getParentId() ));
//初始值
if (businessLine1Pagination.getParentId()==null||businessLine1Pagination.getParentId()==""){
//没有生产线的车间
if (businessLine1Pagination.getParentId()==null && entity.getDifflag().equals("6") ) {
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(businessLine1Pagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
Map<String, Object> businessLine1Map=JsonUtil.entityToMap(entity);
businessLine1Map.put("id", businessLine1Map.get("id"));
//副表数据
@ -98,6 +111,23 @@ public class BusinessLine1Controller {
List<BusinessContact1Entity> businessContact1List = businessLine1Service.getBusinessContact1List(entity.getId(),businessLine1Pagination);
businessLine1Map.put("tableField133",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContact1List)));
realList.add(businessLine1Map);
} else {
//根据ParentId显示列表
if (businessLine1Pagination.getParentId()!=null && businessLine1Pagination.getParentId().equals(entity.getParentId())){
Map<String, Object> businessLine1Map=JsonUtil.entityToMap(entity);
businessLine1Map.put("id", businessLine1Map.get("id"));
//副表数据
//子表数据
List<BusinessContact1Entity> businessContact1List = businessLine1Service.getBusinessContact1List(entity.getId(),businessLine1Pagination);
businessLine1Map.put("tableField133",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContact1List)));
realList.add(businessLine1Map);
}else {
}
}
}
}
@ -131,6 +161,7 @@ public class BusinessLine1Controller {
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*

@ -183,6 +183,12 @@ public class BusinessLineController {
return ActionResult.fail(b );
}
try{
if (businessLineForm.getDiffFlag().equals("3")){
businessLineForm.setDiffFlag("5");
}else if (businessLineForm.getDiffFlag().equals("5")){
businessLineForm.setDiffFlag("6");
businessLineForm.setParentId(businessLineForm.getWorkshopId());
}
businessLineService.saveOrUpdate(businessLineForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");

@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.model.subjectsettlementrules.SubjectSettlementRulesConstant;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
@ -96,7 +97,6 @@ public class EnergyConsumptionController {
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, EnergyConsumptionConstant.getFormData(), EnergyConsumptionConstant.getColumnData(), energyConsumptionPagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);

@ -30,20 +30,18 @@ public class BusinessContact1Entity {
private String email;
@TableField(value = "FAX" , updateStrategy = FieldStrategy.IGNORED)
private String fax;
@TableField("F_CREATOR_TIME")
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "F_LAST_MODIFY_TIME" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
}

@ -86,19 +86,19 @@ public class BusinessLine1Entity {
private String workshopArea;
@TableField(value = "WORKSHOP_ID" , updateStrategy = FieldStrategy.IGNORED)
private String workshopId;
@TableField("F_CREATOR_TIME")
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@ -112,4 +112,7 @@ public class BusinessLine1Entity {
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField(exist = false)
private String workFactory;
}

@ -22,19 +22,19 @@ public class ClassPlanItemEntity {
private String timeId;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField(value = "F_CREATOR_TIME" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "F_CREATOR_USER_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;

@ -22,19 +22,19 @@ public class ClassPlanTeamEntity {
private String teamId;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField(value = "F_CREATOR_TIME" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "F_DELETE_TIME" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;

@ -20,19 +20,19 @@ public class ClassTeamUseEntity {
private String teamId;
@TableField(value = "BELONG_USER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String belongUserId;
@TableField("F_CREATOR_TIME")
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;

@ -28,20 +28,7 @@ public class EnergyConsumptionEntity {
private String cost;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
// @TableField("F_CREATOR_TIME")
// private Date creatorTime;
// @TableField("F_CREATOR_USER_ID")
// private String creatorUserId;
// @TableField("F_LAST_MODIFY_TIME")
// private Date lastModifyTime;
// @TableField("F_LAST_MODIFY_USER_ID")
// private String lastModifyUserId;
// @TableField("F_DELETE_TIME")
// private Date deleteTime;
// @TableField("F_DELETE_USER_ID")
// private String deleteUserId;
// @TableField("F_DELETE_MARK")
// private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("F_VERSION")

@ -24,19 +24,19 @@ public class WorkOrderPrimaryEntity {
private BigDecimal theoryNum;
@TableField(value = "REALITY_NUM" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal realityNum;
@TableField("F_CREATOR_TIME")
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;

@ -29,19 +29,19 @@ public class WorkOrderProductEntity {
private String cost;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField("F_CREATOR_TIME")
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField("F_DELETE_MARK")
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;

@ -52,8 +52,7 @@
v-if="judgeRequired('bomitemList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('bomitem-productId',scope.$index)"
<JnpfPopupSelect v-model="scope.row.productId" @change="productSelect"
:rowIndex="scope.$index" :formData="dataForm"
:templateJson="interfaceRes.bomitemproductId" placeholder="请选择"
:disabled="judgeWrite('bomitemList')||judgeWrite('bomitemList-productId')"
@ -72,10 +71,9 @@
v-if="judgeRequired('bomitemList-creatorTime')">*</span>商品规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorTime"
<JnpfInput v-model="dataForm.spec"
@change="changeData('bomitem-creatorTime',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('bomitemList')||judgeWrite('bomitemList-creatorTime')"
clearable :style='{"width":"100%"}'>
disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -86,10 +84,9 @@
v-if="judgeRequired('bomitemList-creatorUserId')">*</span>类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorUserId"
<JnpfInput v-model="dataForm.productTypeIds"
@change="changeData('bomitem-creatorUserId',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('bomitemList')||judgeWrite('bomitemList-creatorUserId')"
clearable :style='{"width":"100%"}'>
disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -100,10 +97,9 @@
v-if="judgeRequired('bomitemList-lastModifyTime')">*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyTime"
<JnpfInput v-model="dataForm.inventoryUnitIds"
@change="changeData('bomitem-lastModifyTime',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('bomitemList')||judgeWrite('bomitemList-lastModifyTime')"
clearable :style='{"width":"100%"}'>
disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -114,10 +110,9 @@
v-if="judgeRequired('bomitemList-deleteMark')">*</span>销售单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.deleteMark"
<JnpfInput v-model="dataForm.salesMainUnitIds"
@change="changeData('bomitem-deleteMark',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('bomitemList')||judgeWrite('bomitemList-deleteMark')"
clearable :style='{"width":"100%"}'>
disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -153,7 +148,8 @@
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-productId')">*</span>商品名称
</template>
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('bomitemvalue-productId',scope.$index)"
:rowIndex="scope.$index" :formData="dataForm"
@ -165,7 +161,22 @@
:columnOptions="bomitemvalueproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</template> -->
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" @change="productSelect"
: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')"
prop="creatorTime">
@ -174,11 +185,8 @@
v-if="judgeRequired('bomitemvalueList-creatorTime')">*</span>存货类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorTime"
@change="changeData('bomitemvalue-creatorTime',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('bomitemvalueList')||judgeWrite('bomitemvalueList-creatorTime')"
clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.inventoryType" @change="productSelect"
placeholder="请输入" disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -189,13 +197,12 @@
v-if="judgeRequired('bomitemvalueList-creatorUserId')">*</span>规格
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.creatorUserId"
<JnpfInput v-model="dataForm.spec"
@change="changeData('bomitemvalue-creatorUserId',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('bomitemvalueList')||judgeWrite('bomitemvalueList-creatorUserId')"
clearable :style='{"width":"100%"}'>
placeholder="请输入" disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="库存单位" v-if="judgeShow('bomitemvalue-lastModifyUserId')"
prop="lastModifyUserId">
@ -204,11 +211,9 @@
v-if="judgeRequired('bomitemvalueList-lastModifyUserId')">*</span>库存单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.lastModifyUserId"
<JnpfInput v-model="dataForm.inventoryUnitIds"
@change="changeData('bomitemvalue-lastModifyUserId',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('bomitemvalueList')||judgeWrite('bomitemvalueList-lastModifyUserId')"
clearable :style='{"width":"100%"}'>
placeholder="请输入" disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -219,27 +224,26 @@
v-if="judgeRequired('bomitemvalueList-deleteUserId')">*</span>条码
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.deleteUserId"
<JnpfInput v-model="dataForm.barCode"
@change="changeData('bomitemvalue-deleteUserId',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('bomitemvalueList')||judgeWrite('bomitemvalueList-deleteUserId')"
clearable :style='{"width":"100%"}'>
placeholder="请输入" disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作单位" v-if="judgeShow('bomitemvalue-unit')" prop="unit">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('bomitemvalueList-unit')">*</span>操作单位
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.unit"
<JnpfInput v-model="dataForm.operateUnitIds"
@change="changeData('bomitemvalue-unit',scope.$index)" placeholder="请输入"
:disabled="judgeWrite('bomitemvalueList')||judgeWrite('bomitemvalueList-unit')"
clearable :style='{"width":"100%"}'>
disabled clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="比例数量" v-if="judgeShow('bomitemvalue-proportionNum')"
prop="proportionNum">
<template slot="header">
@ -360,6 +364,10 @@ export default {
bomItemList: [],
bomItemValueList: [],
version: 0,
spec: undefined,
inventoryType: undefined,
inventoryUnitIds: undefined,
salesMainUnitIds: undefined,
},
tableRequiredData: {},
dataRule:
@ -380,6 +388,10 @@ export default {
],
},
bomStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
// inventoryTypeOptions: [{ "fullName": "1", "id": "1" }, { "fullName": "2", "id": "2" }],
// inventoryTypeProps: { "label": "fullName", "value": "enCode" },
bomStatusProps: { "label": "fullName", "value": "id" },
bomitemproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
bomitemvalueproductIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" }, { "label": "规格", "value": "spec" },],
@ -420,8 +432,24 @@ export default {
},
mounted() { },
methods: {
changeProductData(model, row) {
// changeProductData(model, row) {
// },
productSelect(model, row) {
console.log(model);
console.log(row);
this.dataForm.spec = row.spec
this.dataForm.inventoryType = row.inventory_types
this.dataForm.inventoryUnitIds = row.inventory_unit_ids
this.dataForm.salesMainUnitIds = row.sales_main_unit_ids
this.dataForm.barCode = row.bar_code
this.dataForm.operateUnitIds = row.operate_unit_ids
this.dataForm.productTypeIds = row.product_type_ids
// console.log(row.spec);
console.log(this.dataForm.inventoryType);
},
changeData(model, index) {
this.isEdit = false
@ -462,7 +490,15 @@ export default {
}
},
dataAll() {
this.getinventoryTypeOptions();
},
getinventoryTypeOptions() {
getDictionaryDataSelector('521705509590401413').then(res => {
this.inventoryTypeOptions = res.data.list
})
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},

@ -502,21 +502,21 @@ export default {
this.listQuery.currentPage = 1
this.initData()
},
// addOrUpdateHandle(row, flowState) {
// if (!row) {
// this.addHandle();
// } else {
// this.updateHandle(row, flowState)
// }
// },
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
// add(row, flowState) {
// if (!row) {
// this.addHandle();
// } else {
// this.updateHandle(row, flowState)
// }
// },
add(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
add() {
this.$router.push({ path: '/scm/businessline2/form' })
},

@ -92,7 +92,7 @@ div -1
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.businesscontact1List" size='mini'>
<el-table :data="dataForm.businessContact1List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
prop="contactType">
@ -197,11 +197,11 @@ div -1
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delbusinesscontact1List(scope.$index)">删除</el-button>
@click="delbusinessContact1List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addbusinesscontact1List()"
<div class="table-actions" @click="addbusinessContact1List()"
v-if="!judgeWrite('businesscontactList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
@ -251,13 +251,13 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businesscontact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businesscontact1List: {
businessContact1List: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -288,7 +288,7 @@ export default {
diffFlag: "5",
description: undefined,
businesscontact1List: [],
businessContact1List: [],
version: 0,
},
tableRequiredData: {},
@ -472,8 +472,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.businessContact1List.length; i++) {
const e = this.dataForm.businessContact1List[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -583,7 +583,7 @@ export default {
initDefaultData() {
},
addbusinesscontact1List() {
addbusinessContact1List() {
let item = {
contactType: '',
contactTypeOptions: [],
@ -594,20 +594,20 @@ export default {
fax: undefined,
lastModifyTime: undefined,
}
this.getbusinesscontact1List(item)
this.getbusinessContact1List(item)
},
delbusinesscontact1List(index) {
delbusinessContact1List(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businesscontact1List.splice(index, 1);
this.dataForm.businessContact1List.splice(index, 1);
}).catch(() => {
});
},
getbusinesscontact1List(value) {
let item = { ...this.tableRows.businesscontact1List, ...value }
this.dataForm.businesscontact1List.push(item)
this.childIndex = this.dataForm.businesscontact1List.length - 1
getbusinessContact1List(value) {
let item = { ...this.tableRows.businessContact1List, ...value }
this.dataForm.businessContact1List.push(item)
this.childIndex = this.dataForm.businessContact1List.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -700,7 +700,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.businessContact1List.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -3,7 +3,7 @@
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-left">
<div class="JNPF-common-title">
<h2>左侧标题</h2>
<h2>车间工厂</h2>
<el-dropdown>
<el-link icon="icon-ym icon-ym-mpMenu" :underline="false" />
<el-dropdown-menu slot="dropdown">
@ -26,11 +26,11 @@
<div class="JNPF-common-layout-center" v-if="diffFlag=='3'">
<!-- 父级 -->
<FatherVue />
<FatherVue :upfuid="treeActiveId" />
</div>
<div class="JNPF-common-layout-center" v-else-if="diffFlag=='5'">
<!-- 子级 -->
<SonVue />
<SonVue :upfuids="treeActiveId" />
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
@ -74,9 +74,11 @@ import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import FatherVue from './fatherVue.vue';
import SonVue from './sonVue.vue';
// import FatherVue from './fatherVue.vue';
import FatherVue from '@/views/scm/businessline2/index.vue';
import SonVue from '@/views/scm/businessline3/index.vue';
// import SonVue from './sonVue.vue';
export default {
components: {
FlowBox,
@ -383,7 +385,7 @@ export default {
dataType: 0,
menuId: this.menuId,
moduleId: '521949393889270917',
type: 2,
};
request({
url: `/api/scm/BusinessLine1/getList`,

@ -91,7 +91,7 @@
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.businesscontact1List" size='mini'>
<el-table :data="dataForm.businessContact1List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
prop="contactType">
@ -250,13 +250,13 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businesscontact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businesscontact1List: {
businessContact1List: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -282,9 +282,11 @@ export default {
type: undefined,
parentId: undefined,
workshopArea: undefined,
status: undefined,
status: 1,
difflag: "3",
diffFlag: "3",
description: undefined,
businesscontact1List: [],
businessContact1List: [],
version: 0,
},
tableRequiredData: {},
@ -458,8 +460,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.businessContact1List.length; i++) {
const e = this.dataForm.businessContact1List[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -561,14 +563,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businesscontact1List.splice(index, 1);
this.dataForm.businessContact1List.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.businessContact1List, ...value }
this.dataForm.businessContact1List.push(item)
this.childIndex = this.dataForm.businessContact1List.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -661,7 +663,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.businessContact1List.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -1,56 +1,32 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="业务线编号">
<el-form-item label="车间工厂编号">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务线名称">
<el-form-item label="车间工厂名称">
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable
:options="typeOptions"
:props="typeProps" multiple >
</JnpfSelect>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="所属分类">
<JnpfSelect v-model="query.industry" placeholder="请选择" clearable
:options="industryOptions"
:props="industryProps" multiple >
<JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:props="typeProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="成立时间">
<JnpfDateRangePicker v-model="query.establishDate"
format="yyyy-MM-dd" startPlaceholder="开始日期"
endPlaceholder="结束日期" >
</JnpfDateRangePicker>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
@ -63,13 +39,17 @@
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()">
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增车间
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()" v-has="'btn_download'" >导出
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()" v-has="'btn_upload'" >导入
<el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()"
v-has="'btn_upload'">导入
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'" >批量删除
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'">批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
@ -83,51 +63,24 @@
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column
prop="code"
label="业务线编号" align="left"
>
</el-table-column>
<el-table-column
prop="name"
label="业务线名称" align="left"
>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<!-- <el-table-column prop="code" label="业务线编号" align="left">
</el-table-column> -->
<el-table-column prop="name" label="车间名称" align="left">
</el-table-column>
<el-table-column
prop="simpleName"
label="业务线简称" align="left"
>
<el-table-column prop="workFactory" label="所属工厂/基地" align="left">
</el-table-column>
<el-table-column
prop="type"
label="类型" align="left"
>
<el-table-column prop="description" label="描述" align="left">
</el-table-column>
<el-table-column
prop="industry"
label="所属分类" align="left"
>
<el-table-column prop="creatorTime" label="添加时间" align="left">
</el-table-column>
<el-table-column
prop="city"
label="所在城市" align="left"
>
<el-table-column prop="creatorUserId" label="添加人" align="left">
</el-table-column>
<el-table-column
prop="establishDate"
label="成立时间" align="left"
>
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column
prop="description"
label="描述" align="left"
>
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100" >
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
@ -137,27 +90,26 @@
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'" >编辑
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
<el-button type="text" class="JNPF-table-delBtn"
:disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)"
>详情</el-button>
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
<pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
@ -171,8 +123,9 @@
</el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
@ -180,39 +133,45 @@
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
export default {
components: {
FlowBox,
ExportBox,ToFormDetail , SuperQuery
ExportBox, ToFormDetail, SuperQuery
},
props: {
upfuid: { // treeActiveId
type: String,
default: ''
}
},
data() {
return {
keyword:'',
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible:false,
expandObj:{},
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList:[],
exportList: [],
columnList,
showAll: false,
@ -221,11 +180,12 @@
uploadBoxVisible: false,
detailVisible: false,
query: {
code:undefined,
name:undefined,
type:undefined,
industry:undefined,
establishDate:undefined,
code: undefined,
name: undefined,
workFactory: undefined,
type: undefined,
industry: undefined,
establishDate: undefined,
},
treeProps: {
children: 'children',
@ -249,14 +209,14 @@
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
typeOptions:[],
typeProps:{"label":"fullName","value":"id" },
parentIdOptions:[],
parentIdProps:{"label":"name","value":"id" },
statusOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}],
statusProps:{"label":"fullName","value":"id" },
tableField133_contactTypeOptions:[],
tableField133_contactTypeProps:{"label":"fullName","value":"id" },
typeOptions: [],
typeProps: { "label": "fullName", "value": "id" },
parentIdOptions: [],
parentIdProps: { "label": "name", "value": "id" },
statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
statusProps: { "label": "fullName", "value": "id" },
tableField133_contactTypeOptions: [],
tableField133_contactTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: {
},
}
@ -268,9 +228,11 @@
}
},
created() {
console.log(this.upfuid, '------------');
getFormById("521634040684484613").then(res1 => {
let flowId = res1.data&&res1.data.id
getFlowList(flowId,'1').then(res2 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
@ -312,9 +274,9 @@
},
loadNode(node, resolve) {
const nodeData = node.data
const config ={
treeInterfaceId:"",
treeTemplateJson:[]
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
@ -393,7 +355,7 @@
}
})
newList.forEach(item => {
if (item.children && item.children.length ) {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
@ -441,13 +403,13 @@
this.industryOptions = res.data.list
})
},
goDetail(id){
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
@ -466,16 +428,21 @@
...this.query,
keyword: this.keyword,
dataType: 0,
menuId:this.menuId,
moduleId:'521634040684484613',
type:1,
menuId: this.menuId,
moduleId: '521634040684484613',
parentId: this.upfuid,
difflag: "3",
diffFlag: "3",
};
request({
url: `/api/scm/BusinessLine1/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =res.data.list;
var _list = res.data.list;
console.log(_list);
this.list = _list.map(o => ({
...o,
...this.expandObj,
@ -503,10 +470,10 @@
}).catch(() => {
});
},
handelUpload(){
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/BusinessLine1")
this.$refs.UploadBox.init("", "scm/BusinessLine1")
})
},
handleSelectionChange(val) {
@ -553,11 +520,11 @@
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row,flowState) {
if(!row){
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
}else {
this.updateHandle(row,flowState)
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
@ -567,7 +534,7 @@
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/scm/BusinessLine1/Actions/Export`,
method: 'post',
@ -580,14 +547,14 @@
})
},
search() {
this.listQuery.currentPage=1
this.listQuery.pageSize=20
this.listQuery.sort="desc"
this.listQuery.sidx=""
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row,flowState) {
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
@ -647,5 +614,5 @@
if (isrRefresh) this.reset()
},
}
}
}
</script>

@ -0,0 +1,627 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="业务线编号">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务线名称">
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:props="typeProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="所属分类">
<JnpfSelect v-model="query.industry" placeholder="请选择" clearable
:options="industryOptions" :props="industryProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="成立时间">
<JnpfDateRangePicker v-model="query.establishDate" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期">
</JnpfDateRangePicker>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()"
v-has="'btn_upload'">导入
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'">批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<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="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<el-table-column prop="code" label="业务线编号" align="left">
</el-table-column>
<el-table-column prop="name" label="业务线名称" align="left">
</el-table-column>
<el-table-column prop="simpleName" label="业务线简称" align="left">
</el-table-column>
<el-table-column prop="type" label="类型" align="left">
</el-table-column>
<el-table-column prop="industry" label="所属分类" align="left">
</el-table-column>
<el-table-column prop="city" label="所在城市" align="left">
</el-table-column>
<el-table-column prop="establishDate" label="成立时间" align="left">
</el-table-column>
<el-table-column prop="description" label="描述" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn"
:disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
:visible.sync="flowListVisible" class="JNPF-dialog template-dialog JNPF-dialog_center"
lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id"
@click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
FlowBox,
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
code: undefined,
name: undefined,
type: undefined,
industry: undefined,
establishDate: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
typeOptions: [],
typeProps: { "label": "fullName", "value": "id" },
parentIdOptions: [],
parentIdProps: { "label": "name", "value": "id" },
statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
statusProps: { "label": "fullName", "value": "id" },
tableField133_contactTypeOptions: [],
tableField133_contactTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: {
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("521634040684484613").then(res1 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
this.gettypeOptions();
this.getindustryOptions();
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({ type: 'error', message: e.message });
this.$router.push('/404');
})
})
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
gettypeOptions() {
getDictionaryDataSelector('517662753159119813').then(res => {
this.typeOptions = res.data.list
})
},
getindustryOptions() {
getDictionaryDataSelector('517664069117805509').then(res => {
this.industryOptions = res.data.list
})
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '521634040684484613',
type: 1,
};
request({
url: `/api/scm/BusinessLine1/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/BusinessLine1/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/BusinessLine1")
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/BusinessLine1/batchRemove`,
data: ids,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/scm/BusinessLine1/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({ type: 'error', message: '流程不存在' });
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,711 @@
div -1
-2
<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">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24">
<jnpf-form-tip-item>
<JnpfGroupTitle content="基础信息11" contentPosition="left">
</JnpfGroupTitle>
</jnpf-form-tip-item>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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" v-if="judgeShow('-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.businessContact1List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
prop="contactType">
<template slot="header">
<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"
:props="businesscontact1contactTypeProps">
</JnpfSelect>
</template>
</el-table-column>
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name">
<template slot="header">
<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>
</template>
</el-table-column>
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')"
prop="phone">
<template slot="header">
<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>
</template>
</el-table-column>
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')"
prop="landline">
<template slot="header">
<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%"}'>
</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>邮箱
</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>
</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>传真
</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>
</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('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%"}'>
</JnpfInput>
</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"
@click="delbusinesscontact1List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<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" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getFormById } from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
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 {
mixins: [comMixin],
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: {
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businessContact1List: {
contactTypeOptions: [],
name: '',
nameOptions: [],
phone: '',
phoneOptions: [],
landline: '',
landlineOptions: [],
email: '',
emailOptions: [],
fax: '',
faxOptions: [],
lastModifyTime: '',
lastModifyTimeOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
code: undefined,
name: undefined,
simpleName: undefined,
type: undefined,
parentId: undefined,
workshopId: undefined,
status: 1,
difflag: "5",
diffFlag: "5",
description: undefined,
businessContact1List: [],
version: 0,
},
tableRequiredData: {},
dataRule:
{
name: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
type: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
parentId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
workshopId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
status: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
},
typeOptions: [],
typeProps: { "label": "fullName", "value": "id" },
parentIdOptions: [],
parentIdProps: { "label": "name", "value": "id" },
workshopIdOptions: [],
workshopIdProps: { "label": "name", "value": "id" },
statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
statusProps: { "label": "fullName", "value": "id" },
businesscontact1contactTypeOptions: [],
businesscontact1contactTypeProps: { "label": "fullName", "value": "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
code: [],
name: [],
simpleName: [],
type: [],
parentId: [],
workshopId: [],
status: [],
description: [],
businesscontact1contactType: [],
businesscontact1name: [],
businesscontact1phone: [],
businesscontact1landline: [],
businesscontact1email: [],
businesscontact1fax: [],
businesscontact1lastModifyTime: [],
},
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {
this.getFormById()
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData()
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
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() {
this.gettypeOptions();
this.getparentIdOptions();
this.getworkshopIdOptions();
this.getbusinesscontact1contactTypeOptions();
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("521949393889270917").then(res => {
this.dataForm.flowId = res.data && res.data.flowId
// this.encode = res.data&&res.data.encode
})
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
}
if (!this.businesscontact1Exist()) return
return isOk
},
businesscontact1Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businessContact1List.length; i++) {
const e = this.dataForm.businessContact1List[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.name) {
this.$message({
message: '姓名不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.phone) {
this.$message({
message: '手机号不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.email) {
this.$message({
message: '邮箱不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
}
return isOk;
},
gettypeOptions() {
getDictionaryDataSelector('521639458429212677').then(res => {
this.typeOptions = res.data.list
})
},
getparentIdOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentId))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
} else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('521651055751075845', template).then(res => {
let data = res.data
this.parentIdOptions = data
this.changeDataFormData(1, 'parentId', 'parentId', index, '')
})
},
getworkshopIdOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.workshopId))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if (json.relationField) {
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if (relationFieldAll.length > 1 && index > -1) {
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
} else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('521948662406847621', template).then(res => {
let data = res.data
this.workshopIdOptions = data
this.changeDataFormData(1, 'workshopId', 'workshopId', index, '')
})
},
getbusinesscontact1contactTypeOptions() {
getDictionaryDataSelector('517959233023509701').then(res => {
this.businesscontact1contactTypeOptions = res.data.list
})
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
addbusinesscontact1List() {
let item = {
contactType: '',
contactTypeOptions: [],
name: undefined,
phone: undefined,
landline: undefined,
email: undefined,
fax: undefined,
lastModifyTime: undefined,
}
this.getbusinesscontact1List(item)
},
delbusinesscontact1List(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businessContact1List.splice(index, 1);
}).catch(() => {
});
},
getbusinesscontact1List(value) {
let item = { ...this.tableRows.businessContact1List, ...value }
this.dataForm.businessContact1List.push(item)
this.childIndex = this.dataForm.businessContact1List.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.businesscontact1List.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,636 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="生产线编号">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="6">
<el-form-item label="类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:props="typeProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col> -->
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增生产线
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()"
v-has="'btn_upload'">导入
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'">批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<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="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<el-table-column prop="code" label="生产线编号" align="left">
</el-table-column>
<el-table-column prop="name" label="生产线名称" align="left">
</el-table-column>
<el-table-column prop="simpleName" label=" 简称/英文名" align="left">
</el-table-column>
<el-table-column prop="type" label="类型" align="left">
</el-table-column>
<el-table-column prop="description" label="描述" align="left">
</el-table-column>
<el-table-column prop="creatorTime" label="添加时间" align="left">
</el-table-column>
<el-table-column prop="creatorUserId" label="添加人" align="left">
</el-table-column>
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn"
:disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
:visible.sync="flowListVisible" class="JNPF-dialog template-dialog JNPF-dialog_center"
lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id"
@click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
FlowBox,
ExportBox, ToFormDetail, SuperQuery
},
props: {
upfuids: { // treeActiveId
type: String,
default: ''
}
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
code: undefined,
type: undefined,
},
treeProps: {
children: 'children',
label: 'name',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
treeData: [],
treeActiveId: '',
typeOptions: [],
typeProps: { "label": "fullName", "value": "id" },
parentIdOptions: [],
parentIdProps: { "label": "name", "value": "id" },
workshopIdOptions: [],
workshopIdProps: { "label": "name", "value": "id" },
statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
statusProps: { "label": "fullName", "value": "id" },
tableField133_contactTypeOptions: [],
tableField133_contactTypeProps: { "label": "fullName", "value": "id" },
interfaceRes: {
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("521949393889270917").then(res1 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.getTreeView();
this.gettypeOptions();
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({ type: 'error', message: e.message });
this.$router.push('/404');
})
})
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
gettypeOptions() {
getDictionaryDataSelector('521639458429212677').then(res => {
this.typeOptions = res.data.list
})
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
getTreeView() {
getDataInterfaceRes('519521191191380165').then(res => {
let data = res.data
this.treeData = data
this.initSearchDataAndListData()
})
},
getNodePath(node) {
let fullPath = []
const loop = (node) => {
if (node.level) fullPath.unshift(node.data)
if (node.parent) loop(node.parent)
}
loop(node)
return fullPath
},
handleNodeClick(data, node) {
this.treeActiveId = data.id
for (let key in this.query) {
this.query[key] = undefined
}
this.query.name = data.id
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '521949393889270917',
parentId: this.upfuids,
difflag: "5",
diffFlag: "5",
};
request({
url: `/api/scm/BusinessLine1/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/BusinessLine1/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/BusinessLine1")
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/BusinessLine1/batchRemove`,
data: ids,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/scm/BusinessLine1/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({ type: 'error', message: '流程不存在' });
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -87,6 +87,15 @@
</el-table-column>
<el-table-column prop="cost" label="费用信息" align="left">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="left">
</el-table-column>
<el-table-column prop="creatorUserId" label="创建人" align="left">
</el-table-column>
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column prop="lastModifyUserId" label="更新人" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,10 +1,4 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
@ -22,9 +16,8 @@
</el-col>
<el-col :span="6">
<el-form-item label="单据类型">
<JnpfSelect v-model="query.type" placeholder="请选择" clearable
:options="typeOptions"
:props="typeProps" >
<JnpfSelect v-model="query.type" placeholder="请选择" clearable :options="typeOptions"
:props="typeProps">
</JnpfSelect>
</el-form-item>
</el-col>
@ -39,11 +32,14 @@
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()">
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()" v-has="'btn_download'" >导出
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'" >批量删除
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()"
v-has="'btn_batchRemove'">批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
@ -57,36 +53,24 @@
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column
prop="businessfactoryId"
label="工厂名称" align="left"
>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<el-table-column prop="businessfactoryId" label="工厂名称" align="left">
</el-table-column>
<el-table-column prop="code" label="单据编号" align="left">
</el-table-column>
<el-table-column
prop="code"
label="单据编号" align="left"
>
<el-table-column prop="businessId" label="生产线" align="left">
</el-table-column>
<el-table-column
prop="businessId"
label="生产线" align="left"
>
<el-table-column prop="workTime" label="加工时间" align="left">
</el-table-column>
<el-table-column
prop="workTime"
label="加工时间" align="left"
>
<el-table-column prop="businessCode" label="外部单据编号" align="left">
</el-table-column>
<el-table-column
prop="businessCode"
label="外部单据编号" align="left"
>
<el-table-column prop="creatorTime" label="制单时间" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100" >
<el-table-column prop="creatorUserId" label="制单人" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
@ -96,27 +80,26 @@
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'" >编辑
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
<el-button type="text" class="JNPF-table-delBtn"
:disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1" v-has="'btn_remove'"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)"
>详情</el-button>
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
<pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body
@ -130,8 +113,9 @@
</el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
@ -139,39 +123,39 @@
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getFormById } from '@/api/workFlow/FormDesign'
import { getFlowList } from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
export default {
components: {
FlowBox,
ExportBox,ToFormDetail , SuperQuery
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
keyword:'',
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible:false,
expandObj:{},
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList:[],
exportList: [],
columnList,
superQueryVisible: false,
@ -179,9 +163,9 @@
uploadBoxVisible: false,
detailVisible: false,
query: {
code:undefined,
businessCode:undefined,
type:undefined,
code: undefined,
businessCode: undefined,
type: undefined,
},
treeProps: {
children: 'children',
@ -205,20 +189,20 @@
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
typeOptions:[{"fullName":"完工入库","id":"1"},{"fullName":"计划加工","id":"2"},{"fullName":"其他加工","id":"3"}],
typeProps:{"label":"fullName","value":"id" },
tableField116_productIdcolumnOptions:[ {"label":"商品编码","value":"code"}, {"label":"商品名称","value":"name"},],
tableField116_unitIdcolumnOptions:[ {"label":"单位名称","value":"unit_name"},],
tableField116_bomIdcolumnOptions:[ {"label":"bom名称","value":"bom_name"}, {"label":"bom编码","value":"bom_code"},],
tableField126_productIdcolumnOptions:[ {"label":"商品编码","value":"code"}, {"label":"商品名称","value":"name"},],
typeOptions: [{ "fullName": "完工入库", "id": "1" }, { "fullName": "计划加工", "id": "2" }, { "fullName": "其他加工", "id": "3" }],
typeProps: { "label": "fullName", "value": "id" },
tableField116_productIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
tableField116_unitIdcolumnOptions: [{ "label": "单位名称", "value": "unit_name" },],
tableField116_bomIdcolumnOptions: [{ "label": "bom名称", "value": "bom_name" }, { "label": "bom编码", "value": "bom_code" },],
tableField126_productIdcolumnOptions: [{ "label": "商品编码", "value": "code" }, { "label": "商品名称", "value": "name" },],
interfaceRes: {
businessfactoryId:[] ,
businessId:[] ,
teamId:[] ,
tableField116_productId: [] ,
tableField116_unitId: [] ,
tableField116_bomId: [] ,
tableField126_productId: [] ,
businessfactoryId: [],
businessId: [],
teamId: [],
tableField116_productId: [],
tableField116_unitId: [],
tableField116_bomId: [],
tableField126_productId: [],
},
}
},
@ -230,8 +214,8 @@
},
created() {
getFormById("523046103495488069").then(res1 => {
let flowId = res1.data&&res1.data.id
getFlowList(flowId,'1').then(res2 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
@ -271,9 +255,9 @@
},
loadNode(node, resolve) {
const nodeData = node.data
const config ={
treeInterfaceId:"",
treeTemplateJson:[]
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
@ -352,7 +336,7 @@
}
})
newList.forEach(item => {
if (item.children && item.children.length ) {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
@ -390,13 +374,13 @@
}
this.exportList = exportList
},
goDetail(id){
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
sortChange({ column, prop, order }) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
@ -415,16 +399,16 @@
...this.query,
keyword: this.keyword,
dataType: 0,
menuId:this.menuId,
moduleId:'523046103495488069',
type:1,
menuId: this.menuId,
moduleId: '523046103495488069',
type: 1,
};
request({
url: `/api/scm/WorkOrder/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =res.data.list;
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
@ -452,10 +436,10 @@
}).catch(() => {
});
},
handelUpload(){
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/WorkOrder")
this.$refs.UploadBox.init("", "scm/WorkOrder")
})
},
handleSelectionChange(val) {
@ -502,11 +486,11 @@
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row,flowState) {
if(!row){
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
}else {
this.updateHandle(row,flowState)
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
@ -516,7 +500,7 @@
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
request({
url: `/api/scm/WorkOrder/Actions/Export`,
method: 'post',
@ -529,14 +513,14 @@
})
},
search() {
this.listQuery.currentPage=1
this.listQuery.pageSize=20
this.listQuery.sort="desc"
this.listQuery.sidx=""
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row,flowState) {
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
@ -596,5 +580,5 @@
if (isrRefresh) this.reset()
},
}
}
}
</script>

Loading…
Cancel
Save