From 264df5679b62140636c726717534c553d595e296 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 15 Aug 2022 11:38:39 +0800
Subject: [PATCH] 修复选择出库农资时,会给出当前所有出库农资数据的问题
---
src/views/wel/farming.vue | 15 +++++++--------
src/views/task/task.vue | 31 +++++++++++++++++++++----------
2 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/src/views/task/task.vue b/src/views/task/task.vue
index 19fb4bc..b4b0e60 100644
--- a/src/views/task/task.vue
+++ b/src/views/task/task.vue
@@ -68,6 +68,7 @@
import {getList, getDetail, add, update, remove, updatechuli} from "@/api/task/task";
import {mapGetters} from "vuex";
import {getLandList} from "@/api/land/land";
+import {selectStockFa} from "@/api/stockfactory/stockfactory";
export default {
data() {
@@ -159,7 +160,8 @@
prop: "stockId",
hide: true,
type: "tree",
- dicUrl: `/api/soldr/soldr/selectSol`,
+ dicData:[],
+ // dicUrl: `/api/soldr/soldr/selectSol`,
props: {
label: "spn",
value: "id"
@@ -583,16 +585,10 @@
},
immediate: true,
},
- '$farmId':{
+ '$farmId':{
handler (newName, oldName) {
- //获取农地数据
- getLandList(this.$farmId).then((res) => {
- if (res.data.code == 200) {
- var landIdcolumn = this.findObject(this.option.column, "landId")
- this.landList = res.data.data
- landIdcolumn.dicData = res.data.data
- }
- })
+ this.getLandList()
+ this.getSoldrList()
this.query={}
this.onLoad(this.page)
}
@@ -642,6 +638,10 @@
this.gradeBoxVisiblechuli = true;
},
initData() {
+ this.getLandList()
+ this.getSoldrList()
+ },
+ getLandList(){
var that = this;
//获取农地数据
getLandList(this.$farmId).then((res) => {
@@ -652,6 +652,17 @@
}
})
},
+ getSoldrList(){
+ var that = this;
+ //获取农资
+ selectStockFa(this.$farmId).then((res) => {
+ if (res.data.code == 200) {
+ console.log(res,1111111111111)
+ var stockIdcolumn = that.findObject(that.option.column, "stockId");
+ stockIdcolumn.dicData = res.data.data;
+ }
+ });
+ },
rowSave(row, done, loading) {
if(row.tp.length<=0){
row.tp=""
diff --git a/src/views/wel/farming.vue b/src/views/wel/farming.vue
index 0a449a4..9d1a30b 100644
--- a/src/views/wel/farming.vue
+++ b/src/views/wel/farming.vue
@@ -246,10 +246,9 @@
methods: {
getDe(val) {
if (val.value!='') {
- getDetail(val.value
- ).then(res => {
- var amount1 = res.data.data.amount1;
- this.form.num = amount1
+ getDetail(val.value,this.$farmId).then(res => {
+ var amount1 = res.data.data.amount1;
+ this.form.num = amount1
var numz = this.findObject(this.option.column, "num");
var numzs = this.findObject(this.option.column, "snum");
numz.display = true;
@@ -310,7 +309,7 @@
}
});
//获取农资
- selectStockFa().then((res) => {
+ selectStockFa(this.$farmId).then((res) => {
if (res.data.code == 200) {
var stockIdcolumn = that.findObject(that.option.column, "stockId");
stockIdcolumn.dicData = res.data.data;
@@ -322,9 +321,9 @@
submit(row, done) {
var that = this;
row['tenantId'] = this.userInfo.tenant_id;
- row['deptId'] = this.userInfo.dept_id;
- if (row.snum > row.num) {
- this.$message.warning("使用农资数量大于农资数量");
+ row['deptId'] = this.$farmId;
+ if (row.snum > row.num || row.snum <=0) {
+ this.$message.warning("使用数量小于等于0或大于库存数量");
done();
}
else {
--
Gitblit v1.9.3