From 860a7beb590428703054ed7fb7d007434ec7b138 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 01 Aug 2022 15:32:00 +0800
Subject: [PATCH] 加工产品新增销售、库存损耗功能
---
src/views/farmplant/process.vue | 164 ++++++++++++++++++++++++++++++++--------
src/views/farmplant/farmproductstock.vue | 7 +
src/api/sale/sale.js | 18 ++++
3 files changed, 154 insertions(+), 35 deletions(-)
diff --git a/src/api/sale/sale.js b/src/api/sale/sale.js
index af591b4..52c579b 100644
--- a/src/api/sale/sale.js
+++ b/src/api/sale/sale.js
@@ -52,6 +52,15 @@
})
}
+//销售加工产品
+export const insert = (row) => {
+ return request({
+ url: '/api/sale/sale/submitProcess',
+ method: 'post',
+ data: row
+ })
+}
+
export const getInventoryPage = (current, size, params) => {
return request({
url: '/api/inventory/inventory/page',
@@ -72,6 +81,15 @@
})
}
+//销售加工产品
+export const insertKC = (row) => {
+ return request({
+ url: '/api/inventory/inventory/submitProcess',
+ method: 'post',
+ data: row
+ })
+}
+
export const update = (row) => {
return request({
url: '/api/sale/sale/submit',
diff --git a/src/views/farmplant/farmproductstock.vue b/src/views/farmplant/farmproductstock.vue
index bf81685..f1a832e 100644
--- a/src/views/farmplant/farmproductstock.vue
+++ b/src/views/farmplant/farmproductstock.vue
@@ -331,6 +331,7 @@
user: "",
region: "",
},
+ //销售字段
form: {
name: "",
proid: "",
@@ -345,7 +346,7 @@
createUser: "",
saleBrand: "",
},
- //出库
+ //出库字段
formCK: {
name: "",
proid: "",
@@ -392,6 +393,7 @@
currentPage: 1,
total: 0,
},
+ //销售配置
option: {
emptyBtn: false,
submitBtn: false,
@@ -475,6 +477,7 @@
},
]
},
+ //库存损耗配置
optionKC: {
emptyBtn: false,
submitBtn: false,
@@ -559,6 +562,7 @@
},
]
},
+ //加工配置
optionJG: {
emptyBtn: false,
submitBtn: false,
@@ -655,6 +659,7 @@
},
]
},
+ //出库配置
optionCK: {
emptyBtn: false,
submitBtn: false,
diff --git a/src/views/farmplant/process.vue b/src/views/farmplant/process.vue
index a73bd59..de6fc42 100644
--- a/src/views/farmplant/process.vue
+++ b/src/views/farmplant/process.vue
@@ -24,29 +24,28 @@
</div>
<!-- <div class="farm-img">
<img src="../../../public/img/map.png" class="img" />
- </div>-->
+ </div> -->
<div class="cai">{{ item.processName }}</div>
<div class="area">
库存量:
<span>{{ item.processNum }}</span>公斤
</div>
- <!-- <div class="btn">-->
- <!-- <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)">-->
- <!-- <span style="color: #5abf78">销售</span></el-button-->
- <!-- >-->
- <!-- <el-button style="width: 65px;padding-left:8px" plain size="small" @click="openWindow(1,item)">-->
- <!-- <span>库存损耗</span>-->
- <!-- </el-button-->
- <!-- >-->
- <!-- </div>-->
- <!-- <div class="btn">-->
- <!-- <el-button style="width: 65px;" plain size="small"-->
- <!-- ><span style="color: #5abf78">出库</span></el-button-->
- <!-- >-->
- <!-- <el-button style="width: 65px;" plain size="small" @click="openWindow(2,item)">-->
- <!-- 加工-->
- <!-- </el-button>-->
- <!-- </div>-->
+ <div class="btn">
+ <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)">
+ <span style="color: #5abf78">销售</span>
+ </el-button>
+ <el-button style="width: 65px;padding-left:8px" plain size="small" @click="openWindow(1,item)">
+ <span>库存损耗</span>
+ </el-button>
+ </div>
+ <div class="btn">
+ <!-- <el-button style="width: 65px;" plain size="small" @click="openWidow(3,item)">
+ <span style="color: #5abf78">出库</span>
+ </el-button>
+ <el-button style="width: 65px;" plain size="small" @click="openWindow(2,item)">
+ 加工
+ </el-button> -->
+ </div>
</div>
</div>
</div>
@@ -64,7 +63,7 @@
</div>
<el-dialog
- title="农产品销售"
+ title="加工产品销售"
:modal-append-to-body="false"
:append-to-body="true"
:close-on-click-modal="false"
@@ -114,9 +113,9 @@
</template>
</avue-form>
</el-dialog>
-
+ <!-- 库存损耗 -->
<el-dialog
- title="农产品库存损耗"
+ title="加工产品库存损耗"
:modal-append-to-body="false"
:append-to-body="true"
:close-on-click-modal="false"
@@ -149,6 +148,7 @@
</avue-form>
</el-dialog>
+ <!-- 加工产品 -->
<el-dialog
title="加工产品"
:modal-append-to-body="false"
@@ -198,7 +198,7 @@
} from "@/api/process/process"
import {
- add, addKC
+ insert,insertKC
} from "@/api/sale/sale"
import {
@@ -215,6 +215,7 @@
user: "",
region: "",
},
+ //销售字段
form: {
name: "",
proid: "",
@@ -228,6 +229,9 @@
salePrice: "",
createUser: "",
saleBrand: "",
+
+ processName:"",
+ weight:"",
},
//损耗字段
formKC: {
@@ -239,6 +243,8 @@
remarks: "",
reason: "0",
lossTime: "",
+
+ processName:"",
},
//加工字段
formJG: {
@@ -261,20 +267,21 @@
currentPage: 1,
total: 0,
},
+ //销售配置
option: {
emptyBtn: false,
submitBtn: false,
gutter: 30,
column: [
{
- label: "种养品种",
- prop: "strainName",
+ label: "产品",
+ prop: "processName",
span: 24,
disabled: true,
rules: [
{
required: true,
- message: "请输入种养品种",
+ message: "请输入产品",
trigger: "blur",
},
],
@@ -344,6 +351,7 @@
},
]
},
+ //库存损耗配置
optionKC: {
emptyBtn: false,
submitBtn: false,
@@ -351,7 +359,7 @@
column: [
{
label: "损耗品种",
- prop: "strainName",
+ prop: "processName",
span: 24,
disabled: true,
rules: [
@@ -428,6 +436,7 @@
},
]
},
+ //加工配置
optionJG: {
emptyBtn: false,
submitBtn: false,
@@ -524,6 +533,84 @@
},
]
},
+ //出库配置
+ optionCK: {
+ emptyBtn: false,
+ submitBtn: false,
+ gutter: 30,
+ column: [
+ {
+ label: "出库品种",
+ prop: "strainName",
+ span: 24,
+ disabled: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入出库品种",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "出库时间",
+ prop: "saleTime",
+ type: "date",
+ span: 24,
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ rules: [
+ {
+ required: true,
+ message: "请选择出库时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "出库数量",
+ prop: "saleNum",
+ type: "number",
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入出库数量",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "出库去向",
+ prop: "saleDestination",
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请选择出库去向",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "备注",
+ prop: "remarks",
+ span: 24,
+ },
+ {
+ label: "操作人",
+ prop: "name",
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入操作人",
+ trigger: "blur",
+ },
+ ],
+ },
+ ]
+ },
selectionList: [],
data: [],
}
@@ -557,11 +644,12 @@
onSubmit () {
console.log("submit!")
},
+ //销售表单提交
submitSole () {
var that = this
this.$refs.form.validate((vaild, done) => {
if (vaild) {
- add(this.form).then(() => {
+ insert(this.form).then(() => {
this.onLoad(this.page)
this.$message({
type: "success",
@@ -579,7 +667,7 @@
}
})
},
- //加工产品
+ //加工表单提交
submitJGloss () {
var that = this
this.$refs.form.validate((vaild, done) => {
@@ -602,11 +690,12 @@
}
})
},
+ //库存损耗表单提交
submitKCloss () {
var that = this
this.$refs.form.validate((vaild, done) => {
if (vaild) {
- addKC(this.formKC).then(() => {
+ insertKC(this.formKC).then(() => {
this.onLoad(this.page)
this.$message({
type: "success",
@@ -643,26 +732,30 @@
// });
},
openWindow (index, data) {
- if (index == 0) {
+ if (index == 0) { //销售
this.form.name = this.userInfo.nick_name
this.form.createUser = this.userInfo.user_id
- this.form.weight = data.weight
+ this.form.weight = data.processNum
this.form.proid = data.id
this.form.landId = data.landId
this.form.strainId = data.strainId
this.form.strainName = data.strainName
+
+ this.form.processName = data.processName
this.visible = true
- } else if (index == 1) {
+ } else if (index == 1) { //库存损耗
this.formKC.name = this.userInfo.nick_name
this.formKC.createUser = this.userInfo.user_id
- this.formKC.weight = data.weight
+ this.formKC.weight = data.processNum
this.formKC.proid = data.id
this.formKC.landId = data.landId
this.formKC.strainId = data.strainId
this.formKC.strainName = data.strainName
+
+ this.formKC.processName = data.processName
this.visibleKC = true
}
- else if (index == 2) {
+ else if (index == 2) { //加工
this.formJG.name = this.userInfo.nick_name
this.formJG.createUser = this.userInfo.user_id
this.formJG.proid = data.id
@@ -673,17 +766,20 @@
this.visibleJG = true
}
},
+ //销售
cleanData () {
var that = this
that.form.saleDestination = ""
that.$refs.form.resetFields()
that.visible = false
},
+ //库存
cleanKCData () {
var that = this
that.$refs.form.resetFields()
that.visibleKC = false
},
+ //加工
cleanJGData () {
var that = this
that.$refs.form.resetFields()
--
Gitblit v1.9.3