lirl 4 lat temu
rodzic
commit
cdc74f8b08

+ 3 - 3
build/utils.js

@@ -11,11 +11,11 @@ const pathSrc = path.resolve(__dirname, '../src');
 
 // 指定开发模式下需要加载的模块(可以做到只加载当前模块,提高开发效率)
 // index模块(登录)为必须,all 为所有
-// const devModules = ['index', 'systemInterface', 'energyPerformance', 'basicInformation', 'energyScheduling'];
-const devModules = ['all'];
+   const devModules = ['all'];
+// const devModules = ['index','energyPerformance','energyPlan','basicInformation','systemInterface'];
 // 获取入口集合
 const getEntries = function (suffix, polyfill) {
-  // 自动获取
+  // 自动获取//
   const entryHtml = glob.sync(pathSrc + '/views/**/app.html'); // 根据html来
   const entries = {};
   entryHtml.forEach((filePath) => {

+ 9 - 9
config/index.js

@@ -16,7 +16,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/zhongsteel.pass.web/pass/v1': {
-        target: 'http://172.16.100.133:9001/v1', //加http
+        target: 'http://172.16.90.238:8088/v1', //加http
         // target: 'http://192.168.10.191:9001/v1', //加http
         changeOrigin: true,
         pathRewrite: {
@@ -25,7 +25,7 @@ module.exports = {
         }
       },
       '/zhongsteel.pass.web/pass/auth': {
-        target: 'http://172.16.100.133:9001/auth', //加http
+        target: 'http://172.16.90.238:8088/auth', //加http
         // target: 'http://192.168.10.191:9001/auth', //加http
         changeOrigin: true,
         pathRewrite: {
@@ -33,8 +33,8 @@ module.exports = {
           // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/
         }
       },
-      '/zhongsteel.pass.web/pass/logout': {
-        target: 'http://172.16.100.133:9001/logout', //加http
+      '/zhongsteel.pass.web/pass/logout': { 
+        target: 'http://172.16.90.238:8088/logout', //加http
         changeOrigin: true,
         pathRewrite: {
           '^/zhongsteel.pass.web/pass/logout': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替
@@ -64,21 +64,22 @@ module.exports = {
         }
       },
       '/icore-api': {
-        target: 'http://172.16.100.133:9001',
+        target: 'http://172.16.90.238:8088',
         changeOrigin: true,
         pathRewrite: {
           '^/icore-api': '/'
         }
       },
       '/zhongsteel.pass.web/pass/ems': {
-        target: 'http://localhost:9002',
+        // target: '172.16.90.238:8888',
+        target: 'http://localhost:8086',
         changeOrigin: true,
         pathRewrite: {
           '^/zhongsteel.pass.web/pass/ems': '/'
         }
       },
       '/zhongsteel.pass.web/pass/localhost': {
-        target: 'http://localhost:9002',
+        target: 'http://localhost:8888',
         changeOrigin: true,
         pathRewrite: {
           '^/zhongsteel.pass.web/pass/localhost': '/'
@@ -88,7 +89,7 @@ module.exports = {
 
     // Various Dev Server settings
     host: 'localhost', // can be overwritten by process.env.HOST
-    port: 8802, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    port: 8089, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,
     notifyOnErrors: true,
@@ -125,7 +126,6 @@ module.exports = {
     assetsRoot: path.resolve(__dirname, '../dist'),
     assetsSubDirectory: 'static', // 打包后 static放的位置
     assetsPublicPath: '../', // html中webpack打包的JS -> ../static/xxx.js
-
     /**
      * Source Maps
      */

+ 1 - 1
nginx.conf

@@ -88,4 +88,4 @@ http {
         }
 
      }
-}
+}

+ 1688 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectBuildingMaterialsFactory.vue

@@ -0,0 +1,1688 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="轧钢厂 "
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="productid"
+                            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 + '.productid'"
+                                    :rules="tableFormRules.productid"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].productid"
+                                        refcous="true"
+                                        @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>{{scope.row.productid}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="sysl"
+                            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 + '.sysl'"
+                                    :rules="tableFormRules.sysl"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].sysl"
+                                        refcous="true"
+                                        @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>{{scope.row.sysl}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="wxsy"
+                            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 + '.wxsy'"
+                                    :rules="tableFormRules.wxsy"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].wxsy"
+                                        refcous="true"
+                                        @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>{{scope.row.wxsy}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-焦化厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.workprocid"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.workprocid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unitid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+        </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+                <el-form-item
+                 label="外销数量"
+                 prop="wxsy"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.wxsy"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.wxsy"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                 label="高炉用量"
+                 prop="sysl"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.sysl"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.sysl"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="产品"
+                 prop="productid"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.productid"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.productid"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-轧钢复制"
+       :visible.sync="dialog.editorBox2.show"
+        width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :rules="dialog.editorBox2.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    prproductid: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'JC',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wxsy: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                sysl: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                productid: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT2014': {
+                          id: 'AT2014',
+                          name: '矿渣粉'
+                         },
+                         'AT3011': {
+                          id: 'AT3011',
+                          name: '1#回转窑'
+                         },
+                         'AT3012': {
+                          id: 'AT3012',
+                          name: '2#回转窑'
+                         }
+                         },
+                    arr: [{
+                           id: 'AT2011',
+                           name: '焦化'
+                        },
+                         {
+                          id: 'AT3011',
+                          name: '1#回转窑'
+                         },
+                         {
+                          id: 'AT3012',
+                          name: '2#回转窑'
+                         }
+                       ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: '',
+                            sysl: '',
+                            wxsy: '',
+                            productid: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            workprocid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            productid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            sysl: [
+                                 { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            wxsy: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                    rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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,
+                                productid: item.productid
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                line: that.dialog.editorBox.form.data.workprocid,
+                parentid: that.filterForm.data.parentid,
+                memo: that.dialog.editorBox.form.data.memo,
+                sysl: that.dialog.editorBox.form.data.sysl,
+                wxsy: that.dialog.editorBox.form.data.wxsy,
+                productid: that.dialog.editorBox.form.data.productid
+            });
+            console.log(SubmitData)
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1535 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectCoke.vue

@@ -0,0 +1,1535 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="机焦厂"
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-机焦厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.line"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.line"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unit"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                    :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+          <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       :visible.sync="dialog.editorBox2.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="memo"
+                    label-width="60px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'JJ',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {
+                        't': {
+                            id: 't',
+                            name: '吨'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: 't',
+                            name: '吨'
+                        }
+                    ]
+                },
+                workprocid: {
+                    obj: {
+                        'AT3009': {
+                            id: 'AT3009',
+                          name: '粗苯'
+                         },
+                         'AT3010': {
+                             id: 'AT3010',
+                           name: '硫铵'
+                        }
+                         },
+                    arr: [{
+                          id: 'AT3009',
+                          name: '粗苯'
+                        },
+                        {
+                        id: 'AT3010',
+                        name: '硫铵'
+                       }]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                     rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+                yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                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;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1673 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectCoking.vue

@@ -0,0 +1,1673 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="轧钢厂 "
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="productid"
+                            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 + '.productid'"
+                                    :rules="tableFormRules.productid"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].productid"
+                                        refcous="true"
+                                        @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>{{scope.row.productid}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="sysl"
+                            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 + '.sysl'"
+                                    :rules="tableFormRules.sysl"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].sysl"
+                                        refcous="true"
+                                        @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>{{scope.row.sysl}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="wxsy"
+                            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 + '.wxsy'"
+                                    :rules="tableFormRules.wxsy"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].wxsy"
+                                        refcous="true"
+                                        @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>{{scope.row.wxsy}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-焦化厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.workprocid"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.workprocid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unitid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+        </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+                <el-form-item
+                 label="外销数量"
+                 prop="wxsy"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.wxsy"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.wxsy"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                 label="高炉用量"
+                 prop="sysl"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.sysl"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.sysl"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="产品"
+                 prop="productid"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.productid"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.productid"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-轧钢复制"
+       :visible.sync="dialog.editorBox2.show"
+        width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :rules="dialog.editorBox2.form.yearmonth"
+                    :defaultOffset="-1"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    prproductid: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'JH',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wxsy: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                sysl: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                productid: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT2011': {
+                          id: 'AT2011',
+                          name: '焦化'
+                         }
+                         },
+                    arr: [{
+                           id: 'AT2011',
+                           name: '焦化'
+                        }
+                       ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: '',
+                            sysl: '',
+                            wxsy: '',
+                            productid: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            workprocid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            productid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            sysl: [
+                                 { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            wxsy: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                    rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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,
+                                productid: item.productid
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+                yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                line: that.dialog.editorBox.form.data.workprocid,
+                parentid: that.filterForm.data.parentid,
+                memo: that.dialog.editorBox.form.data.memo,
+                sysl: that.dialog.editorBox.form.data.sysl,
+                wxsy: that.dialog.editorBox.form.data.wxsy,
+                productid: that.dialog.editorBox.form.data.productid
+            });
+            console.log(SubmitData)
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1717 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectDataMonth.vue

@@ -0,0 +1,1717 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="6">
+                            <el-form-item label="查找日期">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.may"
+                                    style="width: 100%;"
+                                    :timegranId="'MONTH'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                            <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.workprocid"
+                                    multiple
+                                    collapse-tags
+                                    style="width: 100%;"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.location.showDataArr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="3">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    style="margin-left: 20px;"
+                                    @click="but_add"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >新增</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                   class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    style="margin-left: 20px;"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="workprocid"
+                            label="工序"
+                            fixed="left"
+                            width="70px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                              <span>{{ nameObj.workprocid.obj[scope.row.workprocid] ? nameObj.workprocid.obj[scope.row.workprocid] : scope.row.workprocid }}</span>                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="may"
+                            label="月份"
+                            fixed="left"
+                            width="80px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="productid"
+                            label="产品"
+                            fixed="left"
+                            width="80px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unitid"
+                            label="单位名称"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                              <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                         </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weightDay"
+                            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 + '.weightDay'"
+                                    :rules="tableFormRules.weightDay"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weightDay"
+                                        refcous="true"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change = "getApportValue(scope.row.seq, tableFormDataObj[scope.row.seq].weightDay,scope.$index, $event)"
+                                    ></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.weightDay}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="rxj"
+                            label="日小计"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="jxdays"
+                            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 + '.jxdays'"
+                                    :rules="tableFormRules.jxdays"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].jxdays"
+                                        refcous="true"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        @change = "getApportValue(scope.row.seq, tableFormDataObj[scope.row.seq].jxdays, scope.$index, $event)"
+                                    ></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.jxdays}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="weightMonth"
+                            label="目标计划量(月)"
+                            width="110px"
+                            :show-overflow-tooltip="true"
+                        >
+                            <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection"
+                                    :prop="scope.row.seq + '.weightMonth'"
+                                    :rules="tableFormRules.weightMonth"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        v-model="tableFormDataObj[scope.row.seq].weightMonth"
+                                        @change="chnageApportvalue(scope.row.seq, tableFormDataObj[scope.row.seq].weightMonth, scope.$index)"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.weightMonth}}</span>
+                            </template>
+                        </el-table-column>
+                         <el-table-column
+                            prop="yhj"
+                            label="月合计"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="kxf_weight"
+                            label="可下发量"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection"
+                                    :prop="scope.row.seq + '.kxf_weight'"
+                                    :rules="tableFormRules.kxf_weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        v-model="tableFormDataObj[scope.row.seq].kxf_weight"
+                                        @change="chnageApportvalue(scope.row.seq, tableFormDataObj[scope.row.seq].kxf_weight, scope.$index)"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.kxf_weight}}</span>
+                            </template>
+                        </el-table-column>
+                         <el-table-column
+                            prop="yxf_weight"
+                            label="已下发量"
+                            width="100px"
+                            :show-overflow-tooltip="true"
+                        >
+                         <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection"
+                                    :prop="scope.row.seq + '.yxf_weight'"
+                                    :rules="tableFormRules.yxf_weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        v-model="tableFormDataObj[scope.row.seq].yxf_weight"
+                                        @change="chnageApportvalue(scope.row.seq, tableFormDataObj[scope.row.seq].yxf_weight, scope.$index)"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.yxf_weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="createman"
+                            label="创建人"
+                            width="95px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="createtime"
+                            label="创建时间"
+                            width="95px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                         <el-table-column
+                            prop="updatetime"
+                            label="修改时间"
+                            width="95px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="updateman"
+                            label="修改人"
+                            width="110px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            :show-overflow-tooltip="true"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+        <el-dialog
+        title="月度计划编制 新增"
+        :visible.sync="dialog.editorBox.show"
+         width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         ref="dialog_form"
+         :model="dialog.editorBox.form.data"
+         :rules="dialog.editorBox.form.rules"
+         size="mini"
+         label-width="95px"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.workprocid"
+                     placeholder=""
+                    style="width: 100%;"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="may"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.may"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="产品"
+                 prop="productid"
+                >
+               <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.productid"
+                v-model="dialog.editorBox.form.data.productid"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+               <el-form-item
+               label="单位名称"
+               prop="unitid"
+               >
+                   <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.unitid"
+                     placeholder=""
+                     :rules="dialog.editorBox.form.unitid"
+                    style="width: 100%;"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+              </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+            <el-form-item
+            label="目标计划量(日)"
+            prop="weightDay"
+                >
+           <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weightDay"
+                v-model="dialog.editorBox.form.data.weightDay"
+               ></el-input>
+            </el-form-item>
+            </el-col>
+            <el-col :span="12">
+            <el-form-item
+            label="检修小时"
+            prop="jxdays"
+                >
+             <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.jxdays"
+                v-model="dialog.editorBox.form.data.jxdays"
+               ></el-input>
+            </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                label="目标计划量 (月)"
+                prop="weightMonth"
+                >
+                <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weightMonth"
+                v-model="dialog.editorBox.form.data.weightMonth"
+               ></el-input>
+                </el-form-item>
+            </el-col>
+             <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop="memo"
+                 :rules="dialog.editorBox.form.memo"
+                >
+               <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.memo"
+                v-model="dialog.editorBox.form.data.memo"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                label="可下发量"
+                prop="kxf_weight"
+                >
+                <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.kxf_weight"
+                v-model="dialog.editorBox.form.data.kxf_weight"
+               ></el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                label="已下发量"
+                prop="yxf_weight"
+                >
+                <el-input
+                clearable
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.yxf_weight"
+                v-model="dialog.editorBox.form.data.yxf_weight"
+               ></el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        @click="dialog.editorBox.show = false"
+        :loading="loading"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="月度计划编制-复制"
+       :visible.sync="dialog.editorBox2.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="时间"
+                    prop="may"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.may"
+                     style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox2.form.may"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    show: false,
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    productid: '',
+                    may: '',
+                    weightMonth: '',
+                    weightDay: '',
+                    unit: '',
+                    jxdays: '',
+                    createtime: '',
+                    createman: '',
+                    updatetime: '',
+                    updateman: '',
+                    memo: '',
+                    startTime: '',
+                    endTime: '',
+                    kxf_weight: '',
+                    yxf_weight: ''
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            workprocid: '',
+                            unitid: '',
+                            may: '',
+                            productid: '',
+                            weightDay: '',
+                            weightMonth: '',
+                            jxdays: '',
+                            memo: '',
+                            kxf_weight: '',
+                            yxf_weight: ''
+                        },
+                         rules: {
+                             weightMonth: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            weightDay: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            workprocid: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            may: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            productid: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            unitid: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            jxdays: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            memo: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            kxf_weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yxf_weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          may: ''
+                      },
+                      rules: {
+                            may: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weightDay: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                jxdays: [
+                     { required: true, message: '该项不能为空', trigger: 'change' },
+                     { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weightMonth: [
+                     { required: true, message: '该项不能为空', trigger: 'change' },
+                     { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                kxf_weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                     { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                yxf_weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                     { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                bz: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                workprocid: {
+                    obj: {},
+                    arr: []
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                },
+                unitid: {
+                    obj: {},
+                    arr: [],
+                    defaults: ''
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        that.getNodeData();
+        // that.getLocation();
+         that.getUnitIdData();
+        that.getLocateIdData();
+        // that.getTableData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weightMonth', 'weightDay', 'rxj', 'yhj']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        getNodeData () {
+            let that = this
+            let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.workprocid.arr = arr;
+                        that.nameObj.workprocid.obj = obj;
+                        that.connn();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/emsprodplanmonths/getWorkprocs'
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+                productid: that.dialog.editorBox.form.data.productid,
+                workprocid: that.dialog.editorBox.form.data.workprocid.toString(),
+                may: that.dialog.editorBox.form.data.may,
+                weightMonth: that.dialog.editorBox.form.data.weightMonth,
+                weightDay: that.dialog.editorBox.form.data.weightDay,
+                unit: that.dialog.editorBox.form.data.unitid,
+                jxdays: that.dialog.editorBox.form.data.jxdays,
+                memo: that.dialog.editorBox.form.data.memo,
+                kxf_weight: that.dialog.editorBox.form.data.kxf_weight,
+                yxf_weight: that.dialog.editorBox.form.data.yxf_weight
+            });
+            console.log(SubmitData)
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanmonths/', SubmitData, {
+                            contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            });
+        },
+        but_copy_plural () {
+            let that = this;
+            let SubmitData = [];
+            for (let key in that.tableFormDataObj) {
+                SubmitData.push({
+                    productid: that.tableFormDataObj[key].productid,
+                    workprocid: that.tableFormDataObj[key].workprocid,
+                    may: that.dialog.editorBox2.form.data.may,
+                    networkid: that.tableFormDataObj[key].networkid,
+                    weightMonth: that.tableFormDataObj[key].weightMonth,
+                    weightDay: that.tableFormDataObj[key].weightDay,
+                    unit: that.tableFormDataObj[key].unit,
+                    jxdays: that.tableFormDataObj[key].jxdays,
+                    createtime: that.tableFormDataObj[key].createtime,
+                    createman: that.tableFormDataObj[key].createman,
+                    updatetime: that.tableFormDataObj[key].updatetime,
+                    updateman: that.tableFormDataObj[key].updateman,
+                    state: that.tableFormDataObj[key].state,
+                    memo: that.tableFormDataObj[key].memo,
+                    kxf_weight: that.tableFormDataObj[key].kxf_weight,
+                    yxf_weight: that.tableFormDataObj[key].yxf_weight
+                            });
+                        }
+                        console.log(SubmitData)
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanmonths/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+                   });
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    id: that.filterForm.data.id,
+                    productid: that.filterForm.data.productid,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    weightMonth: that.filterForm.data.weightMonth,
+                    weightDay: that.filterForm.data.weightDay,
+                    unit: that.filterForm.data.unit,
+                    state: that.filterForm.data.state,
+                    jxdays: that.filterForm.data.jxdays,
+                    createtime: that.filterForm.data.createtime,
+                    createman: that.filterForm.data.createman,
+                    updatetime: that.filterForm.data.updatetime,
+                    updateman: that.filterForm.data.updateman,
+                    memo: that.filterForm.data.memo,
+                    may: that.filterForm.data.may
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanmonths/?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,
+                                id: item.id,
+                                productid: item.productid,
+                                workprocid: item.workprocid,
+                                may: item.may,
+                                networkid: item.networkid,
+                                weightMonth: item.weightMonth,
+                                weightDay: item.weightDay,
+                                unit: item.unit,
+                                jxdays: item.jxdays,
+                                createtime: item.createtime,
+                                createman: item.createman,
+                                updatetime: item.updatetime,
+                                updateman: item.updateman,
+                                memo: item.memo,
+                                state: item.state,
+                                kxf_weight: item.kxf_weight,
+                                yxf_weight: item.yxf_weight
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        console.log('表格数据', arr)
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    id: that.filterForm.data.id,
+                    productid: that.filterForm.data.productid,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    may: that.filterForm.data.clockc[0],
+                    networkid: that.filterForm.data.networkid.toString(),
+                    weightMonth: that.filterForm.data.weightMonth,
+                    weightDay: that.filterForm.data.weightDay,
+                    unit: that.filterForm.data.unit,
+                    state: that.filterForm.data.state,
+                    jxdays: that.filterForm.data.jxdays,
+                    createtime: that.filterForm.data.createtime,
+                    createman: that.filterForm.data.createman,
+                    updatetime: that.filterForm.data.updatetime,
+                    updateman: that.filterForm.data.updateman,
+                    memo: that.filterForm.data.memo
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanmonths/getDateEditForPage/?pageNum=1&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,
+                                id: item.id,
+                                productid: item.productid,
+                                workprocid: item.workprocid,
+                                may: item.may,
+                                state: item.state,
+                                networkid: item.networkid,
+                                weightMonth: item.weightMonth,
+                                weightDay: item.weightDay,
+                                unit: item.unit,
+                                jxdays: item.jxdays,
+                                createtime: item.createtime,
+                                createman: item.createman,
+                                updatetime: item.updatetime,
+                                updateman: item.updateman,
+                                memo: item.memo
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds' || column['property'] === 'rxj' || column['property'] === 'yhj') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+        but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                if (valid) {
+                    that.dialog.editorBox2.show = true;
+                setTimeout(() => {
+                    that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+                }
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        // 获取标准计量单位
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+            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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let rxj = 0;
+                let yhj = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        rxj = that.floatComputed(Number(item.weightDay), rxj, '+');
+                        yhj = that.floatComputed(Number(item.weightMonth), yhj, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].rxj = rxj;
+                        that.tableData[i].yhj = yhj;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    if (valid) {
+                        let SubmitData = [];
+                        for (let key in that.tableFormDataObj) {
+                            SubmitData.push({
+                                id: that.tableFormDataObj[key].id,
+                                productid: that.tableFormDataObj[key].productid,
+                                workprocid: that.tableFormDataObj[key].workprocid,
+                                may: that.tableFormDataObj[key].may,
+                                networkid: that.tableFormDataObj[key].networkid,
+                                weightMonth: that.tableFormDataObj[key].weightMonth,
+                                weightDay: that.tableFormDataObj[key].weightDay,
+                                unit: that.tableFormDataObj[key].unit,
+                                jxdays: that.tableFormDataObj[key].jxdays,
+                                createtime: that.tableFormDataObj[key].createtime,
+                                createman: that.tableFormDataObj[key].createman,
+                                updatetime: that.tableFormDataObj[key].updatetime,
+                                updateman: that.tableFormDataObj[key].updateman,
+                                state: that.tableFormDataObj[key].state,
+                                memo: that.tableFormDataObj[key].memo,
+                                kxf_weight: that.tableFormDataObj[key].kxf_weight,
+                                yxf_weight: that.tableFormDataObj[key].yxf_weight
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanmonths/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (!item.id) {
+                        this.$message.error('数据未保存,请点击"查询"');
+                        return;
+                    }
+                    SubmitData.push({
+                        id: item.id
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanmonths/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1533 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectDataYear.vue

@@ -0,0 +1,1533 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.workprocid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="请选择工序"
+                                    style="width: 100%;"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.workprocid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="查找日期">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'MONTH'"
+                                    :oneFoo="getTableData"
+                                    :defaultOffset="-1"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="计量点编号" label-width="85px">
+                                <el-input
+                                    clearable
+                                    v-model="filterForm.data.measureid"
+                                    placeholder="计量点编号"
+                                    style="width: 100%;"
+                                    @keyup.enter.native="getTableData(1)"
+                                ></el-input>
+                            </el-form-item> -->
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <!-- <el-form-item style="display: inline-block;margin-bottom:0px;" label="生成日期">
+                                    <zj-timegran-date
+                                        v-model="filterForm.data.clockc"
+                                        style="width: 100%;"
+                                        :type="'daterange'"
+                                        :timegranId="'DAY'"
+                                        :oneFoo="getTableData"
+                                        :defaultOffset="-1"
+                                    ></zj-timegran-date>
+                                </el-form-item> -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            width="80px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="单位名称"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-铁车车间新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.line"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.line"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="单位名称"
+               prop="unit"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                    :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-铁车车间复制"
+       :visible.sync="dialog.editorBox2.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="时间"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'LT',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        // 'AT3001': {
+                        //     id: 'AT3001',
+                        //   name: '1#高炉'
+                        //  },
+                        //  'AT3002': {
+                        //      id: 'AT3002',
+                        //    name: '2#高炉'
+                        // },
+                        // 'AT3003': {
+                        //      id: 'AT3003',
+                        //    name: '3#高炉'
+                        // },
+                        // 'AT3004': {
+                        //      id: 'AT3004',
+                        //    name: '4#高炉'
+                        // }
+                         },
+                    arr: []
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                unit: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                      rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+        that.getNodeData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+       // 获取工序列表
+        getNodeData () {
+            let that = this
+            let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.workprocid.arr = arr;
+                        that.nameObj.workprocid.obj = obj;
+                        that.connn();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                line: that.dialog.editorBox.form.data.line,
+                parentid: that.filterForm.data.parentid
+
+            });
+            console.log(SubmitData)
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1537 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectIronMill.vue

@@ -0,0 +1,1537 @@
+<template>
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="炼钢厂"
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                     style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-炼钢厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.line"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.line"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unit"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                    :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-炼钢厂复制"
+       :visible.sync="dialog.editorBox2.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    label-width="60px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'LG',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT3005': {
+                            id: 'AT3005',
+                          name: '供高线一车间'
+                         },
+                         'AT3006': {
+                             id: 'AT3006',
+                           name: '供高线二车间'
+                        },
+                        'AT3007': {
+                             id: 'AT3007',
+                           name: '供型钢厂异形坯'
+                        },
+                        'AT3008': {
+                             id: 'AT3008',
+                           name: '外销方坯'
+                        }
+                         },
+                    arr: [{
+                        id: 'AT3005',
+                        name: '供高线一车间'
+                        },
+                        {
+                         id: 'AT3006',
+                        name: '供高线二车间'
+                       },
+                       {
+                           id: 'AT3007',
+                           name: '供型钢厂异形坯'
+                       },
+                       {
+                           id: 'AT3008',
+                           name: '外销方坯'
+                       }]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                      rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                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;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1711 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectPowerPlant.vue

@@ -0,0 +1,1711 @@
+<template>
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="轧钢厂 "
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="productid"
+                            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 + '.productid'"
+                                    :rules="tableFormRules.productid"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].productid"
+                                        refcous="true"
+                                        @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>{{scope.row.productid}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="sysl"
+                            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 + '.sysl'"
+                                    :rules="tableFormRules.sysl"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].sysl"
+                                        refcous="true"
+                                        @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>{{scope.row.sysl}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="wxsy"
+                            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 + '.wxsy'"
+                                    :rules="tableFormRules.wxsy"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].wxsy"
+                                        refcous="true"
+                                        @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>{{scope.row.wxsy}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-焦化厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.workprocid"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.workprocid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unitid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+        </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+                <el-form-item
+                 label="外销数量"
+                 prop="wxsy"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.wxsy"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.wxsy"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                 label="高炉用量"
+                 prop="sysl"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.sysl"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.sysl"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="产品"
+                 prop="productid"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.productid"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.productid"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-轧钢复制"
+       :visible.sync="dialog.editorBox2.show"
+        width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :rules="dialog.editorBox2.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    prproductid: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'JH',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wxsy: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                sysl: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                productid: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT2015': {
+                          id: 'AT2015',
+                          name: '6WM'
+                         },
+                         'AT2016': {
+                          id: 'AT2016',
+                          name: '25WM'
+                         },
+                         'AT2017': {
+                          id: 'AT2017',
+                          name: '25WM'
+                         },
+                         'AT2022': {
+                          id: 'AT2022',
+                          name: '3WM'
+                         },
+                         'AT2020': {
+                          id: 'AT2020',
+                          name: '12WM'
+                         },
+                         'AT2021': {
+                          id: 'AT2021',
+                          name: 'TRT'
+                         }
+                         },
+                    arr: [
+                        {
+                          id: 'AT2015',
+                          name: '6WM'
+                         },
+                        {
+                          id: 'AT2016',
+                          name: '25WM'
+                         },
+                          {
+                          id: 'AT2017',
+                          name: '25WM'
+                         },
+                         {
+                          id: 'AT2022',
+                          name: '3WM'
+                         },
+                         {
+                          id: 'AT2020',
+                          name: '12WM'
+                         },
+                         {
+                          id: 'AT2021',
+                          name: 'TRT'
+                         }
+                       ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: '',
+                            sysl: '',
+                            wxsy: '',
+                            productid: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            workprocid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            productid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            sysl: [
+                                 { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            wxsy: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                    rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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,
+                                productid: item.productid
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                line: that.dialog.editorBox.form.data.workprocid,
+                parentid: that.filterForm.data.parentid,
+                memo: that.dialog.editorBox.form.data.memo,
+                sysl: that.dialog.editorBox.form.data.sysl,
+                wxsy: that.dialog.editorBox.form.data.wxsy,
+                productid: that.dialog.editorBox.form.data.productid
+            });
+            console.log(SubmitData)
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1538 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectPuddling.vue

@@ -0,0 +1,1538 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <!-- <el-form-item style="display: inline-block;margin-bottom:0px;" label="生成日期">
+                                    <zj-timegran-date
+                                        v-model="filterForm.data.clockc"
+                                        style="width: 100%;"
+                                        :type="'daterange'"
+                                        :timegranId="'DAY'"
+                                        :oneFoo="getTableData"
+                                        :defaultOffset="-1"
+                                    ></zj-timegran-date>
+                                </el-form-item> -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-铁车车间新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.line"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.line"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unit"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                    :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-铁车车间复制"
+       :visible.sync="dialog.editorBox2.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="时间"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'LT',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT3001': {
+                            id: 'AT3001',
+                          name: '1#高炉'
+                         },
+                         'AT3002': {
+                             id: 'AT3002',
+                           name: '2#高炉'
+                        },
+                        'AT3003': {
+                             id: 'AT3003',
+                           name: '3#高炉'
+                        },
+                        'AT3004': {
+                             id: 'AT3004',
+                           name: '4#高炉'
+                        }
+                         },
+                    arr: [
+                        {
+                        id: 'AT3001',
+                        name: '1#高炉'
+                        },
+                        {
+                         id: 'AT3002',
+                        name: '2#高炉'
+                       },
+                       {
+                           id: 'AT3003',
+                           name: '3#高炉'
+                       },
+                       {
+                           id: 'AT3004',
+                           name: '4#高炉'
+                       }
+                    ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                unit: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                      rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+       // that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+       // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                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;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

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

@@ -0,0 +1,1742 @@
+<template>
+    <div class="balanceSheetData">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="70px"
+                >
+                    <el-row>
+                        <el-col :span="6">
+                             <el-form-item label="月份">
+                                 <zj-timegran-date
+                                    v-model="filterForm.data.clock"
+                                    style="width: 100%;"
+                                    :timegranId="filterForm.data.timegranid"
+                                    :oneFoo="getTableData"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                           <el-form-item label="产线">
+                                <el-select
+                                filterable clearable
+                                    v-model="filterForm.data.workprocid"
+                                    placeholder=""
+                                    style="width: 100%;"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.workprocid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </el-form>
+               <div class="box-top-gjl">
+                        <el-button
+                            class="button"
+                            type="primary"
+                            size="mini"
+                            icon="el-icon-plus"
+                            v-privilege="activeMenu + 'ADD'"
+                            @click="but_add"
+                        >新增</el-button>
+                    <el-button
+                        type="primary"
+                        size="mini"
+                        icon="el-icon-add-outline"
+                        @click="but_edit_plural()"
+                    >修改</el-button>
+                    <el-button
+                        class="button"
+                        type="danger"
+                        size="mini"
+                        icon="el-icon-delete"
+                        @click="but_del_plural()"
+                    >删除</el-button>
+                    <el-button
+                        type="primary"
+                        size="mini"
+                        icon="el-icon-add-outline"
+                        @click="issue(1)"
+                    >下发</el-button>
+                    <el-button
+                        type="primary"
+                        size="mini"
+                        icon="el-icon-add-outline"
+                        @click="issue(0)"
+                    >取消下发</el-button>
+                    <div style="float:right; text-align: right;">
+                        <el-button
+                            class="button"
+                            type="primary"
+                            size="mini"
+                            icon="el-icon-search"
+                            v-privilege="activeMenu + 'QUERY'"
+                            @click="getTableData(1)"
+                        >查询</el-button>
+                        <el-button
+                            size="mini"
+                            :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                            :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                            @click="filterForm.show = !filterForm.show;
+                                $nextTick(() => {
+                                    singleTableHeight = getRoleHeight($refs['boxBottom']) - 45;
+                                }
+                            );"
+                        >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                    </div>
+                </div>
+            </div>
+            <div class="box-bottom" ref="boxBottom">
+                <div class="table-box" ref="table_box">
+                    <div class="table-left" :style="{ width: leftTableWidth + 'px' }">
+                        <el-form
+                            size="mini"
+                            ref="dialog_form_arr_1"
+                            label-width="0px"
+                            :model="tableFormDataObj"
+                        >
+                            <el-table stripe
+                                id="singleTable1"
+                                ref="singleTable1"
+                                :data="leftTableData"
+                                v-loading="leftTableLoading"
+                                style="width: 100%;"
+                                :height="singleTableHeight"
+                                border
+                                size="mini"
+                                highlight-current-row
+                                show-summary
+                                :summary-method="getSummaries"
+                                @current-change="getTableDetailData"
+                            >
+                                <el-table-column
+                                prop="sqno"
+                                label="序号"
+                                fixed="left"
+                                width="50px"
+                                :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="may"
+                                    label="月份"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="workprocid"
+                                    label="工序"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                        <span>{{ nameObj.workprocid.obj[scope.row.workprocid] ? nameObj.workprocid.obj[scope.row.workprocid].name : scope.row.workprocid }}</span>
+                                    </template>
+                                </el-table-column>
+                              <el-table-column
+                                sortable
+                                    prop="unit"
+                                    label="单位"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                    <template slot-scope="scope">
+                                        <span>{{ nameObj.unit.obj[scope.row.unit] ? nameObj.unit.obj[scope.row.unit] : scope.row.unit }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column
+                                sortable
+                                    prop="kxf_weight"
+                                    label="可下发量"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                </el-table-column>
+                                <el-table-column
+                                sortable
+                                    prop="weightMonth"
+                                    label="年度计划量(月)"
+                                    min-width="115px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                </el-table-column>
+                                <el-table-column
+                                sortable
+                                    prop="yxf_weight"
+                                    label="已下发量"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                </el-table-column>
+                                <el-table-column
+                                prop="id"
+                                label="序号"
+                                fixed="left"
+                                width="50px"
+                                :show-overflow-tooltip="true"
+                                v-if="filterForm.data.show"
+                                ></el-table-column>
+                            </el-table>
+                        </el-form>
+                    </div>
+                    <div class="table-tuodong" :style="{ height: singleTableHeight + 'px' }"
+                        @mousedown="tableTDMousedown"
+                    ></div>
+                    <div class="table-right" :style="{ 'margin-left': (leftTableWidth + 7) + 'px' }">
+                        <el-form
+                            size="mini"
+                            ref="dialog_form_arr_2"
+                            label-width="0px"
+                            :model="rightTableObj"
+                        >
+                            <el-table stripe
+                                id="singleTable2"
+                                ref="singleTable2"
+                                :data="rightTableData"
+                                v-loading="tableLoading"
+                                style="width: 100%;"
+                                :height="singleTableHeight"
+                                border
+                                size="mini"
+                                highlight-current-row
+                                show-summary
+                                :summary-method="getSummaries"
+                                 @selection-change="handleSelectionChange"
+                            >
+                                <el-table-column
+                                type="selection"
+                                width="40"
+                                align="center"
+                                :selectable='checkboxT'
+                                fixed="left"
+                                class-name="cnspicuous"
+                            ></el-table-column>
+                                <el-table-column
+                                    prop="sqno"
+                                    label="月序号"
+                                    min-width="100px"
+                                    v-model="filterForm.data.sqno"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="may"
+                                    label="月份"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                </el-table-column>
+                                <el-table-column
+                                    prop="describe"
+                                    label="轮次描述"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                </el-table-column>
+                                <el-table-column
+                                    prop="state"
+                                    label="状态"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                <span
+                                    :style="{color: nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].color : ''}"
+                                >{{ nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].name : scope.row.state }}</span>
+                                 </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="grades"
+                                    label="钢种"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                    <el-form-item
+                                    :prop="scope.row.seq + '.grades'"
+                                    v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                    :rules="tableFormRules.grades"
+                                  >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="rightTableObj[scope.row.seq].grades"
+                                    placeholder=""
+                                    >
+                                    <el-option
+                                    v-for="item of nameObj.grades.arr"
+                                    :key="item.id"
+                                    :value="item.id"
+                                    :label="item.name"
+                                    ></el-option>
+                                    </el-select>
+                                </el-form-item>
+                                <span v-else>{{ nameObj.grades.obj[scope.row.grades] ? nameObj.grades.obj[scope.row.grades].name : scope.row.grades }}</span>
+                                </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="planWeight"
+                                    label="计划量"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                <el-form-item
+                                 :prop="scope.row.seq + '.planWeight'"
+                                 v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                  :rules="tableFormRules.planWeight"
+                                >
+                                    <el-input
+                                    style="width: 100%;"
+                                    v-model="rightTableObj[scope.row.seq].planWeight"
+                                    refcous="true"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.planWeight}}</span>
+                            </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="specifications"
+                                    label="规格"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                    <el-form-item
+                                  :prop="scope.row.seq + '.specifications'"
+                                   v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                   :rules="tableFormRules.specifications"
+                                  >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="rightTableObj[scope.row.seq].specifications"
+                                    placeholder=""
+                                    >
+                                    <el-option
+                                    v-for="item of nameObj.specifications.arr"
+                                    :key="item.id"
+                                    :value="item.id"
+                                    :label="item.name"
+                                    ></el-option>
+                                    </el-select>
+                                </el-form-item>
+                                <span v-else>{{ nameObj.specifications.obj[scope.row.specifications] ? nameObj.specifications.obj[scope.row.specifications].name : scope.row.specifications }}</span>
+                                </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="transportType"
+                                    label="运输方式"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                     <el-form-item
+                                     :prop="scope.row.seq + '.transportType'"
+                                     v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                     :rules="tableFormRules.transportType"
+                                  >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="rightTableObj[scope.row.seq].transportType"
+                                    placeholder=""
+                                    >
+                                    <el-option
+                                    v-for="item of nameObj.transportType.arr"
+                                    :key="item.id"
+                                    :value="item.id"
+                                    :label="item.name"
+                                    ></el-option>
+                                    </el-select>
+                                </el-form-item>
+                                <span v-else>{{ nameObj.transportType.obj[scope.row.transportType] ? nameObj.transportType.obj[scope.row.transportType].name : scope.row.transportType }}</span>
+                                </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="purpose"
+                                    label="用途"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                    <el-form-item
+                                    :prop="scope.row.seq + '.purpose'"
+                                    :rules="tableFormRules.purpose"
+                                     v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                  >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="rightTableObj[scope.row.seq].purpose"
+                                    placeholder=""
+                                    >
+                                    <el-option
+                                    v-for="item of nameObj.purpose.arr"
+                                    :key="item.id"
+                                    :value="item.id"
+                                    :label="item.name"
+                                    ></el-option>
+                                    </el-select>
+                                </el-form-item>
+                                <span v-else>{{ nameObj.purpose.obj[scope.row.purpose] ? nameObj.purpose.obj[scope.row.purpose].name : scope.row.purpose }}</span>
+                                </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="chemicalStandard"
+                                    label="执行标准"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                   <el-form-item
+                                   :prop="scope.row.seq + '.chemicalStandard'"
+                                   :rules="tableFormRules.chemicalStandard"
+                                   v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
+                                  >
+                                    <el-select
+                                    filterable clearable
+                                    v-model="rightTableObj[scope.row.seq].chemicalStandard"
+                                    placeholder=""
+
+                                    >
+                                    <el-option
+                                    v-for="item of nameObj.chemicalStandard.arr"
+                                    :key="item.id"
+                                    :value="item.id"
+                                    :label="item.name"
+                                    ></el-option>
+                                    </el-select>
+                                </el-form-item>
+                                 <span v-else>{{ nameObj.chemicalStandard.obj[scope.row.chemicalStandard] ? nameObj.chemicalStandard.obj[scope.row.chemicalStandard].name : scope.row.chemicalStandard }}</span>
+                                </template>
+                                </el-table-column>
+                                <el-table-column
+                                    prop="memo"
+                                    label="备注"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                </el-table-column>
+                                <el-table-column
+                                    prop="issuedTime"
+                                    label="下发时间"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="createman"
+                                    label="创建人"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="createtime"
+                                    label="创建时间"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="updateman"
+                                    label="修改人"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="updatetime"
+                                    label="修改时间"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="roundid"
+                                    label="轮次序号"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                    v-if="filterForm.data.show"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="parentid"
+                                    label="月序号"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                    v-if="filterForm.data.show"
+                                ></el-table-column>
+                                <el-table-column
+                                    prop="workprocType"
+                                    label="工序类别"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                     v-if="filterForm.data.show"
+                                ></el-table-column>
+                            </el-table>
+                        </el-form>
+                    </div>
+                </div>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: left;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+        <el-dialog
+        title="轮次计划-高线 新增"
+        :visible.sync="dialog.editorBox.show"
+         width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+          ref="dialog_form"
+         :model="dialog.editorBox.form.data"
+         :rules="dialog.editorBox.form.rules"
+         size="mini"
+         label-width="95px"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               :rules="dialog.editorBox.form.workprocid"
+               >
+                   <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.workprocid"
+                     placeholder=""
+                     style="width: 100%;"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="may"
+                    :rules="dialog.editorBox.form.may"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.may"
+                    style="width: 100%;"
+                    :timegranId="filterForm.data.timegranid"
+                    :oneFoo="getTableData"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="轮次描述"
+                 prop="describe"
+                 :rules="dialog.editorBox.form.describe"
+                >
+               <el-input
+                clearable
+                style="width: 100%;"
+                v-model="dialog.editorBox.form.data.describe"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+            <el-col :span="12">
+               <el-form-item
+               label="钢种"
+               prop="grades"
+               >
+                   <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.grades"
+                     placeholder=""
+                    style="width: 100%;"
+                    :rules="tableFormRules.grades"
+                    >
+                    <el-option
+                    v-for="item of nameObj.grades.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+              </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+            <el-form-item
+            label="规格"
+            prop="specifications"
+                >
+            <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.specifications"
+                     placeholder=""
+                    style="width: 100%;"
+                    :rules="tableFormRules.specifications"
+                    >
+                    <el-option
+                    v-for="item of nameObj.specifications.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+            </el-form-item>
+            </el-col>
+            <el-col :span="12">
+            <el-form-item
+            label="运输方式"
+            prop="transportType"
+                >
+             <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.transportType"
+                     placeholder=""
+                    style="width: 100%;"
+                    :rules="tableFormRules.transportType"
+                    >
+                    <el-option
+                    v-for="item of nameObj.transportType.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+            </el-select>
+            </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                label="执行标准"
+                 prop="chemicalStandard"
+                :rules="tableFormRules.chemicalStandard"
+                >
+               <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.chemicalStandard"
+                     placeholder=""
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.chemicalStandard"
+                    >
+                    <el-option
+                    v-for="item of nameObj.chemicalStandard.arr"
+                    :key="item.id"
+                    :value="item.name"
+                    :label="item.name"
+                    ></el-option>
+            </el-select>
+                </el-form-item>
+            </el-col>
+             <el-col :span="12">
+                <el-form-item
+                 label="计划量"
+                 prop="planWeight"
+                 :rules="dialog.editorBox.form.planWeight"
+                >
+               <el-input
+                clearable
+                style="width: 100%;"
+                v-model="dialog.editorBox.form.data.planWeight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+                <el-form-item
+                 label="用途"
+                 prop="purpose"
+                 :rules="dialog.editorBox.form.purpose"
+                >
+               <el-select
+                     filterable clearable
+                     v-model="dialog.editorBox.form.data.purpose"
+                     placeholder=""
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.purpose"
+                    >
+                    <el-option
+                    v-for="item of nameObj.purpose.arr"
+                    :key="item.id"
+                    :value="item.name"
+                    :label="item.name"
+                    ></el-option>
+            </el-select>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        @click="dialog.editorBox.show = false"
+        :loading="loading"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js';
+import timegranDate from '@/components/zg/timegranDate.vue';
+import formulaEditor from '@/components/zg/formulaEditor.vue';
+import {formatDate, commonSummaries} from '@/utils/util.js';
+export default {
+    name: 'balanceSheetData',
+    components: {
+        'zj-timegran-date': timegranDate,
+        'zj-formulaEditor': formulaEditor
+    },
+    data () {
+        return {
+            activeMenu: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    id: '',
+                    timegranid: '',
+                    clock: '',
+                    workprocid: '',
+                    workprocType: '',
+                    energyid: '',
+                    propertyid: '',
+                    itemid: '',
+                    itemname: '',
+                    itemdesc: '',
+                    may: '',
+                    canissue: '',
+                    weightMonth: '',
+                    issue: '',
+                    yxf_weight: '',
+                    kxf_weight: '',
+                    describe: '',
+                    state: '',
+                    grades: '',
+                    specifications: '',
+                    lengths: '',
+                    chemicalStandard: '',
+                    surfaceStandard: '',
+                    transportType: '',
+                    parentid: '',
+                    purpose: '',
+                    sqno: '',
+                    show: false
+                }
+            },
+             rules: {
+                },
+            pageNum: 1,
+            pageSize: 20,
+            total: 0,
+            rightTableData: [],
+            singleTableHeight: 100,
+            leftTableData: [],
+            leftTableLoading: false,
+            leftTableWidth: 550,
+            difference: 0,
+            rightTableObj: {},
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                planWeight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                grades: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                specifications: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                transportType: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                purpose: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                chemicalStandard: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ]
+            },
+            nameObj: {
+                timegranid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT2005': {
+                            id: 'AT2005',
+                          name: '一高线'
+                         },
+                         'AT2006': {
+                             id: 'AT2006',
+                           name: '二高线'
+                        }
+                         },
+                    arr: [{
+                        id: 'AT2005',
+                        name: '一高线'
+                        },
+                        {
+                        id: 'AT2006',
+                        name: '二高线'
+                       }]
+                },
+                energyid: {
+                    obj: {},
+                    arr: []
+                },
+                propertyid: {
+                    obj: {},
+                    arr: []
+                },
+                unit: {
+                    obj: {},
+                    arr: []
+                },
+                state: {
+                    obj: {
+                        '0': {
+                            name: '已编制',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已下发',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已接收',
+                            color: 'red'
+                        },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '已编制'
+                        },
+                        {
+                            id: '1',
+                            name: '已下发'
+                        },
+                        {
+                            id: '2',
+                            name: '已接收'
+                        }
+                    ]
+                    }
+                },
+                grades: {
+                    obj: {
+                        '0': {name: 'Q235'},
+                        '1': {name: 'Q195'}
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: 'Q235'
+                        },
+                        {
+                            id: '1',
+                            name: 'Q195'
+                        }
+                    ]
+                },
+                specifications: {
+                    obj: {
+                        '0': {name: '6.5'},
+                        '1': {name: '20'}
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '6.5'
+                        },
+                        {
+                            id: '1',
+                            name: '20'
+                        }
+                    ]
+                },
+                transportType: {
+                    obj: {'0': {name: '火运'}, '1': {name: '汽运'}},
+                    arr: [
+                        {
+                            id: '0',
+                            name: '火运'
+                        },
+                        {
+                            id: '1',
+                            name: '汽运'
+                        }
+                    ]
+                },
+                chemicalStandard: {
+                    obj: {
+                        '0': {name: 'Q/JXT017-2021'},
+                        '1': {name: 'GB/T 700-2006'},
+                        '2': {name: 'GB/T 701-2008'}
+                        },
+                    arr: [
+                        {
+                            id: '0',
+                            name: 'Q/JXT017-2021'
+                        },
+                        {
+                            id: '1',
+                            name: 'GB/T 700-2006'
+                        },
+                        {
+                            id: '2',
+                            name: 'GB/T 701-2008'
+                        }
+                    ]
+                },
+                purpose: {
+                    obj: {
+                        '0': {name: '标准件'},
+                        '1': {name: '铁丝'}
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '标准件'
+                        },
+                        {
+                            id: '1',
+                            name: '铁丝'
+                        }
+                    ]
+                }
+            },
+            loading: false,
+            tableLoading: false,
+            dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            itemid: '',
+                            materialid: '',
+                            workprocid: '',
+                            unitid: '',
+                            seqno: '',
+                            mes_prodline: '',
+                            code: '',
+                            digits: '',
+                            may: '',
+                            canissue: '',
+                            weightMonth: '',
+                            issue: '',
+                            yxf_weight: '',
+                            kxf_weight: '',
+                            describe: '',
+                            state: '',
+                            grades: '',
+                            specifications: '',
+                            lengths: '',
+                            chemicalStandard: '',
+                            surfaceStandard: '',
+                            transportType: '',
+                            workprocType: '',
+                            purpose: '',
+                            planWeight: ''
+                        },
+                         rules: {
+                            planWeight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            grades: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            specifications: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            transportType: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            purpose: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            chemicalStandard: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            may: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            workprocid: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ]
+                        }
+                    }
+                }
+            }
+        }
+    },
+    created () {
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '左表格',
+                    id: 'singleTable1'
+                },
+                {
+                    name: '右表格',
+                    id: 'singleTable2'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
+            }, 1);
+        });
+        that.getTimeGranData();
+        that.getEnergyIdData();
+        that.getPropertyIdData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['kxf_weight', 'weightMonth', 'yxf_weight', 'planWeight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取时间粒度(平衡表数据维护)
+        getTimeGranData () {
+            let that = this
+            let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmBalanceValue';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.ID,
+                                name: item.NAME
+                            })
+                            obj[item.ID] = item.NAME;
+                            that.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.ID;
+                        }
+                        that.nameObj.timegranid.arr = arr;
+                        that.nameObj.timegranid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        checkboxT (row, index) {
+            if (row.state === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        // 获取能介(平衡表)
+        getEnergyIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmenergys/selectNameAndId/?isbalance=1';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.energyid.arr = arr;
+                        that.nameObj.energyid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取属性
+        getPropertyIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.propertyid.arr = arr;
+                        that.nameObj.propertyid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取标准计量单位
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unit.arr = arr;
+                        that.nameObj.unit.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {
+                    timegranid: that.filterForm.data.timegranid,
+                    may: that.filterForm.data.clock,
+                    workprocid: that.filterForm.data.workprocid,
+                    energyid: that.filterForm.data.energyid,
+                    propertyid: that.filterForm.data.propertyid,
+                    itemid: that.filterForm.data.itemid,
+                    itemname: that.filterForm.data.itemname,
+                    itemdesc: that.filterForm.data.itemdesc,
+                    fid: '',
+                    type: 'gx'
+                };
+            that.pageNum = pageNum || that.pageNum;
+            that.leftTableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            that.axios.get(url, {
+                params: params
+            })
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        for (let item of res.data.list) {
+                            arr.push({
+                                unit: item.unit,
+                                canissue: item.canissue,
+                                weightMonth: item.weightMonth,
+                                issue: item.issue,
+                                may: item.may,
+                                workprocid: item.workprocid,
+                                yxf_weight: item.yxf_weight,
+                                kxf_weight: item.kxf_weight,
+                                parentid: item.id,
+                                id: item.id,
+                                sqno: item.sqno
+                            })
+                        }
+                        that.leftTableData = arr;
+                        that.rightTableObj.tableData = [];
+                        that.dialog.fRow = null;
+                        that.total = res.data.total;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.leftTableLoading = false;
+                }).catch(function () {
+                    that.leftTableLoading = false;
+                });
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 点击查询
+        getTableDetailData (row) {
+            let that = this;
+            let params = {
+            parentid: row.id
+        };
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanrounds/';
+            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,
+                    parentid: item.parentid,
+                    may: item.may,
+                    roundid: item.id,
+                    describe: item.describe,
+                    state: item.state,
+                    grades: item.grades,
+                    planWeight: item.planWeight,
+                    specifications: item.specifications,
+                    transportType: item.transportType,
+                    purpose: item.purpose,
+                    chemicalStandard: item.chemicalStandard,
+                    memo: item.memo,
+                    issuedTime: item.issuedTime,
+                    createman: item.createman,
+                    createtime: item.createtime,
+                    updateman: item.updateman,
+                    updatetime: item.updatetime,
+                    sqno: item.sqno,
+                    workprocType: item.workprocType
+                 });
+                    }
+                    that.rightTableData = arr;
+                    that.total = res.data.total;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.tableLoading = false;
+                    }).catch(function () {
+                    that.tableLoading = false;
+            });
+        },
+        getTableDetailDatas () {
+            let that = this;
+            let params = {
+            may: that.filterForm.data.clock,
+            workprocType: that.filterForm.data.workprocid ? that.nameObj.workprocid.obj['AT2005'].id : 'AT2005'
+         };
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanrounds/';
+            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,
+                    parentid: item.parentid,
+                    may: item.may,
+                    roundid: item.id,
+                    describe: item.describe,
+                    state: item.state,
+                    grades: item.grades,
+                    planWeight: item.planWeight,
+                    specifications: item.specifications,
+                    transportType: item.transportType,
+                    purpose: item.purpose,
+                    chemicalStandard: item.chemicalStandard,
+                    memo: item.memo,
+                    issuedTime: item.issuedTime,
+                    createman: item.createman,
+                    createtime: item.createtime,
+                    updateman: item.updateman,
+                    updatetime: item.updatetime
+                 });
+                    }
+                    that.rightTableData = arr;
+                    that.total = res.data.total;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.tableLoading = false;
+                    }).catch(function () {
+                    that.tableLoading = false;
+            });
+        },
+        jsDifference () {
+            let that = this;
+            let fV = that.dialog.fRow.apportvalue,
+                zV = 0;
+            let xId = that.dialog.fRow.itemid + '-' + that.dialog.fRow.timegranid + '-' + that.dialog.fRow.clock;
+            if (that.tableFormDataObj[xId]) {
+                fV = that.tableFormDataObj[xId].apportvalue;
+            }
+            for (let item of that.rightTableObj.tableData) {
+                zV = that.floatComputed(zV, item.apportvalue, '+');
+            }
+            that.difference = +that.floatComputed(fV, zV, '-').toFixed(3);
+        },
+        upTableFormDataObj () {
+            // 更新右侧表格编辑模式绑定的数据
+            let that = this;
+            let fRow = that.dialog.fRow;
+            if (fRow) {
+                if (!fRow.tableFormDataArr || !fRow.isSelection) {
+                    // 当前选中行被勾选时不更新tableFormDataObj
+                    fRow.tableFormDataArr = JSON.parse(JSON.stringify(fRow.childrenArr));
+                }
+                if (fRow.isSelection) {
+                    that.rightTableObj.tableData = fRow.tableFormDataArr;
+                } else {
+                    that.rightTableObj.tableData = fRow.childrenArr;
+                }
+                that.jsDifference();
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let rightTableObj = {};
+            let arr = [];
+            for (let item of val) {
+                arr.push(item.seq);
+            }
+            this.seqArr = arr.sort(sortNumber);
+            for (let item of that.rightTableData) {
+                item.isSelection = false;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.rightTableObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    rightTableObj[xId] = that.rightTableObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    rightTableObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.rightTableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.rightTableObj = rightTableObj;
+            that.multipleSelection = val;
+        },
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr_2'].validate((valid) => {
+                    if (valid) {
+                        let SubmitData = [];
+                        for (let key in that.rightTableObj) {
+                            SubmitData.push({
+                                parentid: that.rightTableObj[key].parentid,
+                                may: that.rightTableObj[key].may,
+                                describe: that.rightTableObj[key].describe,
+                                state: that.rightTableObj[key].state,
+                                grades: that.rightTableObj[key].grades,
+                                planWeight: that.rightTableObj[key].planWeight,
+                                specifications: that.rightTableObj[key].specifications,
+                                transportType: that.rightTableObj[key].transportType,
+                                workprocType: that.rightTableObj[key].workprocType,
+                                purpose: that.rightTableObj[key].purpose,
+                                chemicalStandard: that.rightTableObj[key].chemicalStandard,
+                                memo: that.rightTableObj[key].memo,
+                                id: that.rightTableObj[key].roundid,
+                                sqno: that.rightTableObj[key].sqno,
+                                createman: that.rightTableObj[key].createman,
+                                createtime: that.rightTableObj[key].createtime
+                            });
+                        }
+                        console.log(SubmitData)
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanrounds/batchUpdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '保存成功',
+                                        type: 'success'
+                                    });
+                                     that.getTableDetailDatas();
+                                    that.getTableData();
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        } else {
+                        }
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        issue (sate) {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+            that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
+            if (valid) {
+                let SubmitData = [];
+                for (let key in that.rightTableObj) {
+                   SubmitData.push({
+                        parentid: that.rightTableObj[key].parentid,
+                        may: that.rightTableObj[key].may,
+                        roundid: that.rightTableObj[key].roundid,
+                        describe: that.rightTableObj[key].describe,
+                        grades: that.rightTableObj[key].grades,
+                        planWeight: that.rightTableObj[key].planWeight,
+                        specifications: that.rightTableObj[key].specifications,
+                        transportType: that.rightTableObj[key].transportType,
+                        workprocType: that.rightTableObj[key].workprocType,
+                        purpose: that.rightTableObj[key].purpose,
+                        chemicalStandard: that.rightTableObj[key].chemicalStandard,
+                        memo: that.rightTableObj[key].memo,
+                        issuedTime: that.rightTableObj[key].issuedTime,
+                        createman: that.rightTableObj[key].createman,
+                        createtime: that.rightTableObj[key].createtime,
+                        updateman: that.rightTableObj[key].updateman,
+                        updatetime: that.rightTableObj[key].updatetime,
+                        id: that.rightTableObj[key].roundid,
+                        state: that.rightTableObj[key].state,
+                        sqno: that.rightTableObj[key].sqno,
+                        isxf: sate
+                   });
+                }
+                that.loading = true;
+                that.axios.post('pass/ems/v1/emsprodplanrounds/issue', SubmitData, {
+                    contentType: 'application/json'
+                })
+                .then(function (res) {
+                if (res.code === '0') {
+                   that.$message({
+                    message: '操作成功',
+                    type: 'success'
+                     });
+                    that.getTableData();
+                   that.getTableDetailDatas();
+                } else {
+                that.$message.error(res.message);
+            }
+                that.loading = false;
+                }).catch(function () {
+                 that.loading = false;
+                });
+            }
+          });
+             } else {
+                  this.$message.error('至少要选择一条数据');
+             }
+        },
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+            that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
+            if (valid) {
+                let SubmitData = [];
+                for (let key in that.rightTableObj) {
+                   SubmitData.push({
+                        id: that.rightTableObj[key].roundid,
+                        state: that.rightTableObj[key].state
+                   });
+                }
+                console.log(SubmitData)
+                that.loading = true;
+                that.axios.post('pass/ems/v1/emsprodplanrounds/delete', SubmitData, {
+                    contentType: 'application/json'
+                })
+                .then(function (res) {
+                if (res.code === '0') {
+                    that.$message({
+                    message: '删除成功',
+                   type: 'success'
+                 });
+                that.getTableData();
+                that.getTableDetailDatas();
+                that.dialog.editorBox.show = false;
+                } else {
+                that.$message.error(res.message);
+                }
+                that.loading = false;
+                }).catch(function () {
+                 that.loading = false;
+                });
+            }
+          });
+             } else {
+                  this.$message.error('至少要选择一条数据');
+             }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = {
+                may: that.dialog.editorBox.form.data.may,
+                describe: that.dialog.editorBox.form.data.describe,
+                grades: that.dialog.editorBox.form.data.grades,
+                specifications: that.dialog.editorBox.form.data.specifications,
+                transportType: that.dialog.editorBox.form.data.transportType,
+                chemicalStandard: that.dialog.editorBox.form.data.chemicalStandard,
+                workprocType: that.dialog.editorBox.form.data.workprocid,
+                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;
+                        that.axios.post('pass/ems/v1/emsprodplanrounds/', SubmitData, {
+                            contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            });
+        },
+        correctvalueUpFoo (row) {
+            let that = this;
+            // 防止数据为无效值
+            if (row.correctvalue === '' || !isFinite(row.correctvalue)) {
+                row.correctvalue = 0;
+                row.apportvalue = row.actualvalue;
+            } else {
+                row.apportvalue = that.floatComputed(row.actualvalue, row.correctvalue, '+');
+            }
+            that.jsDifference();
+        },
+        apportvalueUpFoo (row) {
+            let that = this;
+            if (row.apportvalue === '' || !isFinite(row.apportvalue)) {
+                row.correctvalue = 0;
+                row.apportvalue = row.actualvalue;
+            } else {
+                row.correctvalue = that.floatComputed(row.apportvalue, row.actualvalue, '-');
+            }
+            that.jsDifference();
+        },
+        tableTDMousedown (e) {
+            let that = this;
+            let nowPageX = e.pageX,
+                nowWidth = that.leftTableWidth,
+                minWidth = 200,
+                maxWidth = window.innerWidth - 200;
+            that.$refs.table_box.style.userSelect = 'none';
+            that.$refs.table_box.style.cursor = 'col-resize';
+            that.$refs.table_box.onmousemove = function (e) {
+                let bh = e.pageX - nowPageX;
+                if (nowWidth + bh > maxWidth) {
+                    that.leftTableWidth = maxWidth;
+                } else if (nowWidth + bh < minWidth) {
+                    that.leftTableWidth = minWidth;
+                } else {
+                    that.leftTableWidth = nowWidth + bh;
+                }
+            }
+            that.$refs.table_box.onmouseup = function () {
+                that.$refs.table_box.onmousemove = false;
+                that.$refs.table_box.onmouseup = false;
+                that.$refs.table_box.style.userSelect = '';
+                that.$refs.table_box.style.cursor = ''
+            }
+        },
+        // 对proportion的值进行处理,使其符合要求
+        proportionFormat (row) {
+            let that = this;
+            if (row.proportion === '' || !isFinite(row.proportion)) {
+                row.proportion = 0;
+            }
+        },
+        // 重新计算,根据自定义的分配比例来自动调整最终值
+        againCount () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                for (let item of that.multipleSelection) {
+                    let xId = item.itemid + '-' + item.timegranid + '-' + item.clock;
+                    let objItem = that.tableFormDataObj[xId];
+                    let bl = 0;
+                    for (let dataObj of item.tableFormDataArr) {
+                        bl = +that.floatComputed(bl, dataObj.proportion, '+');
+                    }
+                    if (bl !== 100) {
+                        this.$message.error('所有比例之和不为100%,请调整比例后再执行计算。');
+                        continue;
+                    }
+                    let sum = objItem.apportvalue;
+                    for (let i = 0, ilength = item.tableFormDataArr.length; i < ilength; i++) {
+                        if (i === (ilength - 1)) {
+                            item.tableFormDataArr[i].apportvalue = sum;
+                        } else {
+                            let z = that.floatComputed(objItem.apportvalue, item.tableFormDataArr[i].proportion, '*');
+                            item.tableFormDataArr[i].apportvalue = that.floatComputed(z, 100, '/');
+                            sum = that.floatComputed(sum, item.tableFormDataArr[i].apportvalue, '-');
+                        }
+                        item.tableFormDataArr[i].correctvalue = that.floatComputed(item.tableFormDataArr[i].apportvalue, item.tableFormDataArr[i].actualvalue, '-');
+                    }
+                    that.jsDifference();
+                }
+            } else {
+                this.$message.error('请勾选一条数据');
+            }
+        },
+      but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+        getChildTable (row, expandedRows) {
+            let that = this;
+            if (!row.getTable) {
+                let params = {
+                        clock: row.clock,
+                        energyid: row.energyid
+                    };
+                row.tableLoading = true;
+                let url = 'pass/ems/v1/trmbalancevalues/getitem';
+                that.axios.get(url, {
+                    params: params
+                })
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    clock: item.CLOCK,
+                                    itemname: item.ITEMNAME,
+                                    timegranid: item.TIMEGRANID,
+                                    apportvalue: item.APPORTVALUE
+                                })
+                            }
+                            console.log(arr)
+                            row.tableData = arr;
+                            row.getTable = true;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                        row.tableLoading = false;
+                    }).catch(function () {
+                        row.tableLoading = false;
+                    });
+            }
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.balanceSheetData {
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                // margin-top: -7px;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+                // border-bottom: 1px solid #ccc;
+                // margin-bottom: 6px;
+            }
+        }
+        .table-box {
+            .table-left {
+                float: left;
+                width: 550px;
+            }
+            .table-tuodong {
+                float: left;
+                width: 5px;
+                margin: 0 1px 0 1px;
+                cursor: col-resize;
+            }
+            .table-right {
+                margin-left: 557px;
+            }
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+        // 隐藏全选按钮
+        thead .el-table-column--selection .cell {
+            display: none;
+        }
+    }
+}
+</style>

