Jelajahi Sumber

2021/7/26 zhangyan
1.修改页面排版

zhangyan 3 tahun lalu
induk
melakukan
afc4a4a0d4

+ 5 - 5
src/views/energyPlan/components/supplyAndDemand/planProjectBuildingMaterialsWaterSlag.vue

@@ -181,7 +181,7 @@
                             width="80px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
-                        <el-table-column
+                        <!-- <el-table-column
                             prop="productid"
                             label="产品名称"
                             fixed="left"
@@ -191,7 +191,7 @@
                         <template slot-scope="scope">
                                         <span>{{ nameObj.workprocid.obj[scope.row.productid] ? nameObj.workprocid.obj[scope.row.productid].name : scope.row.productid }}</span>
                         </template>
-                        </el-table-column>
+                        </el-table-column> -->
                          <el-table-column
                             fixed="left"
                             prop="unit"
@@ -204,7 +204,7 @@
                         </el-table-column>
                         <el-table-column
                             prop="weight"
-                            label="年度计划量"
+                            label="矿渣粉"
                             width="160px"
                             :show-overflow-tooltip="true"
                         >
@@ -395,7 +395,7 @@
     </span>
     </el-dialog>
      <el-dialog
-       title="年计划编制-轧钢复制"
+       title="年计划编制-建材(水渣)复制"
        :visible.sync="dialog.editorBox2.show"
         width="400px"
        :close-on-click-modal="false"
@@ -1271,7 +1271,7 @@ export default {
                                 memo: that.tableFormDataObj[key].memo,
                                 cjsj: that.tableFormDataObj[key].cjsj,
                                 jzsj: that.tableFormDataObj[key].jzsj,
-                                line: that.tableFormDataObj[key].line,
+                                productid: that.tableFormDataObj[key].productid,
                                 xgr: that.tableFormDataObj[key].xgr,
                                 xgsj: that.tableFormDataObj[key].xgsj,
                                 cp: that.tableFormDataObj[key].cp,

+ 261 - 88
src/views/energyPlan/components/supplyAndDemand/planProjectCoke.vue

@@ -181,7 +181,7 @@
                             width="80px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
-                        <el-table-column
+                        <!-- <el-table-column
                             prop="line"
                             label="产品"
                             fixed="left"
@@ -191,7 +191,7 @@
                         <template slot-scope="scope">
                                         <span>{{ nameObj.workprocid.obj[scope.row.line] ? nameObj.workprocid.obj[scope.row.line].name : scope.row.line }}</span>
                         </template>
-                        </el-table-column>
+                        </el-table-column> -->
                         <el-table-column
                             fixed="left"
                             prop="unit"
@@ -205,30 +205,103 @@
                         </el-table-column>
                         <el-table-column
                             prop="weight"
-                            label="年度计划量"
-                            width="160px"
+                            label="焦油"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['焦油']"
+                                        v-if="!isNaN(Number(itemform['焦油']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['焦油']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="粗苯"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3009']"
+                                        v-if="!isNaN(Number(itemform['AT3009']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3009']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="硫铵"
+                            width="120px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
                                 <el-form-item
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
                                     :prop="scope.row.seq + '.weight'"
-                                    :rules="tableFormRules.weight"
                                 >
                                     <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
                                         style="width: 100%;"
-                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        v-model="itemform['AT3010']"
+                                        v-if="!isNaN(Number(itemform['AT3010']))"
                                         refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
                                         @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                         @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
                                     ></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.weight}}</span>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3010']}}</span>
                             </template>
                         </el-table-column>
+                        <el-table-column
+                            prop="total"
+                            label="合计产量"
+                            fixed="left"
+                            width="160px"
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -298,7 +371,7 @@
             </div>
         </div>
          <el-dialog
-        title="年计划编制-机焦厂新增"
+        title="年计划编制-机焦厂(副产品)新增"
         :visible.sync="dialog.editorBox.show"
         width="600px"
         :close-on-click-modal="false"
@@ -419,6 +492,7 @@
     </span>
     </el-dialog>
      <el-dialog
+      title="年计划编制-机焦厂(副产品)复制"
        :visible.sync="dialog.editorBox2.show"
        width="400px"
        :close-on-click-modal="false"
