数量可输入两位小数

This commit is contained in:
zzyuan 2025-07-16 11:01:11 +08:00
parent c8c083096d
commit 377a8fb1ad
6 changed files with 84 additions and 73 deletions

View File

@ -139,12 +139,12 @@
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true"> <el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <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,''))"/> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true"> <el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.orderNum*scope.row.singlePrice }}</span> <span>{{ (scope.row.orderNum*scope.row.singlePrice).toFixed(4) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
@ -483,7 +483,9 @@ export default {
param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0]) param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1]) param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime) param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
if(this.baseInfo.payMoneyDate){
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate) param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
}
param.contractAmount = 0; param.contractAmount = 0;
param.commitStatus=1 param.commitStatus=1
param.purchaseContractDetailList = [] param.purchaseContractDetailList = []
@ -550,7 +552,9 @@ export default {
param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0]) param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1]) param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime) param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
if(this.baseInfo.payMoneyDate){
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate) param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
}
param.contractAmount = 0; param.contractAmount = 0;
param.commitStatus=2 param.commitStatus=2
param.purchaseContractDetailList = [] param.purchaseContractDetailList = []

View File

@ -87,7 +87,7 @@
</el-table-column> </el-table-column>
<el-table-column label="合同总金额(元)" align="center" prop="contractAmount" :show-overflow-tooltip="true" width="120"> <el-table-column label="合同总金额(元)" align="center" prop="contractAmount" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ (scope.row.contractAmount/100).toFixed(2) }}</span> <span>{{ (scope.row.contractAmount/100).toFixed(4) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" width="120"/> <el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" width="120"/>

View File

@ -52,21 +52,12 @@
<el-option label="已提交" :value="2"></el-option> <el-option label="已提交" :value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="审批状态" prop="approveStatus">
<el-select v-model="queryParams.approveStatus" placeholder="请选择审批状态" style="width: 240px;">
<el-option label="待审批" :value="1"></el-option>
<el-option label="审批中" :value="2"></el-option>
<el-option label="审批同意" :value="3"></el-option>
<el-option label="审批拒绝" :value="4"></el-option>
</el-select>
</el-form-item> -->
<!-- <el-form-item label="分解状态" prop="decompositionState"> <!-- <el-form-item label="分解状态" prop="decompositionState">
<el-select v-model="queryParams.decompositionState" placeholder="请选择分解状态" style="width: 240px;"> <el-select v-model="queryParams.decompositionState" placeholder="请选择分解状态" style="width: 240px;">
<el-option label="待分解" :value="1"></el-option> <el-option label="待分解" :value="1"></el-option>
<el-option label="已分解" :value="2"></el-option> <el-option label="已分解" :value="2"></el-option>
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -147,6 +138,12 @@
icon="el-icon-edit" v-if="scope.row.status==2" icon="el-icon-edit" v-if="scope.row.status==2"
@click="handleView(scope.row)" @click="handleView(scope.row)"
>详情</el-button> >详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit" v-if="scope.row.status==2"
@click="handlePurchasePlan(scope.row)"
>生成采购计划</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -166,16 +163,36 @@
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-table v-loading="loading2" :data="dialogTableList" height="600">
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
<el-table-column label="原料名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
<!-- <template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
<span v-if="scope.row.salesMode==2">称重</span>
</template> -->
</el-table-column>
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="可食用部分(%)" align="center" prop="" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>100</span>
</template>
</el-table-column>
<el-table-column label="系统分解重量(kg)" align="center" prop="" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="预留比例(%)" align="center" prop="" :show-overflow-tooltip="true" width="140">
</el-table-column>
<el-table-column label="数量(kg)" align="center" prop="" :show-overflow-tooltip="true" width="150">
</el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitPlan">生成采购计划</el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -207,10 +224,6 @@ export default {
total: 0, total: 0,
// //
tableListData: [], tableListData: [],
//
title: "",
//
open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -248,17 +261,12 @@ export default {
} }
}] }]
}, },
// //
form: {}, title: "",
// //
rules: { open: false,
// canteenName: [ loading2: false,
// { required: true, message: "", trigger: "blur" } dialogTableList: [],
// ],
// dictType: [
// { required: true, message: "", trigger: "blur" }
// ]
}
}; };
}, },
created() { created() {
@ -341,7 +349,7 @@ export default {
handleCommand(command){ handleCommand(command){
this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {dialogType:command} }); this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {dialogType:command} });
}, },
/** 修改按钮操作 */ /** 详情按钮操作 */
handleView(row) { handleView(row) {
this.$router.push({ path: "/foodManage/purchaseManage/productionPlanDetail",query: {productionPlanRowData:JSON.stringify(row),dialogType:row.productionPlanType} }); this.$router.push({ path: "/foodManage/purchaseManage/productionPlanDetail",query: {productionPlanRowData:JSON.stringify(row),dialogType:row.productionPlanType} });
}, },
@ -349,35 +357,36 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} }); this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} });
}, },
/** 生成采购计划操作 */
handlePurchasePlan(row) { //purchaseManage/planEdit
this.dialogTableList = [];
// let param = {
// "productionPlanCode": this.queryParams.productionPlanCode,
// "goodsType":1,
// "areaId": this.queryParams.areaId,
// "canteenId": this.queryParams.canteenId,
// "stallId": this.queryParams.stallId,
// "status": this.queryParams.status,
// "decompositionState": this.queryParams.decompositionState,
// }
// this.loading2=true;
// productionPlanPageApi(param).then(response => {
// this.dialogTableList = response.rows;
this.title = "生成采购计划"
this.open=true;
// this.loading2 = false;
// }).catch(() => {
// this.loading2 = false;
// });
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); this.dialogTableList = [];
},
//
reset() {
this.form = {};
this.resetForm("form");
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitPlan: {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
// updateType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
} else {
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
}
}
});
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {

View File

@ -95,7 +95,7 @@
</el-table-column> </el-table-column>
<el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true"> <el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <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,''))"/> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true"> <el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
@ -105,12 +105,12 @@
</el-table-column> </el-table-column>
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true"> <el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.number="scope.row.deliveryNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.deliveryNum=v.replace(/[^\d]/g,''))"/> <el-input v-model.number="scope.row.deliveryNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.deliveryNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true"> <el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.number="scope.row.qualifiedNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.qualifiedNum=v.replace(/[^\d]/g,''))"/> <el-input v-model.number="scope.row.qualifiedNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.qualifiedNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
@ -448,7 +448,6 @@ export default {
if (valid) { if (valid) {
let param = Object.assign({},this.baseInfo); let param = Object.assign({},this.baseInfo);
param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate) param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
param.deliveryTotalNum = 0;// param.deliveryTotalNum = 0;//
param.inspectQualifiedNum = 0;// param.inspectQualifiedNum = 0;//
param.status=1 param.status=1
@ -516,7 +515,6 @@ export default {
if (valid) { if (valid) {
let param = Object.assign({},this.baseInfo); let param = Object.assign({},this.baseInfo);
param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate) param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
param.deliveryTotalNum = 0;// param.deliveryTotalNum = 0;//
param.inspectQualifiedNum = 0;// param.inspectQualifiedNum = 0;//
param.status=2 param.status=2

View File

@ -126,7 +126,7 @@
</el-table-column> </el-table-column>
<el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true"> <el-table-column label="数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <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,''))"/> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true"> <el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">

View File

@ -87,7 +87,7 @@
</el-table-column> </el-table-column>
<el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true"> <el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.number="scope.row.purchaseNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.purchaseNum=v.replace(/[^\d]/g,''))"/> <el-input v-model.number="scope.row.purchaseNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.purchaseNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计采购金额(元)" align="center" prop="" :show-overflow-tooltip="true"> <el-table-column label="预计采购金额(元)" align="center" prop="" :show-overflow-tooltip="true">