Parcourir la source

lrl -2021-12-04

lirl il y a 3 ans
Parent
commit
ec775196ac

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

@@ -248,14 +248,14 @@
                             align="center"
                             fixed="left"
                         ></el-table-column>
-                        <el-table-column
+                        <!-- <el-table-column
                             sortable
                             prop="showno"
                             width="100px"
-                            label="排序序号"
+                            label="序号"
                             align="center"
                             fixed="left"
-                        ></el-table-column>
+                        ></el-table-column> -->
                         <el-table-column
                         sortable
                             prop="clock"

+ 8 - 8
src/views/energyBalance/components/balanceSheetItem.vue

@@ -208,17 +208,10 @@
                         @selection-change="handleSelectionChange"
                         :row-class-name="rowClassName"
                     >
-                        <el-table-column
-                            type="selection"
-                            width="40"
-                            align="center"
-                            fixed="left"
-                            class-name="cnspicuous"
-                        ></el-table-column>
                         <el-table-column
                             sortable
                             prop="showno"
-                            label="序号"
+                            label="序号"
                             width="85px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
@@ -361,6 +354,13 @@
                                 <span v-else>{{ scope.row.fid }}</span>
                             </template>
                         </el-table-column>
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
                         <el-table-column
                             sortable
                             prop="userid"

+ 2 - 3
src/views/energyBalance/components/panku/consume.vue

@@ -163,7 +163,7 @@
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
-                                <span>{{ nameObj.workprocid.obj[scope.row.workprocid] ? nameObj.workprocid.obj[scope.row.workprocid].name : scope.row.workprocid }}</span>
+                                <span>{{ nameObj.workprocid.obj[scope.row.workprocid] ? nameObj.workprocid.obj[scope.row.workprocid] : scope.row.workprocid }}</span>
                             </template>
                         </el-table-column>
                         <el-table-column
@@ -175,7 +175,7 @@
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
-                                <span>{{ nameObj.materialid.obj[scope.row.materialid] ? nameObj.materialid.obj[scope.row.materialid].name : scope.row.materialid }}</span>
+                                <span>{{ nameObj.materialid.obj[scope.row.materialid] ? nameObj.materialid.obj[scope.row.materialid] : scope.row.materialid }}</span>
                             </template>
                         </el-table-column>
                         <el-table-column
@@ -790,7 +790,6 @@ export default {
                 item.isSelection = true;
             }
             that.tableFormDataObj = tableFormDataObj;
-            console.log(that.tableFormDataObj)
             this.multipleSelection = val;
         },
         // 修改修正值

+ 1 - 2
src/views/energyBalance/components/panku/output.vue

@@ -233,7 +233,7 @@
                 ></el-pagination> -->
                 <div class="box-xh" v-if="filterForm.checked">
                     <el-form
-                    style="margin-left: 630px;"
+                    style="margin-left: 590px;"
                     size="mini"
                     label-width="100px"
                     >
@@ -434,7 +434,6 @@ export default {
              that.filterForm.data.productid = that.$route.query.productid;
         }
         if(that.$route.query.workprocid){
-            console.log(that.$route.query.workprocid);
             that.filterForm.data.workprocid = that.$route.query.workprocid;
         }
         that.getTimeGranData();

+ 8 - 8
src/views/energyPerformance/components/supplyAnddemand/Project.vue

@@ -215,14 +215,6 @@
                         @current-change="handleCurrentChange"
                         :row-class-name="rowClassName"
                     >
-                        <el-table-column
-                         sortable
-                            type="selection"
-                            width="40"
-                            align="center"
-                            fixed="left"
-                            class-name="cnspicuous"
-                        ></el-table-column>
                         <el-table-column
                             sortable
                             prop="showno"
@@ -449,6 +441,14 @@
                                 <span v-else>{{ scope.row.fid }}</span>
                             </template>
                         </el-table-column>
+                         <el-table-column
+                         sortable
+                            type="selection"
+                            width="40"
+                            align="center"
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
                         <el-table-column
                             sortable
                             prop="showno"

+ 3 - 3
src/views/energyPerformance/components/supplyAnddemand/ProjectData.vue

@@ -282,13 +282,13 @@
                             align="center"
                             fixed="left"
                         ></el-table-column>
-                         <el-table-column
+                         <!-- <el-table-column
                         sortable
                             type="index"
