From c7d469efc2bc11d2c54d2aafef90d16e27088eb8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 02 Aug 2022 11:43:42 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhny_web
---
src/views/farmplant/process.vue | 180 +++++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 141 insertions(+), 39 deletions(-)
diff --git a/src/views/farmplant/process.vue b/src/views/farmplant/process.vue
index a73bd59..57d439d 100644
--- a/src/views/farmplant/process.vue
+++ b/src/views/farmplant/process.vue
@@ -24,29 +24,32 @@
</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>公斤
+ <span>{{ item.productInventoryNum }}</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="area">
+ 原材料:
+ <span>{{ item.strainName }}</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" @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 +67,7 @@
</div>
<el-dialog
- title="农产品销售"
+ title="加工产品销售"
:modal-append-to-body="false"
:append-to-body="true"
:close-on-click-modal="false"
@@ -114,9 +117,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 +152,7 @@
</avue-form>
</el-dialog>
+ <!-- 加工产品 -->
<el-dialog
title="加工产品"
:modal-append-to-body="false"
@@ -193,12 +197,14 @@
</template>
<script>
-import {
- getList,
-} from "@/api/process/process"
+//获取加工产品库存数据
+import{
+ getPage,
+} from "@/api/processinv/processinv"
+//向销售表和损耗表中添加数据
import {
- add, addKC
+ insert,insertKC
} from "@/api/sale/sale"
import {
@@ -215,6 +221,7 @@
user: "",
region: "",
},
+ //销售字段
form: {
name: "",
proid: "",
@@ -228,6 +235,9 @@
salePrice: "",
createUser: "",
saleBrand: "",
+
+ processName:"",
+ weight:"",
},
//损耗字段
formKC: {
@@ -239,6 +249,8 @@
remarks: "",
reason: "0",
lossTime: "",
+
+ processName:"",
},
//加工字段
formJG: {
@@ -261,20 +273,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 +357,7 @@
},
]
},
+ //库存损耗配置
optionKC: {
emptyBtn: false,
submitBtn: false,
@@ -351,7 +365,7 @@
column: [
{
label: "损耗品种",
- prop: "strainName",
+ prop: "processName",
span: 24,
disabled: true,
rules: [
@@ -428,6 +442,7 @@
},
]
},
+ //加工配置
optionJG: {
emptyBtn: false,
submitBtn: false,
@@ -524,6 +539,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 +650,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 +673,7 @@
}
})
},
- //加工产品
+ //加工表单提交
submitJGloss () {
var that = this
this.$refs.form.validate((vaild, done) => {
@@ -602,11 +696,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 +738,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.productInventoryNum
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.productInventoryNum
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 +772,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()
@@ -700,7 +802,7 @@
onLoad (page, params = {}) {
params['tenantId'] = this.userInfo.tenant_id
params['deptId'] = this.userInfo.dept_id
- getList(
+ getPage(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
--
Gitblit v1.9.3