问题修改

product
杨世强 2 years ago
parent de7822f5f5
commit 7e8e1d2478

@ -589,6 +589,10 @@ public class PoundlistController {
PoundlistEntity entity= poundlistService.getInfo(id);
if(entity!=null){
entity.setIsExamine("0");
entity.setPurchaseId(null);
entity.setSupplierId(null);
entity.setSupplierName(null);
entity.setPurchasePrice(null);
poundlistService.updateById(entity);
return ActionResult.success("驳回成功");
}

@ -19,6 +19,7 @@ import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.service.PoundlistService;
import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.purchaseorder.entity.Purchaseorder_item0Entity;
import jnpf.purchaseorder.entity.PurchaseorderitemEntity;
import jnpf.purchaseorder.service.PurchaseorderitemService;
import jnpf.reservoirarea.entity.ReservoirareaEntity;
@ -56,6 +57,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
import java.util.*;
import java.util.stream.Collectors;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
@ -121,9 +123,9 @@ public class ReceiptinController {
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
}*/
List<ReceiptinListVO> listVO=JsonUtil.getJsonToList(list,ReceiptinListVO.class);
/*for(ReceiptinListVO receiptinVO:listVO){
for(ReceiptinListVO receiptinVO:listVO){
}
*/
PageListVO vo=new PageListVO();
vo.setList(listVO);
@ -339,19 +341,23 @@ public class ReceiptinController {
//子表
List<Receiptin_item0Entity> Receiptin_item0List = receiptinService.GetReceiptin_item0List(id);
for(Receiptin_item0Entity receiptin_item0Entity : Receiptin_item0List){
if(StringUtils.isNotEmpty(receiptin_item0Entity.getReservoirareaId())){
for(Receiptin_item0Entity receiptin_item0Entity : Receiptin_item0List) {
if (StringUtils.isNotEmpty(receiptin_item0Entity.getReservoirareaId())) {
ReservoirareaEntity reservoirareaEntity = reservoirareaService.getById(receiptin_item0Entity.getReservoirareaId());
if(reservoirareaEntity != null){
if (reservoirareaEntity != null) {
receiptin_item0Entity.setReservoirareaName(reservoirareaEntity.getAreaname());
}
}
if(StringUtils.isNotEmpty(receiptin_item0Entity.getWarehouseId())){
if (StringUtils.isNotEmpty(receiptin_item0Entity.getWarehouseId())) {
WareHouseEntity wareHouseEntity = wareHouseService.getById(receiptin_item0Entity.getWarehouseId());
if(wareHouseEntity != null){
if (wareHouseEntity != null) {
receiptin_item0Entity.setWarehouseName(wareHouseEntity.getName());
}
}
if (StringUtils.isNotEmpty(receiptin_item0Entity.getPoundlistId())) {
PoundlistEntity poundlistEntity = poundlistService.getById(receiptin_item0Entity.getPoundlistId());
receiptin_item0Entity.setPoundlistEntity(poundlistEntity);
}
}
vo.setReceiptin_item0List(JsonUtil.getJsonToList(Receiptin_item0List,Receiptin_item0Model.class ));
//副表

@ -2,6 +2,7 @@ package jnpf.receiptin.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import jnpf.poundlist.entity.PoundlistEntity;
import lombok.Data;
import java.util.Date;
@ -9,6 +10,8 @@ import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -127,4 +130,7 @@ public class Receiptin_item0Entity {
@TableField(exist = false)
private String reservoirareaName;
@TableField(exist = false)
private PoundlistEntity poundlistEntity;
}

@ -2,6 +2,7 @@ package jnpf.receiptin.model.receiptin;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import jnpf.poundlist.entity.PoundlistEntity;
import lombok.Data;
import java.util.List;
import java.util.Date;
@ -97,4 +98,7 @@ public class Receiptin_item0Model {
@JsonProperty("reservoirareaName")
private String reservoirareaName;
@JsonProperty("poundlistEntity")
private PoundlistEntity poundlistEntity;
}

@ -55,6 +55,7 @@ import javax.validation.Valid;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -538,6 +539,8 @@ public class TradeuploadController {
return ActionResult.fail("磅单重复");
}
entity.setId(mainId);
BigDecimal netWeight = new BigDecimal(tradeuploadCrForm.getNetWeight());
entity.setSettlement(netWeight);
tradeuploadService.save(entity);
return ActionResult.success("创建成功");
}
@ -742,10 +745,10 @@ public class TradeuploadController {
public ActionResult<TradeuploadInfoVO> info(@PathVariable("id") String id){
TradeuploadEntity entity= tradeuploadService.getInfo(id);
TradeuploadInfoVO vo=JsonUtil.getJsonToBean(entity, TradeuploadInfoVO.class);
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
//vo.setOriginPlace(generaterSwapUtil.provinceData(vo.getOriginPlace()));
// if(vo.getCreatorTime()!=null){
// vo.setCreatorTime(vo.getCreatorTime());
// }
// vo.setOriginPlace(generaterSwapUtil.provinceData(vo.getOriginPlace()));
//子表
//副表
return ActionResult.success(vo);
@ -804,6 +807,8 @@ public class TradeuploadController {
if(entity!=null){
TradeuploadEntity subentity=JsonUtil.getJsonToBean(tradeuploadUpForm, TradeuploadEntity.class);
subentity.setCreatorTime(entity.getCreatorTime());
BigDecimal netWeight = new BigDecimal(tradeuploadUpForm.getNetWeight());
subentity.setSettlement(netWeight);
QueryWrapper<TradeuploadEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(TradeuploadEntity::getPoundlistNo,entity.getPoundlistNo());
queryWrapper.lambda().eq(TradeuploadEntity::getCustomerId,entity.getCustomerId());

@ -6,8 +6,8 @@
<template v-if="!loading && formOperates">
<el-col :span="6" v-if="judgeShow('documentNo')">
<el-form-item label="单据编号" prop="documentNo">
<el-input :disabled="judgeWrite('documentNo')" v-model="dataForm.documentNo"
placeholder="系统自动生成" disabled >
<el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
@ -18,7 +18,7 @@
<popupSelect v-model="dataForm.supplierId" placeholder="请选择" clearable field="supplierId"
interfaceId="389674191453990661" :columnOptions="supplierIdcolumnOptions"
propsValue="id" relationField="supplier_name" popupType="dialog" popupTitle="选择数据"
popupWidth="800px" hasPage :pageSize="20" :disabled="true">
popupWidth="800px" hasPage :pageSize="20" :disabled="true" :title="dataForm.supplierName">
</popupSelect>
</el-form-item>
@ -26,8 +26,8 @@
<el-col :span="6" v-if="judgeShow('paymentType')">
<el-form-item label="付款类型" prop="paymentType">
<el-select :disabled="judgeWrite('paymentType')" v-model="dataForm.paymentType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-select v-model="dataForm.paymentType"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled" disabled></el-option>
@ -37,9 +37,9 @@
<el-col :span="6" v-if="judgeShow('businessDate')">
<el-form-item label="业务日期" prop="businessDate">
<el-date-picker :disabled="judgeWrite('businessDate')" v-model="dataForm.businessDate"
<el-date-picker v-model="dataForm.businessDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
value-format="timestamp">
value-format="timestamp" readonly>
</el-date-picker>
</el-form-item>
@ -48,7 +48,7 @@
<el-col :span="6" v-if="judgeShow('currency')">
<el-form-item label="币别" prop="currency">
<el-select :disabled="true" v-model="dataForm.currency" placeholder="请选择" clearable
:style='{"width":"100%"}'>
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
@ -59,7 +59,7 @@
<el-col :span="6" v-if="judgeShow('settlementType')">
<el-form-item label="结算类型" prop="settlementType">
<el-select :disabled="judgeWrite('settlementType')" v-model="dataForm.settlementType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
@ -69,8 +69,8 @@
<el-col :span="6" v-if="judgeShow('ramount')">
<el-form-item label="申请金额" prop="ramount">
<el-input-number :disabled="true" v-model="dataForm.ramount" :style='{"width":"100%"}'
placeholder="数字文本" :step="1" :precision="6">
<el-input-number v-model="dataForm.ramount" :style='{"width":"100%"}'
placeholder="数字文本" :step="1" :precision="6" disabled>
</el-input-number>
</el-form-item>
@ -78,8 +78,8 @@
<el-col :span="6" v-if="judgeShow('paymentAmount')">
<el-form-item label="已付款金额" prop="paymentAmount">
<el-input-number :disabled="true" v-model="dataForm.paymentAmount" :style='{"width":"100%"}'
placeholder="数字文本" :step="1" :precision="6">
<el-input-number v-model="dataForm.paymentAmount" :style='{"width":"100%"}'
placeholder="数字文本" :step="1" :precision="6" disabled>
</el-input-number>
</el-form-item>
@ -103,7 +103,7 @@
<el-col :span="6" v-if="judgeShow('collectionAccount')">
<el-form-item label="收款账户" prop="collectionAccount">
<el-input :disabled="judgeWrite('collectionAccount')" v-model="dataForm.collectionAccount"
<el-input v-model="dataForm.collectionAccount"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
@ -112,7 +112,7 @@
<el-col :span="6" v-if="judgeShow('colectionBank')">
<el-form-item label="收款银行" prop="colectionBank">
<el-input :disabled="judgeWrite('colectionBank')" v-model="dataForm.colectionBank"
<el-input v-model="dataForm.colectionBank"
placeholder="请输入" clearable :style='{"width":"100%"}' readonly>
</el-input>
@ -121,9 +121,9 @@
<el-col :span="6" v-if="judgeShow('dueDate')">
<el-form-item label="应付日期" prop="dueDate">
<el-date-picker :disabled="judgeWrite('dueDate')" v-model="dataForm.dueDate"
<el-date-picker v-model="dataForm.dueDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"
value-format="timestamp">
value-format="timestamp" readonly>
</el-date-picker>
</el-form-item>
@ -153,8 +153,8 @@
<el-col :span="12" v-if="judgeShow('remark')">
<el-form-item label="备注" prop="remark">
<el-input :disabled="judgeWrite('remark')" v-model="dataForm.remark" placeholder="请输入"
clearable :style='{"width":"100%"}'>
<el-input v-model="dataForm.remark" placeholder="请输入"
clearable :style='{"width":"100%"}' readonly>
</el-input>
</el-form-item>
@ -190,7 +190,6 @@
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
:disabled="judgeWrite('paymentdocitem0List') || judgeWrite('paymentdocitem0List-amount')"
placeholder="请输入" clearable :style='{"width":"100%"}'
@change="amountChange(scope.row)" readonly>
</el-input>
@ -404,7 +403,7 @@
<el-table-column prop="poundType" label="磅单类型" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.poundType" placeholder="请选择" clearable
:style='{"width":"100%"}' readonly>
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in poundTypeOptions"
:key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled" disabled></el-option>
@ -421,7 +420,7 @@
<el-table-column prop="unit" label="单位" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.unit" placeholder="请选择" clearable
:style='{"width":"100%"}' readonly>
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
@ -432,7 +431,7 @@
:disabled="true">
<template slot-scope="scope">
<el-select v-model="scope.row.advance" placeholder="请选择" clearable
:style='{"width":"100%"}' readonly>
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in advanceOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
@ -456,7 +455,7 @@
<el-table-column prop="rate" label="税率 " align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.rate" placeholder="请选择" clearable
:style='{"width":"100%"}' readonly>
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in rateOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled" disabled></el-option>

@ -622,6 +622,7 @@
},
request2() {
this.submitDisabled = true;
this.dataForm;
var _data = this.dataList()
debugger
if (!this.dataForm.id) {

@ -575,14 +575,14 @@
})
},
handleReturn(row){
/* if(row.purchaseStatus != '99' || row.salesStatus != '99'){
if(row.purchaseStatus != '99' || row.salesStatus != '99'){
this.$message({
type: 'error',
message: '该磅单已生成采购或销售无法删除',
duration: 2500,
})
message: '该磅单当前状态不允许驳回',
duration: 2500
});
return
}*/
}
this.$confirm('是否确认驳回?', '提示', {
type: 'warning'
}).then(() => {

@ -847,8 +847,6 @@
},
methods: {
editPrice(row) {
row.id
debugger
var advanceAmount = 0
var price = 0
var notPrice = 0
@ -858,25 +856,10 @@
rate = parseInt(item.fullName)
}
})
// for (let i = 0;i<this.dataForm.salesorder_item0List.length;i++) {
// this.dataForm.salesorder_item0List[i].price = this.dataForm.salesorder_item0List[i].unitPrice * this.dataForm.salesorder_item0List[i].settlement;
// price = price + parseFloat(this.dataForm.salesorder_item0List[i].price);
// }
this.dataForm.salesorder_item0List.forEach((item, index) => {
if (row.vehicleId == item.vehicleId) {
item.price = this.jnpf.floatMul(item.settlement, item.unitPrice)//
item.noPrice = this.jnpf.floatDiv(this.jnpf.floatMul(item.price, (this.jnpf.floatSub(100, rate))), 100)//
// request({
// url: '/api/saleorder/Saleorderitem/updatePrice'+row.poundlistId,
// method: 'post',
// data: item.price
// }).then((res) => {
// this.$message({
// message: res.msg,
// type: 'success',
// duration: 1000,
// })
// })
}
if (item.advance == '1') {//
advanceAmount = this.jnpf.floatAdd(advanceAmount, item.price)//
@ -887,24 +870,6 @@
this.dataForm.advanceAmount = advanceAmount
this.dataForm.price = price
this.dataForm.notPrice = notPrice
// row.salesPrice = row.unitPrice;
// request({
// url: '/api/saleorder/Saleorderitem/updatePrice',
// method: 'post',
// data: row
// }).then((res) => {
// debugger
// this.$message({
// message: res.msg,
// type: 'success',
// duration: 1000,
// onClose: () => {
// this.visible = false
// this.$emit('refresh', true)
// }
// })
// })
},
getSummaries(param) {
const { columns, data } = param

@ -640,7 +640,7 @@
item.unitPrice = item.price;
item.taxRate = item.rate;
item.amountNotTax = item.notAmount;
item.taxAmount = item.amount - item.notAmount;
item.taxAmount = this.jnpf.floatSub(item.amount, item.notAmount);
});
this.dataForm.invoicesitem1List = purchaseorder.purchaseorder_item0List;
let param = {

@ -447,6 +447,14 @@
});
return
}
if (row.isPayment == '1' || row.isTransfer == '1'){
this.$message({
type: 'error',
message: '已转销售或已提交付款申请无法删除',
duration: 2500
});
return
}
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
@ -697,6 +705,20 @@
})
return
}
var flag = true;
this.multipleSelectionItem[0].poundlistEntityList.forEach((item,index) => {
if (item.salesStatus > 0){
flag = false;
}
})
if (!flag){
this.$message({
type: 'error',
message: '存在已发货的磅单无法入库',
duration: 2500
})
return
}
//id
request({
url: '/api/purchaseorder/Purchaseorder/' + this.multipleSelectionItem[0].id,

@ -656,7 +656,13 @@
this.dataForm.receiptin_item0List.forEach((item, index) => {
item.purchaseorderitemId = item.id;
item.num = item.settlement;
item.rateamount = item.amount - item.notAmount;
// item.rateamount = this.jnpf.floatDiv(item.amount,) - item.notAmount;
this.rateOptions.find((item2) => {
if (item.rate == item2.id) {
item.rateamount =this.jnpf.floatDiv(item.amount,this.jnpf.floatAdd(1, this.jnpf.floatDiv(item2.fullName,100))).toFixed(2)
debugger
}
})
item.id = '';
});
let param = {
@ -695,6 +701,20 @@
})
},
request() {
var flag = true;
this.dataForm.receiptin_item0List.forEach((item,index) => {
if (item.reservoirareaName == null || item.reservoirareaName == ''){
flag = false;
}
})
if (!flag){
this.$message({
message: res.msg,
type: 'success',
duration: 2000
})
return
}
this.submitDisabled = true;
var _data = this.dataList()
if (!this.dataForm.id) {

@ -110,7 +110,7 @@
<el-tabs v-model="activevpzhms" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24">
<el-form-item label-width="0">
<el-form-item label-width="0" :rules="rules">
<div class="JNPF-common-title">
<h2></h2>
</div>
@ -636,6 +636,32 @@
})
},
request() {
var flag = true;
var statusFlag = true;
this.dataForm.receiptin_item0List.forEach((item,index) => {
if (item.reservoirareaName == null || item.reservoirareaName == ''){
flag = false;
}
if (item.poundlistEntity.salesStatus > 0){
statusFlag = false;
}
})
if (!flag){
this.$message({
message: res.msg,
type: 'success',
duration: 2000
})
return
}
if (!statusFlag){
this.$message({
type: 'error',
message: '存在已发货的磅单无法入库',
duration: 2500
})
return
}
this.submitDisabled = true;
var _data = this.dataList()
if (!this.dataForm.id) {

@ -815,7 +815,6 @@
message: '请在备注说明修改单价原因',
duration: 2500,
})
return
}
item.price = this.jnpf.floatMul(item.unitPrice,item.settlement);//
debugger
@ -824,20 +823,6 @@
item.noPrice = this.jnpf.floatDiv(this.jnpf.floatMul(item.price,(this.jnpf.floatSub(100,item2.fullName))), 100);//
}
});
// let params = {}
// params.id = row.poundlistId
// params.salesPrice = item.unitPrice
// request({
// url: '/api/saleorder/Saleorderitem/updatePrice',
// method: 'post',
// data: params
// }).then((res) => {
// this.$message({
// message: res.msg,
// type: 'success',
// duration: 1000,
// })
// })
}
if (item.advance == '1') {//
advanceAmount = this.jnpf.floatAdd(advanceAmount,item.price);//

@ -8,7 +8,7 @@
<el-col :span="12">
<el-form-item label="磅单上传" prop="poundPictures">
<JNPF-UploadImg2B v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="1"
@change="imgChange" ref="poundUpload">
@change="imgChange" ref="poundUpload" >
</JNPF-UploadImg2B>
</el-form-item>
@ -25,7 +25,7 @@
<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">
popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20" disabled>
</popupSelect>
</el-form-item>
@ -35,7 +35,7 @@
<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">
popupWidth="800px" hasPage :pageSize="20" @change="customerSelect" >
</popupSelect>
</el-form-item>
@ -50,6 +50,31 @@
</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" disabled>
</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>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购价格" prop="purchasePrice" disabled="">
<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"
@ -177,7 +202,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注信息" clearable
:style='{"width":"100%"}'>
@ -191,7 +216,7 @@
<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()" :disabled="submitDisabled"> 继续上传</el-button>
<!-- <el-button type="primary" @click="continueUpload()" :disabled="submitDisabled"> 继续上传</el-button>-->
</span>
</el-dialog>
</template>
@ -426,7 +451,13 @@
"label": "业务员2地址",
"value": "adress"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}],
}
},
computed: {},
@ -569,22 +600,106 @@
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.dataForm.businessId = this.$store.state.user.userInfo.userId;
this.dataForm.businessName = this.$store.state.user.userInfo.userName;
this.dataForm.poundDate = new Date();
// this.dataForm.businessId = this.$store.state.user.userInfo.userId;
// this.dataForm.businessName = this.$store.state.user.userInfo.userName;
// this.dataForm.poundDate = new Date().getTime();
this.loading = false
});
} else {
this.clearData(this.dataForm)
this.dataForm.businessId = this.$store.state.user.userInfo.userId;
this.dataForm.businessName = this.$store.state.user.userInfo.userName;
this.dataForm.poundDate = new Date();
// this.dataForm.businessId = this.$store.state.user.userInfo.userId;
// this.dataForm.businessName = this.$store.state.user.userInfo.userName;
// this.dataForm.poundDate = new Date();
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
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 {
debugger
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
})
}
},
/* dataFormSubmit() {
var tareWeight = this.dataForm.tareWeight; //
var grossWeight = this.dataForm.grossWeight; //
var buckleWeight = this.dataForm.buckleWeight; //
@ -648,7 +763,7 @@
this.submitDisabled = false
})
}
},
},*/
request3() {
this.submitDisabled = true;
var _data = this.dataList()

@ -0,0 +1,988 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="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-UploadImg2B v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="1"
@change="imgChange" ref="poundUpload" >
</JNPF-UploadImg2B>
</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 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 >
</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>
</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" disabled>
</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>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="采购价格" prop="purchasePrice" disabled="">
<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">
</popupSelect>
</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" :min="0">
</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%"}'
@change="grossWeightChange" :precision="6" :min="0"></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%"}'
@change="grossWeightChange" :precision="6" :min="0"></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%"}'
@change="grossWeightChange" :precision="6" :min="0"></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" :min="0">
</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" :min="0">
</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="请选择业务员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" 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">
</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" :min="0">
</el-input-number>
</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()" :disabled="submitDisabled"> 继续上传</el-button>
</span>
</el-dialog>
</template>
<script>
const units = {
KB: 1024,
MB: 1024 * 1024,
GB: 1024 * 1024 * 1024
}
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,
fileList: [],
uploadHeaders: {
Authorization: this.$store.getters.token
},
value: [],
type: 'annexpic',
disabled: false,
detailed: false,
showTip: false,
limit: 0,
accept: 'image/*',
sizeUnit: 'MB',
fileSize: 5,
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: "",
salesId: "",
vehicleId: "",
vehiclePictures: [],
poundDate: '',
poundlistNo: '',
tareWeight: 0,
grossWeight: 0,
buckleWeight: 0,
collectPrice: 0,
netWeight: 0,
unit: "0",
transportType: "0",
advance: "0",
transportPrice: 0,
originPlace: [],
salesPrice: 0,
businessId: "",
naturalId: "",
remark: '',
creatorTime: "",
},
rules: {
materialId: [{
required: true,
message: '请选择物料编码',
trigger: 'change'
}, ],
customerId: [{
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'
}, ],
businessId: [{
required: true,
message: '请选择业务员',
trigger: 'change'
}, ],
},
materialIdcolumnOptions: [{
"label": "物料编码",
"value": "item_code"
}, {
"label": "物料名称",
"value": "item_name"
}, {
"label": "单位",
"value": "primary_unit_of_measure"
}, {
"label": "默认入库区",
"value": "inareaname"
}, {
"label": "默认出库区",
"value": "outareaname"
}, ],
customerIdcolumnOptions: [{
"label": "客户编码",
"value": "supplier_cd"
}, {
"label": "客户名称",
"value": "supplier_nm"
}, {
"label": "地址",
"value": "address"
}, {
"label": "银行账号",
"value": "bank_account"
}, ],
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_Account"
}, {
"label": "人员职位",
"value": "positionName"
}],
naturalIdcolumnOptions: [{
"label": "业务员2名称",
"value": "name"
}, {
"label": "业务员2手机号",
"value": "contact"
}, {
"label": "业务员2地址",
"value": "adress"
}, ],
supplierIdcolumnOptions: [{
"label": "供应商编码",
"value": "supplier_code"
}, {
"label": "供应商名称",
"value": "supplier_name"
}],
}
},
computed: {},
watch: {
/* value: {
immediate: true,
handler(val) {
this.fileList = val
this.$nextTick(() => {
if (!val.length) {
this.$refs.elUpload && this.$refs.elUpload.uploadFiles.splice(0)
} else {
if (!this.$refs.elUpload) return
this.$refs.elUpload.uploadFiles = val.map(o => ({
...o,
uid: o.fileId
}))
}
})
}
} */
},
created() {},
mounted() {},
methods: {
imgChange(res) {
// 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 > 1000 ? (res.data.tareWeight / 1000).toFixed(6) : res.data
.tareWeight;
this.dataForm.grossWeight = res.data.grossWeight > 1000 ? (res.data.grossWeight / 1000).toFixed(6) : res
.data.grossWeight;
this.dataForm.buckleWeight = res.data.buckleWeight > 1000 ? (res.data.buckleWeight / 1000).toFixed(6) : res
.data.buckleWeight;
if (this.dataForm.netWeight && this.dataForm.netWeight > 0) {
this.dataForm.netWeight = res.data.netWeight > 1000 ? (res.data.netWeight / 1000).toFixed(6) : res.data
.netWeight;
} else {
this.dataForm.netWeight = res.data.grossWeight - res.data.tareWeight - res.data.buckleWeight;
}
if (res.data.vehiclePictures && res.data.vehiclePictures.length > 0) {
this.dataForm.vehiclePictures = JSON.parse(res.data.vehiclePictures);
}
},
grossWeightChange(e, f) {
//this.dataForm.netWeight = this.dataForm.grossWeight - this.dataForm.tareWeight - this.dataForm.buckleWeight;
this.dataForm.netWeight = this.jnpf.floatSub(this.jnpf.floatSub(parseFloat(this.dataForm.grossWeight),
parseFloat(this.dataForm.tareWeight)), parseFloat(this.dataForm.buckleWeight))
},
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
}
})
},
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; //
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 != this.jnpf.floatAdd(tareWeight, this.jnpf.floatAdd(buckleWeight, netWeight))) {
this.$message({
message: '毛重必须等于皮重+扣重+净重',
type: 'warning',
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.value = [];
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.dataForm.businessId = this.$store.state.user.userInfo.userId;
// this.dataForm.businessName = this.$store.state.user.userInfo.userName;
// this.dataForm.poundDate = new Date().getTime();
this.loading = false
});
} else {
this.clearData(this.dataForm)
// this.dataForm.businessId = this.$store.state.user.userInfo.userId;
// this.dataForm.businessName = this.$store.state.user.userInfo.userName;
// this.dataForm.poundDate = new Date();
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
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.id = '';
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 {
debugger
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
})
}
},
/* 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 != this.jnpf.floatAdd(tareWeight, this.jnpf.floatAdd(buckleWeight, netWeight))) {
this.$message({
message: '毛重必须等于皮重+扣重+净重',
type: 'error',
duration: 1000
})
return
}
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request2()
}
})
},
request2() {
this.submitDisabled = true;
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.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: 1000,
onClose: () => {
this.submitDisabled = false;
this.visible = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.submitDisabled = false
})
}
},*/
request3() {
this.submitDisabled = true;
this.dataForm.id = '';
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.submitDisabled = false;
this.dataForm.id = '';
this.dataForm.tareWeight = 0; //
this.dataForm.grossWeight = 0; //
this.dataForm.buckleWeight = 0; //
this.dataForm.netWeight = 0; //
this.dataForm.poundlistNo = '';
this.$refs.poundUpload.handleRemove(0);
}
})
}).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: 1000,
onClose: () => {
this.submitDisabled = false;
this.dataForm.id = '';
this.dataForm.tareWeight = 0; //
this.dataForm.grossWeight = 0; //
this.dataForm.buckleWeight = 0; //
this.dataForm.netWeight = 0; //
this.dataForm.poundlistNo = '';
this.$refs.poundUpload.handleRemove(0);
}
})
}).catch(() => {
this.submitDisabled = false
})
}
},
request() {
this.submitDisabled = true;
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.submitDisabled = false;
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.submitDisabled = false;
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
_dataAll.poundPictures = []
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
if (_dataAll.originPlace.length > 0) {
_dataAll.originPlace = JSON.parse(_dataAll.originPlace)
} else {
_dataAll.originPlace = []
}
this.value = _dataAll.poundPictures;
_dataAll.id = '';
_dataAll.tareWeight = 0; //
_dataAll.grossWeight = 0; //
_dataAll.buckleWeight = 0; //
_dataAll.netWeight = 0; //
_dataAll.poundlistNo = '';
//this.$refs.poundUpload.handleRemove(0);
this.dataForm = _dataAll
},
beforeUpload(file) {
const unitNum = units[this.sizeUnit];
if (!this.fileSize) return true
let isRightSize = file.size / unitNum < this.fileSize
if (!isRightSize) {
this.$message.error(`图片大小超过${this.fileSize}${this.sizeUnit}`)
return isRightSize;
}
let isAccept = new RegExp('image/*').test(file.type)
if (!isAccept) {
this.$message.error(`请上传图片`)
return isAccept;
}
return isRightSize && isAccept;
},
/* 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);
}, */
handleSuccess(res, file, fileList) {
if (res.code == 200) {
this.fileList.push({
name: file.name,
fileId: res.data.vo.name,
url: res.data.vo.url
})
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);
this.dataForm.poundPictures = this.fileList;
if (res.data.grossWeight >= 1000) {
this.dataForm.unit = '1';
this.unit = '1';
}
/* this.$emit('input', this.fileList)
this.$emit('change', this.fileList) */
} else {
this.$refs.elUpload.uploadFiles.splice(fileList.length - 1, 1)
fileList.filter(o => o.uid != file.uid)
this.$emit('input', this.fileList)
this.$emit('change', this.fileList)
this.$message({
message: res.msg,
type: 'error',
duration: 2500
})
}
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制最多可以上传${this.limit}张图片`)
},
handlePictureCardPreview(index) {
this.$refs['image' + index][0].clickHandler()
},
handleRemove(index) {
this.fileList.splice(index, 1)
this.$refs.elUpload.uploadFiles.splice(index, 1)
this.$emit("input", this.fileList)
this.$emit('change', this.fileList)
},
getImgList(list) {
const newList = list.map(o => this.define.comUrl + o.url)
return newList
}
},
}
</script>
<style lang="scss" scoped>
>>>.el-upload-list--picture-card .el-upload-list__item {
width: 120px;
height: 120px;
}
>>>.el-upload--picture-card {
width: 120px;
height: 120px;
line-height: 120px;
}
.upload-btn {
display: inline-block;
}
</style>

@ -154,6 +154,9 @@
<el-table-column label="操作" align="center" fixed="right"
width="200">
<template slot-scope="scope">
<el-button type="text"
@click="continueUpload(scope.row.id)" v-has="'btn_addOrUpdateHandle2'">继续上传
</el-button>
<el-button type="text"
@click="addOrUpdateHandle2(scope.row.id)" v-has="'btn_addOrUpdateHandle2'">审核
</el-button>
@ -174,6 +177,7 @@
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<JNPF-Form2 v-if="formVisible2" ref="JNPFForm2" @refresh="refresh2"/>
<JNPF-Form3 v-if="formVisible3" ref="JNPFForm3" @refresh="refresh3"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div>
@ -184,13 +188,14 @@
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import JNPFForm2 from './Form2'
import JNPFForm3 from './Form3'
import ExportBox from './ExportBox'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default {
components: { JNPFForm, JNPFForm2, ExportBox, Detail },
components: { JNPFForm, JNPFForm2, JNPFForm3, ExportBox, Detail },
data() {
return {
showAll: false,
@ -215,6 +220,7 @@
},
formVisible: false,
formVisible2: false,
formVisible3: false,
exportBoxVisible: false,
columnList: [
{ prop: 'creatorTime', label: '磅单日期' },
@ -257,6 +263,12 @@
this.initData()
},
methods: {
continueUpload(id,isDetail){
this.formVisible3 = true
this.$nextTick(() => {
this.$refs.JNPFForm3.init(id, isDetail)
})
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
@ -391,6 +403,10 @@
this.formVisible2 = false
if (isrRefresh) this.reset()
},
refresh3(isrRefresh) {
this.formVisible2 = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined

Loading…
Cancel
Save