-                            label="序号"
+                            label="序号"
                             width="80px"
                             :show-overflow-tooltip="true"
-                        ></el-table-column>
+                        ></el-table-column> -->
                         <el-table-column
                         sortable
                             prop="clock"

+ 350 - 2
src/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue

@@ -350,6 +350,133 @@
                                 <span v-else>{{scope.row.lengths}}</span>
                         </template>
                         </el-table-column>
+                        <el-table-column
+                         align="center"
+                         label="添加化学成分信息"
+                         width="110px"
+                         :show-overflow-tooltip="true"
+                         v-if="filterForm.data.gx==='LG'"
+                        >
+                        <template  slot-scope="scope">
+                        <el-popover
+                            placement="top"
+                            title="添加化学成分信息"
+                            width="600"
+                            :ref="'popover-' + scope.row.id"
+                            trigger="click"
+                            @show="gethxcfDate(scope.row)" 
+                        >
+                              <div style="float:left">
+                                 <el-button
+                                 class="button"
+                                 type="primary"
+                                 size="mini"
+                                 icon="el-icon-edit-outline"
+                                 @click="addhxcf(scope.row)"
+                                 :loading="loading"
+                                 >
+                                 保存
+                                 </el-button>
+                             </div>
+                              <div>
+                                    <div class="box-bottom">
+                                        <P><el-button class="el-icon-plus" style="float:right;margin-top:34px;padding:9px 20px;margin-right: 4px" type="min" @click.prevent="addRow(scope.row)"></el-button></P>
+                                        <p><el-button class="el-icon-minus" style="position:relative;top:34px;left:380px;padding:9px 20px" type="min" @click.prevent="delData(scope.row)"></el-button></p>
+                                        <el-form
+                                        size="mini"
+                                        ref="dialog_form_hxcf"
+                                        label-width="0px"
+                                        :model="hxcfDataObj"
+                                        >
+                                        <el-table
+                                            id="multipleTable"
+                                            ref="multipleTable"
+                                            :data="gridData"
+                                            tooltip-effect="dark"
+                                            v-loading="gridDataLoading"
+                                            border
+                                            stripe
+                                            style="width: 80%"
+                                            @selection-change="selectRow"
+                                            @cell-click="cellClickHxcf"
+                                            >
+                                            <el-table-column
+                                                type="selection"
+                                                width="40"
+                                                align="center"
+                                                fixed="left"
+                                                class-name="cnspicuous"
+                                            ></el-table-column>
+                                            <el-table-column
+                                                sortable
+                                                label="成分信息"
+                                                prop="chemcode"
+                                                align="center"
+                                                min-width="100px"
+                                                :show-overflow-tooltip="true"
+                                             >
+                                               <template slot-scope="scope">
+                                                   <el-form-item
+                                                    v-if="scope.row.isSelection"
+                                                    :prop="scope.row.seq + '.chemcode'"
+                                                    :rules="hxcfRules.chemcode"
+                                                   >
+                                                   <el-select
+                                                   filterable 
+                                                   collapse-tags
+                                                   v-model="hxcfDataObj[scope.row.seq].chemcode"
+                                                   >
+                                                   <el-option
+                                                    v-for="item of nameObj.hxcf.arr"
+                                                    :key="item.id"
+                                                    :value="item.id"
+                                                    :label="item.name"
+                                                    ></el-option>
+                                                   </el-select>
+                                                   </el-form-item>
+                                                   <span v-else>{{nameObj.hxcf.obj[scope.row.chemcode] ? nameObj.hxcf.obj[scope.row.chemcode].name : scope.row.chemcode }}</span>
+                                               </template>
+                                            </el-table-column>
+                                            <el-table-column sortable min-width="100" prop="nkstdmin" align="center" label="下限值">
+                                            <template slot-scope="scope">
+                                                <el-form-item
+                                                 v-if="scope.row.isSelection"
+                                                 :prop="scope.row.seq + '.nkstdmin'"
+                                                 :rules="hxcfRules.nkstdmin"
+                                                >
+                                                    <el-input
+                                                    style="width: 100%;"
+                                                    v-model="hxcfDataObj[scope.row.seq].nkstdmin"
+                                                    >
+                                                    </el-input>
+                                                </el-form-item>
+                                               <span v-else>{{scope.row.nkstdmin}}</span>
+                                            </template>
+                                            </el-table-column>
+                                            <el-table-column sortable min-width="100" prop="nkstdmax" align="center" label="上限值">
+                                            <template slot-scope="scope">
+                                                <el-form-item
+                                                v-if="scope.row.isSelection"
+                                                :prop="scope.row.seq + '.nkstdmax'"
+                                                :rules="hxcfRules.nkstdmax"
+                                                >
+                                                    <el-input
+                                                    style="width: 100%;"
+                                                    v-model="hxcfDataObj[scope.row.seq].nkstdmax"
+                                                    >
+                                                    </el-input>
+                                                </el-form-item>
+                                                <span v-else>{{scope.row.nkstdmax}}</span>
+                                            </template>
+                                            </el-table-column>
+                                        </el-table>
+                                        </el-form>
+                                    </div>
+                              </div>
+                                <el-button slot="reference" class= "el-tooltip" size="mini" type="text">点击添加数据</el-button>
+                        </el-popover>
+                        </template>
+                        </el-table-column>
                         <el-table-column
                         sortable
                             prop="planweight"
