| | |
| | | <div class="cai">{{ item.processName }}</div> |
| | | <div class="area"> |
| | | 库存量: |
| | | <span>{{ item.productInventoryNum>10000?(item.productInventoryNum/10000).toFixed(2)+"万":item.productInventoryNum }}</span>公斤 |
| | | </div> |
| | | <div class="area"> |
| | | 原材料: |
| | | <span>{{ item.strainName }}</span> |
| | | <span>{{ item.productInventoryNum }}</span>公斤 |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div class="btn"> |
| | | <!-- <el-button style="width: 65px;" plain size="small" @click="openWindow(3,item)"> |
| | | <span style="color: #5abf78">出库</span> |
| | | </el-button> |
| | | <el-button style="width: 65px;" plain size="small" @click="openWindow(2,item)"> |
| | | 加工 |
| | | </el-button> --> |
| | | <el-button style="width: 65px;" plain size="small" @click="openWindow(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> |
| | |
| | | </template> |
| | | <template slot="menuForm"> |
| | | <div style="text-align: center"> |
| | | <el-button style="width: 120px" type="success" plain @click="submitSole">销售</el-button> |
| | | <el-button style="width: 80px" plain @click="cleanData">取消</el-button> |
| | | <el-button style="width: 80px" type="success" plain @click="submitSole">销售</el-button> |
| | | </div> |
| | | </template> |
| | | </avue-form> |
| | |
| | | </el-dialog> |
| | | <!-- 加工产品 --> |
| | | <el-dialog |
| | | title="加工产品" |
| | | title="加工产品加工" |
| | | :modal-append-to-body="false" |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | |
| | | </el-dialog> |
| | | <!--出库--> |
| | | <el-dialog |
| | | title="出库产品" |
| | | title="加工产品出库" |
| | | :modal-append-to-body="false" |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | |
| | | <el-tag type="success">{{ formCK.name }}</el-tag> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleDestination"> |
| | | <!-- <template slot-scope="{disabled,size}" slot="saleDestination"> |
| | | <div> |
| | | <el-cascader |
| | | style="width: 100%;" |
| | |
| | | v-model="saleDestination" |
| | | ></el-cascader> |
| | | </div> |
| | | </template> |
| | | </template> --> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入出库数量" v-model="formCK.saleNum"> |
| | |
| | | <template slot="menuForm"> |
| | | <div style="text-align: center"> |
| | | <el-button style="width: 80px" plain @click="cleanCKData">取消</el-button> |
| | | <el-button style="width: 120px" type="success" plain @click="submitCK">出库</el-button> |
| | | <el-button style="width: 80px" type="success" plain @click="submitCK">出库</el-button> |
| | | </div> |
| | | </template> |
| | | </avue-form> |
| | |
| | | } from "@/api/sale/sale" |
| | | |
| | | import { |
| | | addjg |
| | | submitProcessJG |
| | | } from "@/api/process/process" |
| | | |
| | | import { |
| | | submitProcess |
| | | } from "@/api/retrieval/retrieval" |
| | | import { |
| | | selectInfo |
| | | } from "@/api/machining/machining" |
| | | import { mapGetters } from "vuex" |
| | | import { regionData } from 'element-china-area-data' |
| | | import fixed from "@/util/mathHandler" |
| | | import {limitNumLength} from "@/util/validate"; |
| | | |
| | | export default { |
| | | data () { |
| | |
| | | form: { |
| | | name: "", |
| | | proid: "", |
| | | landId: "", |
| | | strainId: "", |
| | | // landId: "", |
| | | // strainId: "", |
| | | saleTime: "", |
| | | saleNum: "", |
| | | saleDestination: "", |
| | |
| | | salePrice: "", |
| | | createUser: "", |
| | | saleBrand: "", |
| | | |
| | | |
| | | processName:"", |
| | | weight:"", |
| | | type:"1", |
| | |
| | | formCK: { |
| | | name: "", |
| | | proid: "", |
| | | landId: "", |
| | | strainId: "", |
| | | // landId: "", |
| | | // strainId: "", |
| | | saleTime: "", |
| | | saleNum: "", |
| | | saleDestination: "", |
| | |
| | | createUser: "", |
| | | remarks: "", |
| | | |
| | | |
| | | type:"1", |
| | | processName:"" |
| | | }, |
| | | //损耗字段 |
| | | formKC: { |
| | | name: "", |
| | | proid: "", |
| | | landId: "", |
| | | strainId: "", |
| | | // landId: "", |
| | | // strainId: "", |
| | | saleNum: "", |
| | | remarks: "", |
| | | lossTime: "", |
| | |
| | | formJG: { |
| | | name: "", |
| | | proid: "", |
| | | landId: "", |
| | | strainId: "", |
| | | // landId: "", |
| | | // strainId: "", |
| | | saleNum: "", |
| | | processNum: "", |
| | | remarks: "", |
| | | reason: "0", |
| | | saleTime: "", |
| | | |
| | | processName:"" |
| | | processName:"", |
| | | parentId:"", |
| | | }, |
| | | visible: false, |
| | | visibleKC: false, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入产品", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择销售时间", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入销售数量", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择销售去向", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | prop: "salePrice", |
| | | span: 24, |
| | | type: "number", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | trigger: ["blur","change"], |
| | | validator:limitNumLength |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "品牌", |
| | | prop: "saleBrand", |
| | | span: 24, |
| | | maxlength:100, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "name", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: ["blur","change"], |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //库存损耗配置 |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入损耗品种", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择损耗时间", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入损耗数量", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择损耗原因", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remarks", |
| | | maxlength:200, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "name", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: ["blur","change"], |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //加工配置 |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入加工品种", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择加工时间", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入加工数量", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | prop: "processId", |
| | | span: 24, |
| | | type: "tree", |
| | | dicUrl: "/api/machining/machining/selectInfo", |
| | | dicData:[], |
| | | // dicUrl: "/api/machining/machining/selectInfo", |
| | | // dicFormatter:(res)=>{ |
| | | // res = res.data.filter(e=>{ |
| | | // return e.processId != this.formJG.parentId |
| | | // }) |
| | | // return res |
| | | // }, |
| | | props: { |
| | | label: "processName", |
| | | value: "processId" |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入加工产品", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入产品数量", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remarks", |
| | | maxlength:200, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "name", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: ["blur","change"], |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //出库配置 |
| | |
| | | gutter: 30, |
| | | column: [ |
| | | { |
| | | label: "出库品种", |
| | | prop: "strainName", |
| | | label: "出库产品", |
| | | prop: "processName", |
| | | span: 24, |
| | | disabled: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入出库品种", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择出库时间", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入出库数量", |
| | | trigger: "blur", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "出库去向", |
| | | // prop: "saleDestination", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择出库去向", |
| | | // trigger: ["blur","change"], |
| | | // }, |
| | | // ], |
| | | // }, |
| | | { |
| | | label: "出库去向", |
| | | prop: "saleDestination", |
| | | prop: "saleDestination1", |
| | | span: 24, |
| | | type: "select", |
| | | // value: "0", |
| | | dicUrl:"/api/blade-system/dict-biz/dictionary?code=reDestination", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择出库去向", |
| | | trigger: "blur", |
| | | message: "请选择损耗原因", |
| | | trigger: ["blur","change"], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remarks", |
| | | maxlength:200, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "name", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: ["blur","change"], |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | selectionList: [], |
| | |
| | | this.query ={} |
| | | this.onLoad(this.page) |
| | | } |
| | | }, |
| | | 'formJG.parentId':{ |
| | | handler(newName,oldName){ |
| | | const column = this.findObject(this.optionJG.column, "processId") |
| | | selectInfo().then(res=>{ |
| | | var data = res.data.data.filter(e=>{ |
| | | return e.processId != newName |
| | | }) |
| | | column.dicData = data |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | mounted () { |
| | | }, |
| | | created () { |
| | |
| | | type: "warning", |
| | | message: "销售数量和销售价格不能为负数!" |
| | | }) |
| | | done() |
| | | done() |
| | | }else{ |
| | | insert(this.form).then(() => { |
| | | this.onLoad(this.page) |
| | |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addjg(this.formJG).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanJGData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanJGData() |
| | | done() |
| | | this.formJG['farmId'] = this.$farmId |
| | | if(this.formJG.saleNum <0 || this.formJG.processNum<0){ |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "加工数量和产品数量不能为负数!" |
| | | }) |
| | | done() |
| | | }else { |
| | | submitProcessJG(this.formJG).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanJGData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanJGData() |
| | | done() |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | //出库表单提交 |
| | | // submitCK () { |
| | | // var that = this |
| | | // this.$refs.form.validate((vaild, done) => { |
| | | // if (vaild) { |
| | | // addck(this.formCK).then(() => { |
| | | // this.onLoad(this.page) |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "操作成功!" |
| | | // }) |
| | | // //提交完成,关闭窗口清空数据 |
| | | // that.cleanCKData() |
| | | // done() |
| | | // }, error => { |
| | | // window.console.log(error) |
| | | // //提交失败,关闭窗口清空数据 |
| | | // that.cleanCKData() |
| | | // done() |
| | | // }) |
| | | // } |
| | | // }) |
| | | // }, |
| | | // 出库表单提交 |
| | | submitCK () { |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | submitProcess(this.formCK).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanCKData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanCKData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleChange (value) { |
| | | if (value != null) { |
| | | this.form.saleDestination = value[0] |
| | |
| | | this.form.createUser = this.userInfo.user_id |
| | | this.form.weight = data.productInventoryNum |
| | | this.form.proid = data.id |
| | | this.form.landId = data.landId |
| | | this.form.strainId = data.strainId |
| | | // 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.productInventoryNum |
| | | this.formKC.proid = data.id |
| | | this.formKC.landId = data.landId |
| | | this.formKC.strainId = data.strainId |
| | | // this.formKC.landId = data.landId |
| | | // this.formKC.strainId = data.strainId |
| | | this.formKC.strainName = data.strainName |
| | | |
| | | this.formKC.processName = data.processName |
| | |
| | | this.formJG.name = this.userInfo.nick_name |
| | | this.formJG.createUser = this.userInfo.user_id |
| | | this.formJG.proid = data.id |
| | | this.formJG.landId = data.landId |
| | | // this.formJG.landId = data.landId |
| | | this.formJG.weight = data.productInventoryNum |
| | | this.formJG.strainId = data.strainId |
| | | // this.formJG.strainId = data.strainId |
| | | this.formJG.strainName = data.strainName |
| | | |
| | | this.formKC.processName = data.processName |
| | | this.formJG.processName = data.processName |
| | | this.formJG.parentId = data.productId |
| | | this.visibleJG = true |
| | | }else if (index == 3) { //出库 |
| | | this.formCK.name = this.userInfo.nick_name |
| | | this.formCK.createUser = this.userInfo.user_id |
| | | this.formCK.weight = data.productInventoryNum |
| | | this.formCK.proid = data.id |
| | | this.formCK.landId = data.landId |
| | | this.formCK.strainId = data.strainId |
| | | // this.formCK.landId = data.landId |
| | | // this.formCK.strainId = data.strainId |
| | | this.formCK.strainName = data.strainName |
| | | |
| | | this.formKC.processName = data.processName |
| | | this.formCK.processName = data.processName |
| | | this.visibleCK = true |
| | | } |
| | | }, |
| | |
| | | this.data = data.records.filter((e)=>{ |
| | | return e.productInventoryNum != 0 |
| | | }) |
| | | this.data.forEach((e)=>{ |
| | | e.productInventoryNum = fixed.fixedNum(e.productInventoryNum) |
| | | }) |
| | | this.loading = false |
| | | this.selectionClear() |
| | | // this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | |
| | | |
| | | .farm { |
| | | width: 168px; |
| | | height: 300px; |
| | | height: 310px; |
| | | /*height: 315px;*/ |
| | | background-color: #f7f9fb; |
| | | border-radius: 5px; |