+ 1535 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectSinter.vue

@@ -0,0 +1,1535 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="轧钢厂 "
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-轧钢厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.line"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.line"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unit"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                    :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-轧钢复制"
+       :visible.sync="dialog.editorBox2.show"
+        width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :rules="dialog.editorBox2.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'SJ',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT3013': {
+                          id: 'AT3013',
+                          name: '1#烧结'
+                         },
+                         'AT3014': {
+                        id: 'AT3014',
+                           name: '2#烧结'
+                        },
+                        'AT3015': {
+                           id: 'AT3015',
+                           name: '3#烧结'
+                        }
+                         },
+                    arr: [{
+                          id: 'AT3013',
+                          name: '1#烧结'
+                         },
+                        {
+                        id: 'AT3014',
+                           name: '2#烧结'
+                        },
+                       {
+                           id: 'AT3015',
+                           name: '3#烧结'
+                        }
+                       ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                    rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                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;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>

+ 1535 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectSteelRolling.vue

@@ -0,0 +1,1535 @@
+<template>
+<!-- 转供电实绩 -->
+<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+    <div class="outElectricity">
+        <div class="box">
+            <div class="box-top">
+                <el-form
+                    style="overflow: hidden;"
+                    :style="filterForm.show ? null : { height: '0px' }"
+                    size="mini"
+                    label-width="75px"
+                >
+                    <el-row>
+                        <el-col :span="5">
+                            <!-- <el-form-item label="工序">
+                                <el-select
+                                    filterable clearable
+                                    v-model="filterForm.data.networkid"
+                                    multiple
+                                    collapse-tags
+                                    placeholder="轧钢厂 "
+                                    style="width: 100%;"
+                                    disabled
+                                    @change="connn()"
+                                >
+                                    <el-option
+                                        v-for="item of nameObj.networkid.arr"
+                                        :key="item.id"
+                                        :value="item.id"
+                                        :label="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item> -->
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="年份">
+                                <zj-timegran-date
+                                    v-model="filterForm.data.yearmonth"
+                                    style="width: 100%;"
+                                    :timegranId="'YEAR'"
+                                    :oneFoo="getTableData"
+                                    :custom="1"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                        <el-col :span="5">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="box-top-gjl">
+                    <el-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_add"
+                                    :loading="loading"
+                                >新增</el-button>
+                                   <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-plus"
+                                    @click="but_copy"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >复制</el-button>
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-edit-outline"
+                                    @click="but_edit_plural()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                >修改</el-button>
+                                <el-button
+                                    class="button"
+                                    type="danger"
+                                    size="mini"
+                                    icon="el-icon-delete"
+                                    v-if="butPrivilege.PUT && !isCheck"
+                                    @click="but_del_plural()"
+                                    :loading="loading"
+                                >删除</el-button>
+                                <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+                                <el-button
+                                    class="button"
+                                    type="primary"
+                                    size="mini"
+                                    icon="el-icon-view"
+                                    @click="upState()"
+                                    :loading="loading"
+                                    v-if="butPrivilege.CHECK && isCheck"
+                                >审核</el-button>
+                                <el-button
+                                    class="button"
+                                    size="mini"
+                                    icon="el-icon-refresh"
+                                    @click="upState('1')"
+                                    :loading="loading"
+                                    v-if="butPrivilege.UNDOCHECK && isCheck"
+                                >撤销审核</el-button>
+                            </el-col>
+                            <el-col :span="8">
+                                <div style="float:right; text-align: right;">
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData(1)"
+                                    >查询</el-button>
+                                    <el-button
+                                        size="mini"
+                                        :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
+                                        :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
+                                        @click="filterForm.show = !filterForm.show;
+                                            $nextTick(() => {
+                                                singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
+                                            }
+                                        );"
+                                    >{{ filterForm.show ? '收起' : '展开' }}</el-button>
+                                </div>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                </div>
+            </div>
+            <div class="box-bottom">
+                <el-form
+                    size="mini"
+                    ref="dialog_form_arr"
+                    label-width="0px"
+                    :model="tableFormDataObj"
+                >
+                    <el-table stripe
+                        id="singleTable"
+                        ref="singleTable"
+                        :data="tableData"
+                        v-loading="tableLoading"
+                        style="width: 100%;"
+                        :height="singleTableHeight"
+                        border
+                        size="mini"
+                        highlight-current-row
+                        @selection-change="handleSelectionChange"
+                        show-summary
+                        :summary-method="getSummaries"
+                        :span-method="arraySpanMethod"
+                        :row-class-name="tableRowClassName"
+                        @cell-click="cellClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="index"
+                            label="序号"
+                            fixed="left"
+                            width="50px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            fixed="left"
+                            prop="unit"
+                            label="计量单位"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                        <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="yearmonth"
+                            label="月份"
+                            fixed="left"
+                            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
+                            prop="weight"
+                            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'"
+                                    :rules="tableFormRules.weight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].weight"
+                                        refcous="true"
+                                        @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>{{scope.row.weight}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="cjsj"
+                            label="创建时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="cjr"
+                            label="创建人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                         <el-table-column
+                            prop="xgsj"
+                            label="修改时间"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="xgr"
+                            label="修改人"
+                            width="160px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="memo"
+                            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 + '.memo'"
+                                    :rules="tableFormRules.memo"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        v-model="tableFormDataObj[scope.row.seq].memo"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                    ></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.memo}}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="ID"
+                            width="140px"
+                            v-if="filterForm.data.show"
+                        ></el-table-column>
+                    </el-table>
+                </el-form>
+                <el-pagination
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="total"
+                    :page-sizes="[10, 20, 50, 100, 500, 1000]"
+                    :page-size="pageSize"
+                    :current-page.sync="pageNum"
+                    @size-change="tableSizeChange"
+                    @current-change="getTableData()"
+                    style="text-align: right;margin-top: 10px;"
+                ></el-pagination>
+            </div>
+        </div>
+         <el-dialog
+        title="年计划编制-轧钢厂新增"
+        :visible.sync="dialog.editorBox.show"
+        width="600px"
+        :close-on-click-modal="false"
+        :show-close="!loading"
+        >
+     <div>
+         <el-form
+         :model="dialog.editorBox.form.data"
+         ref="dialog_form"
+         size="mini"
+         label-width="95px"
+         :rules="dialog.editorBox.form.rules"
+         >
+         <el-row>
+             <el-col :span="12">
+               <el-form-item
+               label="工序"
+               prop="workprocid"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="line"
+                     v-model="dialog.editorBox.form.data.line"
+                     style="width: 100%;"
+                     :rules="dialog.editorBox.form.line"
+                    >
+                    <el-option
+                    v-for="item of nameObj.workprocid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.yearmonth"
+                    style="width: 100%;"
+                    :timegranId="'MONTH'"
+                    :defaultOffset="-1"
+                    :rules="dialog.editorBox.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
+               <el-form-item
+               label="计量单位"
+               prop="unit"
+               >
+                   <el-select
+                     placeholder=""
+                     prop="unitid"
+                     v-model="dialog.editorBox.form.data.unitid"
+                     style="width: 100%;"
+                    :rules="dialog.editorBox.form.unitid"
+                    >
+                    <el-option
+                    v-for="item of nameObj.unitid.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                    ></el-option>
+                    </el-select>
+               </el-form-item>
+             </el-col>
+         <el-col :span="12">
+          <el-form-item
+                 label="计划量"
+                 prop="weight"
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.weight"
+                style="width: 100%;"
+                :rules="dialog.editorBox.form.weight"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+                <el-form-item
+                 label="备注"
+                 prop=""
+                >
+               <el-input
+                clearable
+                v-model="dialog.editorBox.form.data.memo"
+                style="width: 100%;"
+               >
+               </el-input>
+                </el-form-item>
+            </el-col>
+        </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="dataSave"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+    </el-dialog>
+     <el-dialog
+       title="年计划编制-轧钢复制"
+       :visible.sync="dialog.editorBox2.show"
+        width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading"
+     >
+         <div>
+        <el-form
+         :model="dialog.editorBox2.form.data"
+         ref="dialog_form2"
+         size="mini"
+         label-width="300px"
+         :rules="dialog.editorBox2.form.rules"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="12">
+                  <el-form-item
+                    label="月份"
+                    prop="yearmonth"
+                    label-width="100px"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox2.form.data.yearmonth"
+                    style="width: 150%;"
+                    :timegranId="'MONTH'"
+                    :rules="dialog.editorBox2.form.yearmonth"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox2.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy_plural"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js'
+import timegranDate from '@/components/zg/timegranDate.vue'
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+export default {
+    name: 'outElectricity',
+    components: {
+        'zj-timegran-date': timegranDate
+    },
+    data () {
+        let setDate = new Date();
+        setDate.setDate(15);
+        setDate.setMonth((setDate.getMonth() - 1));
+        return {
+            rowIndex: '',
+            columnId: '',
+            focusTarget: null,
+            seqArr: [],
+            editSetFlag: '',
+            isCheck: false, // 是否为审核人
+            filterForm: {
+                show: true,
+                data: {
+                    clock: '',
+                    clockc: '',
+                    workprocid: [],
+                    location: [],
+                    networkid: [],
+                    state: '',
+                    itemname: '',
+                    searchtype: '0',
+                    measureid: '',
+                    line: '',
+                    unit: '',
+                    yearmonth: '',
+                    weight: '',
+                    cjr: '',
+                    xgr: '',
+                    xgsj: '',
+                    memo: '',
+                    cp: '',
+                    sysl: '',
+                    wxsy: '',
+                    parentid: 'ZG',
+                    cjsj: '',
+                    jzsj: '',
+                    zt: '',
+                    show: false
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                mintvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                weight: [
+                    { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                wastage: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                secondVal: [
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                memo: [
+
+                ]
+            },
+            nameObj: {
+                state: {
+                    obj: {
+                        '0': {
+                            name: '未编辑',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '已编辑',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已审核',
+                            color: 'red'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '未编辑'
+                        },
+                        {
+                            id: '1',
+                            name: '已编辑'
+                        },
+                        {
+                            id: '2',
+                            name: '已审核'
+                        },
+                        {
+                            name: '已接收',
+                            color: 'red'
+                        }
+                    ]
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                unitid: {
+                    obj: {},
+                    arr: []
+                },
+                workprocid: {
+                    obj: {
+                        'AT2005': {
+                          id: 'AT2005',
+                          name: '一高线'
+                         },
+                         'AT2006': {
+                        id: 'AT2006',
+                           name: '二高线'
+                        },
+                        'AT2007': {
+                           id: 'AT2007',
+                           name: '型钢'
+                        }
+                         },
+                    arr: [{
+                           id: 'AT2005',
+                           name: '一高线'
+                        },
+                        {
+                           id: 'AT2006',
+                           name: '二高线'
+                       },
+                       {
+                           id: 'AT2007',
+                           name: '型钢'
+                       }
+                       ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                }
+            },
+         dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            unitid: '',
+                            line: '',
+                            yearmonth: '',
+                            weight: '',
+                            memo: ''
+                        },
+                         rules: {
+                            weight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
+                            line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                },
+                editorBox2: {
+                    show: false,
+                    type: '',
+                    form: {
+                      data: {
+                          yearmonth: ''
+                      },
+                    rules: {
+                            yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName')
+        }
+    },
+    created () {
+        // 获取按钮权限
+        this.activeMenu = window.localStorage.getItem('activeMenu');
+        for (let key in this.butPrivilege) {
+            this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
+        }
+    },
+    mounted () {
+        let that = this;
+        window.PEDataObj = {
+            // 将数据绑定到window上,供main页面使用
+            vm: that,
+            // tableArr:用于导出成Excel的表格的信息
+            tableArr: [
+                {
+                    name: '',
+                    id: 'singleTable'
+                }
+            ]
+        };
+        that.$nextTick(() => {
+            // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+            setTimeout(() => {
+                that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+            }, 1);
+        });
+        // 接收路由参数
+        if (that.$route.query.networkid) {
+            that.filterForm.disabled.networkid = true;
+            that.filterForm.data.networkid = that.$route.query.networkid.split(',');
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // that.getLocation();
+        that.getLocateIdData();
+        that.getNetworkIdData();
+        // that.getTableData();
+        that.getUnitIdData();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['apportvalue', 'realvalue', 'wastage', 'weight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        // 获取工序列表
+        // getNodeData () {
+        //     let that = this
+        //     let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
+        //     that.axios.get(url)
+        //         .then(function (res) {
+        //             if (res.code === '0') {
+        //                 let arr = [];
+        //                 let obj = {};
+        //                 for (let item of res.data) {
+        //                     arr.push({
+        //                         id: item.id,
+        //                         name: item.name
+        //                     })
+        //                     obj[item.id] = item.name;
+        //                 }
+        //                 that.nameObj.workprocid.arr = arr;
+        //                 that.nameObj.workprocid.obj = obj;
+        //                 that.connn();
+        //             } else {
+        //                 that.$message.error(res.message);
+        //             }
+        //         });
+        // },
+        getUnitIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmunits/getIdAndName';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                            if (item.name === '吨') {
+                                that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
+                            }
+                        }
+                        that.nameObj.unitid.arr = arr;
+                        that.nameObj.unitid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取站所
+        getNetworkIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmstations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.networkid.arr = arr;
+                        that.nameObj.networkid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+     but_copy_plural () {
+            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
+                            });
+                        }
+                   that.$refs['dialog_form2'].validate((valid) => {
+                      if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                             contentType: 'application/json'
+                        })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox2.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                } else {
+                    this.$message.error('至少选择一条数据');
+                }
+                   });
+        },
+        connn () {
+            let that = this;
+            if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
+                that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
+            } else {
+                let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
+                that.axios.get(url)
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            let arr = [];
+                            for (let item of res.data) {
+                                arr.push({
+                                    id: item.id,
+                                    name: item.name
+                                })
+                            }
+                            that.nameObj.location.showDataArr = arr;
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                    });
+            }
+        },
+        // 获取位置
+        getLocateIdData () {
+            let that = this
+            let url = 'pass/ems/v1/trmlocations/getidandname/';
+            that.axios.get(url)
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let arr = [];
+                        let obj = {};
+                        for (let item of res.data) {
+                            arr.push({
+                                id: item.id,
+                                name: item.name
+                            })
+                            obj[item.id] = item.name;
+                        }
+                        that.nameObj.locateid.arr = arr;
+                        that.nameObj.locateid.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    zt: that.filterForm.data.zt,
+                    measureid: that.filterForm.data.measureid,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.pageNum = pageNum || that.pageNum;
+            that.tableLoading = true;
+            // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+            // 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;
+            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
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取表格中的数据
+        getTableDataEdit () {
+            let that = this,
+                params = {},
+                pData = {
+                    yearmonth: that.filterForm.data.yearmonth,
+                    workprocid: that.filterForm.data.workprocid.toString(),
+                    location: that.filterForm.data.location.toString(),
+                    networkid: that.filterForm.data.networkid.toString(),
+                    itemname: that.filterForm.data.itemname,
+                    exactsearch: that.filterForm.data.searchtype,
+                    parentid: that.filterForm.data.parentid
+                };
+                for (let key in pData) {
+                    if (pData[key]) {
+                        params[key] = pData[key];
+                    }
+                }
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&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,
+                                zt: item.zt,
+                                wxsy: item.wxsy
+                            });
+                        }
+                        that.total = res.data.total;
+                        that.tableData = arr;
+                        that.getAdds();
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.$nextTick(() => {
+                        setTimeout(() => {
+                            that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
+                        }, 1);
+                    });
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 合并相同的用电地点
+        arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
+            let that = this;
+            let tableData = this.$refs.singleTable.tableData
+            let c1 = row.workprocid;
+            let c2 = row.location;
+            let c3 = row.workshop;
+            let c4 = row.clock;
+            let c5 = row.clocke;
+            let rowsPan = 1;
+            // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
+            if (column['property'] === 'workprocid' || column['property'] === 'adds') {
+                if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
+                c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
+                    return {
+                        rowspan: 0,
+                        colspan: 0
+                    };
+                };
+                while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
+                    c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
+                    rowsPan += 1
+                }
+                return {
+                    rowspan: rowsPan,
+                    colspan: 1
+                };
+            }
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            that.getTableData(1);
+        },
+        // 重置搜索
+        tableDataCancel () {
+            let that = this;
+            for (let key in that.filterForm.data) {
+                if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
+                    if (that.filterForm.data[key] instanceof Array) {
+                        that.filterForm.data[key] = [];
+                    } else {
+                        that.filterForm.data[key] = '';
+                    }
+                }
+            }
+            that.getTableData(1);
+        },
+        keyDown (event1, disabledFlag) {
+            let tdTarget = event1.target;
+            let _this = this;
+            while (tdTarget.tagName !== 'TD') {
+                tdTarget = tdTarget.parentElement;
+            }
+            // 如果按下键盘下键或者回车键
+            if (event.keyCode === 40 || event.keyCode === 13) {
+                let index = parseInt(this.rowIndex);
+                // index++;
+                if (index !== this.seqArr[this.seqArr.length - 1]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i + 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 38) { // 键盘上键
+                let index = parseInt(this.rowIndex);
+                if (index !== this.seqArr[0]) {
+                    for (let i = 0; i < this.seqArr.length; i++) {
+                        if (index === this.seqArr[i]) {
+                        index = this.seqArr[i - 1];
+                        break;
+                        }
+                    }
+                }
+                this.editSetFlag = index + this.columnId;
+                let id = '#' + this.editSetFlag;
+                this.$nextTick(() => {
+                    $(id).click();
+                });
+            } else if (event.keyCode === 37) { // 键盘左键
+                $(tdTarget).prevAll().find('input:text').last().click();
+            } else if (event.keyCode === 39) { // 键盘右键
+                $(tdTarget).nextAll().find('input').eq(0).click();
+            }
+        },
+        // 只允许对未接受的数据进行操作
+        checkboxT (row, index) {
+            if (row.zt === '2' && !this.isCheck) {
+                return false;
+            } else {
+                return true;
+            }
+        },
+        handleSelectionChange (val) {
+            let that = this;
+            let tableFormDataObj = {};
+             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;
+            }
+            for (let item of val) {
+                let obj = {};
+                let xId = item.seq;
+                if (that.tableFormDataObj[xId]) {
+                    // 如果已存在该数据则使用该数据
+                    tableFormDataObj[xId] = that.tableFormDataObj[xId];
+                } else {
+                    // 负责则从对应行中获取行内原数据
+                    for (let key in item) {
+                        obj[key] = item[key];
+                    }
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    tableFormDataObj[xId] = obj;
+                }
+                item.isSelection = true;
+            }
+            for (let item of that.tableData) {
+                if (item.isSelection === false) {
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                }
+            }
+            that.tableFormDataObj = tableFormDataObj;
+            that.multipleSelection = val;
+            this.getAdds();
+        },
+        // 当上月底码发生改变时计算抄度与实际电量
+        getApportValue (seq, value, rowIndex, event) {
+            let that = this;
+            if (!isNaN(Number(value))) {
+                if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
+                    let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
+                    that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
+                    let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                    that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                    that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+                }
+            }
+        },
+        // 手动修改抄度后计算实际电量
+        chnageApportvalue (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
+            }
+            that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+        },
+        // 手动修改损耗后计算实际电量
+        chnageWastage (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 手动修改二次转供电后计算实际电量
+        chnageSecondVal (seq, value, rowIndex) {
+            let that = this;
+            if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
+                let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
+                that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
+                that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
+            }
+        },
+        // 统计合计值
+        getAdds () {
+            let that = this;
+            let wlarr = [];
+            for (var i = 0; i < that.tableData.length; i++) {
+               wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
+            }
+            let wls = [...new Set(wlarr)]
+            let arrs = [];
+            for (let wl of wls) {
+                let adds = 0;
+                for (let item of that.tableData) {
+                    if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
+                        adds = that.floatComputed(Number(item.realvalue), adds, '+');
+                    }
+                }
+                for (let i = 0; i < that.tableData.length; i++) {
+                    if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
+                        that.tableData[i].adds = adds;
+                    }
+                }
+            }
+        },
+        // 展示实际电量
+        showRealValue (rowIndex, value) {
+            let that = this;
+            for (let i = 0; i < that.tableData.length; i++) {
+                if (i === rowIndex) {
+                    that.tableData[i].realvalue = value;
+                }
+            }
+            this.getAdds();
+        },
+        // 批量修改
+        but_edit_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                that.$refs['dialog_form_arr'].validate((valid, obj) => {
+                    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
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsprodplanyears/batchupdate', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '修改成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                    this.$message.error('至少选择一条数据');
+            }
+        },
+        dataSave () {
+            let that = this;
+            let SubmitData = [];
+            SubmitData.push({
+               yearmonth: that.dialog.editorBox.form.data.yearmonth,
+                weight: that.dialog.editorBox.form.data.weight,
+                unit: that.dialog.editorBox.form.data.unitid,
+                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;
+                        that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
+                        contentType: 'application/json'
+                })
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '新增成功',
+                                        type: 'success'
+                                    });
+                                    that.getTableData();
+                                    that.dialog.editorBox.show = false;
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                }
+            }
+            );
+        },
+        // 批量删除
+        but_del_plural () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let item of that.multipleSelection) {
+                    if (item.zt === '2') {
+                        this.$message.error('已经审核的数据不能删除');
+                        return;
+                    }
+                    SubmitData.push({
+                        no: item.no
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
+                        data: SubmitData,
+                        contentType: 'application/json;charset=UTF-8'
+                    })
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: '删除成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                        }).catch(function () {
+                        });
+                }).catch(() => {
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        upState (state = '2') {
+            let that = this;
+            let dataArr = [];
+            for (let item of that.multipleSelection) {
+                if (item.state !== state) {
+                    dataArr.push(item);
+                }
+            }
+            if (dataArr.length > 0) {
+                that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    let SubmitData = [];
+                    for (let item of dataArr) {
+                        SubmitData.push({
+                            state: state,
+                            id: item.id
+                        });
+                    }
+                    that.loading = true;
+                    that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
+                        .then(function (res) {
+                            if (res.code === '0') {
+                                that.$message({
+                                    message: (state === '2' ? '审核' : '撤销') + '成功',
+                                    type: 'success'
+                                });
+                                that.getTableData();
+                            } else {
+                                that.$message.error(res.message);
+                            }
+                            that.loading = false;
+                        }).catch(function () {
+                            that.loading = false;
+                        });
+                }).catch(() => {
+                });
+            } else {
+                if (that.multipleSelection.length > 0) {
+                    this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
+                } else {
+                    this.$message.error('至少要选择一条数据');
+                }
+            }
+        },
+    but_add () {
+            let that = this;
+            that.dialog.editorBox.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form'].clearValidate();
+            }, 100);
+        },
+    but_copy () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+             that.dialog.editorBox2.show = true;
+             setTimeout(() => {
+                that.$refs['dialog_form2'].clearValidate();
+            }, 100);
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+      },
+        tableRowClassName ({row, rowIndex}) {
+            // 把每一行的索引放进row
+            row.index = rowIndex;
+        },
+        cellClick (row, column, cell, event) {
+            let _this = this;
+            this.rowIndex = row.index;
+            this.columnId = column.id;
+            _this.editSetFlag = row.index + column.id;
+            _this.focusTarget = event.target;
+            while (_this.focusTarget.tagName !== 'TD') {
+                _this.focusTarget = _this.focusTarget.parentElement;
+            }
+            _this.$nextTick(() => {
+                let target = this.focusTarget;
+                $(target).find('input').focus();
+            });
+        }
+    }
+}
+function sortNumber (a, b) {
+  return a - b
+}
+</script>
+
+<style lang="less">
+.outElectricity{
+    min-width: 700px;
+    height: 100%;
+    .box {
+        height: 100%;
+        padding: 15px 15px 0 15px;
+        .box-top {
+            .el-form-item {
+                margin-bottom: 7px;
+            }
+            .box-top-gjl {
+                overflow: hidden;
+                padding: 7px 0;
+                border-top: 1px solid #ccc;
+            }
+        }
+        .rowDisable td {
+            color: #6bb025 !important;
+        }
+        .el-table .el-table__row {
+            height: 35px;
+        }
+        .el-table__body .el-form-item--mini.el-form-item {
+            margin: 0px;
+            .error {
+                overflow: hidden;
+                color: #f56c6c;
+                font-size: 12px;
+                line-height: 1;
+            }
+        }
+    }
+    .color_no {
+        color: #7a7a7a;
+    }
+    .color_yes {
+        color: #1a9f17;
+    }
+    .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
+        background-color: #dcdfe6;
+        border-color: #babbbf;
+    }
+}
+</style>