@@ -848,6 +975,8 @@ export default {
             seqArr: [],
             editSetFlag: '',
             isCheck: false, // 是否为审核人
+            visible: false,
+            selectlistRow: [],
             filterForm: {
                 show: true,
                 data: {
@@ -957,10 +1086,27 @@ export default {
             singleTableHeight: 100,
             tableData: [
             ],
+            gridData: [],
             loading: false,
             tableLoading: false,
+            gridDataLoading: false,
             multipleSelection: [],
+            hxcfSelection: [],
+            hxcfDataObj: {},
             tableFormDataObj: {},
+            hxcfRules: {
+                chemcode: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                nkstdmin: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                nkstdmax: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ]
+            },
             tableFormRules: {
                 grades: [
                      { required: true, message: '该项不能为空', trigger: 'change' }
@@ -1069,6 +1215,10 @@ export default {
                         }
                     ]
                 },
+                hxcf: {
+                    obj: {},
+                    arr: []
+                },
                 workprocid: {
                     obj: {},
                     arr: []
@@ -1208,6 +1358,7 @@ export default {
         // that.getLocation();
         that.getUnitIdData();
         that.getLocateIdData();
+        that.gethxcf();
         // that.getTableData();
     },
     methods: {
@@ -1231,7 +1382,6 @@ export default {
                type = '型钢'
             }
             let url = 'pass/product/v1/emssteel/getGrades/?type=' + type;
-
             that.axios.get(url)
                 .then(function (res) {
                     if (res.code === '0') {
@@ -1254,6 +1404,182 @@ export default {
                     }
                 });
         },
+        gethxcfDate(row){
+         let that = this;
+         let url = 'pass/ems/v1/chemicalconstituentss/getDataByGmid';
+         let params ={};
+         params = {
+             gmid: row.id
+         }
+         that.gridDataLoading = true;
+         that.axios.get(url, {
+             params: params
+            }).then(function (res) {
+                if (res.code === '0') {
+                    let arr = [];
+                    for(let i = 0 ; i < res.data.length; i++){
+                        let item = res.data[i];
+                        arr.push({
+                            seq: i,
+                            gmid: item.gmid,
+                            chemcode: item.chemCode,
+                            nkstdmin: item.nkStdMin,
+                            nkstdmax: item.nkStdMax
+                        })
+                    }
+                    that.gridData = arr;
+                    that.gridDataLoading = false;
+                } else {
+                    that.$message.error(res.message);
+                }
+            }).catch(function () {
+                that.leftTableLoading = false;
+            });
+        },
+        addhxcf(row){
+            let that = this;
+            if (that.hxcfSelection.length > 0){
+               that.$refs['dialog_form_hxcf'].validate((valid, obj) => {
+
+                    if (valid) {
+                        let SubmitData = [];
+                         for (let key in that.hxcfDataObj) {
+                              SubmitData.push({
+                              gmid: row.id,
+                              chemCode: that.hxcfDataObj[key].chemcode,
+                              nkStdMin: that.hxcfDataObj[key].nkstdmin,
+                              nkStdMax: that.hxcfDataObj[key].nkstdmax
+                              });
+                         }
+                         that.gridDataLoading = true;
+                         that.axios.put('pass/ems/v1/chemicalconstituentss/update', SubmitData)
+                         .then(function (res) {
+                            if (res.code === '0') {
+                              that.$message({
+                                message: '保存成功',
+                                type: 'success'
+                                });
+                            that.gethxcfDate(row);    
+                            } else {
+                              that.$message.error(res.message);
+                            }
+                          that.gridDataLoading = false;   
+                         }).catch(function () {
+                             that.gridDataLoading = false;
+                         });
+                    }
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+
+        },
+        gethxcf () {
+            let that = this;
+            let url = 'pass/ems/v1/qcmbasechems/getIdAndName'
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.chemCode,
+                                name: item.chemName
+                            })
+                                obj[item.id] = {
+                                name: item.chemName,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.hxcf.arr = arr;
+                        that.nameObj.hxcf.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+      selectRow (val) {
+          let that = this;
+          let hxcfDataObj = {};
+          let arr = [];
+           for (let item of val) {
+               arr.push(item.seq);
+           }
+         this.seqArr = arr.sort(sortNumber);
+         for (let item of that.gridData) {
+             item.isSelection = false;
+         }
+        for (let item of val) {
+            let obj = {};
+            let xId = item.seq;
+            if (that.hxcfDataObj[xId]) {
+                 hxcfDataObj[xId] = that.hxcfDataObj[xId];
+            } else {
+                for (let key in item) {
+                    obj[key] = item[key];
+                }
+                hxcfDataObj[xId] = obj;
+            }
+            item.isSelection = true;
+        }
+        that.hxcfDataObj = hxcfDataObj;
+        that.hxcfSelection = val;
+      },
+       addRow (row) {
+        let that = this;
+        let seq = that.gridData.length;
+        var list = {
+            seq:seq+1,
+            chemcode:'',
+            nkstdmin: 0,
+            nkstdmax: 0
+          }
+        this.gridData.unshift(list)
+      },
+      delData () {
+          let that = this;
+          let gridData = that.gridData;
+          //let val = that.hxcfSelection;
+          if( that.hxcfSelection.length >0 ){
+              let SubmitData = [];
+              for (let item of that.hxcfSelection) {
+                    SubmitData.push({
+                        gmid: item.gmid, 
+                        chemCode: item.chemcode,
+                        nkStdMin: item.nkstdmin,
+                        nkStdMax: item.nkstdmax
+                    });
+                }
+                 that.axios.delete('pass/ems/v1/chemicalconstituentss/delete', {
+                  data: SubmitData,
+                  contentType: 'application/json;charset=UTF-8'
+                }).then(function (res) {
+                 if (res.code === '0') {
+                     that.$message({
+                     message: '删除成功',
+                     type: 'success'
+                });
+                that.hxcfSelection.forEach((val, index) => {
+                    gridData.forEach((v, i) => {
+                    if (val.seq === v.seq) {
+                        gridData.splice(i, 1)
+                        }
+                    })
+                })
+                 //this.$refs.multipleTable.clearSelection();
+            }
+        });
+            //   that.$confirm('是否删除已选数据?', '提示', {
+            //       confirmButtonText: '确定',
+            //       cancelButtonText: '取消',
+            //       state: 'warning'
+            //   }).then(() => {
+            //   });
+          } else {
+              this.$message.error('至少要选择一条数据');
+          }
+    },
         // 获取高线规格
         getSpecifications () {
             let that = this
@@ -1329,7 +1655,7 @@ export default {
                 });
         },
         // 获取炼钢规格
-        getSpecificationsAsLg () {
+        getSpecificationsAsLg() {
             let that = this
             let url = 'pass/product/v1/emsvqcmbasespecbillet/getbasespecbillet';
             that.axios.get(url)
@@ -1445,6 +1771,7 @@ export default {
                     });
             }
         },
+
         // 保存数据
         dataSave () {
             let that = this;
@@ -1718,6 +2045,13 @@ export default {
                 return true;
             }
         },
+        //成分标准选择
+        checkboxTcf(row, index){
+          if(row.isSelection){
+              return true
+          }
+          return false;
+        },
         // 获取标准计量单位
         getUnitIdData () {
             let that = this
@@ -2081,6 +2415,20 @@ export default {
             // 把每一行的索引放进row
             row.index = rowIndex;
         },
+        cellClickHxcf(row, column, cell, event){
+          let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        },
         cellClick (row, column, cell, event) {
             let _this = this;
             this.rowIndex = row.index;

+ 105 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectRoundLG.vue

@@ -551,6 +551,48 @@
                                  <span v-else>{{ nameObj.chemicalStandard.obj[scope.row.chemicalStandard] ? nameObj.chemicalStandard.obj[scope.row.chemicalStandard].name : scope.row.chemicalStandard }}</span>
                                 </template>
                                 </el-table-column>
+                                <el-table-column
+                                    align="center"
+                                    label="查看化学成分信息"
+                                    width="110px"
+                                >
+                                <template slot-scope="scope">
+                                <el-popover 
+                                trigger="click"
+                                :ref="'popover-' + scope.row.roundid"  
+                                placement="top" 
+                                width="400"
+                                @show="gethxcfDate(scope.row)">
+                                        <el-table
+                                            id="multipleTable"
+                                            ref="multipleTable"
+                                            :data="gridData"
+                                            tooltip-effect="dark"
+                                            border
+                                            stripe
+                                            style="width: 100%">
+                                            <el-table-column
+                                                sortable
+                                                label="成分信息"
+                                                prop="chemcode"
+                                                align="center"
+                                                width="100px"
+                                                :show-overflow-tooltip="true"
+                                             >
+                                             <template slot-scope="scope">
+                                                <span
+                                                >{{ nameObj.hxcf.obj[scope.row.chemcode] ? nameObj.hxcf.obj[scope.row.chemcode].name : scope.row.chemcode }}</span>
+                                                </template>
+                                             </el-table-column>
+                                            <el-table-column sortable min-width="100" prop="nkstdmin" align="center" label="下限值">
+                                            </el-table-column>
+                                            <el-table-column sortable width="100" prop="nkstdmax" align="center" label="上限值">
+                                            </el-table-column>
+                                            </el-table>
+                                         <el-button slot="reference" type="text" class= "el-tooltip" size="mini">点击查看</el-button>
+                                    </el-popover>
+                                 </template>
+                                </el-table-column>
                                 <el-table-column
                                 sortable
                                     prop="goinfo"
@@ -782,6 +824,7 @@ export default {
             columnId: '',
             focusTarget: null,
             radio: '1',
+            gridData:[],
             leftTableShow: true,
             seqArr: [],
             filterForm: {
@@ -873,6 +916,10 @@ export default {
                     obj: {},
                     arr: []
                 },
+                hxcf: {
+                    obj: {},
+                    arr: []
+                },
                 state: {
                     obj: {
                         '0': {
@@ -1090,6 +1137,7 @@ export default {
         that.getStandards();
         that.getUnitIdData();
         that.getsurfaceStandard();
+        that.gethxcf();
     },
     methods: {
         //  计算树区域高度
@@ -1181,6 +1229,38 @@ export default {
                     }
                 });
         },
+        gethxcfDate(row){
+         let that = this;
+         let url = 'pass/ems/v1/chemicalconstituentss/getDataByGmid';
+         let params ={};
+         params = {
+             gmid: row.parentid
+         }
+         that.gridDataLoading = true;
+         that.axios.get(url, {
+             params: params
+            }).then(function (res) {
+                if (res.code === '0') {
+                    let arr = [];
+                    for(let i = 0 ; i < res.data.length; i++){
+                        let item = res.data[i];
+                        arr.push({
+                            seq: i,
+                            gmid: item.gmid,
+                            chemcode: item.chemCode,
+                            nkstdmin: item.nkStdMin,
+                            nkstdmax: item.nkStdMax
+                        })
+                    }
+                    that.gridData = arr;
+                    that.gridDataLoading = false;
+                } else {
+                    that.$message.error(res.message);
+                }
+            }).catch(function () {
+                that.leftTableLoading = false;
+            });
+        },
         // 获取标准计量单位
         getUnitIdData () {
             let that = this
@@ -1339,6 +1419,31 @@ export default {
             });
             }
         },
+        gethxcf () {
+            let that = this;
+            let url = 'pass/ems/v1/qcmbasechems/getIdAndName'
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.chemCode,
+                                name: item.chemName
+                            })
+                                obj[item.id] = {
+                                name: item.chemName,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.hxcf.arr = arr;
+                        that.nameObj.hxcf.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
         getTableDetailDatas (pageNum, type) {
             let that = this;
             let params = {};