@@ -631,6 +705,10 @@ export default {
                 },
                 workprocid: {
                     obj: {
+                        '焦油': {
+                             id: '焦油',
+                           name: '焦油'
+                        },
                         'AT3009': {
                             id: 'AT3009',
                           name: '粗苯'
@@ -638,26 +716,26 @@ export default {
                         'AT3010': {
                            id: 'AT3010',
                            name: '硫铵'
-                        },
-                        '焦油': {
-                             id: '焦油',
-                           name: '焦油'
                         }},
                     arr: [{
+                             id: '焦油',
+                           name: '焦油'
+                        },
+                        {
                           id: 'AT3009',
                           name: '粗苯'
                         },
                         {
                         id: 'AT3010',
                         name: '硫铵'
-                       },
-                       {
-                            id: '焦油',
-                          name: '焦油'
                        }]
                 },
                 line: {
                     obj: {
+                        '焦油': {
+                             id: '焦油',
+                           name: '焦油'
+                        },
                         'AT3009': {
                             id: 'AT3009',
                           name: '粗苯'
@@ -665,22 +743,18 @@ export default {
                         'AT3010': {
                            id: 'AT3010',
                            name: '硫铵'
-                        },
-                        '焦油': {
-                             id: '焦油',
-                           name: '焦油'
                         }},
                     arr: [{
+                           id: '焦油',
+                           name: '焦油'
+                        },
+                        {
                           id: 'AT3009',
                           name: '粗苯'
                         },
                         {
                         id: 'AT3010',
                         name: '硫铵'
-                       },
-                       {
-                            id: '焦油',
-                          name: '焦油'
                        }]
                 },
                 location: {
@@ -805,8 +879,49 @@ export default {
         },
         // 自定义的表格合计方法:只给指定列进行合计
         getSummaries (param) {
-            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
-            return commonSummaries(param, prop);
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'total']; // 合计列绑定的prop
+            const {columns, data} = param;
+            const sums = commonSummaries(param, prop);
+            let that = this;
+            columns.forEach((column, index) => {
+            if (index === 1) {
+            sums[index] = '合计';
+            return;
+            };
+            let lineTotal = 0;
+            let weiItem = 0;
+            switch (column.property) {
+            case 'weight':
+             lineTotal = 0;
+            for (let i = 0; i < that.tableData.length; i++) {
+                switch (0) {
+                    case index % 7:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3010']) ? 0 : item['AT3010']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 6:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3009']) ? 0 : item['AT3009']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    default:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['焦油']) ? 0 : item['焦油']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                }
+            };
+            sums[index] = lineTotal;
+            break;
+            default:
+            break;
+            }
+            });
+            return sums;
         },
         // 获取工序列表
         // getNodeData () {
@@ -884,17 +999,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    productid: that.tableFormDataObj[key].productid,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -980,7 +1098,8 @@ export default {
                     zt: that.filterForm.data.zt,
                     measureid: that.filterForm.data.measureid,
                     exactsearch: that.filterForm.data.searchtype,
-                    parentid: that.filterForm.data.parentid
+                    parentid: that.filterForm.data.parentid,
+                    parentNum: that.nameObj.line.arr.length
                 };
                 for (let key in pData) {
                     if (pData[key]) {
@@ -993,39 +1112,67 @@ export default {
             // if (that.isCheck) {
             //     url = 'pass/ems/v1/trmtransfereactvalues/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             // }
-            let url = 'pass/ems/v1/emsprodplanyears/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanyears/getList?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let i = 0; i < res.data.list.length; i++) {
-                            let item = res.data.list[i];
-                            arr.push({
-                                seq: i,
-                                unit: item.unit,
-                                line: item.line,
-                                productid: item.productid,
-                                yearmonth: item.yearmonth,
-                                weight: item.weight,
-                                cjr: item.cjr,
-                                cjsj: item.cjsj,
-                                jzsj: item.jzsj,
-                                xgr: item.xgr,
-                                xgsj: item.xgsj,
-                                cp: item.cp,
-                                sysl: item.sysl,
-                                wxsy: item.wxsy,
-                                zt: item.zt,
-                                parentid: item.parentid,
-                                no: item.no,
-                                id: item.id,
-                                memo: item.memo
-                            });
+                        let index = 0;
+                        let chirItem = res.data.list[0];
+                        for (let e in chirItem) {
+                            let item = chirItem[e];
+                            let weightArr = [];
+                            let lineArr = [];
+                            let noArr = [];
+                            let memoArr = [];
+                            let sum = 0;
+                            let memoLong = '';
+                        for (let i = 0; i < chirItem[e].length; i++) {
+                            weightArr.push({
+                                [item[i].line]: item[i].weight
+                                });
+                            lineArr.push({
+                                [i]: item[i].line
+                                });
+                            memoArr.push({
+                                [i]: item[i].memo
+                                });
+                            noArr.push({
+                                [i]: item[i].no
+                                });
+                            if (item[i].memo !== null && item[i].memo !== '') {
+                                 memoLong = memoLong + item[i].memo + ';';
+                            }
+                            sum += item[i].weight;
+                        };
+                        arr.push({
+                            seq: index,
+                            unit: item[chirItem[e].length - 1].unit,
+                            line: lineArr,
+                            yearmonth: item[chirItem[e].length - 1].yearmonth,
+                            weight: weightArr,
+                            cjr: item[chirItem[e].length - 1].cjr,
+                            cjsj: item[chirItem[e].length - 1].cjsj,
+                            jzsj: item[chirItem[e].length - 1].jzsj,
+                            xgr: item[chirItem[e].length - 1].xgr,
+                            xgsj: item[chirItem[e].length - 1].xgsj,
+                            cp: item[chirItem[e].length - 1].cp,
+                            sysl: item[chirItem[e].length - 1].sysl,
+                            wxsy: item[chirItem[e].length - 1].wxsy,
+                            zt: item[chirItem[e].length - 1].zt,
+                            parentid: item[chirItem[e].length - 1].parentid,
+                            no: noArr,
+                            id: item[chirItem[e].length - 1].id,
+                            memo: memoLong,
+                            total: sum
+                        });
+                        index = index + 1;
                         }
                         that.total = res.data.total;
-                        that.tableData = arr;
+                        that.tableData = JSON.parse(JSON.stringify(arr));
+                        that.originalData = JSON.parse(JSON.stringify(arr));
                         that.getAdds();
                     } else {
                         that.$message.error(res.message);
@@ -1214,6 +1361,17 @@ export default {
             for (let item of that.tableData) {
                 item.isSelection = false;
             }
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
+            let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
+            for (let item of arrcha) {
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1319,28 +1477,31 @@ export default {
                     if (valid) {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
-                            SubmitData.push({
-                                no: that.tableFormDataObj[key].no,
-                                weight: that.tableFormDataObj[key].weight,
-                                cjr: that.tableFormDataObj[key].cjr,
-                                memo: that.tableFormDataObj[key].memo,
-                                cjsj: that.tableFormDataObj[key].cjsj,
-                                jzsj: that.tableFormDataObj[key].jzsj,
-                                line: that.tableFormDataObj[key].line,
-                                productid: that.tableFormDataObj[key].productid,
-                                xgr: that.tableFormDataObj[key].xgr,
-                                xgsj: that.tableFormDataObj[key].xgsj,
-                                cp: that.tableFormDataObj[key].cp,
-                                sysl: that.tableFormDataObj[key].sysl,
-                                zt: that.tableFormDataObj[key].zt,
-                                wxsy: that.tableFormDataObj[key].wxsy,
-                                unit: that.tableFormDataObj[key].unit,
-                                parentid: that.filterForm.data.parentid,
-                                yearmonth: that.tableFormDataObj[key].yearmonth
-                            });
-                        }
+                            let memoArr = that.tableFormDataObj[key].memo.split(';');
+                            for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                                 for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                                     SubmitData.push({
+                                     weight: that.tableFormDataObj[key].weight[i][keyname],
+                                     no: that.tableFormDataObj[key].no[i][i],
+                                     memo: memoArr[i],
+                                     cjsj: that.tableFormDataObj[key].cjsj,
+                                     jzsj: that.tableFormDataObj[key].jzsj,
+                                     line: that.tableFormDataObj[key].line[i][i],
+                                     xgr: that.tableFormDataObj[key].xgr,
+                                     xgsj: that.tableFormDataObj[key].xgsj,
+                                     cp: that.tableFormDataObj[key].cp,
+                                     sysl: that.tableFormDataObj[key].sysl,
+                                     zt: that.tableFormDataObj[key].zt,
+                                     wxsy: that.tableFormDataObj[key].wxsy,
+                                     unit: that.tableFormDataObj[key].unit,
+                                     parentid: that.filterForm.data.parentid,
+                                     yearmonth: that.tableFormDataObj[key].yearmonth
+                                     });
+                                 };
+                             }
+                         }
                         that.loading = true;
-                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdateList', SubmitData)
                             .then(function (res) {
                                 if (res.code === '0') {
                                     that.$message({
@@ -1374,7 +1535,6 @@ export default {
                 parentid: that.filterForm.data.parentid,
                 memo: that.dialog.editorBox.form.data.memo
             });
-            console.log(SubmitData)
             that.$refs['dialog_form'].validate((valid) => {
                if (valid) {
                         that.loading = true;
@@ -1410,9 +1570,11 @@ export default {
                         this.$message.error('已经审核的数据不能删除');
                         return;
                     }
-                    SubmitData.push({
-                        no: item.no
-                    });
+                    for (let noItem in item.no) {
+                        SubmitData.push({
+                            no: item.no[noItem][noItem]
+                        });
+                    }
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
@@ -1523,6 +1685,17 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
         }
     }
 }

+ 42 - 18
src/views/energyPlan/components/supplyAndDemand/planProjectGeneration.vue

@@ -61,7 +61,7 @@
                                     @click="but_add"
                                     :loading="loading"
                                 >新增</el-button>
-                                   <!-- <el-button
+                                   <el-button
                                     class="button"
                                     type="primary"
                                     size="mini"
@@ -69,7 +69,7 @@
                                     @click="but_copy"
                                     :loading="loading"
                                     v-if="butPrivilege.PUT && !isCheck"
-                                >复制</el-button> -->
+                                >复制</el-button>
                                 <el-button
                                     class="button"
                                     type="primary"
@@ -373,7 +373,10 @@
                             label="产量合计"
                             width="200px"
                             :show-overflow-tooltip="true"
-                        ></el-table-column>
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -543,6 +546,7 @@
     </span>
     </el-dialog>
      <el-dialog
+        title="年计划编制-发电厂复制"
        :visible.sync="dialog.editorBox2.show"
        width="400px"
        :close-on-click-modal="false"
@@ -1059,16 +1063,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -1189,7 +1197,7 @@ export default {
                                 [item[i].line]: item[i].weight
                                 });
                             lineArr.push({
-                                [i]: item[i].weight
+                                [i]: item[i].line
                                 });
                             noArr.push({
                                  [i]: item[i].no
@@ -1412,10 +1420,17 @@ export default {
             for (let item of that.tableData) {
                 item.isSelection = false;
             }
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
             let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
             for (let item of arrcha) {
-                that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
-            };
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1434,12 +1449,10 @@ export default {
             }
             for (let item of that.tableData) {
                 if (item.isSelection === false) {
-                    that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
                     item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
                 }
             }
             that.tableFormDataObj = tableFormDataObj;
-            console.log(val);
             that.multipleSelection = val;
             this.getAdds();
         },
@@ -1723,6 +1736,17 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
         }
     }
 }

+ 285 - 68
src/views/energyPlan/components/supplyAndDemand/planProjectIronMill.vue

@@ -179,7 +179,7 @@
                             width="80px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
-                        <el-table-column
+<!--                        <el-table-column
                             prop="line"
                             label="工序"
                             fixed="left"
@@ -189,7 +189,7 @@
                         <template slot-scope="scope">
                                         <span>{{ nameObj.workprocid.obj[scope.row.line] ? nameObj.workprocid.obj[scope.row.line].name : scope.row.line }}</span>
                         </template>
-                        </el-table-column>
+                        </el-table-column> -->
                         <el-table-column
                             fixed="left"
                             prop="unit"
@@ -203,7 +203,37 @@
                         </el-table-column>
                         <el-table-column
                             prop="weight"
-                            label="年度计划量"
+                            label="供高线一车间方坯"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3005']"
+                                        v-if="!isNaN(Number(itemform['AT3005']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3005']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="供高线二车间方坯"
                             width="160px"
                             :show-overflow-tooltip="true"
                         >
@@ -211,22 +241,95 @@
                                 <el-form-item
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
                                     :prop="scope.row.seq + '.weight'"
-                                    :rules="tableFormRules.weight"
                                 >
                                     <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3006']"
+                                        v-if="!isNaN(Number(itemform['AT3006']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3006']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="异形坯"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3007']"
+                                        v-if="!isNaN(Number(itemform['AT3007']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3007']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="外销方坯"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
                                         style="width: 100%;"
-                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        v-model="itemform['AT3008']"
+                                        v-if="!isNaN(Number(itemform['AT3008']))"
                                         refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
                                         @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                         @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
                                     ></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.weight}}</span>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3008']}}</span>
                             </template>
                         </el-table-column>
+                        <el-table-column
+                            prop="total"
+                            label="合计产量"
+                            fixed="left"
+                            width="160px"
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -530,6 +633,7 @@ export default {
             singleTableHeight: 100,
             tableData: [
             ],
+            originalData: [],
             loading: false,
             tableLoading: false,
             multipleSelection: [],
@@ -806,8 +910,61 @@ export default {
         },
         // 自定义的表格合计方法:只给指定列进行合计
         getSummaries (param) {
-            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
-            return commonSummaries(param, prop);
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'total']; // 合计列绑定的prop
+            const {columns, data} = param;
+            const sums = commonSummaries(param, prop);
+            let that = this;
+            columns.forEach((column, index) => {
+            if (index === 1) {
+            sums[index] = '合计';
+            return;
+            };
+            let lineTotal = 0;
+            let lineTotal1 = 0;
+            let lineTotal2 = 0;
+            let lineTotal3 = 0;
+            let weiItem = 0;
+            switch (column.property) {
+            case 'weight':
+             lineTotal = 0;
+             lineTotal1 = 0;
+             lineTotal2 = 0;
+             lineTotal3 = 0;
+            for (let i = 0; i < that.tableData.length; i++) {
+                switch (0) {
+                    case index % 8:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3008']) ? 0 : item['AT3008']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 7:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3007']) ? 0 : item['AT3007']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 6:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3006']) ? 0 : item['AT3006']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    default:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3005']) ? 0 : item['AT3005']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                }
+            };
+            sums[index] = lineTotal;
+            break;
+            default:
+            break;
+            }
+            });
+            return sums;
         },
         // 获取工序列表
         // getNodeData () {
