前端最新版本同步

This commit is contained in:
Zhang.WH
2025-09-25 10:36:07 +08:00
parent a3a06d6f3c
commit 1276dc4adb
117 changed files with 11964 additions and 2466 deletions

View File

@@ -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)

View File

@@ -83,7 +83,7 @@
</el-form-item>
<el-form-item label="单据日期:">
<el-date-picker
v-model="receiptHeaderForm.occurrence_time"
v-model="receiptHeaderForm.occurrenceTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetime"
:disabled="data.isEdit"
@@ -757,7 +757,7 @@ const form = reactive({
const rowList = ref([])
const receiptHeaderForm = reactive({
busNo: undefined,
occurrence_time: formatDate(new Date()),
occurrenceTime: formatDate(new Date()),
});
const data = reactive({
@@ -827,7 +827,7 @@ watch(
if (newVlaue&&!route.query.supplyBusNo) {
form.purchaseinventoryList = newVlaue?.purchaseinventoryList
receiptHeaderForm.busNo = newVlaue?.receiptHeaderForm.busNo
receiptHeaderForm.occurrence_time = newVlaue?.receiptHeaderForm.occurrence_time
receiptHeaderForm.occurrenceTime = newVlaue?.receiptHeaderForm.occurrenceTime
receiptHeaderForm.sourceTypeEnum = newVlaue?.receiptHeaderForm.sourceTypeEnum
handleChangeSourceTypeEnum(receiptHeaderForm.sourceTypeEnum,1)
receiptHeaderForm.sourceLocationId = newVlaue?.receiptHeaderForm.sourceLocationId
@@ -915,7 +915,7 @@ function addNewRow() {
const newRow = {
id: "",
supplyBusNo:"",
occurrence_time:"",
occurrenceTime:"",
typeEnum_enumText:"",
statusEnum_enumText:"",
sourceTypeEnum:"",
@@ -1011,7 +1011,7 @@ function handleBlur(row, index) {
row.applyTime = formatDate(row.applyTime)
row.startTime = formatDateymd(row.startTime)
row.endTime = formatDateymd(row.endTime)
row.occurrence_time = receiptHeaderForm.occurrence_time;
row.occurrenceTime = receiptHeaderForm.occurrenceTime;
let sourceTypeEnum = warehous_type.value.filter(e=>{return e.label==receiptHeaderForm.sourceTypeEnum})
@@ -1041,6 +1041,7 @@ function getTransferProductDetails(type){
getTransferProductDetail(queryParams.value).then((res) => {
form.purchaseinventoryList = res.data.records
receiptHeaderForm.occurrenceTime = formatDate(res.data.records[0].occurrenceTime)
total.value = res.data.total;
form.purchaseinventoryList.map((e,index)=>{
e.isSave = true
@@ -1091,16 +1092,16 @@ function getTransferProductDetails(type){
// 单价 大单位单价
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.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);
}
}
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
@@ -1165,16 +1166,16 @@ function getTransferProductDetails(type){
// 单价 大单位单价
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
@@ -1329,11 +1330,11 @@ function handleLocationClick(id,purposeLocationId,itemId, index) {
// 单价 大单位单价
if(form.purchaseinventoryList[index].unitCode==form.purchaseinventoryList[index].unitList.minUnitCode){
form.purchaseinventoryList[index].price = res.data[0].price / form.purchaseinventoryList[index].partPercent|| "";
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price>0?form.purchaseinventoryList[index].price.toFixed(4):0
form.purchaseinventoryList[index].price = form.purchaseinventoryList[index].price>0?form.purchaseinventoryList[index].price.toFixed(2):0
}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);
}
}
// handleUnitCodeChange(form.purchaseinventoryList[index], index, form.purchaseinventoryList[index].unitCode)
@@ -1410,7 +1411,7 @@ function handleUnitCodeChange(row, index, value) {
// 单价
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 { // 切换成大的计量单位
@@ -1462,7 +1463,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 getMaxCounts(row,index,counts){
@@ -1506,7 +1507,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);
}
}
//修改备注
@@ -1527,7 +1528,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);
// parseFloat(form.purchaseinventoryList[index].totalPrice.toFixed(4))
}
if(form.purchaseinventoryList[index].itemQuantity==0){
@@ -1687,7 +1688,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;
}
/** 选择条数 */