From f45b159864ad79f326884ab3644269ef9eb7ee9d Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期四, 04 一月 2024 11:49:16 +0800
Subject: [PATCH] 出入库bug修复,调整仓库位置字段绑定,编辑时列表绑定源位置
---
src/views/warehouseManage/listingRules/index.vue | 87 +++++++++++++++++++++----------------------
1 files changed, 42 insertions(+), 45 deletions(-)
diff --git a/src/views/warehouseManage/listingRules/index.vue b/src/views/warehouseManage/listingRules/index.vue
index 22a6742..32b3b4c 100644
--- a/src/views/warehouseManage/listingRules/index.vue
+++ b/src/views/warehouseManage/listingRules/index.vue
@@ -27,7 +27,7 @@
@querySearchData="querySearchData"
@selProductClick="selProductClick"
>
- <!--
+ <!--
@selProductTypeClick="selProductTypeClick"
-->
<template slot="tableButton">
@@ -82,15 +82,14 @@
queryProductId: null,
categoryId: null,
searchTaskMap: [],
- isCreate:false,
- thatRow:{},
+ isCreate: false,
+ thatRow: {}
}
},
created() {
this.setTable()
let query = this.$route.query
if (query) {
- console.log("aaaaaaaaaaaaa", query)
this.queryProductId = query.productId?.length ? query.productId : null
this.categoryId = query.id ? Number(query.id) : null
this.pagerOptions.currPage = 1
@@ -111,13 +110,13 @@
selectBox: false,
selectIndex: true,
tableColumn: [
- { label: "褰撲骇鍝佸埌杈�", prop: "areaName", location: true },
+ { label: "褰撲骇鍝佸埌杈�", prop: "areaName", toLocation: true },
{ label: "浜у搧", prop: "productName", product: true },
{ label: "浜у搧绫诲埆", prop: "productCategory", productType: true },
{ label: "瀛樺偍鍒板瓙浣嶇疆", prop: "subLocation", sonLocation: true }
// { label: "鍏徃", prop: "companyName", company: true }
],
- rowClickIndex:-1
+ rowClickIndex: -1
}
},
// 璇锋眰鏁版嵁
@@ -132,7 +131,7 @@
const list = res.data.map((item) => {
return {
...item,
- areaName: { label: item.location.jointName, value: item.location.id },
+ areaName: { label: item.area.jointName, value: item.area.id },
subLocation: { label: item.location.jointName, value: item.location.id },
productName: item.product.name,
productCategory: item.productCategory.name,
@@ -157,7 +156,7 @@
},
// 鏂板
addProductClick() {
- this.isCreate=true
+ this.isCreate = true
this.tableList.tableColumn[1].product = true
this.tableList.tableColumn[2].productType = true
console.log(this.tableData)
@@ -177,7 +176,7 @@
subLocation: "",
productName: "",
companyName: "",
- productCategory:"",
+ productCategory: "",
isSet: true,
isEdit: false,
isOrder: true
@@ -213,14 +212,14 @@
areaId: this.areaId,
locationId: this.subLocationId,
productCategoryId: this.productCategoryId,
- productId: this.productId
+ productId: this.productId
}).then((res) => {
console.log(res)
if (res.code === 200) {
this.getData()
let tipStr = this.currentRowId === 0 ? "娣诲姞鎴愬姛" : "淇敼鎴愬姛"
this.$message.success(tipStr)
- this.isCreate=false
+ this.isCreate = false
}
})
}
@@ -240,7 +239,7 @@
// 鍙栨秷
discardBtnClick() {
this.getData()
- this.isCreate=false
+ this.isCreate = false
this.tableList.tableColumn[1].product = true
this.tableList.tableColumn[2].productType = true
this.addTitle = "鏂板缓"
@@ -279,21 +278,20 @@
},
// 琛岀偣鍑�
tableRowClick(row, rowIndex) {
-
- this.thatRow=row
- this.tableList.rowClickIndex=rowIndex
+ this.thatRow = row
+ this.tableList.rowClickIndex = rowIndex
this.rowIndex = rowIndex
this.isSel()
if (!this.isNoProduct && this.currentRowId === 0) {
this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓")
- }else {
- this.currentRowId = row.id||0
+ } else {
+ this.currentRowId = row.id || 0
this.addTitle = "淇濆瓨"
this.showDiscard = true
this.isRowClick = true
if (this.isNoProduct) {
// this.tableData.splice(this.tableData.length - 1, 1)
- this.tableData.map((item, index) => {
+ this.tableData.map((item, index) => {
if (index === rowIndex) {
item.isEdit = false
item.isOrder = true
@@ -308,25 +306,25 @@
}
}
},
- querySearchData(queryString,results,value){
- if(this.isCreate){
- if(queryString===''){
+ querySearchData(queryString, results, value) {
+ if (this.isCreate) {
+ if (queryString === "") {
this.tableList.tableColumn[1].product = true
this.tableList.tableColumn[2].productType = true
- }else{
- if(value==="product"){
+ } else {
+ if (value === "product") {
this.tableList.tableColumn[2].productType = false
- if(results.length!==0){
- this.productId=results[0].id
- }else{
- this.productId=0
+ if (results.length !== 0) {
+ this.productId = results[0].id
+ } else {
+ this.productId = 0
}
- }else if(value==="productType"){
+ } else if (value === "productType") {
this.tableList.tableColumn[1].product = false
- if(results.length!==0){
- this.productCategoryId=results[0].id
- }else{
- this.productCategoryId=0
+ if (results.length !== 0) {
+ this.productCategoryId = results[0].id
+ } else {
+ this.productCategoryId = 0
}
}
}
@@ -368,14 +366,15 @@
this.subLocationId = item.value
},
// 閫変腑浜у搧鏂规硶
- selProductClick(value,item){
- if(value==="product"){
+ selProductClick(value, item) {
+ console.log(value, item)
+ if (value === "product") {
this.RuleType = 1
this.tableList.tableColumn[2].productType = false
- this.productId=item.id
- this.productCategoryId=item.categoryId
- }else if(value==="productType"){
- this.productCategoryId=item.id
+ this.productId = item.productId
+ this.productCategoryId = item.categoryId
+ } else if (value === "productType") {
+ this.productCategoryId = item.id
this.RuleType = 2
this.tableList.tableColumn[1].product = false
}
@@ -399,19 +398,17 @@
},
watch: {
rowIndex(newVal) {
- if(this.isCreate){
- if(newVal===0){
+ if (this.isCreate) {
+ if (newVal === 0) {
this.tableList.tableColumn[1].product = true
this.tableList.tableColumn[2].productType = true
- }else{
+ } else {
this.$message.error("璇峰畬鎴愬綋鍓嶆柊寤烘垨鍙栨秷鏂板缓")
this.tableList.tableColumn[1].product = false
this.tableList.tableColumn[2].productType = false
}
- }else{
- if (
- this.tableList.tableData[newVal].productName === ""
- ) {
+ } else {
+ if (this.tableList.tableData[newVal].productName === "") {
this.tableList.tableColumn[1].product = false
this.tableList.tableColumn[2].productType = true
} else {
--
Gitblit v1.8.0