@@ -885,16 +1042,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -980,7 +1141,8 @@ export default {
                     zt: that.filterForm.data.zt,
                     measureid: that.filterForm.data.measureid,
                     exactsearch: that.filterForm.data.searchtype,
-                    parentid: that.filterForm.data.parentid
+                    parentid: that.filterForm.data.parentid,
+                    parentNum: that.nameObj.workprocid.arr.length
                 };
                 for (let key in pData) {
                     if (pData[key]) {
@@ -993,38 +1155,67 @@ export default {
             // if (that.isCheck) {
             //     url = 'pass/ems/v1/trmtransfereactvalues/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             // }
-            let url = 'pass/ems/v1/emsprodplanyears/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanyears/getList?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let i = 0; i < res.data.list.length; i++) {
-                            let item = res.data.list[i];
-                            arr.push({
-                                seq: i,
-                                unit: item.unit,
-                                line: item.line,
-                                yearmonth: item.yearmonth,
-                                weight: item.weight,
-                                cjr: item.cjr,
-                                cjsj: item.cjsj,
-                                jzsj: item.jzsj,
-                                xgr: item.xgr,
-                                xgsj: item.xgsj,
-                                cp: item.cp,
-                                sysl: item.sysl,
-                                wxsy: item.wxsy,
-                                zt: item.zt,
-                                parentid: item.parentid,
-                                no: item.no,
-                                id: item.id,
-                                memo: item.memo
-                            });
+                        let index = 0;
+                        let chirItem = res.data.list[0];
+                        for (let e in chirItem) {
+                            let item = chirItem[e];
+                            let weightArr = [];
+                            let lineArr = [];
+                            let noArr = [];
+                            let memoArr = [];
+                            let sum = 0;
+                            let memoLong = '';
+                        for (let i = 0; i < chirItem[e].length; i++) {
+                            weightArr.push({
+                                [item[i].line]: item[i].weight
+                                });
+                            lineArr.push({
+                                [i]: item[i].line
+                                });
+                            memoArr.push({
+                                [i]: item[i].memo
+                                });
+                            noArr.push({
+                                [i]: item[i].no
+                                });
+                            if (item[i].memo !== null && item[i].memo !== '') {
+                                 memoLong = memoLong + item[i].memo + ';';
+                            }
+                            sum += item[i].weight;
+                        };
+                        arr.push({
+                            seq: index,
+                            unit: item[chirItem[e].length - 1].unit,
+                            line: lineArr,
+                            yearmonth: item[chirItem[e].length - 1].yearmonth,
+                            weight: weightArr,
+                            cjr: item[chirItem[e].length - 1].cjr,
+                            cjsj: item[chirItem[e].length - 1].cjsj,
+                            jzsj: item[chirItem[e].length - 1].jzsj,
+                            xgr: item[chirItem[e].length - 1].xgr,
+                            xgsj: item[chirItem[e].length - 1].xgsj,
+                            cp: item[chirItem[e].length - 1].cp,
+                            sysl: item[chirItem[e].length - 1].sysl,
+                            wxsy: item[chirItem[e].length - 1].wxsy,
+                            zt: item[chirItem[e].length - 1].zt,
+                            parentid: item[chirItem[e].length - 1].parentid,
+                            no: noArr,
+                            id: item[chirItem[e].length - 1].id,
+                            memo: memoLong,
+                            total: sum
+                        });
+                        index = index + 1;
                         }
                         that.total = res.data.total;
-                        that.tableData = arr;
+                        that.tableData = JSON.parse(JSON.stringify(arr));
+                        that.originalData = JSON.parse(JSON.stringify(arr));
                         that.getAdds();
                     } else {
                         that.$message.error(res.message);
@@ -1212,6 +1403,17 @@ export default {
             for (let item of that.tableData) {
                 item.isSelection = false;
             }
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
+            let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
+            for (let item of arrcha) {
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1317,27 +1519,31 @@ export default {
                     if (valid) {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
-                            SubmitData.push({
-                                no: that.tableFormDataObj[key].no,
-                                weight: that.tableFormDataObj[key].weight,
-                                cjr: that.tableFormDataObj[key].cjr,
-                                memo: that.tableFormDataObj[key].memo,
-                                cjsj: that.tableFormDataObj[key].cjsj,
-                                jzsj: that.tableFormDataObj[key].jzsj,
-                                line: that.tableFormDataObj[key].line,
-                                xgr: that.tableFormDataObj[key].xgr,
-                                xgsj: that.tableFormDataObj[key].xgsj,
-                                cp: that.tableFormDataObj[key].cp,
-                                sysl: that.tableFormDataObj[key].sysl,
-                                zt: that.tableFormDataObj[key].zt,
-                                wxsy: that.tableFormDataObj[key].wxsy,
-                                unit: that.tableFormDataObj[key].unit,
-                                parentid: that.filterForm.data.parentid,
-                                yearmonth: that.tableFormDataObj[key].yearmonth
-                            });
+                           let memoArr = that.tableFormDataObj[key].memo.split(';');
+                           for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                                for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                                    SubmitData.push({
+                                    weight: that.tableFormDataObj[key].weight[i][keyname],
+                                    no: that.tableFormDataObj[key].no[i][i],
+                                    memo: memoArr[i],
+                                    cjsj: that.tableFormDataObj[key].cjsj,
+                                    jzsj: that.tableFormDataObj[key].jzsj,
+                                    line: that.tableFormDataObj[key].line[i][i],
+                                    xgr: that.tableFormDataObj[key].xgr,
+                                    xgsj: that.tableFormDataObj[key].xgsj,
+                                    cp: that.tableFormDataObj[key].cp,
+                                    sysl: that.tableFormDataObj[key].sysl,
+                                    zt: that.tableFormDataObj[key].zt,
+                                    wxsy: that.tableFormDataObj[key].wxsy,
+                                    unit: that.tableFormDataObj[key].unit,
+                                    parentid: that.filterForm.data.parentid,
+                                    yearmonth: that.tableFormDataObj[key].yearmonth
+                                    });
+                                };
+                            }
                         }
-                        that.loading = true;
-                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                       that.loading = true;
+                       that.axios.put('pass/ems/v1/emsprodplanyears/batchupdateList', SubmitData)
                             .then(function (res) {
                                 if (res.code === '0') {
                                     that.$message({
@@ -1369,9 +1575,7 @@ export default {
                 line: that.dialog.editorBox.form.data.line,
                 parentid: that.filterForm.data.parentid,
                 memo: that.dialog.editorBox.form.data.memo
-
             });
-            console.log(SubmitData)
             that.$refs['dialog_form'].validate((valid) => {
                if (valid) {
                         that.loading = true;
@@ -1407,9 +1611,11 @@ export default {
                         this.$message.error('已经审核的数据不能删除');
                         return;
                     }
-                    SubmitData.push({
-                        no: item.no
-                    });
+                    for (let noItem in item.no) {
+                        SubmitData.push({
+                            no: item.no[noItem][noItem]
+                        });
+                    }
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
@@ -1520,6 +1726,17 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
         }
     }
 }

+ 49 - 26
src/views/energyPlan/components/supplyAndDemand/planProjectLimePowder.vue

@@ -61,7 +61,7 @@
                                     @click="but_add"
                                     :loading="loading"
                                 >新增</el-button>
-                                   <!-- <el-button
+                                   <el-button
                                     class="button"
                                     type="primary"
                                     size="mini"
@@ -69,7 +69,7 @@
                                     @click="but_copy"
                                     :loading="loading"
                                     v-if="butPrivilege.PUT && !isCheck"
-                                >复制</el-button> -->
+                                >复制</el-button>
                                 <el-button
                                     class="button"
                                     type="primary"
@@ -263,7 +263,7 @@
                         <el-table-column
                             prop="weight"
                             label="1#回转窑"
-                            width="160px"
+                            width="100px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
@@ -293,7 +293,7 @@
                         <el-table-column
                             prop="weight"
                             label="2#回转窑"
-                            width="160px"
+                            width="100px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
@@ -326,7 +326,10 @@
                             label="合计产量"
                             fixed="left"
                             width="160px"
-                        ></el-table-column>
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -533,7 +536,7 @@
     </span>
     </el-dialog>
      <el-dialog
-       title="年计划编制-轧钢复制"
+       title="年计划编制-建材厂(石灰)复制"
        :visible.sync="dialog.editorBox2.show"
         width="400px"
        :close-on-click-modal="false"
@@ -1011,19 +1014,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth,
-                    wxsy: that.tableFormDataObj[key].wxsy,
-                    sysl: that.tableFormDataObj[key].wxsy,
-                    productid: that.tableFormDataObj[key].productid
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -1145,7 +1149,7 @@ export default {
                                 [item[i].line]: item[i].weight
                                 });
                             lineArr.push({
-                                [i]: item[i].weight
+                                [i]: item[i].line
                                 });
                             memoArr.push({
                                 [i]: item[i].memo
@@ -1371,10 +1375,17 @@ export default {
             for (let item of that.tableData) {
                 item.isSelection = false;
             }
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
             let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
             for (let item of arrcha) {
-                that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
-            };
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1393,7 +1404,6 @@ export default {
             }
             for (let item of that.tableData) {
                 if (item.isSelection === false) {
-                    that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
                     item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
                 }
             }
@@ -1576,9 +1586,11 @@ export default {
                         this.$message.error('已经审核的数据不能删除');
                         return;
                     }
-                    SubmitData.push({
-                        no: item.no
-                    });
+                    for (let noItem in item.no) {
+                        SubmitData.push({
+                            no: item.no[noItem][noItem]
+                        });
+                    }
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
@@ -1689,6 +1701,17 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
         }
     }
 }

+ 175 - 130
src/views/energyPlan/components/supplyAndDemand/planProjectMachineCoke.vue

@@ -61,7 +61,7 @@
                                     @click="but_add"
                                     :loading="loading"
                                 >新增</el-button>
-                                   <!-- <el-button
+                                   <el-button
                                     class="button"
                                     type="primary"
                                     size="mini"
@@ -69,7 +69,7 @@
                                     @click="but_copy"
                                     :loading="loading"
                                     v-if="butPrivilege.PUT && !isCheck"
-                                >复制</el-button> -->
+                                >复制</el-button>
                                 <el-button
                                     class="button"
                                     type="primary"
@@ -205,10 +205,14 @@
                             fixed="left"
                             width="160px"
                             :show-overflow-tooltip="true"
-                        ></el-table-column>
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template>
+                        </el-table-column>
                         <el-table-column
                             label="成品焦">
-                        <el-table-column
+                        <!-- <el-table-column
                             label="产生数量"
                             prop="weight"
                             rowsPan="3"
@@ -236,7 +240,7 @@
                                 </template>
                             </el-form-item>
                         <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['成品焦']}}</span>
-                        </template></el-table-column>
+                        </template></el-table-column> -->
                         <el-table-column
                             prop="weight1"
                             label="高炉用量"
@@ -291,37 +295,24 @@
                             </el-form-item>
                         <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['成品焦']}}</span>
                         </template></el-table-column>
-                        </el-table-column>
-                        <el-table-column
-                            label="小粒焦">
                         <el-table-column
-                            label="产生数量"
-                            prop="weight"
+                            label="生产合计"
+                            prop="subtotal"
                             fixed="left"
                             width="120px"
                             :show-overflow-tooltip="true"
                         ><template slot-scope="scope">
-                            <el-form-item
+                            <template
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
-                                    :prop="scope.row.seq + '.weight'"
-                            ><el-input clearable
-                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
-                                        :key="key"
-                                        v-if="!isNaN(Number(itemform['小粒焦']))"
-                                        style="width: 100%;"
-                                        v-model="itemform['小粒焦']"
-                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
-                                        refcous="true"
-                                        :rules="dialog.editorBox.form.weight"
-                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
-                                ></el-input>
-                                <template slot="error" slot-scope="scope">
-                                    <p class="error" :title="scope.error">{{ scope.error }}</p>
-                                </template>
-                            </el-form-item>
-                        <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['小粒焦']}}</span>
+                            ><span
+                            v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['成品焦']))"
+                            :key="key">{{ Number(itemform['成品焦']) + Number(tableData[scope.row.index].weight2[key]['成品焦']) }}</span>
+                            </template>
+                        <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['成品焦']}}</span>
                         </template></el-table-column>
