| | |
| | | </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">--> |
| | | <!-- 加工--> |
| | | <!-- </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">--> |
| | | <!-- 加工--> |
| | | <!-- </el-button--> |
| | | <!-- >--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"><i slot="suffix"style="font-style:normal;margin-right: 5px;">公斤</i></el-input> |
| | | <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">可销售量:{{form.weight}}公斤</div> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="salePrice"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"><i slot="suffix"style="font-style:normal;margin-right: 5px;">元/公斤</i> |
| | | <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">元/公斤</i> |
| | | </el-input> |
| | | </div> |
| | | </template> |
| | |
| | | :close-on-click-modal="false" |
| | | @close="close" |
| | | width="30%" |
| | | :before-close="cleanKCData" |
| | | :visible.sync="visibleKC" |
| | | center |
| | | > |
| | | <avue-form ref="form" v-model="form" :option="optionKC"> |
| | | <avue-form ref="form" v-model="formKC" :option="optionKC"> |
| | | <template slot-scope="{disabled,size}" slot="name"> |
| | | <div> |
| | | <el-tag type="success">{{form.name}}</el-tag> |
| | | <el-tag type="success">{{formKC.name}}</el-tag> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入损耗数量" v-model="form.saleNum"><i slot="suffix"style="font-style:normal;margin-right: 5px;">公斤</i></el-input> |
| | | <div style="text-align: right;color: #ffb218">库存量:{{form.weight}}公斤</div> |
| | | <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"><i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">库存量:{{formKC.weight}}公斤</div> |
| | | </div> |
| | | </template> |
| | | <template slot="menuForm"> |
| | | <div style="text-align: center"> |
| | | <el-button style="width: 80px" plain >取消</el-button> |
| | | <el-button style="width: 80px" type="success" plain >确认</el-button> |
| | | <el-button style="width: 80px" plain @click="cleanKCData">取消</el-button> |
| | | <el-button style="width: 80px" type="success" plain @click="submitKCloss">确认</el-button> |
| | | </div> |
| | | </template> |
| | | </avue-form> |
| | |
| | | } from "@/api/farmplant/farmproductstock"; |
| | | |
| | | import { |
| | | add |
| | | add,addKC |
| | | } from "@/api/sale/sale"; |
| | | |
| | | import {getStrainList} from "@/api/farmplant/strain"; |
| | |
| | | county: "", |
| | | salePrice: "", |
| | | createUser: "", |
| | | saleBrand: "" |
| | | saleBrand: "", |
| | | }, |
| | | //损耗字段 |
| | | formKC:{ |
| | | name: "", |
| | | strainId: "", |
| | | saleNum: "", |
| | | remarks:"", |
| | | reason:"0", |
| | | lossTime:"", |
| | | }, |
| | | visible: false, |
| | | visibleKC: false, |
| | |
| | | }, |
| | | { |
| | | label: "损耗时间", |
| | | prop: "saleTime", |
| | | prop: "lossTime", |
| | | type: "date", |
| | | span: 24, |
| | | format: "yyyy-MM-dd", |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: "损耗原因", |
| | | prop: "reason", |
| | | span: 24, |
| | | type: "select", |
| | | value: "0", |
| | | dicData: [ |
| | | { |
| | | label: "库存损耗", |
| | | value: "0", |
| | | }], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择损耗原因", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "bz", |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanData(); |
| | | done(); |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | submitKCloss() { |
| | | var that = this; |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addKC(this.formKC).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanKCData(); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanKCData(); |
| | | done(); |
| | | }); |
| | | } |
| | | }) |
| | |
| | | // }); |
| | | }, |
| | | openWindow(index, data) { |
| | | this.form.name = this.userInfo.nick_name; |
| | | this.form.createUser = this.userInfo.user_id; |
| | | this.form.weight = data.weight; |
| | | this.form.strainId = data.strainId; |
| | | this.form.strainName = data.strainName; |
| | | if (index == 0) { |
| | | this.form.name = this.userInfo.nick_name; |
| | | this.form.createUser = this.userInfo.user_id; |
| | | this.form.weight = data.weight; |
| | | this.form.strainId = data.strainId; |
| | | this.form.strainName = data.strainName; |
| | | 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.strainId = data.strainId; |
| | | this.formKC.strainName = data.strainName; |
| | | this.visibleKC = true; |
| | | } |
| | | }, |
| | | cleanData(){ |
| | | 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; |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.onLoad(this.page); |