前端最新版本同步
This commit is contained in:
@@ -1173,16 +1173,16 @@ function handleLocationClick(id,purposeLocationId,itemId, index) {
|
||||
form.purchaseinventoryList[index].startTime = formatDateymd(res.data[0].productionDate)|| "";
|
||||
form.purchaseinventoryList[index].endTime = formatDateymd(res.data[0].expirationDate) || "";
|
||||
|
||||
form.purchaseinventoryList[index].unitCode = form.purchaseinventoryList[index].unitList.minUnitCode
|
||||
form.purchaseinventoryList[index].unitCode_dictText = form.purchaseinventoryList[index].unitList.minUnitCode_dictText
|
||||
form.purchaseinventoryList[index].unitCode = form.purchaseinventoryList[index].unitList.unitCode
|
||||
form.purchaseinventoryList[index].unitCode_dictText = form.purchaseinventoryList[index].unitList.unitCode_dictText
|
||||
|
||||
// 单价 大单位单价
|
||||
if(form.purchaseinventoryList[index].unitCode==form.purchaseinventoryList[index].unitList.minUnitCode){
|
||||
if(form.purchaseinventoryList[index].unitCode==form.purchaseinventoryList[index].unitList.unitCode){
|
||||
form.purchaseinventoryList[index].price = res.data[0].price / form.purchaseinventoryList[index].partPercent|| "";
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(4);
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
|
||||
}else{
|
||||
if(form.purchaseinventoryList[index].price>1){
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(4);
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
|
||||
}
|
||||
}
|
||||
startTimeOld.value = form.purchaseinventoryList[index].startTime?form.purchaseinventoryList[index].startTime:''
|
||||
@@ -1250,27 +1250,29 @@ function editBatchTransfer(index){
|
||||
// 单位处理
|
||||
function handleUnitCodeChange(row, index, value) {
|
||||
// 防止点击和已选一样的问题
|
||||
if(!form.purchaseinventoryList[index].statusMaxvalue&&Number(row.measurementUnitCode)==Number(value)){
|
||||
return
|
||||
}
|
||||
// if(!form.purchaseinventoryList[index].statusMaxvalue&&Number(row.measurementUnitCode)==Number(value)){
|
||||
// return
|
||||
// }
|
||||
console.log(row.minUnitCode, value)
|
||||
console.log(form.purchaseinventoryList[index])
|
||||
if (row.minUnitCode == value) { //最小计量单位
|
||||
form.purchaseinventoryList[index].totalSourceQuantity = form.purchaseinventoryList[index].oldtotalSourceQuantity
|
||||
form.purchaseinventoryList[index].totalPurposeQuantity = form.purchaseinventoryList[index].oldtotalPurposeQuantity
|
||||
form.purchaseinventoryList[index].itemQuantity = 0
|
||||
form.purchaseinventoryList[index].totalPrice = 0
|
||||
// form.purchaseinventoryList[index].itemQuantity = form.purchaseinventoryList[index].olditemQuantity
|
||||
// form.purchaseinventoryList[index].itemQuantity = 0
|
||||
// form.purchaseinventoryList[index].totalPrice = 0
|
||||
form.purchaseinventoryList[index].itemQuantity = form.purchaseinventoryList[index].oldtotalPurposeQuantity
|
||||
|
||||
// 单价
|
||||
form.purchaseinventoryList[index].price =
|
||||
form.purchaseinventoryList[index].price / row.partPercent;
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(4);
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
|
||||
} else { // 切换成大的计量单位
|
||||
form.purchaseinventoryList[index].itemQuantity = 0
|
||||
form.purchaseinventoryList[index].totalPrice = 0
|
||||
// form.purchaseinventoryList[index].itemQuantity = 0
|
||||
// form.purchaseinventoryList[index].totalPrice = 0
|
||||
getMaxCounts(row,index)
|
||||
}
|
||||
form.purchaseinventoryList[index].statusMaxvalue = true
|
||||
|
||||
handleTotalPrice(index)
|
||||
editBatchTransfer(index)
|
||||
}
|
||||
function getMaxCounts(row,index,counts){
|
||||
@@ -1292,6 +1294,8 @@ function getMaxCounts(row,index,counts){
|
||||
form.purchaseinventoryList[index].totalPurposeQuantity / row.partPercent;
|
||||
|
||||
const integerPart2 = Math.floor(form.purchaseinventoryList[index].totalPurposeQuantity); // 获取整数部分
|
||||
|
||||
form.purchaseinventoryList[index].itemQuantity = integerPart1
|
||||
const decimalPart2 = form.purchaseinventoryList[index].totalPurposeQuantity - integerPart2; // 获取小数部分
|
||||
|
||||
if(decimalPart2){
|
||||
@@ -1313,7 +1317,7 @@ function getMaxCounts(row,index,counts){
|
||||
}else{
|
||||
form.purchaseinventoryList[index].price =
|
||||
form.purchaseinventoryList[index].price * row.partPercent;
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(4);
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
|
||||
}
|
||||
}
|
||||
// 计算总价
|
||||
@@ -1324,7 +1328,7 @@ function handleTotalPrice(index) {
|
||||
if (purchaseItem.price > 0 && purchaseItem.itemQuantity > 0) {
|
||||
form.purchaseinventoryList[index].totalPrice =
|
||||
purchaseItem.price * purchaseItem.itemQuantity;
|
||||
form.purchaseinventoryList[index].totalPrice = form.purchaseinventoryList[index].totalPrice.toFixed(4);
|
||||
form.purchaseinventoryList[index].totalPrice = form.purchaseinventoryList[index].totalPrice.toFixed(2);
|
||||
}
|
||||
if(form.purchaseinventoryList[index].itemQuantity==0){
|
||||
form.purchaseinventoryList[index].totalPrice = 0
|
||||
@@ -1362,7 +1366,7 @@ function handleSave() {
|
||||
}
|
||||
if(rows.unitCode == rows.unitCode_dictText){
|
||||
if(rows.unitCode_dictText == rows.unitList.minUnitCode_dictText){
|
||||
rows.unitCode = rows.unitList.minUnitCode
|
||||
rows.unitCode = rows.unitList.unitCode
|
||||
}else{
|
||||
rows.unitCode = rows.unitList.unitCode
|
||||
rows.unitCode_dictText = rows.unitList.unitCode_dictText
|
||||
@@ -1438,6 +1442,7 @@ function addTransferProducts(rowList){
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, 'selection')
|
||||
// selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.id);
|
||||
selectedRows.value = selection;
|
||||
@@ -1499,7 +1504,12 @@ function handleScan(row,index){
|
||||
currentIndex.value = index
|
||||
}
|
||||
function submit(value){
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo = value;
|
||||
if (form.purchaseinventoryList[currentIndex.value].traceNo) {
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo =
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo + ',' + value;
|
||||
} else {
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo = value;
|
||||
}
|
||||
openTraceNoDialog.value = false;
|
||||
}
|
||||
|
||||
@@ -1561,8 +1571,8 @@ function getDetailAll(){
|
||||
forms.purchaseinventoryList[index].totalPurposeQuantity = forms.purchaseinventoryList[index].totalPurposeQuantity?forms.purchaseinventoryList[index].totalPurposeQuantity:0
|
||||
if(e.unitList&&e.unitCode){
|
||||
forms.purchaseinventoryList[index].unitList = e.unitList[0]?e.unitList[0]:e.unitList //计量单位回显数组
|
||||
forms.purchaseinventoryList[index].unitCode = forms.purchaseinventoryList[index].measurementUnitCode
|
||||
forms.purchaseinventoryList[index].unitCode_dictText = forms.purchaseinventoryList[index].measurementUnitCode_dictText;
|
||||
forms.purchaseinventoryList[index].unitCode = forms.purchaseinventoryList[index].unitCode
|
||||
forms.purchaseinventoryList[index].unitCode_dictText = forms.purchaseinventoryList[index].unitCode_dictText;
|
||||
if(forms.purchaseinventoryList[index].measurementUnitCode == forms.purchaseinventoryList[index].unitList.unitCode){ // 回显大单位
|
||||
getMaxCountsAll(e,index,1)
|
||||
}
|
||||
@@ -1571,16 +1581,16 @@ function getDetailAll(){
|
||||
// 单价 大单位单价
|
||||
if(forms.purchaseinventoryList[index].measurementUnitCode == forms.purchaseinventoryList[index].unitList.minUnitCode){
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price / forms.purchaseinventoryList[index].partPercent|| "";
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price.toFixed(4);
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price.toFixed(2);
|
||||
}else{
|
||||
if(forms.purchaseinventoryList[index].price>1){
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price.toFixed(4);
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price.toFixed(2);
|
||||
}
|
||||
}
|
||||
if (forms.purchaseinventoryList[index].price > 0 && forms.purchaseinventoryList[index].itemQuantity > 0) {
|
||||
forms.purchaseinventoryList[index].totalPrice =
|
||||
forms.purchaseinventoryList[index].price * forms.purchaseinventoryList[index].itemQuantity;
|
||||
forms.purchaseinventoryList[index].totalPrice = forms.purchaseinventoryList[index].totalPrice.toFixed(4);
|
||||
forms.purchaseinventoryList[index].totalPrice = forms.purchaseinventoryList[index].totalPrice.toFixed(2);
|
||||
}
|
||||
}else{
|
||||
forms.purchaseinventoryList[index].price = 0
|
||||
@@ -1631,7 +1641,7 @@ function getMaxCountsAll(row,index,counts){
|
||||
}else{
|
||||
forms.purchaseinventoryList[index].price =
|
||||
forms.purchaseinventoryList[index].price * row.partPercent;
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price.toFixed(4);
|
||||
forms.purchaseinventoryList[index].price = forms.purchaseinventoryList[index].price.toFixed(2);
|
||||
}
|
||||
}
|
||||
function getDetail(type){
|
||||
@@ -1680,27 +1690,27 @@ function getDetail(type){
|
||||
form.purchaseinventoryList[index].totalPurposeQuantity = form.purchaseinventoryList[index].totalPurposeQuantity?form.purchaseinventoryList[index].totalPurposeQuantity:0
|
||||
if(e.unitList&&e.unitCode){
|
||||
form.purchaseinventoryList[index].unitList = e.unitList[0]?e.unitList[0]:e.unitList //计量单位回显数组
|
||||
form.purchaseinventoryList[index].unitCode = form.purchaseinventoryList[index].measurementUnitCode
|
||||
form.purchaseinventoryList[index].unitCode_dictText = form.purchaseinventoryList[index].measurementUnitCode_dictText;
|
||||
if(form.purchaseinventoryList[index].measurementUnitCode == form.purchaseinventoryList[index].unitList.unitCode){ // 回显大单位
|
||||
form.purchaseinventoryList[index].unitCode = form.purchaseinventoryList[index].unitCode
|
||||
form.purchaseinventoryList[index].unitCode_dictText = form.purchaseinventoryList[index].unitCode_dictText;
|
||||
if(form.purchaseinventoryList[index].unitCode == form.purchaseinventoryList[index].unitList.unitCode){ // 回显大单位
|
||||
getMaxCounts(e,index,1)
|
||||
}
|
||||
}
|
||||
if(e.price){
|
||||
// 单价 大单位单价
|
||||
if(form.purchaseinventoryList[index].measurementUnitCode == form.purchaseinventoryList[index].unitList.minUnitCode){
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price / form.purchaseinventoryList[index].partPercent|| "";
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(4);
|
||||
// form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price / form.purchaseinventoryList[index].partPercent|| "";
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
|
||||
// parseFloat(form.purchaseinventoryList[index].price.toFixed(4))
|
||||
}else{
|
||||
if(form.purchaseinventoryList[index].price>1){
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(4);
|
||||
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price.toFixed(2);
|
||||
}
|
||||
}
|
||||
if (form.purchaseinventoryList[index].price > 0 && form.purchaseinventoryList[index].itemQuantity > 0) {
|
||||
form.purchaseinventoryList[index].totalPrice =
|
||||
form.purchaseinventoryList[index].price * form.purchaseinventoryList[index].itemQuantity;
|
||||
form.purchaseinventoryList[index].totalPrice = form.purchaseinventoryList[index].totalPrice.toFixed(4);
|
||||
form.purchaseinventoryList[index].totalPrice = form.purchaseinventoryList[index].totalPrice.toFixed(2);
|
||||
}
|
||||
}else{
|
||||
form.purchaseinventoryList[index].price = 0
|
||||
@@ -1821,6 +1831,7 @@ function getBusNoInitList() {
|
||||
queryParams.value.busNo = receiptHeaderForm.busNo
|
||||
getTransferProductDetail(queryParams.value).then((res) => {
|
||||
form.purchaseinventoryList = res.data.records?res.data.records:res.data
|
||||
receiptHeaderForm.occurrenceTime = res.data.records[0].occurrenceTime ? formatDate(res.data.records[0].occurrenceTime) : new Date()
|
||||
total.value = res.data.total
|
||||
getDetail(1)
|
||||
getAllBatchList(2)
|
||||
|
||||
Reference in New Issue
Block a user