+                        </el-table-column>
+                        <el-table-column
+                            label="小粒焦">
                         <el-table-column
                             prop="weight1"
                             label="高炉用量"
@@ -376,37 +367,25 @@
                             </el-form-item>
                         <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['小粒焦']}}</span>
                         </template></el-table-column>
-                        </el-table-column>
                         <el-table-column
-                            label="焦粉"
-                        ><el-table-column
-                            prop="weight"
-                            label="产生数量"
+                            label="生产合计"
+                            prop="subtotal"
+                            fixed="left"
                             width="120px"
                             :show-overflow-tooltip="true"
                         ><template slot-scope="scope">
-                            <el-form-item
+                            <template
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
-                                    :prop="scope.row.seq + '.weight'"
-                            ><el-input clearable
-                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
-                                        style="width: 100%;"
-                                        v-model="itemform['焦粉']"
-                                        v-if="!isNaN(Number(itemform['焦粉']))"
-                                        refcous="true"
-                                        :rules="tableFormRules.weight"
-                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
-                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
-                                        :key="key"
-                                ></el-input>
-                                <template slot="error" slot-scope="scope">
-                                    <p class="error" :title="scope.error">{{ scope.error }}</p>
-                                </template>
-                            </el-form-item>
-                        <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['焦粉']}}</span>
+                            ><span
+                            v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['小粒焦']))"
+                            :key="key">{{ Number(itemform['小粒焦']) + Number(tableData[scope.row.index].weight2[key]['小粒焦']) }}</span>
+                            </template>
+                        <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['小粒焦']}}</span>
                         </template></el-table-column>
+                        </el-table-column>
                         <el-table-column
+                            label="焦粉"
+                        ><el-table-column
                             prop="weight1"
                             label="烧结用量"
                             width="120px"
@@ -460,36 +439,25 @@
                             </el-form-item>
                         <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['焦粉']}}</span>
                         </template></el-table-column>
-                        </el-table-column>
                         <el-table-column
-                            label="除尘焦粉"
-                        ><el-table-column
-                            prop="weight"
-                            label="产生数量"
+                            label="生产合计"
+                            prop="subtotal"
+                            fixed="left"
                             width="120px"
                             :show-overflow-tooltip="true"
                         ><template slot-scope="scope">
-                            <el-form-item
+                            <template
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
-                                    :prop="scope.row.seq + '.weight'"
-                            ><el-input clearable
-                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
-                                        style="width: 100%;"
-                                        v-model="itemform['除尘焦粉']"
-                                        v-if="!isNaN(Number(itemform['除尘焦粉']))"
-                                        refcous="true"
-                                        :rules="tableFormRules.weight"
-                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
-                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
-                                        :key="key"
-                                ></el-input>
-                                <template slot="error" slot-scope="scope">
-                                    <p class="error" :title="scope.error">{{ scope.error }}</p>
-                                </template>
-                            </el-form-item>
-                        <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['除尘焦粉']}}</span>
+                            ><span
+                            v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['焦粉']))"
+                            :key="key">{{ Number(itemform['焦粉']) + Number(tableData[scope.row.index].weight2[key]['焦粉']) }}</span>
+                            </template>
+                        <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['焦粉']}}</span>
                         </template></el-table-column>
+                        </el-table-column>
+                        <el-table-column
+                            label="除尘焦粉"
+                        >
                         <el-table-column
                             prop="weight1"
                             label="高炉用量"
@@ -544,6 +512,21 @@
                             </el-form-item>
                         <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['除尘焦粉']}}</span>
                         </template></el-table-column>
+                        <el-table-column
+                            label="生产合计"
+                            prop="subtotal"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        ><template slot-scope="scope">
+                            <template
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                            ><span
+                            v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['除尘焦粉']))"
+                            :key="key">{{ Number(itemform['除尘焦粉']) + Number(tableData[scope.row.index].weight2[key]['除尘焦粉']) }}</span>
+                            </template>
+                        <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['除尘焦粉']}}</span>
+                        </template></el-table-column>
                         </el-table-column>
                         <el-table-column
                             prop="cjsj"
@@ -681,7 +664,7 @@
                  </el-time-picker>
                </el-form-item>
              </el-col> -->
-             <el-col :span="12">
+<!--             <el-col :span="12">
               <el-form-item
                      label="产生数量"
                      prop="weight"
@@ -694,7 +677,7 @@
                    >
             </el-input>
             </el-form-item>
-            </el-col>
+            </el-col> -->
             <el-col :span="12">
                 <el-form-item
                     label="烧结用量"
@@ -723,11 +706,11 @@
                     </el-input>
                 </el-form-item>
             </el-col>
-            </el-row>
-            <el-row>
+<!--            </el-row>
+            <el-row> -->
             <el-col :span="12">
              <el-form-item
-                    label="外销量"
+                    label="外销量"
                     prop="weight2"
                    >
                   <el-input
@@ -739,8 +722,8 @@
                   </el-input>
                    </el-form-item>
                </el-col>
-<!--        </el-row>
-        <el-row> -->
+       </el-row>
+        <el-row>
             <el-col :span="12">
             <el-form-item
                    label="备注"
