Commit a524284e authored by tianhongyang's avatar tianhongyang

merge

parent c1f67922
<template> <template>
<el-dialog :title="comIsEntityMaterials ? '推送到物资用量' : '推送工程量'" :visible.sync="pushProjectUseDialog" width="480px" class="push-project-use-dialog" <el-dialog :title="comIsEntityMaterials ? '推送到物资用量' : '推送工程量'" :visible.sync="comPushProjectUseDialog" width="480px"
@close="dialogClose"> class="push-project-use-dialog" @close="dialogClose">
<div class="dialog-body-content"> <div class="dialog-body-content">
<el-form :model="pushForm" ref="pushForm" :rules="rules"> <el-form :model="pushForm" ref="pushForm" :rules="rules" class="push-form">
<el-form-item label="分包项目名称"> <el-form-item label="分包项目名称">
<el-input v-model="form.projectName"></el-input> <el-input :value="pushForm.projectName" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="本月实际工程量">
<el-input :value="pushForm.totalQuantities" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="需推送工程量" prop="pushQuantities">
<el-input v-model="pushForm.pushQuantities" placeholder="请填写需推送工程量"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { subtract } from "@/utils/decimal";
import { cloneDeep } from 'lodash-es';
export default { export default {
name: "pushProjectUseDialog", name: "pushProjectUseDialog",
model: { model: {
...@@ -45,11 +53,17 @@ export default { ...@@ -45,11 +53,17 @@ export default {
rowData: { rowData: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
const _temp = newValue ? newValue : {}; const _temp = newValue ? newValue : {};
this.pushForm = { ...this.pushForm, ..._temp }; this.pushForm = cloneDeep({ ...this.pushForm, ..._temp });
} }
} }
}, },
data() { data() {
// 验证需推送工程量
const pushQuantitiesValidator = (rule, value, callback) => {
const reg = /^(?!0\d)(?!0+$)(?!0*\.0*$)\d+(\.\d+)?$/;
if (!reg.test(value)) return callback(new Error("请输入正确的工程量"));
callback();
};
return { return {
comIsEntityMaterials: this.isEntityMaterials, comIsEntityMaterials: this.isEntityMaterials,
comPushProjectUseDialog: this.pushProjectUseDialog, comPushProjectUseDialog: this.pushProjectUseDialog,
...@@ -61,7 +75,9 @@ export default { ...@@ -61,7 +75,9 @@ export default {
ipmBizCode: "" ipmBizCode: ""
}, },
rules: { rules: {
pushQuantities: [
{ trigger: ["blur", "change"], validator: pushQuantitiesValidator }
]
} }
}; };
}, },
...@@ -76,6 +92,10 @@ export default { ...@@ -76,6 +92,10 @@ export default {
//方法集 //方法集
methods: { methods: {
dialogClose() { dialogClose() {
const form = this.$refs["pushForm"];
if (form) form.clearValidate();
this.$emit("dialogClose");
this.pushForm = this.$options.data.call(this).pushForm;
this.$emit("close", false); this.$emit("close", false);
} }
}, },
...@@ -120,6 +140,51 @@ export default { ...@@ -120,6 +140,51 @@ export default {
.dialog-body-content { .dialog-body-content {
padding: 24px 20px; padding: 24px 20px;
box-sizing: border-box; box-sizing: border-box;
.push-form {
.el-form-item {
margin-bottom: 16px;
display: flex;
align-items: center;
.el-form-item__label {
width: 98px;
min-width: 98px;
line-height: 20px;
color: rgba(35, 35, 35, 0.8);
font-weight: 350;
font-size: 14px;
text-align: right;
padding-right: 0px;
margin-right: 16px;
white-space: nowrap;
}
.el-form-item__content {
width: 100%;
line-height: 32px;
.el-input {
&.is-disabled {
.el-input__inner {
background: #fff;
color: rgba(35, 35, 35, 0.8);
}
}
}
.el-input__inner {
line-height: 32px;
height: 32px;
border-radius: 2px;
padding: 0px 7px;
::placeholder {
color: #c0c4cc !important;
}
}
}
}
}
} }
} }
} }
......
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
<add-actual-cost v-model="showAddActualCost" :project-create-time="projectDetailInfo.createTime" @timeSelect="timeSelect"></add-actual-cost> <add-actual-cost v-model="showAddActualCost" :project-create-time="projectDetailInfo.createTime" @timeSelect="timeSelect"></add-actual-cost>
<!-- 推送工程量 , 推送物资 --> <!-- 推送工程量 , 推送物资 -->
<push-project-use-dialog v-model="pushProjectUseDialog" :is-entity-materials="isEntityMaterials" <push-project-use-dialog v-model="pushProjectUseDialog" :is-entity-materials="isEntityMaterials" :row-data="pushProjectUseTemp"
:row-data="pushProjectUseTemp"></push-project-use-dialog> @dialogClose="dialogClose"></push-project-use-dialog>
<!-- 单位换算弹窗 --> <!-- 单位换算弹窗 -->
<unit-conversion v-if="showUnitConversion" :isVisible="showUnitConversion" :dataList="unitConversionList" <unit-conversion v-if="showUnitConversion" :isVisible="showUnitConversion" :dataList="unitConversionList"
...@@ -646,6 +646,10 @@ export default { ...@@ -646,6 +646,10 @@ export default {
this.pushProjectUseTemp = _temp; this.pushProjectUseTemp = _temp;
this.pushProjectUseDialog = true; this.pushProjectUseDialog = true;
}, },
// 推送工程用量弹窗关闭
dialogClose() {
this.pushProjectUseTemp = {};
},
differentCompare() { differentCompare() {
const originData = this.originTableDataList; const originData = this.originTableDataList;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment