数量可输入两位小数
This commit is contained in:
		
							parent
							
								
									c8c083096d
								
							
						
					
					
						commit
						377a8fb1ad
					
				| 
						 | 
				
			
			@ -139,12 +139,12 @@
 | 
			
		|||
                    </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,''))"/>
 | 
			
		||||
                            <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.singlePrice }}</span>
 | 
			
		||||
                            <span>{{ (scope.row.orderNum*scope.row.singlePrice).toFixed(4) }}</span>
 | 
			
		||||
                        </template>
 | 
			
		||||
                    </el-table-column> 
 | 
			
		||||
                    <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.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
 | 
			
		||||
                    param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
 | 
			
		||||
                    if(this.baseInfo.payMoneyDate){
 | 
			
		||||
                        param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)   
 | 
			
		||||
                    } 
 | 
			
		||||
                    param.contractAmount = 0;
 | 
			
		||||
                    param.commitStatus=1
 | 
			
		||||
                    param.purchaseContractDetailList = []  
 | 
			
		||||
| 
						 | 
				
			
			@ -550,7 +552,9 @@ export default {
 | 
			
		|||
                    param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
 | 
			
		||||
                    param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
 | 
			
		||||
                    param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
 | 
			
		||||
                    if(this.baseInfo.payMoneyDate){
 | 
			
		||||
                        param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)   
 | 
			
		||||
                    } 
 | 
			
		||||
                    param.contractAmount = 0;
 | 
			
		||||
                    param.commitStatus=2
 | 
			
		||||
                    param.purchaseContractDetailList = [] 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -87,7 +87,7 @@
 | 
			
		|||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="合同总金额(元)" align="center" prop="contractAmount" :show-overflow-tooltip="true" width="120">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
               <span>{{ (scope.row.contractAmount/100).toFixed(2) }}</span>
 | 
			
		||||
               <span>{{ (scope.row.contractAmount/100).toFixed(4) }}</span>
 | 
			
		||||
            </template>  
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" width="120"/>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,21 +52,12 @@
 | 
			
		|||
                <el-option label="已提交" :value="2"></el-option> 
 | 
			
		||||
            </el-select> 
 | 
			
		||||
        </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-select v-model="queryParams.decompositionState" placeholder="请选择分解状态" style="width: 240px;">
 | 
			
		||||
                <el-option label="待分解" :value="1"></el-option>
 | 
			
		||||
                <el-option label="已分解" :value="2"></el-option>  
 | 
			
		||||
            </el-select> 
 | 
			
		||||
        </el-form-item> --> 
 | 
			
		||||
        
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
            <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>
 | 
			
		||||
| 
						 | 
				
			
			@ -147,6 +138,12 @@
 | 
			
		|||
                icon="el-icon-edit" v-if="scope.row.status==2"
 | 
			
		||||
                @click="handleView(scope.row)" 
 | 
			
		||||
            >详情</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
 | 
			
		||||
                size="mini"
 | 
			
		||||
                type="text"
 | 
			
		||||
| 
						 | 
				
			
			@ -166,16 +163,36 @@
 | 
			
		|||
    />
 | 
			
		||||
 | 
			
		||||
    <!-- 添加或修改参数配置对话框 -->
 | 
			
		||||
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
 | 
			
		||||
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 | 
			
		||||
    <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
 | 
			
		||||
        <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">
 | 
			
		||||
        <el-button type="primary" @click="submitForm">确 定</el-button>
 | 
			
		||||
        <el-button type="primary" @click="submitPlan">生成采购计划</el-button>
 | 
			
		||||
        <el-button @click="cancel">取 消</el-button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-dialog>
 | 
			
		||||