@@ -1201,32 +1184,31 @@ export default {
             let priductIdTotal3 = 0;
             let weiItem = 0;
             switch (column.property) {
-            case 'weight':
+            case 'subtotal':
              priductIdTotal = 0;
              priductIdTotal1 = 0;
              priductIdTotal2 = 0;
              priductIdTotal3 = 0;
-            for (let i = 0; i < that.tableData.length; i++) {
-                 that.tableData[i].weight.forEach((item, key) => {
+            for (let i = 0; i < this.tableData.length; i++) {
+                 this.tableData[i].subtotal.forEach((item, key) => {
                     weiItem = (isNaN(item['成品焦']) ? 0 : item['成品焦']);
                     priductIdTotal += Number(weiItem);
                 });
-                that.tableData[i].weight.forEach((item, key) => {
+                that.tableData[i].subtotal.forEach((item, key) => {
                     weiItem = (isNaN(item['小粒焦']) ? 0 : item['小粒焦']);
                     priductIdTotal1 += Number(weiItem);
                 });
-                that.tableData[i].weight.forEach((item, key) => {
+                that.tableData[i].subtotal.forEach((item, key) => {
                     weiItem = (isNaN(item['焦粉']) ? 0 : item['焦粉']);
                     priductIdTotal2 += Number(weiItem);
                 });
-                that.tableData[i].weight.forEach((item, key) => {
+                that.tableData[i].subtotal.forEach((item, key) => {
                     weiItem = (isNaN(item['除尘焦粉']) ? 0 : item['除尘焦粉']);
                     priductIdTotal3 += Number(weiItem);
                 });
             };
-            console.log('1111');
-            sums[index] = (index % 14 === 0) ? priductIdTotal3 : (
-            (index % 11 === 0) ? priductIdTotal2 : (index % 8 === 0) ? priductIdTotal1 : priductIdTotal);
+            sums[index] = (index % 16 === 0) ? priductIdTotal3 : (
+            (index % 13 === 0) ? priductIdTotal2 : (index % 10 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             case 'weight1':
             priductIdTotal = 0;
@@ -1251,8 +1233,8 @@ export default {
                     priductIdTotal3 += Number(weiItem);
                 });
             };
-            sums[index] = (index % 15 === 0) ? priductIdTotal3 : (
-            (index % 12 === 0) ? priductIdTotal2 : (index % 9 === 0) ? priductIdTotal1 : priductIdTotal);
+            sums[index] = (index % 14 === 0) ? priductIdTotal3 : (
+            (index % 11 === 0) ? priductIdTotal2 : (index % 8 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             case 'weight2':
             priductIdTotal = 0;
@@ -1277,8 +1259,8 @@ export default {
                         priductIdTotal3 += Number(weiItem);
                     });
                 };
-            sums[index] = (index % 16 === 0) ? priductIdTotal3 : (
-            (index % 13 === 0) ? priductIdTotal2 : (index % 10 === 0) ? priductIdTotal1 : priductIdTotal);
+            sums[index] = (index % 15 === 0) ? priductIdTotal3 : (
+            (index % 12 === 0) ? priductIdTotal2 : (index % 9 === 0) ? priductIdTotal1 : priductIdTotal);
             break;
             default:
             break;
@@ -1359,22 +1341,27 @@ export default {
                     }
                 });
         },
-     but_copy_plural () {
+        // 复制
+        but_copy_plural () {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    weight1: that.tableFormDataObj[key].weight1,
-                    weight2: that.tableFormDataObj[key].weight2,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight1.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight1[i]) {
+                        SubmitData.push({
+                        // weight: that.tableFormDataObj[key].weight[i][keyname],
+                        weight1: that.tableFormDataObj[key].weight1[i][keyname],
+                        weight2: that.tableFormDataObj[key].weight2[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        productid: that.tableFormDataObj[key].productid[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -1486,7 +1473,8 @@ export default {
                         let chirItem = res.data.list[0];
                         for (let e in chirItem) {
                             let item = chirItem[e];
-                            let weightArr = [];
+                            // let weightArr = [];
+                            let subtotalArr = [];
                             let weightArr1 = [];
                             let weightArr2 = [];
                             let noArr = [];
@@ -1497,9 +1485,9 @@ export default {
                             let productidArr = [];
                             let memoLong = '';
                         for (let i = 0; i < chirItem[e].length; i++) {
-                            weightArr.push({
-                                [item[i].productid]: item[i].weight
-                                });
+                            // weightArr.push({
+                            //     [item[i].productid]: item[i].weight
+                            //     });
                             weightArr1.push({
                                 [item[i].productid]: item[i].weight1
                                 });
@@ -1517,12 +1505,15 @@ export default {
                             });
                             if (item[i].memo !== null && item[i].memo !== '') {
                                  memoLong = memoLong + item[i].memo + ';';
-                            }
+                            };
                             indexArr.push({
                                 [i]: [i]
-                            })
+                            });
+                            subtotalArr.push({
+                                [item[i].productid]: item[i].weight1 + item[i].weight2
+                                });
                             // sum += item[i].weight + item[i].weight1 + item[i].weight2;
-                            sum += item[i].weight;
+                            sum += item[i].weight1 + item[i].weight2;
                             };
                             arr.push({
                                 seq: index,
@@ -1540,7 +1531,8 @@ export default {
                                 no: noArr,
                                 id: item[chirItem[e].length - 1].id,
                                 total: sum,
-                                weight: weightArr,
+                                // weight: weightArr,
+                                subtotal: subtotalArr,
                                 weight1: weightArr1,
                                 weight2: weightArr2,
                                 productid: productidArr,
@@ -1599,7 +1591,7 @@ export default {
                                 unit: item.unit,
                                 line: item.line,
                                 yearmonth: item.yearmonth,
-                                weight: item.weight,
+                                // weight: item.weight,
                                 weight1: item.weight1,
                                 weight2: item.weight2,
                                 productid: item.productid,
@@ -1679,6 +1671,7 @@ export default {
             }
             that.getTableData(1);
         },
+        // 键盘事件
         keyDown (event1, disabledFlag) {
             let tdTarget = event1.target;
             let _this = this;
@@ -1723,7 +1716,7 @@ export default {
                 $(tdTarget).nextAll().find('input').eq(0).click();
             }
         },
-        // 只允许对未接的数据进行操作
+        // 只允许对未接的数据进行操作
         checkboxT (row, index) {
             if (row.zt === '2' && !this.isCheck) {
                 return false;
@@ -1731,6 +1724,7 @@ export default {
                 return true;
             }
         },
+        // 选择的值发生改变
         handleSelectionChange (val) {
             // console.log('我要改数据了');
             let that = this;
@@ -1746,8 +1740,17 @@ export default {
             }
             let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
             for (let item of arrcha) {
-                that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
-            };
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight1) {
+                    for (let weiKey in that.tableData[item.seq].weight1[weiIndex]) {
+                        // that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                        that.tableData[item.seq].weight1[weiIndex][weiKey] = that.originalData[item.seq].weight1[weiIndex][weiKey];
+                        that.tableData[item.seq].weight2[weiIndex][weiKey] = that.originalData[item.seq].weight2[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq].weight = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1766,7 +1769,7 @@ export default {
             }
             for (let item of that.tableData) {
                 if (item.isSelection === false) {
-                    that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+                    // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
                     item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
                 }
             }
@@ -1855,10 +1858,10 @@ export default {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
                             let memoArr = that.tableFormDataObj[key].memo.split(';');
-                            for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
-                                for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                            for (let i = 0; i < that.tableFormDataObj[key].weight1.length; i++) {
+                                for (let keyname in that.tableFormDataObj[key].weight1[i]) {
                                     SubmitData.push({
-                                    weight: that.tableFormDataObj[key].weight[i][keyname],
+                                    // weight: that.tableFormDataObj[key].weight[i][keyname],
                                     weight1: that.tableFormDataObj[key].weight1[i][keyname],
                                     weight2: that.tableFormDataObj[key].weight2[i][keyname],
                                     no: that.tableFormDataObj[key].no[i][i],
@@ -1907,7 +1910,7 @@ export default {
             let SubmitData = [];
             SubmitData.push({
                 yearmonth: that.dialog.editorBox.form.data.yearmonth,
-                weight: that.dialog.editorBox.form.data.weight,
+                // weight: that.dialog.editorBox.form.data.weight,
                 weight1: that.dialog.editorBox.form.data.weight1,
                 weight2: that.dialog.editorBox.form.data.weight2,
                 unit: that.dialog.editorBox.form.data.unitid,
@@ -2068,18 +2071,60 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight1) {
+                for (let weiKey in item.weight1[weiIndex]) {
+                    result += Number(item.weight1[weiIndex][weiKey]) + Number(item.weight2[weiIndex][weiKey]);
+                }
+            }
+            return result;
+        },
+        // 小计
+        rowSubSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight1) {
+                for (let weiKey in item.weight1[weiIndex]) {
+                    if (weiKey === '成品焦') {
+                       result += Number(item.weight1[weiIndex][weiKey]) + Number(item.weight1[weiIndex][weiKey]);
+                    };
+                    if (weiKey === '小粒焦') {
+                       result += Number(item.weight1[weiIndex][weiKey]) + Number(item.weight1[weiIndex][weiKey]);
+                    };
+                };
+            }
+            return result;
         }
     },
     computed: {
+      // 暂时用不上
       activeUsers: function () {
           let that = this;
-          console.log('111');
         return that.tableData.filter(function (tableData) {
             // console.log(tableData);
-            for (let item in tableData.weight) {
-                return isNaN((tableData.weight[item]));
+            for (let item in tableData.weight1) {
+                return isNaN((tableData.weight1[item]));
             }
         })
+      },
+      rowSumc: function (item, event) {
+          let result = 0;
+          let that = this;
+          for (let item of that.tableFormDataOb) {
+              result = 0;
+            for (let weiIndex in that.tableFormDataObj[item.seq].weight1) {
+                for (let weiKey in that.tableFormDataObj[item.seq].weight1[weiIndex]) {
+                    result += that.tableFormDataObj[item.seq].weight1[weiIndex][weiKey] +
+                    that.tableFormDataObj[item.seq].weight2[weiIndex][weiKey];
+                }
+            }
+            item.total = result;
+          }
+          return result;
       }
     }
 }

+ 284 - 79
src/views/energyPlan/components/supplyAndDemand/planProjectPuddling.vue

@@ -172,17 +172,6 @@
                             width="80px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
-                        <el-table-column
-                            prop="line"
-                            label="工序"
-                            fixed="left"
-                            width="160PX"
-                            :show-overflow-tooltip="true"
-                        >
-                        <template slot-scope="scope">
-                                        <span>{{ nameObj.workprocid.obj[scope.row.line] ? nameObj.workprocid.obj[scope.row.line].name : scope.row.line }}</span>
-                        </template>
-                        </el-table-column>
                         <el-table-column
                             fixed="left"
                             prop="unit"
@@ -196,30 +185,133 @@
                         </el-table-column>
                         <el-table-column
                             prop="weight"
-                            label="年度计划量"
-                            width="160px"
+                            label="1#高炉"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3001']"
+                                        v-if="!isNaN(Number(itemform['AT3001']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3001']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="2#高炉"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3002']"
+                                        v-if="!isNaN(Number(itemform['AT3002']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3002']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="3#高炉"
+                            width="120px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
                                 <el-form-item
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
                                     :prop="scope.row.seq + '.weight'"
-                                    :rules="tableFormRules.weight"
                                 >
                                     <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
                                         style="width: 100%;"
-                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        v-model="itemform['AT3003']"
+                                        v-if="!isNaN(Number(itemform['AT3003']))"
                                         refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
                                         @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                         @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
                                     ></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.weight}}</span>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3003']}}</span>
                             </template>
                         </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="4#高炉"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3004']"
+                                        v-if="!isNaN(Number(itemform['AT3004']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3004']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="total"
+                            label="合计产量"
+                            fixed="left"
+                            width="160px"
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -411,7 +503,7 @@
     </span>
     </el-dialog>
      <el-dialog
-       title="年计划编制-铁车间复制"
+       title="年计划编制-铁车间复制"
        :visible.sync="dialog.editorBox2.show"
        width="400px"
        :close-on-click-modal="false"
@@ -809,8 +901,61 @@ export default {
         },
         // 自定义的表格合计方法:只给指定列进行合计
         getSummaries (param) {
-            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
-            return commonSummaries(param, prop);
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'total']; // 合计列绑定的prop
+            const {columns, data} = param;
+            const sums = commonSummaries(param, prop);
+            let that = this;
+            columns.forEach((column, index) => {
+            if (index === 1) {
+            sums[index] = '合计';
+            return;
+            };
+            let lineTotal = 0;
+            let lineTotal1 = 0;
+            let lineTotal2 = 0;
+            let lineTotal3 = 0;
+            let weiItem = 0;
+            switch (column.property) {
+            case 'weight':
+             lineTotal = 0;
+             lineTotal1 = 0;
+             lineTotal2 = 0;
+             lineTotal3 = 0;
+            for (let i = 0; i < that.tableData.length; i++) {
+                switch (0) {
+                    case index % 8:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3004']) ? 0 : item['AT3004']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 7:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3003']) ? 0 : item['AT3003']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 6:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3002']) ? 0 : item['AT3002']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    default:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3001']) ? 0 : item['AT3001']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                }
+            };
+            sums[index] = lineTotal;
+            break;
+            default:
+            break;
+            }
+            });
+            return sums;
         },
        // 获取工序列表
         // getNodeData () {
@@ -888,16 +1033,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -983,7 +1132,8 @@ export default {
                     zt: that.filterForm.data.zt,
                     measureid: that.filterForm.data.measureid,
                     exactsearch: that.filterForm.data.searchtype,
-                    parentid: that.filterForm.data.parentid
+                    parentid: that.filterForm.data.parentid,
+                    parentNum: that.nameObj.line.arr.length
                 };
                 for (let key in pData) {
                     if (pData[key]) {
@@ -996,38 +1146,67 @@ export default {
             // if (that.isCheck) {
             //     url = 'pass/ems/v1/trmtransfereactvalues/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             // }
-            let url = 'pass/ems/v1/emsprodplanyears/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanyears/getList?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let i = 0; i < res.data.list.length; i++) {
-                            let item = res.data.list[i];
-                            arr.push({
-                                seq: i,
-                                unit: item.unit,
-                                line: item.line,
-                                yearmonth: item.yearmonth,
-                                weight: item.weight,
-                                cjr: item.cjr,
-                                cjsj: item.cjsj,
-                                jzsj: item.jzsj,
-                                xgr: item.xgr,
-                                xgsj: item.xgsj,
-                                cp: item.cp,
-                                sysl: item.sysl,
-                                wxsy: item.wxsy,
-                                zt: item.zt,
-                                parentid: item.parentid,
-                                no: item.no,
-                                id: item.id,
-                                memo: item.memo
-                            });
+                        let index = 0;
+                        let chirItem = res.data.list[0];
+                        for (let e in chirItem) {
+                            let item = chirItem[e];
+                            let weightArr = [];
+                            let lineArr = [];
+                            let noArr = [];
+                            let memoArr = [];
+                            let sum = 0;
+                            let memoLong = '';
+                        for (let i = 0; i < chirItem[e].length; i++) {
+                            weightArr.push({
+                                [item[i].line]: item[i].weight
+                                });
+                            lineArr.push({
+                                [i]: item[i].line
+                                });
+                            memoArr.push({
+                                [i]: item[i].memo
+                                });
+                            noArr.push({
+                                [i]: item[i].no
+                                });
+                            if (item[i].memo !== null && item[i].memo !== '') {
+                                 memoLong = memoLong + item[i].memo + ';';
+                            }
+                            sum += item[i].weight;
+                        };
+                        arr.push({
+                            seq: index,
+                            unit: item[chirItem[e].length - 1].unit,
+                            line: lineArr,
+                            yearmonth: item[chirItem[e].length - 1].yearmonth,
+                            weight: weightArr,
+                            cjr: item[chirItem[e].length - 1].cjr,
+                            cjsj: item[chirItem[e].length - 1].cjsj,
+                            jzsj: item[chirItem[e].length - 1].jzsj,
+                            xgr: item[chirItem[e].length - 1].xgr,
+                            xgsj: item[chirItem[e].length - 1].xgsj,
+                            cp: item[chirItem[e].length - 1].cp,
+                            sysl: item[chirItem[e].length - 1].sysl,
+                            wxsy: item[chirItem[e].length - 1].wxsy,
+                            zt: item[chirItem[e].length - 1].zt,
+                            parentid: item[chirItem[e].length - 1].parentid,
+                            no: noArr,
+                            id: item[chirItem[e].length - 1].id,
+                            memo: memoLong,
+                            total: sum
+                        });
+                        index = index + 1;
                         }
                         that.total = res.data.total;
-                        that.tableData = arr;
+                        that.tableData = JSON.parse(JSON.stringify(arr));
+                        that.originalData = JSON.parse(JSON.stringify(arr));
                         that.getAdds();
                     } else {
                         that.$message.error(res.message);
@@ -1215,6 +1394,17 @@ export default {
             for (let item of that.tableData) {
                 item.isSelection = false;
             }
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
+            let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
+            for (let item of arrcha) {
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1320,27 +1510,31 @@ export default {
                     if (valid) {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
-                            SubmitData.push({
-                                no: that.tableFormDataObj[key].no,
-                                weight: that.tableFormDataObj[key].weight,
-                                cjr: that.tableFormDataObj[key].cjr,
-                                memo: that.tableFormDataObj[key].memo,
-                                cjsj: that.tableFormDataObj[key].cjsj,
-                                jzsj: that.tableFormDataObj[key].jzsj,
-                                line: that.tableFormDataObj[key].line,
-                                xgr: that.tableFormDataObj[key].xgr,
-                                xgsj: that.tableFormDataObj[key].xgsj,
-                                cp: that.tableFormDataObj[key].cp,
-                                sysl: that.tableFormDataObj[key].sysl,
-                                zt: that.tableFormDataObj[key].zt,
-                                wxsy: that.tableFormDataObj[key].wxsy,
-                                unit: that.tableFormDataObj[key].unit,
-                                parentid: that.filterForm.data.parentid,
-                                yearmonth: that.tableFormDataObj[key].yearmonth
-                            });
-                        }
+                            let memoArr = that.tableFormDataObj[key].memo.split(';');
+                            for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                                 for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                                     SubmitData.push({
+                                     weight: that.tableFormDataObj[key].weight[i][keyname],
+                                     no: that.tableFormDataObj[key].no[i][i],
+                                     memo: memoArr[i],
+                                     cjsj: that.tableFormDataObj[key].cjsj,
+                                     jzsj: that.tableFormDataObj[key].jzsj,
+                                     line: that.tableFormDataObj[key].line[i][i],
+                                     xgr: that.tableFormDataObj[key].xgr,
+                                     xgsj: that.tableFormDataObj[key].xgsj,
+                                     cp: that.tableFormDataObj[key].cp,
+                                     sysl: that.tableFormDataObj[key].sysl,
+                                     zt: that.tableFormDataObj[key].zt,
+                                     wxsy: that.tableFormDataObj[key].wxsy,
+                                     unit: that.tableFormDataObj[key].unit,
+                                     parentid: that.filterForm.data.parentid,
+                                     yearmonth: that.tableFormDataObj[key].yearmonth
+                                     });
+                                 };
+                             }
+                         }
                         that.loading = true;
-                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdateList', SubmitData)
                             .then(function (res) {
                                 if (res.code === '0') {
                                     that.$message({
@@ -1372,9 +1566,7 @@ export default {
                 line: that.dialog.editorBox.form.data.line,
                 parentid: that.filterForm.data.parentid,
                 memo: that.dialog.editorBox.form.data.memo
-
             });
-            console.log(SubmitData)
             that.$refs['dialog_form'].validate((valid) => {
                if (valid) {
                         that.loading = true;
@@ -1410,9 +1602,11 @@ export default {
                         this.$message.error('已经审核的数据不能删除');
                         return;
                     }
-                    SubmitData.push({
-                        no: item.no
-                    });
+                    for (let noItem in item.no) {
+                        SubmitData.push({
+                            no: item.no[noItem][noItem]
+                        });
+                    }
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
@@ -1523,6 +1717,17 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
         }
     }
 }

+ 0 - 4
src/views/energyPlan/components/supplyAndDemand/planProjectRoundGx.vue

@@ -1394,7 +1394,6 @@ export default {
                                 createtime: that.rightTableObj[key].createtime
                             });
                         }
-                        console.log(SubmitData)
                         that.loading = true;
                         that.axios.put('pass/ems/v1/emsprodplanrounds/batchUpdate', SubmitData)
                             .then(function (res) {
@@ -1487,7 +1486,6 @@ export default {
                         state: that.rightTableObj[key].state
                    });
                 }
-                console.log(SubmitData)
                 that.loading = true;
                 that.axios.post('pass/ems/v1/emsprodplanrounds/delete', SubmitData, {
                     contentType: 'application/json'
@@ -1527,7 +1525,6 @@ export default {
                 planWeight: that.dialog.editorBox.form.data.planWeight,
                 purpose: that.dialog.editorBox.form.data.purpose
             };
-            console.log(SubmitData)
             that.$refs['dialog_form'].validate((valid) => {
                if (valid) {
                         that.loading = true;
@@ -1667,7 +1664,6 @@ export default {
                                     apportvalue: item.APPORTVALUE
                                 })
                             }
-                            console.log(arr)
                             row.tableData = arr;
                             row.getTable = true;
                         } else {

+ 273 - 77
src/views/energyPlan/components/supplyAndDemand/planProjectSinter.vue

@@ -181,17 +181,6 @@
                             width="80px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
-                        <el-table-column
-                            prop="line"
-                            label="工序"
-                            fixed="left"
-                            width="160px"
-                            :show-overflow-tooltip="true"
-                        >
-                        <template slot-scope="scope">
-                                        <span>{{ nameObj.workprocid.obj[scope.row.line] ? nameObj.workprocid.obj[scope.row.line].name : scope.row.line }}</span>
-                        </template>
-                        </el-table-column>
                         <el-table-column
                             fixed="left"
                             prop="unit"
@@ -203,32 +192,118 @@
                                         <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
                         </template>
                         </el-table-column>
+                        <el-table-column
+                        label="一烧结">
                         <el-table-column
                             prop="weight"
-                            label="年度计划量"
-                            width="160px"
+                            label="1#烧结"
+                            width="100px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
                                 <el-form-item
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
                                     :prop="scope.row.seq + '.weight'"
-                                    :rules="tableFormRules.weight"
                                 >
                                     <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
                                         style="width: 100%;"
-                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        v-model="itemform['AT3013']"
+                                        v-if="!isNaN(Number(itemform['AT3013']))"
                                         refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
                                         @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                         @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
                                     ></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.weight}}</span>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3013']}}</span>
                             </template>
                         </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="2#烧结"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3014']"
+                                        v-if="!isNaN(Number(itemform['AT3014']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3014']}}</span>
+                            </template></el-table-column>
+                            <el-table-column
+                                prop="subtotal"
+                                label="小计"
+                                fixed="left"
+                                width="100px"
+                            ><template slot-scope="scope">
+                                <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSubSum(scope.row) }}</span>
+                                <span v-else>{{ scope.row.subtotal }}</span>
+                            </template></el-table-column>
+                        </el-table-column>
+                        <el-table-column
+                        label="二烧结">
+                        <el-table-column
+                            prop="weight"
+                            label="3#烧结"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT3015']"
+                                        v-if="!isNaN(Number(itemform['AT3015']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT3015']}}</span>
+                            </template></el-table-column>
+                        </el-table-column>
+                        <el-table-column
+                            prop="total"
+                            label="合计产量"
+                            fixed="left"
+                            width="120px"
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -420,7 +495,7 @@
     </span>
     </el-dialog>
      <el-dialog
-       title="年计划编制-轧钢复制"
+       title="年计划编制-烧结复制"
        :visible.sync="dialog.editorBox2.show"
         width="400px"
        :close-on-click-modal="false"
@@ -797,8 +872,49 @@ export default {
         },
         // 自定义的表格合计方法:只给指定列进行合计
         getSummaries (param) {
-            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
-            return commonSummaries(param, prop);
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'total', 'subtotal']; // 合计列绑定的prop
+            const {columns, data} = param;
+            const sums = commonSummaries(param, prop);
+            let that = this;
+            columns.forEach((column, index) => {
+            if (index === 1) {
+            sums[index] = '合计';
+            return;
+            };
+            let lineTotal = 0;
+            let weiItem = 0;
+            switch (column.property) {
+            case 'weight':
+             lineTotal = 0;
+            for (let i = 0; i < that.tableData.length; i++) {
+                switch (0) {
+                    case index % 8:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3015']) ? 0 : item['AT3015']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 6:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3014']) ? 0 : item['AT3014']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    default:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT3013']) ? 0 : item['AT3013']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                }
+            };
+            sums[index] = lineTotal;
+            break;
+            default:
+            break;
+            }
+            });
+            return sums;
         },
         // 获取工序列表
         // getNodeData () {
@@ -876,16 +992,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -971,7 +1091,8 @@ export default {
                     zt: that.filterForm.data.zt,
                     measureid: that.filterForm.data.measureid,
                     exactsearch: that.filterForm.data.searchtype,
-                    parentid: that.filterForm.data.parentid
+                    parentid: that.filterForm.data.parentid,
+                    parentNum: that.nameObj.line.arr.length
                 };
                 for (let key in pData) {
                     if (pData[key]) {
@@ -984,38 +1105,72 @@ export default {
             // if (that.isCheck) {
             //     url = 'pass/ems/v1/trmtransfereactvalues/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             // }
-            let url = 'pass/ems/v1/emsprodplanyears/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanyears/getList?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let i = 0; i < res.data.list.length; i++) {
-                            let item = res.data.list[i];
-                            arr.push({
-                                seq: i,
-                                unit: item.unit,
-                                line: item.line,
-                                yearmonth: item.yearmonth,
-                                weight: item.weight,
-                                cjr: item.cjr,
-                                cjsj: item.cjsj,
-                                jzsj: item.jzsj,
-                                xgr: item.xgr,
-                                xgsj: item.xgsj,
-                                cp: item.cp,
-                                sysl: item.sysl,
-                                wxsy: item.wxsy,
-                                zt: item.zt,
-                                parentid: item.parentid,
-                                no: item.no,
-                                id: item.id,
-                                memo: item.memo
-                            });
+                        let index = 0;
+                        let chirItem = res.data.list[0];
+                        for (let e in chirItem) {
+                            let item = chirItem[e];
+                            let weightArr = [];
+                            let lineArr = [];
+                            let noArr = [];
+                            let memoArr = [];
+                            let sum = 0;
+                            let memoLong = '';
+                            let subtotal = 0;
+                        for (let i = 0; i < chirItem[e].length; i++) {
+                            weightArr.push({
+                                [item[i].line]: item[i].weight
+                                });
+                            lineArr.push({
+                                [i]: item[i].line
+                                });
+                            memoArr.push({
+                                [i]: item[i].memo
+                                });
+                            noArr.push({
+                                [i]: item[i].no
+                                });
+                            if (item[i].memo !== null && item[i].memo !== '') {
+                                 memoLong = memoLong + item[i].memo + ';';
+                            }
+                            sum += item[i].weight;
+                            if (item[i].line !== 'AT3015') {
+                                subtotal += item[i].weight;
+                            }
+                        };
+                        arr.push({
+                            seq: index,
+                            unit: item[chirItem[e].length - 1].unit,
+                            line: lineArr,
+                            yearmonth: item[chirItem[e].length - 1].yearmonth,
+                            weight: weightArr,
+                            cjr: item[chirItem[e].length - 1].cjr,
+                            cjsj: item[chirItem[e].length - 1].cjsj,
+                            jzsj: item[chirItem[e].length - 1].jzsj,
+                            xgr: item[chirItem[e].length - 1].xgr,
+                            xgsj: item[chirItem[e].length - 1].xgsj,
+                            cp: item[chirItem[e].length - 1].cp,
+                            sysl: item[chirItem[e].length - 1].sysl,
+                            wxsy: item[chirItem[e].length - 1].wxsy,
+                            zt: item[chirItem[e].length - 1].zt,
+                            parentid: item[chirItem[e].length - 1].parentid,
+                            no: noArr,
+                            id: item[chirItem[e].length - 1].id,
+                            memo: memoLong,
+                            total: sum,
+                            subtotal: subtotal
+                        });
+                        index = index + 1;
                         }
                         that.total = res.data.total;
-                        that.tableData = arr;
+                        that.tableData = JSON.parse(JSON.stringify(arr));
+                        that.originalData = JSON.parse(JSON.stringify(arr));
                         that.getAdds();
                     } else {
                         that.$message.error(res.message);
@@ -1203,6 +1358,17 @@ export default {
             for (let item of that.tableData) {
                 item.isSelection = false;
             }
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
+            let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
+            for (let item of arrcha) {
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1308,27 +1474,31 @@ export default {
                     if (valid) {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
-                            SubmitData.push({
-                                no: that.tableFormDataObj[key].no,
-                                weight: that.tableFormDataObj[key].weight,
-                                cjr: that.tableFormDataObj[key].cjr,
-                                memo: that.tableFormDataObj[key].memo,
-                                cjsj: that.tableFormDataObj[key].cjsj,
-                                jzsj: that.tableFormDataObj[key].jzsj,
-                                line: that.tableFormDataObj[key].line,
-                                xgr: that.tableFormDataObj[key].xgr,
-                                xgsj: that.tableFormDataObj[key].xgsj,
-                                cp: that.tableFormDataObj[key].cp,
-                                sysl: that.tableFormDataObj[key].sysl,
-                                zt: that.tableFormDataObj[key].zt,
-                                wxsy: that.tableFormDataObj[key].wxsy,
-                                unit: that.tableFormDataObj[key].unit,
-                                parentid: that.filterForm.data.parentid,
-                                yearmonth: that.tableFormDataObj[key].yearmonth
-                            });
-                        }
+                            let memoArr = that.tableFormDataObj[key].memo.split(';');
+                            for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                                 for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                                     SubmitData.push({
+                                     weight: that.tableFormDataObj[key].weight[i][keyname],
+                                     no: that.tableFormDataObj[key].no[i][i],
+                                     memo: memoArr[i],
+                                     cjsj: that.tableFormDataObj[key].cjsj,
+                                     jzsj: that.tableFormDataObj[key].jzsj,
+                                     line: that.tableFormDataObj[key].line[i][i],
+                                     xgr: that.tableFormDataObj[key].xgr,
+                                     xgsj: that.tableFormDataObj[key].xgsj,
+                                     cp: that.tableFormDataObj[key].cp,
+                                     sysl: that.tableFormDataObj[key].sysl,
+                                     zt: that.tableFormDataObj[key].zt,
+                                     wxsy: that.tableFormDataObj[key].wxsy,
+                                     unit: that.tableFormDataObj[key].unit,
+                                     parentid: that.filterForm.data.parentid,
+                                     yearmonth: that.tableFormDataObj[key].yearmonth
+                                     });
+                                 };
+                             }
+                         }
                         that.loading = true;
-                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdateList', SubmitData)
                             .then(function (res) {
                                 if (res.code === '0') {
                                     that.$message({
@@ -1397,9 +1567,11 @@ export default {
                         this.$message.error('已经审核的数据不能删除');
                         return;
                     }
-                    SubmitData.push({
-                        no: item.no
-                    });
+                    for (let noItem in item.no) {
+                        SubmitData.push({
+                            no: item.no[noItem][noItem]
+                        });
+                    }
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
@@ -1510,6 +1682,30 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
+        },
+        // 小计
+        rowSubSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    if (weiKey !== 'AT3015') {
+                        result += Number(item.weight[weiIndex][weiKey]);
+                    };
+                };
+            }
+            return result;
         }
     }
 }

+ 249 - 80
src/views/energyPlan/components/supplyAndDemand/planProjectSteelRolling.vue

@@ -181,17 +181,6 @@
                             width="80px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
-                        <el-table-column
-                            prop="line"
-                            label="工序"
-                            fixed="left"
-                            width="160px"
-                            :show-overflow-tooltip="true"
-                        >
-                        <template slot-scope="scope">
-                                        <span>{{ nameObj.workprocid.obj[scope.row.line] ? nameObj.workprocid.obj[scope.row.line].name : scope.row.line }}</span>
-                        </template>
-                        </el-table-column>
                         <el-table-column
                             fixed="left"
                             prop="unit"
@@ -205,30 +194,103 @@
                         </el-table-column>
                         <el-table-column
                             prop="weight"
-                            label="年度计划量"
-                            width="160px"
+                            label="一高线"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT2005']"
+                                        v-if="!isNaN(Number(itemform['AT2005']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT2005']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="二高线"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :prop="scope.row.seq + '.weight'"
+                                >
+                                    <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
+                                        style="width: 100%;"
+                                        v-model="itemform['AT2006']"
+                                        v-if="!isNaN(Number(itemform['AT2006']))"
+                                        refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
+                                    ></el-input>
+                                    <template slot="error" slot-scope="scope">
+                                        <p class="error" :title="scope.error">{{ scope.error }}</p>
+                                    </template>
+                                </el-form-item>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT2006']}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weight"
+                            label="型钢"
+                            width="120px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
                                 <el-form-item
                                     v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
                                     :prop="scope.row.seq + '.weight'"
-                                    :rules="tableFormRules.weight"
                                 >
                                     <el-input clearable
+                                        v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
                                         style="width: 100%;"
-                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        v-model="itemform['AT2007']"
+                                        v-if="!isNaN(Number(itemform['AT2007']))"
                                         refcous="true"
+                                        :rules="tableFormRules.weight"
+                                        oninput="this.value = this.value.replace(/[^\d.]/g,'');"
                                         @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                         @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
+                                        :key="key"
                                     ></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.weight}}</span>
+                                <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['AT2007']}}</span>
                             </template>
                         </el-table-column>
+                        <el-table-column
+                            prop="total"
+                            label="合计产量"
+                            fixed="left"
+                            width="140px"
+                        ><template slot-scope="scope">
+                            <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
+                            <span v-else>{{ scope.row.total }}</span>
+                        </template></el-table-column>
                         <el-table-column
                             prop="cjsj"
                             label="创建时间"
@@ -797,8 +859,55 @@ export default {
         },
         // 自定义的表格合计方法:只给指定列进行合计
         getSummaries (param) {
-            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
-            return commonSummaries(param, prop);
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'total']; // 合计列绑定的prop
+            const {columns, data} = param;
+            const sums = commonSummaries(param, prop);
+            let that = this;
+            columns.forEach((column, index) => {
+            if (index === 1) {
+            sums[index] = '合计';
+            return;
+            };
+            let lineTotal = 0;
+            let lineTotal1 = 0;
+            let lineTotal2 = 0;
+            let lineTotal3 = 0;
+            let weiItem = 0;
+            switch (column.property) {
+            case 'weight':
+             lineTotal = 0;
+             lineTotal1 = 0;
+             lineTotal2 = 0;
+             lineTotal3 = 0;
+            for (let i = 0; i < that.tableData.length; i++) {
+                switch (0) {
+                    case index % 7:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT2007']) ? 0 : item['AT2007']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    case index % 6:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT2006']) ? 0 : item['AT2006']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                    default:
+                    that.tableData[i].weight.forEach((item, key) => {
+                        weiItem = (isNaN(item['AT2005']) ? 0 : item['AT2005']);
+                        lineTotal += Number(weiItem);
+                    });
+                    break;
+                }
+            };
+            sums[index] = lineTotal;
+            break;
+            default:
+            break;
+            }
+            });
+            return sums;
         },
         // 获取工序列表
         // getNodeData () {
@@ -876,16 +985,20 @@ export default {
             let that = this;
             let SubmitData = [];
             for (let key in that.tableFormDataObj) {
-                SubmitData.push({
-                    weight: that.tableFormDataObj[key].weight,
-                    cjr: that.tableFormDataObj[key].cjr,
-                    memo: that.tableFormDataObj[key].memo,
-                    line: that.tableFormDataObj[key].line,
-                    unit: that.tableFormDataObj[key].unit,
-                    parentid: that.filterForm.data.parentid,
-                    yearmonth: that.dialog.editorBox2.form.data.yearmonth
-                            });
-                        }
+                let memoArr = that.tableFormDataObj[key].memo.split(';');
+                for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                    for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                        SubmitData.push({
+                        weight: that.tableFormDataObj[key].weight[i][keyname],
+                        memo: memoArr[i],
+                        unit: that.tableFormDataObj[key].unit,
+                        parentid: that.filterForm.data.parentid,
+                        line: that.tableFormDataObj[key].line[i][i],
+                        yearmonth: that.dialog.editorBox2.form.data.yearmonth
+                        });
+                    };
+                };
+            }
                    that.$refs['dialog_form2'].validate((valid) => {
                       if (valid) {
                         that.loading = true;
@@ -971,7 +1084,8 @@ export default {
                     zt: that.filterForm.data.zt,
                     measureid: that.filterForm.data.measureid,
                     exactsearch: that.filterForm.data.searchtype,
-                    parentid: that.filterForm.data.parentid
+                    parentid: that.filterForm.data.parentid,
+                    parentNum: that.nameObj.line.arr.length
                 };
                 for (let key in pData) {
                     if (pData[key]) {
@@ -984,38 +1098,67 @@ export default {
             // if (that.isCheck) {
             //     url = 'pass/ems/v1/trmtransfereactvalues/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             // }
-            let url = 'pass/ems/v1/emsprodplanyears/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            let url = 'pass/ems/v1/emsprodplanyears/getList?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
             that.axios.get(url, {
                 params: params
             })
                 .then(function (res) {
                     if (res.code === '0') {
                         let arr = [];
-                        for (let i = 0; i < res.data.list.length; i++) {
-                            let item = res.data.list[i];
-                            arr.push({
-                                seq: i,
-                                unit: item.unit,
-                                line: item.line,
-                                yearmonth: item.yearmonth,
-                                weight: item.weight,
-                                cjr: item.cjr,
-                                cjsj: item.cjsj,
-                                jzsj: item.jzsj,
-                                xgr: item.xgr,
-                                xgsj: item.xgsj,
-                                cp: item.cp,
-                                sysl: item.sysl,
-                                wxsy: item.wxsy,
-                                zt: item.zt,
-                                parentid: item.parentid,
-                                no: item.no,
-                                id: item.id,
-                                memo: item.memo
-                            });
+                        let index = 0;
+                        let chirItem = res.data.list[0];
+                        for (let e in chirItem) {
+                            let item = chirItem[e];
+                            let weightArr = [];
+                            let lineArr = [];
+                            let noArr = [];
+                            let memoArr = [];
+                            let sum = 0;
+                            let memoLong = '';
+                        for (let i = 0; i < chirItem[e].length; i++) {
+                            weightArr.push({
+                                [item[i].line]: item[i].weight
+                                });
+                            lineArr.push({
+                                [i]: item[i].line
+                                });
+                            memoArr.push({
+                                [i]: item[i].memo
+                                });
+                            noArr.push({
+                                [i]: item[i].no
+                                });
+                            if (item[i].memo !== null && item[i].memo !== '') {
+                                 memoLong = memoLong + item[i].memo + ';';
+                            }
+                            sum += item[i].weight;
+                        };
+                        arr.push({
+                            seq: index,
+                            unit: item[chirItem[e].length - 1].unit,
+                            line: lineArr,
+                            yearmonth: item[chirItem[e].length - 1].yearmonth,
+                            weight: weightArr,
+                            cjr: item[chirItem[e].length - 1].cjr,
+                            cjsj: item[chirItem[e].length - 1].cjsj,
+                            jzsj: item[chirItem[e].length - 1].jzsj,
+                            xgr: item[chirItem[e].length - 1].xgr,
+                            xgsj: item[chirItem[e].length - 1].xgsj,
+                            cp: item[chirItem[e].length - 1].cp,
+                            sysl: item[chirItem[e].length - 1].sysl,
+                            wxsy: item[chirItem[e].length - 1].wxsy,
+                            zt: item[chirItem[e].length - 1].zt,
+                            parentid: item[chirItem[e].length - 1].parentid,
+                            no: noArr,
+                            id: item[chirItem[e].length - 1].id,
+                            memo: memoLong,
+                            total: sum
+                        });
+                        index = index + 1;
                         }
                         that.total = res.data.total;
-                        that.tableData = arr;
+                        that.tableData = JSON.parse(JSON.stringify(arr));
+                        that.originalData = JSON.parse(JSON.stringify(arr));
                         that.getAdds();
                     } else {
                         that.$message.error(res.message);
@@ -1198,11 +1341,22 @@ export default {
              let arr = [];
             for (let item of val) {
                 arr.push(item.seq);
-            }
+            };
             this.seqArr = arr.sort(sortNumber);
             for (let item of that.tableData) {
                 item.isSelection = false;
-            }
+            };
+            // 引用类型拷贝值JSON.parse(JSON.stringify(obj)
+            let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
+            for (let item of arrcha) {
+                // 取消选择时赋初始值
+                for (let weiIndex in that.tableData[item.seq].weight) {
+                    for (let weiKey in that.tableData[item.seq].weight[weiIndex]) {
+                        that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
+                    }
+                }
+                // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
+             };
             for (let item of val) {
                 let obj = {};
                 let xId = item.seq;
@@ -1308,27 +1462,31 @@ export default {
                     if (valid) {
                         let SubmitData = [];
                         for (let key in that.tableFormDataObj) {
-                            SubmitData.push({
-                                no: that.tableFormDataObj[key].no,
-                                weight: that.tableFormDataObj[key].weight,
-                                cjr: that.tableFormDataObj[key].cjr,
-                                memo: that.tableFormDataObj[key].memo,
-                                cjsj: that.tableFormDataObj[key].cjsj,
-                                jzsj: that.tableFormDataObj[key].jzsj,
-                                line: that.tableFormDataObj[key].line,
-                                xgr: that.tableFormDataObj[key].xgr,
-                                xgsj: that.tableFormDataObj[key].xgsj,
-                                cp: that.tableFormDataObj[key].cp,
-                                sysl: that.tableFormDataObj[key].sysl,
-                                zt: that.tableFormDataObj[key].zt,
-                                wxsy: that.tableFormDataObj[key].wxsy,
-                                unit: that.tableFormDataObj[key].unit,
-                                parentid: that.filterForm.data.parentid,
-                                yearmonth: that.tableFormDataObj[key].yearmonth
-                            });
-                        }
+                            let memoArr = that.tableFormDataObj[key].memo.split(';');
+                            for (let i = 0; i < that.tableFormDataObj[key].weight.length; i++) {
+                                 for (let keyname in that.tableFormDataObj[key].weight[i]) {
+                                     SubmitData.push({
+                                     weight: that.tableFormDataObj[key].weight[i][keyname],
+                                     no: that.tableFormDataObj[key].no[i][i],
+                                     memo: memoArr[i],
+                                     cjsj: that.tableFormDataObj[key].cjsj,
+                                     jzsj: that.tableFormDataObj[key].jzsj,
+                                     line: that.tableFormDataObj[key].line[i][i],
+                                     xgr: that.tableFormDataObj[key].xgr,
+                                     xgsj: that.tableFormDataObj[key].xgsj,
+                                     cp: that.tableFormDataObj[key].cp,
+                                     sysl: that.tableFormDataObj[key].sysl,
+                                     zt: that.tableFormDataObj[key].zt,
+                                     wxsy: that.tableFormDataObj[key].wxsy,
+                                     unit: that.tableFormDataObj[key].unit,
+                                     parentid: that.filterForm.data.parentid,
+                                     yearmonth: that.tableFormDataObj[key].yearmonth
+                                     });
+                                 };
+                             }
+                         }
                         that.loading = true;
-                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdateList', SubmitData)
                             .then(function (res) {
                                 if (res.code === '0') {
                                     that.$message({
@@ -1360,9 +1518,7 @@ export default {
                 line: that.dialog.editorBox.form.data.line,
                 parentid: that.filterForm.data.parentid,
                 memo: that.dialog.editorBox.form.data.memo
-
             });
-            // console.log(SubmitData)
             that.$refs['dialog_form'].validate((valid) => {
                if (valid) {
                         that.loading = true;
@@ -1398,9 +1554,11 @@ export default {
                         this.$message.error('已经审核的数据不能删除');
                         return;
                     }
-                    SubmitData.push({
-                        no: item.no
-                    });
+                    for (let noItem in item.no) {
+                        SubmitData.push({
+                            no: item.no[noItem][noItem]
+                        });
+                    }
                 }
                 that.$confirm('是否删除已选数据?', '提示', {
                     confirmButtonText: '确定',
@@ -1511,6 +1669,17 @@ export default {
                 let target = this.focusTarget;
                 $(target).find('input').focus();
             });
+        },
+        // 获取一行的总和
+        rowSum: function (item, event) {
+            let result = 0;
+            let that = this;
+            for (let weiIndex in item.weight) {
+                for (let weiKey in item.weight[weiIndex]) {
+                    result += Number(item.weight[weiIndex][weiKey]);
+                }
+            }
+            return result;
         }
     }
 }