Bladeren bron

1、平衡项目数据维护分摊值合计
2、平衡表项目加入精度、可以修改项目名称

QuietShadow 3 jaren geleden
bovenliggende
commit
7a2219bc78

+ 3 - 2
src/views/energyBalance/components/balanceData.vue

@@ -306,7 +306,8 @@
                             :show-overflow-tooltip="true"
                         ></el-table-column>
                         <el-table-column
-                            sortable
+                            sortable
+                            prop="ftv"
                             label="分摊值"
                             width="110px"
                             :show-overflow-tooltip="true"
@@ -647,7 +648,7 @@ export default {
         },
         // 自定义的表格合计方法:只给指定列进行合计
         getSummaries (param) {
-            const prop = ['actualvalue', 'correctvalue', 'apportvalue','rav','ftz']; // 合计列绑定的prop
+            const prop = ['actualvalue', 'correctvalue', 'apportvalue','rav','ftv']; // 合计列绑定的prop
             return XtcommonSummaries(param, prop);
         },
         // 获取工序(供需实际)

+ 67 - 9
src/views/energyBalance/components/balanceSheetItem.vue

@@ -221,7 +221,23 @@
                             label="项目名称"
                             width="250px"
                             :show-overflow-tooltip="true"
-                        ></el-table-column>
+                        ><template slot-scope="scope">
+                            <el-form-item
+                                v-if="scope.row.isSelection"
+                                :prop="scope.row.itemid + '.itemname'"
+                                :rules="dialog.editorBox.form.rules.itemname"
+                            >
+                                <el-input clearable
+                                    style="width: 100%;"
+                                    v-model="tableFormDataObj[scope.row.itemid].itemname"
+                                ></el-input>
+                                <template slot="error" slot-scope="scope">
+                                    <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                </template>
+                            </el-form-item>
+                            <span v-else>{{ scope.row.itemname }}</span>
+                        </template>
+                        </el-table-column>
                         <el-table-column
                         sortable
                             prop="itemdesc"
@@ -322,7 +338,30 @@
                             width="85px"
                             v-if="filterForm.seqshow"
                             :show-overflow-tooltip="true"
-                        ></el-table-column>
+                        ></el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="digits"
+                            label="精度"
+                            width="85px"
+                            :show-overflow-tooltip="true"
+                        ><template slot-scope="scope">
+                            <el-form-item
+                                v-if="scope.row.isSelection"
+                                :prop="scope.row.itemid + '.digits'"
+                                :rules="dialog.editorBox.form.rules.digits"
+                            >
+                                <el-input clearable
+                                type="number"
+                                    style="width: 100%;"
+                                    v-model="tableFormDataObj[scope.row.itemid].digits"
+                                ></el-input>
+                                <template slot="error" slot-scope="scope">
+                                    <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                </template>
+                            </el-form-item>
+                            <span v-else>{{ scope.row.digits }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             sortable
                             prop="showno"
@@ -581,7 +620,17 @@
                             </el-form-item>
                         </el-col>
                     </el-row>
-                    <!-- <el-row>
+                    <el-row>
+                      <el-col :span="12">
+                        <el-form-item label="精度" prop="digits">
+                            <el-input clearable
+                             style="width: 100%;"
+                             v-model="dialog.editorBox.form.data.digits"
+                             default= "1"
+                             type='number'
+                            ></el-input>
+                        </el-form-item>
+                      </el-col>
                         <el-col :span="12">
                             <el-form-item label="顺序号" prop="seqno">
                                 <el-input clearable
@@ -693,7 +742,8 @@ export default {
                             unitid: '',
                             seqno: '',
                             fid: '',
-                            showno: ''
+                            showno: '',
+                            digits: ''
                         },
                         rules: {
                             energyid: [
@@ -711,6 +761,9 @@ export default {
                             showno: [
                                 { required: true, message: '该项不能为空', trigger: 'change' },
                                 { validator: zCheckNumber2, trigger: 'change' }
+                            ],
+                            digits: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
                             ]
                         }
                     }
@@ -901,7 +954,8 @@ export default {
                                 defaulman: item.defaulman,
                                 modificationtime: item.modificationtime,
                                 useflag: item.useflag,
-                                showno: item.showno
+                                showno: item.showno,
+                                digits: item.digits
                             })
                         }
                         that.tableData = arr;
@@ -995,7 +1049,8 @@ export default {
                 workprocid: that.dialog.editorBox.form.data.workprocid,
                 propertyid: that.dialog.editorBox.form.data.propertyid,
                 unitid: that.dialog.editorBox.form.data.unitid,
-                fid: that.dialog.editorBox.form.data.fid
+                fid: that.dialog.editorBox.form.data.fid,
+                digits: that.dialog.editorBox.form.data.digits
             };
             that.$refs['dialog_form'].validate((valid) => {
                 if (valid) {
@@ -1020,7 +1075,8 @@ export default {
                             itemtype: 'B',
                             tablename: 'T_RM_BALANCE_VALUE',
                             itemdesc: SubmitData.itemdesc,
-                            fid: SubmitData.fid
+                            fid: SubmitData.fid,
+                            digits: SubmitData.digits
                         };
                         that.loading = true;
                         that.axios.post('pass/ems/v1/trmactitems/', addData, {
@@ -1100,14 +1156,16 @@ export default {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
                             SubmitData.push({
-                                itemid: that.tableFormDataObj[key].itemid,
+                                itemid: that.tableFormDataObj[key].itemid,
+                                itemname: that.tableFormDataObj[key].itemname,
                                 itemdesc: that.tableFormDataObj[key].itemdesc,
                                 energyid: that.tableFormDataObj[key].energyid,
                                 workprocid: that.tableFormDataObj[key].workprocid,
                                 propertyid: that.tableFormDataObj[key].propertyid,
                                 unitid: that.tableFormDataObj[key].unitid,
                                 fid: that.tableFormDataObj[key].fid,
-                                showno: that.tableFormDataObj[key].showno
+                                showno: that.tableFormDataObj[key].showno,
+                                digits: that.tableFormDataObj[key].digits
                             });
                         }
                         that.loading = true;