| 
						 | 
				
			
			@ -207,10 +224,6 @@ export default {
 | 
			
		|||
            total: 0,
 | 
			
		||||
            //表格数据
 | 
			
		||||
            tableListData: [], 
 | 
			
		||||
            // 弹出层标题
 | 
			
		||||
            title: "",
 | 
			
		||||
            // 是否显示弹出层
 | 
			
		||||
            open: false, 
 | 
			
		||||
            // 查询参数
 | 
			
		||||
            queryParams: {
 | 
			
		||||
                pageNum: 1,
 | 
			
		||||
| 
						 | 
				
			
			@ -248,17 +261,12 @@ export default {
 | 
			
		|||
                    }
 | 
			
		||||
                }]
 | 
			
		||||
            },
 | 
			
		||||
            // 表单参数
 | 
			
		||||
            form: {},
 | 
			
		||||
            // 表单校验
 | 
			
		||||
            rules: {
 | 
			
		||||
            //   canteenName: [
 | 
			
		||||
            //     { required: true, message: "字典名称不能为空", trigger: "blur" }
 | 
			
		||||
            //   ],
 | 
			
		||||
            //   dictType: [
 | 
			
		||||
            //     { required: true, message: "字典类型不能为空", trigger: "blur" }
 | 
			
		||||
            //   ]
 | 
			
		||||
            }
 | 
			
		||||
            // 弹出层标题
 | 
			
		||||
            title: "",
 | 
			
		||||
            // 是否显示弹出层
 | 
			
		||||
            open: false, 
 | 
			
		||||
            loading2: false, 
 | 
			
		||||
            dialogTableList: [], 
 | 
			
		||||
        };
 | 
			
		||||
    },
 | 
			
		||||
    created() { 
 | 
			
		||||
| 
						 | 
				
			
			@ -341,7 +349,7 @@ export default {
 | 
			
		|||
        handleCommand(command){
 | 
			
		||||
            this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {dialogType:command} });
 | 
			
		||||
        }, 
 | 
			
		||||
        /** 修改按钮操作 */
 | 
			
		||||
        /** 详情按钮操作 */
 | 
			
		||||
        handleView(row) { 
 | 
			
		||||
            this.$router.push({ path: "/foodManage/purchaseManage/productionPlanDetail",query: {productionPlanRowData:JSON.stringify(row),dialogType:row.productionPlanType} });
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			@ -349,35 +357,36 @@ export default {
 | 
			
		|||
        handleUpdate(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() {
 | 
			
		||||
            this.open = false;
 | 
			
		||||
            this.reset();
 | 
			
		||||
        },
 | 
			
		||||
        // 表单重置
 | 
			
		||||
        reset() {
 | 
			
		||||
            this.form = {};
 | 
			
		||||
            this.resetForm("form");
 | 
			
		||||
            this.dialogTableList = []; 
 | 
			
		||||
        },
 | 
			
		||||
        /** 提交按钮 */
 | 
			
		||||
        submitForm: function() {
 | 
			
		||||
            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();
 | 
			
		||||
                    // });
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            });
 | 
			
		||||
        submitPlan: {
 | 
			
		||||
             
 | 
			
		||||
        },
 | 
			
		||||
        /** 删除按钮操作 */
 | 
			
		||||
        handleDelete(row) { 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -95,7 +95,7 @@
 | 
			
		|||
                    </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,''))"/>
 | 
			
		||||
                            <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">
 | 
			
		||||
| 
						 | 
				
			
			@ -105,12 +105,12 @@
 | 
			
		|||
                    </el-table-column> 
 | 
			
		||||
                    <el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true">
 | 
			
		||||
                        <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>
 | 
			
		||||
                    </el-table-column> 
 | 
			
		||||
                    <el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true">
 | 
			
		||||
                        <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>
 | 
			
		||||
                    </el-table-column> 
 | 
			
		||||
                    <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
 | 
			
		||||
| 
						 | 
				
			
			@ -448,7 +448,6 @@ export default {
 | 
			
		|||
                if (valid) { 
 | 
			
		||||
                    let param = Object.assign({},this.baseInfo);
 | 
			
		||||
                    param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate) 
 | 
			
		||||
                    param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)  
 | 
			
		||||
                    param.deliveryTotalNum = 0;//送货总数量 
 | 
			
		||||
                    param.inspectQualifiedNum = 0;//验货合格总数量 
 | 
			
		||||
                    param.status=1
 | 
			
		||||
| 
						 | 
				
			
			@ -516,7 +515,6 @@ export default {
 | 
			
		|||
                if (valid) { 
 | 
			
		||||
                    let param = Object.assign({},this.baseInfo);
 | 
			
		||||
                    param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate) 
 | 
			
		||||
                    param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)  
 | 
			
		||||
                    param.deliveryTotalNum = 0;//送货总数量 
 | 
			
		||||
                    param.inspectQualifiedNum = 0;//验货合格总数量 
 | 
			
		||||
                    param.status=2
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,7 +126,7 @@
 | 
			
		|||
                    </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,''))"/>
 | 
			
		||||
                            <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">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -87,7 +87,7 @@
 | 
			
		|||
                    </el-table-column> 
 | 
			
		||||
                    <el-table-column label="采购数量" align="center" prop="purchaseNum" :show-overflow-tooltip="true">
 | 
			
		||||
                        <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>
 | 
			
		||||
                    </el-table-column> 
 | 
			
		||||
                    <el-table-column label="预计采购金额(元)" align="center" prop="" :show-overflow-tooltip="true">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue