| | |
| | | }) |
| | | } |
| | | |
| | | export const selectInfo = () => { |
| | | return request({ |
| | | url: '/api/machining/machining/selectInfo', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | export const remove = (ids,farmId) => { |
| | | return request({ |
| | | url: '/api/process/process/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | ids,farmId |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export const submitProcessJG = (row) => { |
| | | return request({ |
| | | url: '/api/process/process/submitProcess', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/process/process/submit', |
| | |
| | | }) |
| | | } |
| | | |
| | | //销售加工产品 |
| | | export const submitProcess = (row) => { |
| | | return request({ |
| | | url: '/api/retrieval/retrieval/submitProcess', |
| | | method: 'post', |
| | | data: row |
| | | }) |
| | | } |
| | | |
| | | export const update = (row) => { |
| | | return request({ |
| | | url: '/api/retrieval/retrieval/submit', |
| | |
| | | createUser: "", |
| | | remarks: "", |
| | | saleDestination1:"", |
| | | type:"0", |
| | | }, |
| | | //损耗字段 |
| | | formKC: { |
| | |
| | | prop: "saleBrand", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //库存损耗配置 |
| | |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //加工配置 |
| | |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //出库配置 |
| | |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | selectionList: [], |
| | |
| | | if (vaild) { |
| | | this.formJG.id = "" |
| | | Object.assign(this.formJG,this.JG) |
| | | this.formJG["farmId"] = this.$farmId |
| | | if(this.formJG.saleNum <0 || this.formJG.processNum<0){ |
| | | this.$message({ |
| | | type: "warning", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | height: 520, |
| | | height: "auto", |
| | | calcHeight: '80', |
| | | editBtn: false, |
| | | addBtn: false, |
| | | delBtn: true, |
| | |
| | | menuAlign: "center", |
| | | align: "center", |
| | | selection: false, |
| | | showSummary: true, |
| | | indexFixed: false, |
| | | selectionFixed: false, |
| | | expandFixed: false, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: "品种", |
| | | prop: "proName" |
| | | label: "品种 / 产品", |
| | | prop: "proName", |
| | | formatter:function(row, column, cellValue, index) { |
| | | return row.proName?row.proName:row.strainName |
| | | } |
| | | }, |
| | | { |
| | | label: "损耗数量", |
| | |
| | | //单位处理 |
| | | this.data.forEach((e)=>{ |
| | | e.saleNum = e.saleNum + " 公斤" |
| | | if(e.type == 1){ |
| | | e.proName = e.proName+"("+e.strainName+")" |
| | | } |
| | | }) |
| | | this.page.total = res.data.data.total |
| | | this.loading = false |
| | |
| | | 库存量: |
| | | <span>{{ item.productInventoryNum }}</span>公斤 |
| | | </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> |
| | | </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> |
| | |
| | | </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"> |
| | |
| | | } 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" |
| | |
| | | form: { |
| | | name: "", |
| | | proid: "", |
| | | landId: "", |
| | | strainId: "", |
| | | // landId: "", |
| | | // strainId: "", |
| | | saleTime: "", |
| | | saleNum: "", |
| | | saleDestination: "", |
| | |
| | | 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, |
| | |
| | | prop: "saleBrand", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //库存损耗配置 |
| | |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //加工配置 |
| | |
| | | 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" |
| | |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | //出库配置 |
| | |
| | | gutter: 30, |
| | | column: [ |
| | | { |
| | | label: "出库品种", |
| | | prop: "strainName", |
| | | label: "出库产品", |
| | | prop: "processName", |
| | | span: 24, |
| | | disabled: true, |
| | | rules: [ |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "出库去向", |
| | | // prop: "saleDestination", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择出库去向", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | { |
| | | 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: "请选择出库去向", |
| | | message: "请选择损耗原因", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | |
| | | prop: "remarks", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "realName", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入操作人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "操作人", |
| | | // prop: "realName", |
| | | // span: 24, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入操作人", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // }, |
| | | ] |
| | | }, |
| | | selectionList: [], |
| | |
| | | handler (newName, oldName) { |
| | | 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 |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }, |
| | |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addjg(this.formJG).then(() => { |
| | | this.formJG['farmId'] = this.$farmId |
| | | submitProcessJG(this.formJG).then(() => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | } |
| | | }) |
| | | }, |
| | | //出库表单提交 |
| | | // 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.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 |
| | | } |
| | | }, |
| | |
| | | |
| | | .farm { |
| | | width: 168px; |
| | | height: 300px; |
| | | height: 310px; |
| | | /*height: 315px;*/ |
| | | background-color: #f7f9fb; |
| | | border-radius: 5px; |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | height: 520, |
| | | height: "auto", |
| | | calcHeight: '80', |
| | | delBtn: true, |
| | | delBtnText:'删除', |
| | | delBtnIcon:'el-icon-delete', |
| | |
| | | menuAlign: "center", |
| | | align: "center", |
| | | selection: false, |
| | | showSummary: true, |
| | | indexFixed: false, |
| | | selectionFixed: false, |
| | | expandFixed: false, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label:"品种", |
| | | prop:"strainName" |
| | | label:"品种 / 来源", |
| | | prop:"strainName", |
| | | formatter:function(row, column, cellValue, index) { |
| | | return row.strainName?row.strainName:row.parentName |
| | | } |
| | | }, |
| | | { |
| | | label:"加工数量", |
| | |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | return remove(row.id) |
| | | return remove(row.id,this.$farmId) |
| | | }).then((res) => { |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | height: 520, |
| | | height: "auto", |
| | | calcHeight: '80', |
| | | editBtn: false, |
| | | addBtn: false, |
| | | delBtn: true, |
| | |
| | | menuAlign: "center", |
| | | align: "center", |
| | | selection: false, |
| | | showSummary: true, |
| | | indexFixed: false, |
| | | selectionFixed: false, |
| | | expandFixed: false, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: "品种", |
| | | prop: "strainName" |
| | | label: "品种 / 产品", |
| | | prop: "proName", |
| | | formatter:function(row, column, cellValue, index) { |
| | | return row.proName?row.proName:row.strainName |
| | | } |
| | | }, |
| | | { |
| | | label: "出库数量", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | height: 520, |
| | | height: "auto", |
| | | calcHeight: '80', |
| | | editBtn: false, |
| | | addBtn: false, |
| | | delBtn: true, |
| | |
| | | menuAlign: "center", |
| | | align: "center", |
| | | selection: false, |
| | | showSummary: true, |
| | | indexFixed: false, |
| | | selectionFixed: false, |
| | | expandFixed: false, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: "品种", |
| | | prop: "proName" |
| | | label: "品种 / 产品", |
| | | prop: "proName", |
| | | formatter:function(row, column, cellValue, index) { |
| | | return row.proName?row.proName:row.strainName |
| | | } |
| | | }, |
| | | { |
| | | label: "销售数量", |
| | |
| | | this.loading = true |
| | | params['farmId'] = this.$farmId |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => { |
| | | console.log(res) |
| | | if (res.data.code == 200) { |
| | | this.data = res.data.data.records |
| | | //单位处理 |
| | | this.data.forEach((e)=>{ |
| | | e.saleNum = e.saleNum + " 公斤" |
| | | e.salePrice = e.salePrice + " 元/公斤" |
| | | if(e.type == 1){ |
| | | e.proName = e.proName+"("+e.strainName+")" |
| | | } |
| | | }) |
| | | this.page.total = res.data.data.total |
| | | this.loading = false |