Merge branch 'bonus-jyy-smart-canteen' of http://192.168.0.75:3000/bonus/bonus-ui into bonus-jyy-smart-canteen

This commit is contained in:
skjia 2025-07-18 15:54:52 +08:00
commit d692ab4e08
3 changed files with 23 additions and 29 deletions

View File

@ -87,7 +87,7 @@
货品信息
</div>
<div style="display: flex;align-items: center;">
<el-button type="primary" plain @click="addMaterial">添加货品</el-button>
<!-- <el-button type="primary" plain @click="addMaterial">添加货品</el-button> -->
<el-button type="primary" plain @click="importPurchaseOrder">导入采购订单</el-button>
<el-button type="danger" plain @click="delMaterial">删除</el-button>
</div>
@ -108,18 +108,20 @@
</template> -->
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.unitPrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.unitPrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
<template slot-scope="scope">
<span>{{ (scope.row.unitPrice/100).toFixed(2) }}</span>
<!-- <el-input v-model="scope.row.unitPrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.unitPrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/> -->
</template>
</el-table-column>
<el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
<span>{{scope.row.orderNum}}</span>
<!-- <el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/> -->
</template>
</el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.orderNum*scope.row.unitPrice }}</span>
<span>{{ (scope.row.orderNum*scope.row.unitPrice/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true">
@ -397,10 +399,7 @@ export default {
//
getPurchaseInspectInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.materialList = this.baseInfo.inspectGoodsDetails;
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",Number(item.unitPrice)/100)
})
this.materialList = this.baseInfo.inspectGoodsDetails;
if(this.baseInfo.inspectAttachmentList.length>0){
this.baseInfo.inspectAttachmentList.forEach(item=>{
this.attachmentList.push({name:item,url:item})
@ -532,12 +531,11 @@ export default {
confirmChosen(){
if(this.batchChosenMaterial.length>0){
this.loading = true
this.materialList = []
this.batchChosenMaterial.forEach(item=>{
let obj = Object.assign({}, item)
obj.unitPrice = item.unitPrice/100;
this.materialList.push(obj)
})
this.materialList = this.batchChosenMaterial
// this.batchChosenMaterial.forEach(item=>{
// let obj = Object.assign({}, item)
// this.materialList.push(obj)
// })
setTimeout(()=>{
this.loading = false
this.openDialog=false
@ -563,12 +561,10 @@ export default {
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.unitPrice==0 || item.orderNum==0){
if(item.deliveryNum==0 || item.qualifiedNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
obj.unitPrice = Number(obj.unitPrice)*100
// obj.totalPrice = (Number(obj.unitPrice)*Number(obj.orderNum))
}else{
let obj = Object.assign({}, item)
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//
param.inspectGoodsDetails.push(obj)
@ -629,12 +625,10 @@ export default {
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
if(item.unitPrice==0 || item.orderNum==0){
if(item.deliveryNum==0 || item.qualifiedNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
obj.unitPrice = Number(obj.unitPrice)*100
// obj.totalPrice = (Number(obj.unitPrice)*Number(obj.orderNum))
let obj = Object.assign({}, item)
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//
param.inspectGoodsDetails.push(obj)
@ -642,7 +636,7 @@ export default {
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量");
this.$modal.msgError("请输入表格数据");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@ -728,7 +722,7 @@ export default {
if(this.materialDetailsData.length>0){
this.materialList = this.materialDetailsData;
this.materialList.forEach(item=>{
this.$set(item,"unitPrice",Number(item.singlePrice)/100)
this.$set(item,"unitPrice",Number(item.singlePrice))
this.$set(item,"orderNum",item.orderNum)
})
this.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;

View File

@ -153,7 +153,7 @@
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="库存数量" align="center" prop="inventoryNum" :show-overflow-tooltip="true" />
<el-table-column label="库存数量" align="center" prop="materialTotalNum" :show-overflow-tooltip="true" />
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>

View File

@ -120,14 +120,14 @@
v-model="form.minNum"
type="text" clearable
placeholder="请输入最小库存"
maxlength="7" @input="(v)=>(form.minNum=v.replace(/[^\d]/g,''))"
maxlength="7" @input="(v)=>(form.minNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"
/>
</el-form-item>
<el-form-item label="最大库存:" prop="maxNum">
<el-input v-model="form.maxNum"
type="text" clearable
placeholder="请输入最大库存"
maxlength="7" @input="(v)=>(form.maxNum=v.replace(/[^\d]/g,''))"
maxlength="7" @input="(v)=>(form.maxNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"
/>
</el-form-item>
</el-form>