更新出库跳转

This commit is contained in:
魏啾 2024-12-03 15:02:22 +08:00
parent 34f7bfac35
commit 554b0d9bfa
3 changed files with 56 additions and 38 deletions

View File

@ -345,16 +345,16 @@ export default {
this.resetForm = { ...this.queryForm }
this.tbShopPurveyorGet()
console.log(this.$route.query.consdata)
if (this.$route.query.consdata) {
let arr = this.$route.query.consdata.map(item => {
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
item.stockNumber = 0
item.costPrice = item.price
item.conInfoId = item.id
return item
})
this.tableData.list = [...this.tableData.list, ...arr]
}
// if (this.$route.query.consdata) {
// let arr = this.$route.query.consdata.map(item => {
// item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
// item.stockNumber = 0
// item.costPrice = item.price
// item.conInfoId = item.id
// return item
// })
// this.tableData.list = [...this.tableData.list, ...arr]
// }
},
methods: {
async querySearchAsync(queryString, cb) {//

View File

@ -40,8 +40,7 @@
<el-form-item label="供应商">
<el-select clearable v-model="queryForm.purveyorId" placeholder="请选择供应商"
style="width: 220px;" @change="changeTypeEnum">
<el-option :label="item.purveyorName" :value="item.id" v-for="item in purveyorList"
:key="item.id"></el-option>
<el-option v-for="item in purveyorList" :label="item.purveyorName" :value="item.id" :key="item.id"></el-option>
</el-select>
{{ queryForm.waitAmount }}
</el-form-item>
@ -120,13 +119,14 @@
@change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips" style="font-size: 16px;">原价
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice)
: scope.row.unit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}}
/
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit == scope.row.conUnitTwo ?
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) :
scope.row.costPrice : scope.row.costPrice)
: scope.row.unit == scope.row.conUnitTwo ?
((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) : scope.row.costPrice }}
/
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
@ -154,13 +154,13 @@
<!-- <div class="tips" style="font-size: 16px;">出库前{{ scope.row.number }}{{ scope.row.conUnit }}</div> -->
<div class="tips" style="font-size: 16px;">出库前
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number)
: scope.row.unit== scope.row.conUnitTwo?
(scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}}
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit == scope.row.conUnitTwo ?
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number)
: scope.row.unit == scope.row.conUnitTwo ?
(scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }}
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
</div>
@ -208,7 +208,8 @@
<template v-slot="scope">
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
@change="modifyPrice($event, scope.row, 'number', 'totalAmount')"></el-input-number>
<div class="tips" style="font-size: 16px;">出库前{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
<div class="tips" style="font-size: 16px;">出库前{{ scope.row.stockNumber }}{{ scope.row.unitName
}}</div>
</template>
</el-table-column>
<el-table-column label="小计">
@ -260,7 +261,7 @@ import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut, tbConsInf
import { formatDecimal } from '@/utils'
export default {
name:'operation_out',
name: 'operation_out',
components: {
shopList,
ConsumableList
@ -342,6 +343,18 @@ export default {
mounted() {
this.resetForm = { ...this.queryForm }
this.tbShopPurveyorGet()
if (this.$route.query.consdata) {
this.queryForm.purveyorId = Number(this.$route.query.purveyorId)//id
console.log(this.$route.query.purveyorId)
let arr = this.$route.query.consdata.map(item => {
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
item.stockNumber = 0
item.costPrice = item.price
item.conInfoId = item.id
return item
})
this.tableData.list = [...this.tableData.list, ...arr]
}
},
methods: {
async querySearchAsync(queryString, cb) {//
@ -562,7 +575,7 @@ export default {
},
//
changeTypeEnum(index) {
let filterd= this.purveyorList.filter(ele=>ele.id == index)
let filterd = this.purveyorList.filter(ele => ele.id == index)
this.queryForm.waitAmount = filterd[0].waitAmount
if (this.queryForm.purveyorId) {

View File

@ -210,7 +210,7 @@
gettbConsInfoFlowstock();
}" /> -->
<div></div>
<div style="color: #43a9fe;" @click="func()">转出库单</div>
<div v-if="consdata.length != 0" style="color: #43a9fe;" @click="func()">转出库单</div>
</div>
</el-dialog>
</div>
@ -467,26 +467,31 @@ export default {
console.log(error)
}
},
wstockChange(e) {
this.stockData.page = e - 1;
this.gettbConsInfoFlowstock();
},
// wstockChange(e) {
// this.stockData.page = e - 1;
// this.gettbConsInfoFlowstock();
// },
func() {
this.$router.push({
name: 'operation_in',
name: 'operation_out',
query: {
consdata: this.consdata
consdata: this.consdata,
purveyorId:this.stockData.purveyorId
}
})
},
async gettbConsInfoFlowstock(item) {
console.log(item)
if (item) {
if (item.conFlows) {
this.stockData.id = item.id
this.stockData.purveyorId = item.purveyorId//id
this.consdata = item.cons
this.stockData.data = item.conFlows
this.variabilityshow = true
}else{
this.$message({ message: '暂无数据!' });
}
this.variabilityshow = true
// this.stockData.loading = true;
let arr = []
// if (this.query.createdAt.length) {