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:
commit
d692ab4e08
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue