钢厂磅单扣结

product
bawei 1 year ago
parent 8c108feba3
commit 983dcf58d9

@ -205,6 +205,75 @@ public class PoundlistController {
return ActionResult.success(vo);
}
/**
*
*
* @param poundlistPagination
* @return
*/
@PostMapping("/getListSourceId")
public ActionResult listsourceid(@RequestBody PoundlistPagination poundlistPagination)throws IOException{
List<PoundlistEntity> list= poundlistService.getListSourceid(poundlistPagination);
//处理id字段转名称若无需转或者为空可删除
for(PoundlistEntity entity:list){
entity.setPoundPictures(generaterSwapUtil.getFileNameInJson(entity.getPoundPictures()));
entity.setVehiclePictures(generaterSwapUtil.getFileNameInJson(entity.getVehiclePictures()));
entity.setOriginPlace(generaterSwapUtil.provinceData(entity.getOriginPlace()));
}
List<PoundlistListVO> listVO=JsonUtil.getJsonToList(list,PoundlistListVO.class);
for(PoundlistListVO poundlistListVO:listVO){
if(StringUtils.isEmpty(poundlistListVO.getSettlement())){
poundlistListVO.setSettlement(poundlistListVO.getNetWeight());
if(StringUtils.isEmpty(poundlistListVO.getSettlement())){
poundlistListVO.setSettlement("0");
}
}
if(StringUtils.isEmpty(poundlistListVO.getPrice())){
poundlistListVO.setPrice(poundlistListVO.getPurchasePrice());
if(StringUtils.isEmpty(poundlistListVO.getPrice())){
poundlistListVO.setPrice("0");
}
}
if(StringUtils.isEmpty(poundlistListVO.getSalesPrice())){
poundlistListVO.setSalesPrice("0");
}
if(StringUtils.isEmpty(poundlistListVO.getSaleRate())){
poundlistListVO.setSaleRate("0");
}
poundlistListVO.setPrice(poundlistListVO.getPurchasePrice());
poundlistListVO.setRate("0");
poundlistListVO.setPountType(poundlistListVO.getPoundType());
poundlistListVO.setAmount(new BigDecimal(poundlistListVO.getSettlement()).multiply(new BigDecimal(poundlistListVO.getPrice())).setScale(2,BigDecimal.ROUND_HALF_UP).toPlainString());
poundlistListVO.setNotAmount(new BigDecimal(poundlistListVO.getAmount()).divide(new BigDecimal("1.13"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
poundlistListVO.setSaleAmount(new BigDecimal(poundlistListVO.getSettlement()).multiply(new BigDecimal(poundlistListVO.getSalesPrice())).toPlainString());
switch (poundlistListVO.getSaleRate()) {
case "1":
poundlistListVO.setSaleNotAmount(new BigDecimal(poundlistListVO.getSaleAmount()).divide(new BigDecimal("1.09"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
break;
case "2":
poundlistListVO.setSaleNotAmount(new BigDecimal(poundlistListVO.getSaleAmount()).divide(new BigDecimal("1.06"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
break;
case "3":
poundlistListVO.setSaleNotAmount(new BigDecimal(poundlistListVO.getSaleAmount()).divide(new BigDecimal("1.05"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
break;
case "4":
poundlistListVO.setSaleNotAmount(new BigDecimal(poundlistListVO.getSaleAmount()).divide(new BigDecimal("1.03"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
break;
case "5":
poundlistListVO.setSaleNotAmount(new BigDecimal(poundlistListVO.getSaleAmount()).divide(new BigDecimal("1"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
break;
default:
poundlistListVO.setSaleNotAmount(new BigDecimal(poundlistListVO.getSaleAmount()).divide(new BigDecimal("1.13"),2,BigDecimal.ROUND_HALF_UP).toPlainString());
break;
}
poundlistListVO.setRateAmount(String.valueOf(Double.parseDouble(poundlistListVO.getAmount()) - Double.parseDouble(poundlistListVO.getNotAmount())));
}
PageListVO vo=new PageListVO();
vo.setList(listVO);
PaginationVO page=JsonUtil.getJsonToBean(poundlistPagination,PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*

@ -221,6 +221,9 @@ public class PoundlistEntity {
@TableField("COLLECTION_AMOUNTS")
private BigDecimal collectionAmounts;
@TableField("SOURCE_ID")
private String sourceId;
@TableField(exist = false)
private String materialName;

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.contractfile.entity.ContractFileEntity;
import jnpf.contractfile.model.contractfile.ContractFilePagination;
import jnpf.poundlist.entity.PoundlistEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.poundlist.entity.PoundlistSEntity;
@ -40,4 +42,6 @@ public interface PoundlistMapper extends BaseMapper<PoundlistEntity> {
List<PoundlistEntity> queryByKeywordNotPage(@Param("poundlistPagination") PoundlistPagination poundlistPagination, @Param("ew") Wrapper<PoundlistEntity> queryWrapper);
List<PoundlistEntity> queryCreateSale(@Param("idList") List<String> idList);
//钢厂磅单扣结
IPage<PoundlistEntity> querypoundlistsourceid(@Param("page") Page<PoundlistEntity> page, @Param("poundlistPagination") PoundlistPagination poundlistPagination, @Param("ew") Wrapper<PoundlistEntity> queryWrapper);
}

@ -163,6 +163,8 @@ public class PoundlistCrForm {
@JsonProperty("collectionAmounts")
private String collectionAmounts;
/** 回款金额 **/
@JsonProperty("sourceId")
private String sourceId;
}

@ -168,4 +168,8 @@ public class PoundlistInfoVO{
@JsonProperty("collectionAmounts")
private String collectionAmounts;
/** 回款金额 **/
@JsonProperty("sourceId")
private String sourceId;
}

@ -286,4 +286,7 @@ public class PoundlistListVO{
@JsonProperty("collectionAmounts")
private String collectionAmounts;
/** 回款金额 **/
@JsonProperty("sourceId")
private String sourceId;
}

@ -192,4 +192,8 @@ public class PoundlistUpForm{
/** 回款金额 **/
@JsonProperty("collectionAmounts")
private String collectionAmounts;
/** 回款金额 **/
@JsonProperty("sourceId")
private String sourceId;
}

@ -27,8 +27,8 @@ public interface PoundlistService extends IService<PoundlistEntity> {
List<PoundlistEntity> getList(PoundlistPagination poundlistPagination);
List<PoundlistEntity> getTypeList(PoundlistPagination poundlistPagination,String dataType);
//钢厂磅单扣结
List<PoundlistEntity> getListSourceid(PoundlistPagination poundlistPagination);
PoundlistEntity getInfo(String id);

@ -493,5 +493,65 @@ public class PoundlistServiceImpl extends ServiceImpl<PoundlistMapper, Poundlist
//列表子表数据方法
//钢厂磅单扣结
public List<PoundlistEntity> getListSourceid(PoundlistPagination poundlistPagination) {
String userId = userProvider.get().getUserId();
List<String> AllIdList = new ArrayList();
int total = 0;
int poundlistNum = 0;
QueryWrapper<PoundlistEntity> poundlistQueryWrapper = new QueryWrapper<>();
poundlistQueryWrapper.lambda().eq(PoundlistEntity::getIsExamine, "1");
boolean pcPermission = true;
boolean appPermission = true;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if (isPc && pcPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object poundlistObj = authorizeService.getCondition2(new AuthorizeConditionModel(poundlistQueryWrapper, poundlistPagination.getMenuId(), "jg_poundlist"));
if (ObjectUtil.isEmpty(poundlistObj)) {
return new ArrayList<>();
} else {
poundlistQueryWrapper = (QueryWrapper<PoundlistEntity>) poundlistObj;
poundlistNum++;
}
}
}
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object poundlistObj = authorizeService.getCondition2(new AuthorizeConditionModel(poundlistQueryWrapper, poundlistPagination.getMenuId(), "jg_poundlist"));
if (ObjectUtil.isEmpty(poundlistObj)) {
return new ArrayList<>();
} else {
poundlistQueryWrapper = (QueryWrapper<PoundlistEntity>) poundlistObj;
poundlistNum++;
}
}
}
if (StringUtil.isNotEmpty(poundlistPagination.getPoundDate())) {
List<String> PoundDateList = poundlistPagination.getPoundDate();
Long fir = Long.valueOf(PoundDateList.get(0));
Long sec = Long.valueOf(PoundDateList.get(1));
poundlistPagination.setStartDate(new Date(fir));
poundlistPagination.setEndDate(DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if (StringUtil.isEmpty(poundlistPagination.getSidx())) {
poundlistPagination.setSidx("CREATOR_TIME");
poundlistPagination.setSort("DESC");
} else {
try {
String sidx = poundlistPagination.getSidx();
PoundlistEntity poundlistEntity = new PoundlistEntity();
Field declaredField = poundlistEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
poundlistPagination.setSidx(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
Page<PoundlistEntity> page = new Page<>(poundlistPagination.getCurrentPage(), poundlistPagination.getPageSize());
IPage<PoundlistEntity> iPage = poundlistMapper.querypoundlistsourceid(page, poundlistPagination, poundlistQueryWrapper);
return poundlistPagination.setData(iPage.getRecords(), iPage.getTotal());
}
}

@ -311,4 +311,105 @@ WHERE a.delete_mark = 0 and
#{item}
</foreach>
</select>
<select id="querypoundlistsourceid" resultType="jnpf.poundlist.entity.PoundlistEntity">
SELECT a.*,b.ticketno vehicleName,c.supplier_name supplierName,d.supplier_nm customerName,e.item_name materialName,f.contract_name salesName,g.contract_name purchaseName,h.F_RealName businessName,
i.name naturalName,g.contract_no purchaseContractNo,f.contract_no salesContractNo, j.id purchaseorderItem0Id,k.id salesorderItem0Id,k.rate saleRate,jp.is_payment isPayment
from jg_poundlist a
LEFT JOIN jg_vehicle b on a.vehicle_id = b.id and b.delete_mark = 0
LEFT JOIN jg_supplier c on a.supplier_id = c.id and c.delete_mark = 0
LEFT JOIN jg_customer d on a.customer_id = d.id and d.delete_mark = 0
LEFT JOIN jg_material e on a.material_id = e.id and e.delete_mark = 0
LEFT JOIN jg_contract f on a.sales_id = f.id and f.delete_mark = 0
LEFT JOIN jg_contract g on a.purchase_id = g.id and g.delete_mark = 0
LEFT JOIN base_user h on a.business_id = h.f_id
LEFT JOIN jg_natural i on a.natural_id = i.id and i.delete_mark = 0
LEFT JOIN jg_purchaseorder_item0 j on a.id = j.poundlist_id and j.delete_mark = 0
LEFT JOIN jg_salesorder_item0 k on a.id = k.poundlist_id and k.delete_mark = 0
LEFT JOIN jg_purchaseorder jp ON a.purchaseorder_id=jp.id and jp.delete_mark = 0
LEFT JOIN jg_salesorder js ON a.salesorder_id=js.id and js.delete_mark = 0
${ew.customSqlSegment} and a.delete_mark = 0 and a.source_id is not null
<if test="poundlistPagination.keyword != null and poundlistPagination.keyword != ''">
AND (b.ticketno LIKE CONCAT('%',#{poundlistPagination.keyword},'%') OR c.supplier_name LIKE CONCAT('%',#{poundlistPagination.keyword},'%') OR d.supplier_nm LIKE CONCAT('%',#{poundlistPagination.keyword},'%'))
</if>
<if test="poundlistPagination.startDate != null and poundlistPagination.endDate != null">
AND a.pound_date &gt; #{poundlistPagination.startDate} AND a.pound_date &lt;= #{poundlistPagination.endDate}
</if>
<if test="poundlistPagination.poundlistNo != null and poundlistPagination.poundlistNo != ''">
AND a.poundlist_no LIKE CONCAT('%',#{poundlistPagination.poundlistNo},'%')
</if>
<if test="poundlistPagination.businessId != null and poundlistPagination.businessId != ''">
AND h.F_RealName LIKE CONCAT('%',#{poundlistPagination.businessId},'%')
</if>
<if test="poundlistPagination.isInvoicing != null and poundlistPagination.isInvoicing != ''">
AND a.is_Invoicing = #{poundlistPagination.isInvoicing}
</if>
<if test="poundlistPagination.isPay != null and poundlistPagination.isPay != ''">
AND a.is_pay = #{poundlistPagination.isPay}
</if>
<!--<if test="poundlistPagination.departmentId != null and poundlistPagination.departmentId != ''">
AND a.department_id = #{poundlistPagination.departmentId}
</if>
<if test="poundlistPagination.orgnizeId != null and poundlistPagination.orgnizeId != ''">
AND a.orgnize_id = #{poundlistPagination.orgnizeId}
</if>-->
<if test="poundlistPagination.isCollection != null and poundlistPagination.isCollection != ''">
AND a.is_collection = #{poundlistPagination.isCollection}
</if>
<if test="poundlistPagination.isExpense != null and poundlistPagination.isExpense != ''">
AND a.is_expense = #{poundlistPagination.isExpense}
</if>
<if test="poundlistPagination.purchaseStatus != null and poundlistPagination.purchaseStatus != ''">
AND a.purchase_status = #{poundlistPagination.purchaseStatus}
</if>
<if test="poundlistPagination.salesStatus != null and poundlistPagination.salesStatus != ''">
AND a.sales_status = #{poundlistPagination.salesStatus}
</if>
<if test="poundlistPagination.materialName != null and poundlistPagination.materialName != ''">
AND e.item_name LIKE CONCAT('%',#{poundlistPagination.materialName},'%')
</if>
<if test="poundlistPagination.vehicleName != null and poundlistPagination.vehicleName != ''">
AND b.ticketno LIKE CONCAT('%',#{poundlistPagination.vehicleName},'%')
</if>
<if test="poundlistPagination.purchaseName != null and poundlistPagination.purchaseName != ''">
AND g.contract_name LIKE CONCAT('%',#{poundlistPagination.purchaseName},'%')
</if>
<if test="poundlistPagination.salesName != null and poundlistPagination.salesName != ''">
AND f.contract_name LIKE CONCAT('%',#{poundlistPagination.salesName},'%')
</if>
<if test="poundlistPagination.customerName != null and poundlistPagination.customerName != ''">
AND d.supplier_nm LIKE CONCAT('%',#{poundlistPagination.customerName},'%')
</if>
<if test="poundlistPagination.supplierName != null and poundlistPagination.supplierName != ''">
AND c.supplier_name LIKE CONCAT('%',#{poundlistPagination.supplierName},'%')
</if>
<if test="poundlistPagination.purchaseOrderId != null and poundlistPagination.purchaseOrderId != ''">
AND a.id IN (SELECT poundlist_id from jg_purchaseorder_item0 where purchaseorder_id = #{poundlistPagination.purchaseOrderId})
</if>
<if test="poundlistPagination.salesOrderId != null and poundlistPagination.salesOrderId != ''">
AND a.id IN (SELECT poundlist_id from jg_salesorder_item0 where sales_order_id = #{poundlistPagination.salesOrderId})
</if>
<if test="poundlistPagination.poundlistIds != null and poundlistPagination.poundlistIds.size()!=0">
AND a.id NOT IN
<foreach collection="poundlistPagination.poundlistIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="poundlistPagination.settlement != null and poundlistPagination.settlement != ''">
AND a.settlement = #{poundlistPagination.settlement}
</if>
<if test="poundlistPagination.purchaseorderNo != null and poundlistPagination.purchaseorderNo != ''">
AND jp.document_no LIKE CONCAT('%',#{poundlistPagination.purchaseorderNo},'%')
</if>
<if test="poundlistPagination.salesorderNo != null and poundlistPagination.salesorderNo != ''">
AND js.document_no LIKE CONCAT('%',#{poundlistPagination.salesorderNo},'%')
</if>
<if test="poundlistPagination.sidx != null and poundlistPagination.sidx != ''">
ORDER BY ${poundlistPagination.sidx} ${poundlistPagination.sort}
</if>
</select>
</mapper>

@ -0,0 +1,780 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'详情'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" v-if="visible" v-dialogDrag class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="12">
<el-form-item label="磅单上传" prop="poundPictures">
<JNPF-UploadImg v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="1" :disabled="true">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆图片" prop="vehiclePictures">
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9" :disabled="true">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称" prop="materialId">
<popupSelect v-model="dataForm.materialId" placeholder="请选择物料名称" clearable field="materialId"
interfaceId="381037852907038533" :columnOptions="materialIdcolumnOptions" propsValue="id"
relationField="item_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称" prop="customerId">
<popupSelect v-model="dataForm.customerId" placeholder="请选择客户" clearable field="customerId"
interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id"
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" @change="customerSelect" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售合同" prop="salesId">
<popupSelect v-model="dataForm.salesId" placeholder="请选择合同" clearable field="salesId"
interfaceId="396203872441416837" :columnOptions="salesIdcolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" :bissId="dataForm.customerId"
hasPage :pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商" prop="supplierId">
<popupSelect v-model="dataForm.supplierId" placeholder="请选择供应商" clearable field="supplierId"
interfaceId="382494924156735557" :columnOptions="supplierIdcolumnOptions" propsValue="id"
relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购合同" prop="purchaseId">
<popupSelect v-model="dataForm.purchaseId" placeholder="请选择合同" clearable field="purchaseId"
interfaceId="397408984857931205" :columnOptions="salesIdcolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" @change="customerSelect2" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购价格" prop="purchasePrice">
<el-input-number v-model="dataForm.purchasePrice" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="车牌号" prop="vehicleId">
<popupSelect v-model="dataForm.vehicleId" placeholder="请选择车辆" clearable field="vehicleId"
interfaceId="381432451370615173" :columnOptions="vehicleIdcolumnOptions" propsValue="id"
relationField="ticketno" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="changePicture"
hasPage :pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="收货价格" prop="collectPrice">
<el-input-number v-model="dataForm.collectPrice" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售价格" prop="salesPrice">
<el-input-number v-model="dataForm.salesPrice" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="毛重" prop="grossWeight">
<el-input-number v-model="dataForm.grossWeight" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="皮重" prop="tareWeight">
<el-input-number v-model="dataForm.tareWeight" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="扣重" prop="buckleWeight">
<el-input-number v-model="dataForm.buckleWeight" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="净重" prop="netWeight">
<el-input-number v-model="dataForm.netWeight" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单时间" prop="poundDate">
<el-date-picker v-model="dataForm.poundDate" placeholder="请选择" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单号" prop="poundlistNo">
<el-input v-model="dataForm.poundlistNo" placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单位 " prop="unit">
<el-select v-model="unit" placeholder="请选择" clearable :style='{"width":"100%"}' @change="unitChange" disabled>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运输类型" prop="transportType">
<el-select v-model="transportType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="transportTypeChange" disabled>
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否垫资" prop="advance">
<el-select v-model="advance" placeholder="请选择" clearable :style='{"width":"100%"}' @change="advanceChange" disabled>
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运费" prop="transportPrice">
<el-input-number v-model="dataForm.transportPrice" :style='{"width":"100%"}' :precision="6" disabled></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="起始地" prop="originPlace">
<JNPF-Address v-model="dataForm.originPlace" placeholder="请选择省市区" clearable :level='2' :disabled="true">
</JNPF-Address>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务员1" prop="businessId">
<popupSelect v-model="dataForm.businessId" placeholder="请选择业务员" clearable field="businessId"
interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="businessIdcolumnOptions"
propsValue="F_Id" relationField="F_RealName" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" :bissId="dataForm.businessId" disabled>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务员2" prop="naturalId">
<popupSelect v-model="dataForm.naturalId" placeholder="请选择业务员2" clearable field="naturalId"
interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id"
relationField="name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注信息" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> -->
<!-- <el-button type="primary" @click="continueUpload()"> </el-button>-->
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
unit: "0",
transportType: "0",
advance: "0",
action: this.define.APIURl + '/api/tradeupload/Tradeupload/UploaderPondList/annexpic',
imageUrl: '',
code: '',
fileList: [],
visible: false,
loading: false,
isDetail: false,
dataForm: {
poundPictures: [],
materialId: "",
customerId: "",
supplierId: "",
salesId: "",
purchaseId: "",
vehicleId: "",
vehiclePictures: [],
originPlace: [],
poundDate: '',
poundlistNo: '',
tareWeight: 0,
grossWeight: 0,
buckleWeight: 0,
netWeight: 0,
unit: "0",
transportType: "0",
advance: "0",
transportPrice: 0,
salesPrice: 0,
purchasePrice: 0,
collectPrice: 0,
businessId: "",
naturalId: "",
remark: '',
creatorTime: "",
},
rules: {
materialId: [{
required: true,
message: '请选择物料编码',
trigger: 'change'
}, ],
customerId: [{
required: true,
message: '请选择客户',
trigger: 'change'
}, ],
supplierId: [{
required: true,
message: '请选择供应商',
trigger: 'change'
}, ],
salesId: [{
required: true,
message: '请选择合同',
trigger: 'change'
}, ],
vehicleId: [{
required: true,
message: '请选择车辆',
trigger: 'change'
}, ],
vehiclePictures: [{
required: true,
message: '请至少选择一个',
trigger: 'click'
}, ],
poundDate: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
poundlistNo: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
tareWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
grossWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
buckleWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
netWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
salesPrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
collectPrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
purchasePrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
businessId: [{
required: true,
message: '请选择业务员',
trigger: 'change'
}, ],
},
materialIdcolumnOptions: [{
"label": "物料编码",
"value": "item_code"
}, {
"label": "物料名称",
"value": "item_name"
}, {
"label": "单位",
"value": "primary_unit_of_measure"
}, {
"label": "默认入库区",
"value": "in_area"
}, {
"label": "默认出库区",
"value": "out_area"
}, ],
customerIdcolumnOptions: [{
"label": "客户编码",
"value": "supplier_cd"
}, {
"label": "客户名称",
"value": "supplier_nm"
}, {
"label": "地址",
"value": "address"
}, {
"label": "银行账号",
"value": "bank_account"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}],
salesIdcolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
}, {
"label": "合同类型",
"value": "contract_type"
}, {
"label": "供应商/客户名称",
"value": "name"
}, ],
vehicleIdcolumnOptions: [{
"label": "车牌号",
"value": "ticketno"
}, {
"label": "司机",
"value": "drivername"
}, {
"label": "车辆照片",
"value": "vehiclephotos"
}, {
"label": "手机号",
"value": "contact"
}, ],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
advanceOptions: [{
"fullName": "否",
"id": "0"
}, {
"fullName": "是",
"id": "1"
}],
businessIdcolumnOptions: [{
"label": "人员名称",
"value": "F_RealName"
}, {
"label": "账号",
"value": "F_Account"
}, {
"label": "人员职位",
"value": "positionName"
}],
naturalIdcolumnOptions: [{
"label": "业务员2名称",
"value": "name"
}, {
"label": "业务员2手机号",
"value": "contact"
}, {
"label": "业务员2地址",
"value": "adress"
}, ],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
unitChange(e){
this.dataForm.unit = e;
},
transportTypeChange(e){
this.dataForm.transportType = e;
},
advanceChange(e){
this.dataForm.advance = e;
},
customerSelect(e, d) {
const query = {
code: d.id
}
request({
url: '/api/example/ContractFile/getListByCustomer',
method: 'post',
data: query
}).then((res) => {
if(res.data.length > 0){
// type
this.dataForm.salesId = res.data[0].id
this.dataForm.salesName = res.data[0].contractName
}
})
},
customerSelect2(a, b) {
this.dataForm.supplierId = b.code;
debugger
},
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
this.dataForm.customerId = res.data.customerId;
this.dataForm.customerName = res.data.customerName;
this.dataForm.salesId = res.data.salesId;
this.dataForm.salesName = res.data.salesName;
this.dataForm.vehicleId = res.data.vehicleId;
this.dataForm.poundDate = res.data.poundDate;
this.dataForm.poundlistNo = res.data.poundlistNo;
this.dataForm.tareWeight = res.data.tareWeight;
this.dataForm.grossWeight = res.data.grossWeight;
this.dataForm.buckleWeight = res.data.buckleWeight;
this.dataForm.netWeight = res.data.netWeight;
this.dataForm.vehiclePictures = JSON.parse(res.data.vehiclePictures);
},
changePicture(a, b) {
this.dataForm.vehiclePictures = JSON.parse(b.vehiclephotos);
},
continueUpload() {
var tareWeight = this.dataForm.tareWeight;//
var grossWeight = this.dataForm.grossWeight;//
var buckleWeight = this.dataForm.buckleWeight;//
var netWeight = this.dataForm.netWeight;//
if(grossWeight < tareWeight + buckleWeight + netWeight){
this.$message({
message: '毛重不得小于皮重+扣重+净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= netWeight){
this.$message({
message: '扣重不得大于净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= grossWeight){
this.$message({
message: '扣重不得大于毛重',
type: 'success',
duration: 1000
})
return
}
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request3()
}
})
},
// poundAI(){
// let formData = new FormData();
// let file = this.dataForm.poundPictures
// formData.append('file',file);
// request({
// url: '/api/tradeupload/Tradeupload/poundai',
// method: 'post',
// data: formData
// }).then(res => {
// this.dataInfo(res.data)
// this.loading = false
// });
// },
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.poundDate = new Date();
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
this.dataForm.businessId = this.$store.state.user.userInfo.userId;
this.dataForm.businessName = this.$store.state.user.userInfo.userName;
},
//
dataFormSubmit() {
var tareWeight = this.dataForm.tareWeight;//
var grossWeight = this.dataForm.grossWeight;//
var buckleWeight = this.dataForm.buckleWeight;//
var netWeight = this.dataForm.netWeight;//
this.dataForm.unit = this.dataForm.unit ? this.dataForm.unit : 0;
this.dataForm.transportType = this.dataForm.transportType ? this.dataForm.transportType : 0;
this.dataForm.advance = this.dataForm.advance ? this.dataForm.advance : 0;
if(grossWeight < tareWeight + buckleWeight + netWeight){
this.$message({
message: '毛重不得小于皮重+扣重+净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= netWeight){
this.$message({
message: '扣重不得大于净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= grossWeight){
this.$message({
message: '扣重不得大于毛重',
type: 'success',
duration: 1000
})
return
}
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request2()
}
})
},
request2() {
var _data = this.dataList()
debugger
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
request3() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
})
})
}
this.dataForm.vehicleId = null;
this.dataForm.vehiclePictures = null;
this.dataForm.poundDate = null;
this.dataForm.poundlistNo = null;
this.dataForm.tareWeight = null;
this.dataForm.grossWeight = null;
this.dataForm.buckleWeight = null;
this.dataForm.netWeight = null;
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
_data.originPlace = JSON.stringify(_data.originPlace)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.unit = _dataAll.unit
this.transportType = _dataAll.transportType
this.advance = _dataAll.advance
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
if(_dataAll.originPlace.length > 0){
_dataAll.originPlace = JSON.parse(_dataAll.originPlace)
}else{
_dataAll.originPlace = []
}
this.dataForm = _dataAll
},
},
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 120px;
height: 120px;
line-height: 120px;
text-align: center;
}
.avatar {
width: 120px;
height: 120px;
display: block;
}
</style>

@ -0,0 +1,68 @@
<template>
<el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible" v-if="visible" v-dialogDrag
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
<el-form label-position="top" label-width="80px">
<el-form-item label="数据选择">
<el-radio-group v-model="type">
<el-radio :label="0">当前页面数据</el-radio>
<el-radio :label="1">全部页面数据</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导出字段">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox-group v-model="columns" @change="handleCheckedChange">
<el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop">
{{item.label}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible=false"> </el-button>
<el-button type="primary" @click="downLoad"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
visible: false,
btnLoading: false,
type: 0,
columns: [],
checkAll: true,
isIndeterminate: false,
columnList: []
}
},
methods: {
init(columnList) {
this.visible = true
this.checkAll = true
this.isIndeterminate = false
this.columnList = columnList
this.columns = columnList.map(o => o.prop)
},
handleCheckAllChange(val) {
this.columns = val ? this.columnList.map(o => o.prop) : [];
this.isIndeterminate = false;
},
handleCheckedChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length;
},
downLoad() {
this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') })
}
}
}
</script>
<style lang="scss" scoped>
>>> .el-dialog__body {
padding: 20px !important;
}
</style>

@ -0,0 +1,789 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'详情'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" v-if="visible" v-dialogDrag class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="12">
<el-form-item label="磅单上传" prop="poundPictures">
<JNPF-UploadImg v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="1" :disabled="true">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆图片" prop="vehiclePictures">
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称" prop="materialId">
<popupSelect v-model="dataForm.materialId" placeholder="请选择物料名称" clearable field="materialId"
interfaceId="381037852907038533" :columnOptions="materialIdcolumnOptions" propsValue="id"
relationField="item_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称" prop="customerId">
<popupSelect v-model="dataForm.customerId" placeholder="请选择客户" clearable field="customerId"
interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id"
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" @change="customerSelect" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售合同" prop="salesId">
<popupSelect v-model="dataForm.salesId" placeholder="请选择合同" clearable field="salesId"
interfaceId="396203872441416837" :columnOptions="salesIdcolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" :bissId="dataForm.customerId"
hasPage :pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商" prop="supplierId">
<popupSelect v-model="dataForm.supplierId" placeholder="请选择供应商" clearable field="supplierId"
interfaceId="382494924156735557" :columnOptions="supplierIdcolumnOptions" propsValue="id"
relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购合同" prop="purchaseId">
<popupSelect v-model="dataForm.purchaseId" placeholder="请选择合同" clearable field="purchaseId"
interfaceId="397408984857931205" :columnOptions="salesIdcolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" @change="customerSelect2" :disabled="true">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购价格" prop="purchasePrice">
<el-input-number v-model="dataForm.purchasePrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="车牌号" prop="vehicleId">
<popupSelect v-model="dataForm.vehicleId" placeholder="请选择车辆" clearable field="vehicleId"
interfaceId="381432451370615173" :columnOptions="vehicleIdcolumnOptions" propsValue="id"
relationField="ticketno" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="changePicture"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="收货价格" prop="collectPrice">
<el-input-number v-model="dataForm.collectPrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售价格" prop="salesPrice">
<el-input-number v-model="dataForm.salesPrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="毛重" prop="grossWeight">
<el-input-number v-model="dataForm.grossWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="皮重" prop="tareWeight">
<el-input-number v-model="dataForm.tareWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="扣重" prop="buckleWeight">
<el-input-number v-model="dataForm.buckleWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="净重" prop="netWeight">
<el-input-number v-model="dataForm.netWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单时间" prop="poundDate">
<el-date-picker v-model="dataForm.poundDate" placeholder="请选择" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单号" prop="poundlistNo">
<el-input v-model="dataForm.poundlistNo" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单位 " prop="unit">
<el-select v-model="unit" placeholder="请选择" clearable :style='{"width":"100%"}' @change="unitChange">
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运输类型" prop="transportType">
<el-select v-model="transportType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="transportTypeChange">
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否垫资" prop="advance">
<el-select v-model="advance" placeholder="请选择" clearable :style='{"width":"100%"}' @change="advanceChange">
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运费" prop="transportPrice">
<el-input-number v-model="dataForm.transportPrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="起始地" prop="originPlace">
<JNPF-Address v-model="dataForm.originPlace" placeholder="请选择省市区" clearable :level='2' >
</JNPF-Address>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务员1" prop="businessId">
<popupSelect v-model="dataForm.businessId" placeholder="请选择业务员" clearable field="businessId"
interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="businessIdcolumnOptions"
propsValue="F_Id" relationField="F_RealName" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" :bissId="dataForm.businessId">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务员2" prop="naturalId">
<popupSelect v-model="dataForm.naturalId" placeholder="请选择业务员2" clearable field="naturalId"
interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id"
relationField="name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注信息" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail" :disabled="submitDisabled"> </el-button>
<!-- <el-button type="primary" @click="continueUpload()"> </el-button>-->
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
submitDisabled: false,
unit: "0",
transportType: "0",
advance: "0",
action: this.define.APIURl + '/api/tradeupload/Tradeupload/UploaderPondList/annexpic',
imageUrl: '',
code: '',
fileList: [],
visible: false,
loading: false,
isDetail: false,
dataForm: {
poundPictures: [],
materialId: "",
customerId: "",
supplierId: "",
salesId: "",
purchaseId: "",
vehicleId: "",
vehiclePictures: [],
originPlace: [],
poundDate: '',
poundlistNo: '',
tareWeight: 0,
grossWeight: 0,
buckleWeight: 0,
netWeight: 0,
unit: "0",
transportType: "0",
advance: "0",
transportPrice: 0,
salesPrice: 0,
purchasePrice: 0,
collectPrice: 0,
businessId: "",
naturalId: "",
remark: '',
creatorTime: "",
},
rules: {
materialId: [{
required: true,
message: '请选择物料编码',
trigger: 'change'
}, ],
customerId: [{
required: true,
message: '请选择客户',
trigger: 'change'
}, ],
supplierId: [{
required: true,
message: '请选择供应商',
trigger: 'change'
}, ],
salesId: [{
required: true,
message: '请选择合同',
trigger: 'change'
}, ],
vehicleId: [{
required: true,
message: '请选择车辆',
trigger: 'change'
}, ],
vehiclePictures: [{
required: true,
message: '请至少选择一个',
trigger: 'click'
}, ],
poundDate: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
poundlistNo: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
tareWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
grossWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
buckleWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
netWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
salesPrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
collectPrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
purchasePrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
businessId: [{
required: true,
message: '请选择业务员',
trigger: 'change'
}, ],
},
materialIdcolumnOptions: [{
"label": "物料编码",
"value": "item_code"
}, {
"label": "物料名称",
"value": "item_name"
}, {
"label": "单位",
"value": "primary_unit_of_measure"
}, {
"label": "默认入库区",
"value": "in_area"
}, {
"label": "默认出库区",
"value": "out_area"
}, ],
customerIdcolumnOptions: [{
"label": "客户编码",
"value": "supplier_cd"
}, {
"label": "客户名称",
"value": "supplier_nm"
}, {
"label": "地址",
"value": "address"
}, {
"label": "银行账号",
"value": "bank_account"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}],
salesIdcolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
}, {
"label": "合同类型",
"value": "contract_type"
}, {
"label": "供应商/客户名称",
"value": "name"
}, ],
vehicleIdcolumnOptions: [{
"label": "车牌号",
"value": "ticketno"
}, {
"label": "司机",
"value": "drivername"
}, {
"label": "车辆照片",
"value": "vehiclephotos"
}, {
"label": "手机号",
"value": "contact"
}, ],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
advanceOptions: [{
"fullName": "否",
"id": "0"
}, {
"fullName": "是",
"id": "1"
}],
businessIdcolumnOptions: [{
"label": "人员名称",
"value": "F_RealName"
}, {
"label": "账号",
"value": "F_Account"
}, {
"label": "人员职位",
"value": "positionName"
}],
naturalIdcolumnOptions: [{
"label": "业务员2名称",
"value": "name"
}, {
"label": "业务员2手机号",
"value": "contact"
}, {
"label": "业务员2地址",
"value": "adress"
}, ],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
unitChange(e){
this.dataForm.unit = e;
},
transportTypeChange(e){
this.dataForm.transportType = e;
},
advanceChange(e){
this.dataForm.advance = e;
},
customerSelect(e, d) {
const query = {
code: d.id
}
request({
url: '/api/example/ContractFile/getListByCustomer',
method: 'post',
data: query
}).then((res) => {
if(res.data.length > 0){
// type
this.dataForm.salesId = res.data[0].id
this.dataForm.salesName = res.data[0].contractName
}
})
},
customerSelect2(a, b) {
this.dataForm.supplierId = b.code;
debugger
},
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
this.dataForm.customerId = res.data.customerId;
this.dataForm.customerName = res.data.customerName;
this.dataForm.salesId = res.data.salesId;
this.dataForm.salesName = res.data.salesName;
this.dataForm.vehicleId = res.data.vehicleId;
this.dataForm.poundDate = res.data.poundDate;
this.dataForm.poundlistNo = res.data.poundlistNo;
this.dataForm.tareWeight = res.data.tareWeight;
this.dataForm.grossWeight = res.data.grossWeight;
this.dataForm.buckleWeight = res.data.buckleWeight;
this.dataForm.netWeight = res.data.netWeight;
this.dataForm.vehiclePictures = JSON.parse(res.data.vehiclePictures);
},
changePicture(a, b) {
this.dataForm.vehiclePictures = JSON.parse(b.vehiclephotos);
},
continueUpload() {
var tareWeight = this.dataForm.tareWeight;//
var grossWeight = this.dataForm.grossWeight;//
var buckleWeight = this.dataForm.buckleWeight;//
var netWeight = this.dataForm.netWeight;//
if(grossWeight < tareWeight + buckleWeight + netWeight){
this.$message({
message: '毛重不得小于皮重+扣重+净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= netWeight){
this.$message({
message: '扣重不得大于净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= grossWeight){
this.$message({
message: '扣重不得大于毛重',
type: 'success',
duration: 1000
})
return
}
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request3()
}
})
},
// poundAI(){
// let formData = new FormData();
// let file = this.dataForm.poundPictures
// formData.append('file',file);
// request({
// url: '/api/tradeupload/Tradeupload/poundai',
// method: 'post',
// data: formData
// }).then(res => {
// this.dataInfo(res.data)
// this.loading = false
// });
// },
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.poundDate = new Date();
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
this.dataForm.businessId = this.$store.state.user.userInfo.userId;
this.dataForm.businessName = this.$store.state.user.userInfo.userName;
},
//
dataFormSubmit() {
var tareWeight = this.dataForm.tareWeight;//
var grossWeight = this.dataForm.grossWeight;//
var buckleWeight = this.dataForm.buckleWeight;//
var netWeight = this.dataForm.netWeight;//
this.dataForm.unit = this.dataForm.unit ? this.dataForm.unit : 0;
this.dataForm.transportType = this.dataForm.transportType ? this.dataForm.transportType : 0;
this.dataForm.advance = this.dataForm.advance ? this.dataForm.advance : 0;
if(grossWeight < tareWeight + buckleWeight + netWeight){
this.$message({
message: '毛重不得小于皮重+扣重+净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= netWeight){
this.$message({
message: '扣重不得大于净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= grossWeight){
this.$message({
message: '扣重不得大于毛重',
type: 'success',
duration: 1000
})
return
}
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request2()
}
})
},
request2() {
this.submitDisabled = true;
this.dataForm;
var _data = this.dataList()
debugger
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 3000,
onClose: () => {
this.submitDisabled = false;
this.visible = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.submitDisabled = false
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 3000,
onClose: () => {
this.submitDisabled = false;
this.visible = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.submitDisabled = false
})
}
},
request3() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
})
})
}
this.dataForm.vehicleId = null;
this.dataForm.vehiclePictures = null;
this.dataForm.poundDate = null;
this.dataForm.poundlistNo = null;
this.dataForm.tareWeight = null;
this.dataForm.grossWeight = null;
this.dataForm.buckleWeight = null;
this.dataForm.netWeight = null;
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
_data.originPlace = JSON.stringify(_data.originPlace)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.unit = _dataAll.unit
this.transportType = _dataAll.transportType
this.advance = _dataAll.advance
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
if(_dataAll.originPlace.length > 0){
_dataAll.originPlace = JSON.parse(_dataAll.originPlace)
}else{
_dataAll.originPlace = []
}
this.dataForm = _dataAll
},
},
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 120px;
height: 120px;
line-height: 120px;
text-align: center;
}
.avatar {
width: 120px;
height: 120px;
display: block;
}
</style>

@ -0,0 +1,247 @@
<template>
<el-dialog title="批量导入" :close-on-click-modal="false" :visible.sync="visible" v-if="visible" v-dialogDrag
class="JNPF-dialog JNPF-dialog_center JNPF-dialog-import" lock-scroll width="1000px" :modal="false" :modal-append-to-body="false">
<el-steps :active="active" align-center>
<el-step title="上传文件"></el-step>
<el-step title="数据预览"></el-step>
<el-step title="导入数据"></el-step>
</el-steps>
<div class="import-main" v-show="active==1">
<div class="upload">
<div class="up_left">
<img src="@/assets/images/upload.png">
</div>
<div class="up_right">
<p class="title">上传填好的数据表</p>
<p class="tip">文件后缀名必须是xls或xlsx文件大小不超过500KB最多支持导入1000条数据</p>
<el-upload :action="define.comUrl+'/api/invoices/Invoices/Uploader'"
:headers="{ Authorization: $store.getters.token}" :on-success="handleSuccess"
:on-remove="handleRemove" :before-remove="beforeRemove" :on-change="handleChange"
:file-list="fileList" accept=".xls,.xlsx" :before-upload="beforeUpload"
class="upload-area">
<el-button type="text">上传文件</el-button>
</el-upload>
</div>
</div>
<div class="upload">
<div class="up_left">
<img src="@/assets/images/import.png">
</div>
<div class="up_right">
<p class="title">填写导入数据信息</p>
<p class="tip">请按照数据模板的格式准备导入数据模板中的表头名称不可更改表头行不能删除</p>
<el-button type="text" @click="templateDownload"></el-button>
</div>
</div>
</div>
<div class="import-main" v-show="active==2">
<JNPF-table v-loading="listLoading" :data="list">
<el-table-column prop="customerName" label="客户名称" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.customerName" />
</template>
</el-table-column>
<el-table-column prop="vehicleName" label="车号" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.vehicleName" />
</template>
</el-table-column>
<el-table-column prop="grossWeight" label="毛重" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.grossWeight" />
</template>
</el-table-column>
<el-table-column prop="tareWeight" label="皮重" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.tareWeight" />
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.settlement" />
</template>
</el-table-column>
<el-table-column prop="unit" label="单位" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.unit" />
</template>
</el-table-column>
<!-- <el-table-column prop="salesPrice" label="销售单价" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.salesPrice" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="salesAmount" label="销售金额" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.salesAmount" />
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="handleDel(scope.$index)">删除</el-button>
</template>
</el-table-column>
</JNPF-table>
</div>
<div class="import-main" v-show="active==3">
<div class="success" v-if="!result.resultType">
<img src="@/assets/images/success.png" alt="">
<p class="success-title">批量导入成功</p>
<p class="success-tip">您已成功导入数据</p>
</div>
<div class="unsuccess" v-if="result.resultType">
<el-alert title="错误提醒:导入失败数据展示" type="warning" show-icon :closable="false" />
<div class="upload error-show">
<div class="up_left">
<img class="" src="@/assets/images/tip.png">
</div>
<div class="up_right">
<p class="tip">正常数量条数<el-link type="success" :underline="false">{{result.snum}}
</el-link>
</p>
<p class="tip">异常数量条数<el-link type="danger" :underline="false">{{result.fnum}}
</el-link>
</p>
</div>
</div>
<p class="contips">以下文件数据为导入异常数据</p>
<JNPF-table :data="resultList" height="280px">
<el-table-column prop="customerName" label="客户名称" width="100" />
<el-table-column prop="vehicleName" label="车号" width="100" />
<el-table-column prop="grossWeight" label="毛重" width="80" />
<el-table-column prop="tareWeight" label="皮重" width="120" />
<el-table-column prop="settlement" label="结算重量" width="120" />
<el-table-column prop="unit" label="单位" width="100" />
<!-- <el-table-column prop="salesPrice" label="销售单价" width="150" />-->
<el-table-column prop="salesAmount" label="销售金额" width="150" />
<el-table-column prop="causeError" label="错误原因" width="100" />
</JNPF-table>
</div>
</div>
<JNPF-Form ref="JNPFForm" />
<span slot="footer" class="dialog-footer">
<el-button @click="cancel()" v-if="active == 1"> </el-button>
<el-button @click="prev" v-if="active == 2"></el-button>
<el-button @click="next" type="primary" v-if="active < 3" :loading="btnLoading"
:disabled="active == 1 && !fileName">下一步
</el-button>
<el-button @click="cancel(true)" type="primary" v-else> </el-button>
</span>
</el-dialog>
</template>
<script>
import { TemplateDownload, ImportData, ImportPreview } from '@/api/scm/poundlist'
import JNPFForm from './salesForm'
export default {
components: {
JNPFForm,
},
data() {
return {
visible: false,
btnLoading: false,
listLoading: false,
fileName: '',
fileList: [],
active: 1,
list: [],
resultList: [],
result: {
resultType: 0,
snum: 0,
fnum: 0
}
}
},
methods: {
prev() {
if (this.active == 1) return
this.active--
},
next() {
if (this.active == 2) {
debugger
if (!this.list.length) return this.$message({ message: '导入数据为空', type: 'warning' })
this.btnLoading = true
// this.btnLoading = false
// this.result = this.list
console.log('rrrrrrr', this.list);
//this.$emit('importData', this.list)
// this.active++
ImportData({ list: this.list }).then(res => {
if (res.data.resultType == 0){
debugger
this.btnLoading = false
this.$nextTick(() => {
this.$refs.JNPFForm.init2(res.data.poundlistEntityList)
})
this.active++
// this.visible = false
// this.cancel()
}else if (res.data.resultType == 1) {
this.result = res.data
this.resultList = res.data.failResult
this.btnLoading = false
this.active++
}
}).catch(() => { this.btnLoading = false })
}
if (this.active == 1) {
if (!this.fileList.length || !this.fileName) return this.$message({ message: '请先上传文件', type: 'warning' })
this.btnLoading = true
ImportPreview({ fileName: this.fileName }).then(res => {
this.list = res.data.dataRow
this.btnLoading = false
this.active++
}).catch(() => { this.btnLoading = false })
}
},
cancel(isRefresh) {
this.visible = false
this.$emit('importData', {
checkedList: this.result
})
//if (isRefresh) this.$emit('refresh')
},
init() {
this.active = 1
this.fileList = []
this.fileName = ''
this.visible = true
},
handleDel(index) {
this.list.splice(index, 1)
},
templateDownload() {
TemplateDownload().then(res => {
this.jnpf.downloadFile(res.data.url)
})
},
beforeUpload(file) {
let isRightSize = file.size / 1024 < 500
if (!isRightSize) this.$message.error(`文件大小不能超过500KB`)
return isRightSize
},
handleRemove(file, fileList) {
this.fileList = []
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`).catch(() => { })
},
handleChange(file, fileList) {
this.fileList = fileList.slice(-1)
},
handleSuccess(res, file, fileList) {
if (res.code == 200) {
this.fileList = fileList.slice(-1)
this.fileName = res.data.name
} else {
this.fileList = fileList.filter(o => o.uid != file.uid)
this.$message({ message: res.msg, type: 'error', duration: 1000 })
}
},
}
}
</script>

@ -0,0 +1,855 @@
<template>
<el-dialog :title="!dataForm.id ? '编辑合同与图片' : isDetail ? '编辑合同与图片':'编辑合同与图片'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" v-if="visible" v-dialogDrag class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="12">
<el-form-item label="磅单上传" prop="poundPictures">
<JNPF-UploadImgB v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="1">
</JNPF-UploadImgB>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车辆图片" prop="vehiclePictures">
<JNPF-UploadImgB v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
</JNPF-UploadImgB>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称" prop="materialId">
<popupSelect disabled v-model="dataForm.materialId" placeholder="请选择物料编码" clearable field="materialId"
interfaceId="381037852907038533" :columnOptions="materialIdcolumnOptions" propsValue="id"
relationField="item_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称" prop="customerId">
<popupSelect v-model="dataForm.customerId" placeholder="请选择客户" clearable field="customerId"
interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id"
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" @change="customerSelect">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售合同" prop="salesId">
<popupSelect v-model="dataForm.salesId" placeholder="请选择合同" clearable field="salesId"
interfaceId="396203872441416837" :columnOptions="salesIdcolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" :bissId="dataForm.customerId"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购合同" prop="purchaseId">
<popupSelect v-model="dataForm.purchaseId" placeholder="请选择合同" clearable field="purchaseId"
interfaceId="397408984857931205" :columnOptions="salesIdcolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" @change="customerSelect2">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商" prop="supplierId">
<popupSelect v-model="dataForm.supplierId" placeholder="请选择客户" clearable field="supplierId"
interfaceId="382494924156735557" :columnOptions="supplierIdcolumnOptions" propsValue="id"
relationField="supplier_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage
:pageSize="20" >
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购价格" prop="purchasePrice">
<el-input-number disabled v-model="dataForm.purchasePrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="销售价格" prop="salesPrice">
<el-input-number disabled v-model="dataForm.salesPrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="收货价格" prop="collectPrice">
<el-input-number v-model="dataForm.collectPrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="毛重" prop="grossWeight">
<el-input-number disabled v-model="dataForm.grossWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="皮重" prop="tareWeight">
<el-input-number disabled v-model="dataForm.tareWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="扣重" prop="buckleWeight">
<el-input-number disabled v-model="dataForm.buckleWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="净重" prop="netWeight">
<el-input-number disabled v-model="dataForm.netWeight" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="车牌号" prop="vehicleId">
<popupSelect disabled v-model="dataForm.vehicleId" placeholder="请选择车辆" clearable field="vehicleId"
interfaceId="381432451370615173" :columnOptions="vehicleIdcolumnOptions" propsValue="id"
relationField="ticketno" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="changePicture"
hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单时间" prop="poundDate">
<el-date-picker disabled v-model="dataForm.poundDate" placeholder="请选择" clearable :style='{"width":"100%"}'
type="date" format="yyyy-MM-dd" value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单号" prop="poundlistNo">
<el-input disabled v-model="dataForm.poundlistNo" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单位 " prop="unit">
<el-select disabled v-model="unit" placeholder="请选择" clearable :style='{"width":"100%"}' @change="unitChange">
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运输类型" prop="transportType">
<el-select disabled v-model="transportType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="transportTypeChange">
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否垫资" prop="advance">
<el-select disabled v-model="advance" placeholder="请选择" clearable :style='{"width":"100%"}' @change="advanceChange">
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运费" prop="transportPrice">
<el-input-number disabled v-model="dataForm.transportPrice" :style='{"width":"100%"}' :precision="6"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="起始地" prop="originPlace">
<JNPF-Address disabled v-model="dataForm.originPlace" placeholder="请选择省市区" clearable :level='2' >
</JNPF-Address>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务员1" prop="businessId">
<popupSelect disabled v-model="dataForm.businessId" placeholder="请选择业务员1" clearable field="businessId"
interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="businessIdcolumnOptions"
propsValue="F_Id" relationField="F_RealName" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
hasPage :pageSize="20" :bissId="dataForm.businessId">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务员2" prop="naturalId">
<popupSelect disabled v-model="dataForm.naturalId" placeholder="请选择业务员2" clearable field="naturalId"
interfaceId="395933800510599301" :columnOptions="naturalIdcolumnOptions" propsValue="id"
relationField="name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20">
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注信息" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail" :disabled="submitDisabled"> </el-button>
<!-- <el-button type="primary" @click="continueUpload()"> </el-button>-->
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
submitDisabled: false,
unit: "0",
transportType: "0",
advance: "0",
action: this.define.APIURl + '/api/tradeupload/Tradeupload/UploaderPondList/annexpic',
imageUrl: '',
code: '100',
fileList: [],
visible: false,
loading: false,
isDetail: false,
dataForm: {
poundPictures: [],
materialId: "",
customerId: "",
supplierId: "",
salesId: "",
vehicleId: "",
vehiclePictures: [],
poundDate: '',
poundlistNo: '',
tareWeight: 0,
grossWeight: 0,
buckleWeight: 0,
netWeight: 0,
unit: "0",
transportType: "0",
originPlace:[],
advance: "0",
transportPrice: 0,
salesPrice: 0,
collectPrice: 0,
purchasePrice: 0,
businessId: "",
naturalId: "",
remark: '',
creatorTime: "",
isExamine: "",
purchaseStatus: 0,
salesStatus: 0,
purchaseIdOld:0,
purchaseId:0,
salesIdOld:0,
salesId:0,
isPayment:0,
},
rules: {
materialId: [{
required: true,
message: '请选择物料编码',
trigger: 'change'
}, ],
customerId: [{
required: true,
message: '请选择客户',
trigger: 'change'
}, ],
supplierId: [{
required: true,
message: '请选择供应商',
trigger: 'change'
}, ],
purchaseId: [{
required: true,
message: '请选择采购合同',
trigger: 'change'
}, ],
salesId: [{
required: true,
message: '请选择合同',
trigger: 'change'
}, ],
vehicleId: [{
required: true,
message: '请选择车辆',
trigger: 'change'
}, ],
// vehiclePictures: [{
// required: true,
// message: '',
// trigger: 'click'
// }, ],
poundDate: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
poundlistNo: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
tareWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
grossWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
buckleWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
netWeight: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
collectPrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
salesPrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
purchasePrice: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
businessId: [{
required: true,
message: '请选择业务员',
trigger: 'change'
}, ],
},
materialIdcolumnOptions: [{
"label": "物料编码",
"value": "item_code"
}, {
"label": "物料名称",
"value": "item_name"
}, {
"label": "单位",
"value": "primary_unit_of_measure"
}, {
"label": "默认入库区",
"value": "in_area"
}, {
"label": "默认出库区",
"value": "out_area"
}, ],
customerIdcolumnOptions: [{
"label": "客户编码",
"value": "supplier_cd"
}, {
"label": "客户名称",
"value": "supplier_nm"
}, {
"label": "地址",
"value": "address"
}, {
"label": "银行账号",
"value": "bank_account"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}],
salesIdcolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
}, {
"label": "合同类型",
"value": "contract_type"
}, {
"label": "供应商/客户名称",
"value": "name"
}, ],
vehicleIdcolumnOptions: [{
"label": "车牌号",
"value": "ticketno"
}, {
"label": "司机",
"value": "drivername"
}, {
"label": "手机号",
"value": "contact"
}, ],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
advanceOptions: [{
"fullName": "否",
"id": "0"
}, {
"fullName": "是",
"id": "1"
}],
businessIdcolumnOptions: [{
"label": "人员名称",
"value": "F_RealName"
}, {
"label": "人员职位",
"value": "F_FullName"
}, ],
naturalIdcolumnOptions: [{
"label": "业务员2名称",
"value": "name"
}, {
"label": "业务员2手机号",
"value": "contact"
}, {
"label": "业务员2地址",
"value": "adress"
}, ],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
unitChange(e){
this.dataForm.unit = e;
},
transportTypeChange(e){
this.dataForm.transportType = e;
},
advanceChange(e){
this.dataForm.advance = e;
},
customerSelect(e, d) {
const query = {
code: d.id
}
request({
url: '/api/example/ContractFile/getListByCustomer',
method: 'post',
data: query
}).then((res) => {
if(res.data.length > 0){
// type
this.dataForm.salesId = res.data[0].id
this.dataForm.salesName = res.data[0].contractName
}
})
},
customerSelect2(a, b) {
this.dataForm.supplierId = b.code;
debugger
},
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
this.dataForm.customerId = res.data.customerId;
this.dataForm.customerName = res.data.customerName;
this.dataForm.salesId = res.data.salesId;
this.dataForm.salesName = res.data.salesName;
this.dataForm.vehicleId = res.data.vehicleId;
this.dataForm.poundDate = res.data.poundDate;
this.dataForm.poundlistNo = res.data.poundlistNo;
this.dataForm.tareWeight = res.data.tareWeight;
this.dataForm.grossWeight = res.data.grossWeight;
this.dataForm.buckleWeight = res.data.buckleWeight;
this.dataForm.netWeight = res.data.netWeight;
this.dataForm.vehiclePictures = JSON.parse(res.data.vehiclePictures);
},
changePicture(a, b) {
this.dataForm.vehiclePictures = JSON.parse(b.vehiclephotos);
},
continueUpload() {
var tareWeight = this.dataForm.tareWeight;//
var grossWeight = this.dataForm.grossWeight;//
var buckleWeight = this.dataForm.buckleWeight;//
var netWeight = this.dataForm.netWeight;//
if(grossWeight < tareWeight + buckleWeight + netWeight){
this.$message({
message: '毛重不得小于皮重+扣重+净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= netWeight){
this.$message({
message: '扣重不得大于净重',
type: 'success',
duration: 1000
})
return
}
if(buckleWeight >= grossWeight){
this.$message({
message: '扣重不得大于毛重',
type: 'success',
duration: 1000
})
return
}
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request3()
}
})
},
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
this.dataForm.poundDate = new Date();
this.dataForm.businessId = this.$store.state.user.userInfo.userId;
this.dataForm.businessName = this.$store.state.user.userInfo.userName;
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
var purchaseStatus = this.dataForm.purchaseStatus;//
var salesStatus = this.dataForm.salesStatus;//
var isPayment = this.dataForm.isPayment;
this.dataForm.isExamine = '1';
this.dataForm.unit = this.dataForm.unit ? this.dataForm.unit : 0;
this.dataForm.transportType = this.dataForm.transportType ? this.dataForm.transportType : 0;
this.dataForm.advance = this.dataForm.advance ? this.dataForm.advance : 0;
// var purchaseName1=this.dataForm.purchaseName;
var purchaseIdOld=this.dataForm.purchaseIdOld;
var salesIdOld=this.dataForm.salesIdOld;
if (purchaseIdOld !=this.dataForm.purchaseId ){
if (isPayment==1){
this.$message({
message: '采购订单已经提交付款申请',
type: 'success',
duration: 2500
})
return
}
if (purchaseStatus==0){
this.$message({
message: '采购订单已经生成,现在是待开票状态',
type: 'success',
duration: 2500
})
return
}
if (purchaseStatus==1){
this.$message({
message: '采购订单已经生成,现在是开票中状态',
type: 'success',
duration: 2500
})
return
}
if (purchaseStatus==2){
this.$message({
message: '采购订单已经生成,现在是已入库状态',
type: 'success',
duration: 2500
})
return
}
if (purchaseStatus==3){
this.$message({
message: '采购订单已经生成,现在是归档状态',
type: 'success',
duration: 2500
})
return
}
}
if (salesIdOld !=this.dataForm.salesId ){
if (salesStatus==0){
this.$message({
message: '销售订单已经生成,现在是待发货状态',
type: 'success',
duration: 2500
})
return
}
if (salesStatus==1){
this.$message({
message: '销售订单已经生成,现在是待开票状态',
type: 'success',
duration: 2500
})
return
}
if (salesStatus==2){
this.$message({
message: '销售订单已经生成,现在是待回款状态',
type: 'success',
duration: 2500
})
return
}
if (salesStatus==3){
this.$message({
message: '销售订单已经生成,现在是归档状态',
type: 'success',
duration: 2500
})
return
}
}
// if(grossWeight < tareWeight + buckleWeight + netWeight){
// this.$message({
// message: '++',
// type: 'success',
// duration: 1000
// })
// return
// }
// if(buckleWeight >= netWeight){
// this.$message({
// message: '',
// type: 'success',
// duration: 1000
// })
// return
// }
// if(buckleWeight >= grossWeight){
// this.$message({
// message: '',
// type: 'success',
// duration: 1000
// })
// return
// }
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request2()
}
})
},
request2() {
this.submitDisabled = true;
var _data = this.dataList()
debugger
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 3000,
onClose: () => {
this.submitDisabled = false;
this.visible = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.submitDisabled = false
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 3000,
onClose: () => {
this.submitDisabled = false;
this.visible = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.submitDisabled = false
})
}
},
request3() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
})
})
}
this.dataForm.vehicleId = null;
this.dataForm.vehiclePictures = null;
this.dataForm.poundDate = null;
this.dataForm.poundlistNo = null;
this.dataForm.tareWeight = null;
this.dataForm.grossWeight = null;
this.dataForm.buckleWeight = null;
this.dataForm.netWeight = null;
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/tradeupload/Tradeupload',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/tradeupload/Tradeupload/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
_data.originPlace = JSON.stringify(_data.originPlace)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.advance = _dataAll.advance
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
if(_dataAll.originPlace.length > 0){
_dataAll.originPlace = JSON.parse(_dataAll.originPlace)
}else{
_dataAll.originPlace = []
}
_dataAll.purchaseIdOld = _dataAll.purchaseId;
_dataAll.salesIdOld = _dataAll.salesId;
console.log(_dataAll)
this.dataForm = _dataAll
},
},
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 120px;
height: 120px;
line-height: 120px;
text-align: center;
}
.avatar {
width: 120px;
height: 120px;
display: block;
}
</style>
Loading…
Cancel
Save