From 76fdc4851d86abbf90cd153ba6f1c87acba07fc7 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 02 十一月 2023 19:18:24 +0800
Subject: [PATCH] 搜索公共組件增加筛选功能
---
src/views/operate/scrap/AddScrapDialog.vue | 66 ++++++++++++++++++++++++---------
1 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/src/views/operate/scrap/AddScrapDialog.vue b/src/views/operate/scrap/AddScrapDialog.vue
index f7a8db1..b877a3e 100644
--- a/src/views/operate/scrap/AddScrapDialog.vue
+++ b/src/views/operate/scrap/AddScrapDialog.vue
@@ -125,7 +125,7 @@
<script>
import { getProductList } from "@/api/product/product"
import { getLocationList } from "@/api/overview/overview"
-import { addDisuse, finishDisuse } from "@/api/operate/scrap"
+import { addDisuse, finishDisuse, updateScrap } from "@/api/operate/scrap"
import SimpleSearchInput from "@/components/makepager/SimpleSearchInput"
export default {
name: "AddScrapDialog",
@@ -168,7 +168,7 @@
currentState: "todo", // 褰撳墠鐘舵��
unit: "",
showButton: true,
- isValidateClick: false // 楠岃瘉鏄惁鏄剧ず
+ isValidateClick: false, // 楠岃瘉鏄惁鏄剧ず
}
},
created() {
@@ -246,23 +246,52 @@
},
// 淇濆瓨
saveClick(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.editConfig.infomation.productId = this.productId
- this.editConfig.infomation.productName = this.productName
- this.editConfig.infomation.unit = this.unit
- addDisuse({
- ...this.editConfig.infomation
- }).then((res) => {
- console.log(res)
- this.editConfig.visible = false
- if (res.code === 200) {
- this.$message.success("娣诲姞鎴愬姛")
- this.$parent.getData()
+ if (this.editCommonConfig.title === "鏂板缓") {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ this.editConfig.infomation.productId = this.productId
+ this.editConfig.infomation.productName = this.productName
+ this.editConfig.infomation.unit = this.unit
+ addDisuse({
+ ...this.editConfig.infomation
+ }).then((res) => {
+ console.log(res)
+ this.editConfig.visible = false
+ if (res.code === 200) {
+ this.$message.success("娣诲姞鎴愬姛")
+ this.$parent.getData()
+ }
+ })
+ }
+ })
+ } else if (this.editCommonConfig.title === "缂栬緫") {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ let params={
+ amount: this.editConfig.infomation.amount,
+ baseOperationType: this.editConfig.infomation.baseOperationType,
+ fromLocationId: this.editConfig.infomation.fromLocationId,
+ id: this.editConfig.infomation.id,
+ number: this.editConfig.infomation.number,
+ operationDate: this.editConfig.infomation.operationDate,
+ productId: this.editConfig.infomation.productId,
+ sourceNumber: this.editConfig.infomation.sourceNumber,
+ status: this.editConfig.infomation.status,
+ toLocationId: this.editConfig.infomation.toLocationId
}
- })
- }
- })
+ updateScrap(
+ params
+ ).then((res) => {
+ console.log(res)
+ this.editConfig.visible = false
+ if (res.code === 200) {
+ this.$message.success("淇敼鎴愬姛")
+ this.$parent.getData()
+ }
+ })
+ }
+ })
+ }
},
// 閫夋嫨浜у搧
selProductChange(val) {
@@ -273,6 +302,7 @@
},
// 楠岃瘉
async validateClick() {
+ console.log(this.editConfig.infomation.id, "xxx")
await finishDisuse(this.editConfig.infomation.id).then((res) => {
console.log(res)
this.editConfig.visible = false
--
Gitblit v1.8.0