Browse Source

Merge branch 'master' of https://git.steerinfo.com/XTEMS/xt-ems-front

QuietShadow 3 years ago
parent
commit
be06e50ca3

+ 0 - 1
src/components/zg/timegranDate.vue

@@ -7,7 +7,6 @@
                 style="width: 100%;"
                 v-model="date"
                 type="date"
-                placeholder="请先选择时间粒度"
                 disabled
             ></el-date-picker>
         </div>

+ 1402 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectAudit.vue

@@ -0,0 +1,1402 @@
+<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%;"
+                                    :type="'daterange'"
+                                    :timegranId="filterForm.data.timegranid"
+                                    :oneFoo="getTableData"
+                                ></zj-timegran-date>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                           <el-form-item label="编号">
+                                <el-input
+                                    v-model="filterForm.data.id"
+                                    style="width: 100%;"
+                                    refcous="true"
+                                    ></el-input>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="6">
+                            <el-form-item label="工序">
+                            <el-select
+                            filterable clearable
+                            v-model="filterForm.data.workprocType"
+                            multiple
+                            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-form size="mini" label-width="75px">
+                        <el-row>
+                            <el-col :span="16">
+                                <el-button
+                                     type="primary"
+                                     size="mini"
+                                     icon="el-icon-add-outline"
+                                    @click="passaudits()"
+                                    :loading="loading"
+                                >通过审核</el-button>
+                                 <el-button
+                                     size="mini"
+                                     type="danger"
+                                     icon="el-icon-add-outline"
+                                    @click="turndown()"
+                                    :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()"
+                                    >查询</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"
+                        @expand-change="rowClick"
+                    >
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="id"
+                            label="编号"
+                            align="center"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="workprocType"
+                            label="工序"
+                            align="center"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                              <span>{{ nameObj.workprocid.obj[scope.row.workprocType] ? nameObj.workprocid.obj[scope.row.workprocType].name : scope.row.workprocType }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="jhTime"
+                            label="排产日期"
+                            align="center"
+                            fixed="left"
+                            width="88px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="deliveryDate"
+                            label="交货日期"
+                            align="center"
+                            fixed="left"
+                            width="88px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="state"
+                            label="状态"
+                            align="center"
+                            fixed="left"
+                            width="88px"
+                            :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
+                           sortable
+                            prop="grades"
+                            label="钢种"
+                            align="center"
+                            fixed="left"
+                            width="106px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                           sortable
+                            prop="specifications"
+                            label="规格"
+                            align="center"
+                            fixed="left"
+                            width="105px"
+                            :show-overflow-tooltip="true"
+                            v-if="filterForm.data.gx!='XG'"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="lengths"
+                            label="长度"
+                            align="center"
+                            width="80px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="lengthTimesWidth"
+                            label="高度*宽度"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="planWeight"
+                            label="计划量"
+                            align="center"
+                            width="60px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="transportType"
+                            label="运输方式"
+                            align="center"
+                            width="87px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="purpose"
+                            label="用途"
+                            align="center"
+                            width="87px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="createMan"
+                            label="创建人"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                         <el-table-column
+                             sortable
+                            prop="createTime"
+                            label="创建时间"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </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>
+    </div>
+</template>
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js';
+import timegranDate from '@/components/zg/timegranDate.vue';
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+import store from '@/store/index.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, // 是否为审核人
+            isClick: false,
+            filterForm: {
+                show: true,
+                data: {
+                    show: false,
+                    id: '',
+                    workprocType: []
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            pageNum: 1,
+            pageSize: 100,
+            total: 0,
+            singleTableHeight: 100,
+            tableData: [
+            ],
+            expands: {},
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            nameObj: {
+                state: {
+                    obj: {
+                        '1': {
+                            name: '等待审核',
+                            color: '#7a7a7a'
+                        },
+                        '2': {
+                            name: '已下发',
+                            color: 'green'
+                        },
+                        '3': {
+                            name: '已接收',
+                            color: 'red'
+                        },
+                        '4': {
+                            name: '审核失败',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            name: '1',
+                            color: '#7a7a7a'
+                        },
+                        {
+                            name: '2',
+                            color: 'green'
+                        },
+                        {
+                             name: '3',
+                            color: 'red'
+                        },
+                        {
+                            name: '4',
+                            color: 'red'
+                        }
+                    ]
+                },
+                roleList: {
+                    obj: {},
+                    arr: []
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                 transportType: {
+                    obj: {'0': {name: '火运'}, '1': {name: '汽运'}, '2': {name: '汽运或者火运'}},
+                    arr: [
+                        {
+                            id: '0',
+                            name: '火运'
+                        },
+                        {
+                            id: '1',
+                            name: '汽运'
+                        },
+                        {
+                            id: '2',
+                            name: '汽运或者火运'
+                        }
+                    ]
+                },
+                workprocid: {
+                    obj: {'AT2004': {name: '炼钢'}, 'AT2005': {name: '一高线'}, 'AT2006': {name: '二高线'}, 'AT2007': {name: '型钢'}},
+                    arr: [
+                        {
+                         id: 'AT2004',
+                         name: '炼钢'
+                        },
+                        {
+                         id: 'AT2005',
+                         name: '一高线'
+                        },
+                        {
+                         id: 'AT2006',
+                         name: '二高线'
+                        },
+                        {
+                         id: 'AT2007',
+                         name: '型钢'
+                        }
+                        ]
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                purpose: {
+                    obj: {
+                        '0': {name: '标准件'},
+                        '1': {name: '铁丝'},
+                        '2': {name: '钢丝、弹簧'}
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '标准件'
+                        },
+                        {
+                            id: '1',
+                            name: '铁丝'
+                        },
+                        {
+                            id: '2',
+                            name: '钢丝、弹簧'
+                        }
+                    ]
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                },
+                unitid: {
+                    obj: {},
+                    arr: [],
+                    defaults: ''
+                },
+                 grades: {
+                    obj: {},
+                    arr: []
+                },
+                specifications: {
+                    obj: {},
+                    arr: []
+                },
+                lengthTimeswidth: {
+                    obj: {},
+                    arr: []
+                },
+                chemicalStandard: {
+                    obj: {},
+                    arr: []
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName'),
+            userInfo: {},
+            userRoles: {},
+            qrRole: [],
+            spread: false,
+            store
+        }
+    },
+    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.workproc_type) {
+            that.filterForm.data.workproc_type = that.$route.query.workproc_type;
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // 接收路由参数
+        if (that.$route.query.gx) {
+            that.filterForm.data.gx = that.$route.query.gx;
+            let its = that.filterForm.data.gx.split(',');
+            if (its && its.length > 10) {
+                that.pageSize = 50;
+                that.custom = 0;
+            }
+        }
+        that.getUnitIdData();
+        that.getlengthTimesWidth();
+        that.getRoles();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['planWeight']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        rowClick (row) {
+          let that = this,
+            params = {
+                parentid: row.id
+            };
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanrounds/getRounds';
+            that.axios.get(url, {
+                params: params
+            })
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let chirItem = Object.keys(res.data[0])[0];
+                        that.expands[chirItem] = res.data[0][chirItem];
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+        },
+        // 获取高线钢种
+        getGrades () {
+            let that = this
+            let type = '';
+            if (that.filterForm.data.gx === 'GX') {
+               type = '高线'
+            }
+            if (that.filterForm.data.gx === 'XG') {
+               type = '型钢'
+            }
+            let url = 'pass/product/v1/emssteel/getGrades/?type=' + type;
+            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.steelName
+                            })
+                                obj[item.id] = {
+                                name: item.steelName,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.grades.arr = arr;
+                        that.nameObj.grades.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取高线规格
+        getSpecifications () {
+            let that = this
+            let url = 'pass/product/v1/emssteel/getSpecifications/?type=' + '高线';
+            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.specName
+                            })
+                            obj[item.id] = {
+                                name: item.specName,
+                                unitid: item.id
+                            }
+                        }
+                        that.nameObj.specifications.arr = arr;
+                        that.nameObj.specifications.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取高线执行标准
+         getStandards () {
+             let that = this
+            let url = 'pass/product/v1/emsstandard/getStandards';
+            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.basecode,
+                                name: item.basename
+                            })
+                        }
+                        that.nameObj.chemicalStandard.arr = arr;
+                        that.nameObj.chemicalStandard.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取炼钢钢种
+        getGradesASLg () {
+            let that = this
+            let url = 'pass/product/v1/emsvqcmbasesteel/getBase'
+            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] = {
+                                name: item.name,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.grades.arr = arr;
+                        that.nameObj.grades.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取炼钢规格
+        getSpecificationsAsLg () {
+            let that = this
+            let url = 'pass/product/v1/emsvqcmbasespecbillet/getbasespecbillet';
+            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] = {
+                                name: item.name,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.specifications.arr = arr;
+                        that.nameObj.specifications.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取炼钢化学成分标准
+        getStandardsAsLg () {
+            let that = this
+            let url = 'pass/product/v1/emsvqcmstdchem/getstdchem';
+            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.basecode,
+                                name: item.standardgb
+                            })
+                        }
+                        that.nameObj.chemicalStandard.arr = arr;
+                        that.nameObj.chemicalStandard.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取型钢宽度*长度
+        getlengthTimesWidth () {
+            let that = this
+            let url = 'pass/ems/v1/emsprodplanrounds/getlengthTimesWidth';
+            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.lengthTimesWidth
+                            })
+                        }
+                        that.nameObj.lengthTimeswidth.arr = arr;
+                        that.nameObj.lengthTimeswidth.obj = obj;
+                        console.log(that.nameObj.lengthTimeswidth);
+                    } 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 = {
+                jhTime: that.dialog.editorBox.form.data.jhTime,
+                grades: that.dialog.editorBox.form.data.grades,
+                unitid: '008',
+                chemicalStandard: that.dialog.editorBox.form.data.chemicalStandard,
+                planWeight: that.dialog.editorBox.form.data.planWeight,
+                specifications: that.dialog.editorBox.form.data.specifications,
+                transportType: that.dialog.editorBox.form.data.transportType,
+                memo: that.dialog.editorBox.form.data.memo,
+                workprocType: that.filterForm.data.workproc_type,
+                lengths: that.dialog.editorBox.form.data.lengths,
+                purpose: that.dialog.editorBox.form.data.purpose,
+                iateralArea: that.dialog.editorBox.form.data.iateralArea,
+                deliveryDate: that.dialog.editorBox.form.data.deliveryDate,
+                lengthTimesWidth: that.dialog.editorBox.form.data.lengthTimesWidth,
+                dimension: that.dialog.editorBox.form.data.dimension,
+                surfaceStandard: that.dialog.editorBox.form.data.surfaceStandard,
+                state: '0'
+            };
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsgmpcjhs/', 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;
+                            });
+                }
+            });
+        },
+        // 获取表格中的数据
+        getTableData (pageNum) {
+            let that = this,
+            params = {},
+                pData = {
+                   startTime: that.filterForm.data.may[0],
+                   endTime: that.filterForm.data.may[1],
+                   id: that.filterForm.data.id,
+                   workprocType: that.filterForm.data.workprocType.toString()
+                };
+                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/emsgmpcjhs/getShData/?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,
+                                jhTime: item.jhTime,
+                                deliveryDate: item.deliveryDate,
+                                state: item.state,
+                                unitid: item.unitid,
+                                grades: item.grades,
+                                specifications: item.specifications,
+                                lengths: item.lengths,
+                                lengthTimesWidth: item.lengthTimesWidth,
+                                transportType: item.transportType,
+                                purpose: item.purpose,
+                                workprocType: item.workprocType,
+                                createMan: item.createMan,
+                                createTime: item.createTime,
+                                planWeight: item.planWeight
+                            });
+                        }
+                        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;
+                });
+        },
+        // 改变表格显示条数
+        tableSizeChange (val) {
+            let that = this;
+            that.pageSize = val;
+            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.state === '3' && !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();
+        },
+        handleclickChange (row, column, cell, event) {
+            let that = this;
+            if (column.label === '计划量' && !this.isClick) {
+                 that.isClick = true;
+            } else {
+                 that.isClick = false;
+            }
+        },
+        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,
+                                jhTime: that.tableFormDataObj[key].jhTime,
+                                grades: that.tableFormDataObj[key].grades,
+                                transportType: that.tableFormDataObj[key].transportType,
+                                specifications: that.tableFormDataObj[key].specifications,
+                                unitid: that.tableFormDataObj[key].unitid,
+                                memo: that.tableFormDataObj[key].memo,
+                                workprocType: that.filterForm.data.workproc_type,
+                                chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
+                                planWeight: that.tableFormDataObj[key].planweight,
+                                createTime: that.tableFormDataObj[key].createtime,
+                                purpose: that.tableFormDataObj[key].purpose,
+                                createMan: that.tableFormDataObj[key].createman,
+                                updateTime: that.tableFormDataObj[key].updatetime,
+                                updateMan: that.tableFormDataObj[key].updateman,
+                                state: that.tableFormDataObj[key].state,
+                                lengths: that.tableFormDataObj[key].lengths,
+                                surfaceStandard: that.tableFormDataObj[key].surfacestandard,
+                                deliveryDate: that.tableFormDataObj[key].deliveryDate,
+                                dimension: that.tableFormDataObj[key].dimension,
+                                iateralArea: that.tableFormDataObj[key].iateralarea,
+                                lengthTimesWidth: that.tableFormDataObj[key].lengthtimeswidth
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/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('至少要选择一条数据');
+            }
+        },
+        getRoles () {
+            let that = this;
+            // 获取用户信息
+            this.store.dispatch('getUserInfo').then((res) => {
+                this.userInfo = res.data;
+                that.axios.get('pass/v1/sysuserroles/?userId=' + res.data.userId + '&pageNum=1&pageSize=100').then(rest => {
+                  if (rest) {
+                    for (let i = 0; i < rest.data.list.length; i++) {
+                      that.qrRole.push(rest.data.list[i].roleId)
+                    }
+                    that.userRoles = rest.data.list; // 获取用户角色关联信息
+                  }
+          let roleId = this.nameObj.roleList.obj['生产部-生产处'].id;
+                if (this.qrRole.includes(roleId)) {
+                this.spread = true;
+           }
+        })
+            });
+            // 获取角色信息
+            this.store.dispatch('system/rolesManage/list').then(res => {
+              if (res.code === '0') {
+                this.nameObj.roleList.arr = res.data;
+                for (let obj of res.data) {
+                    this.nameObj.roleList.obj[obj.roleName] = {
+                        name: obj.roleName,
+                        id: obj.id
+                    };
+                }
+                } else {
+              this.$message.error(res.message);
+            }
+            });
+        },
+        turndown () {
+            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,
+                                workprocType: that.filterForm.data.workproc_type,
+                                state: '0'
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/turndown', 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('至少要选择一条数据');
+            }
+        },
+        passaudits () {
+            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,
+                                workprocType: that.filterForm.data.workproc_type,
+                                state: '2'
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/passaudits', 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('至少要选择一条数据');
+            }
+        },
+        // 下发
+         issue (state) {
+            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,
+                                workprocType: that.filterForm.data.workproc_type,
+                                state: state
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/updatestate', 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) {
+                    SubmitData.push({
+                        id: item.id,
+                        state: item.state,
+                        sqno: item.sqno
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsgmpcjhs/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('至少要选择一条数据');
+            }
+        },
+        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>

+ 206 - 186
src/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue

@@ -12,25 +12,73 @@
                     <el-row>
                         <el-col :span="6">
                             <el-form-item label="排产日期">
-                                <!-- <zj-timegran-date
-                                    v-model="filterForm.data.may"
-                                    style="width: 100%;"
-                                    :timegranId="'DAY'"
-                                    :oneFoo="getTableData"
-                                    :custom="1"
-                                ></zj-timegran-date> -->
                                 <zj-timegran-date
                                     v-model="filterForm.data.may"
                                     style="width: 100%;"
                                     :type="'daterange'"
                                     :timegranId="filterForm.data.timegranid"
                                     :oneFoo="getTableData"
-                                    :defaultOffset="-1"
                                 ></zj-timegran-date>
                             </el-form-item>
                         </el-col>
-                        <el-col :span="3">
+                        <el-col :span="6">
+                         <el-form-item label="钢种">
+                            <el-select
+                            filterable clearable
+                            v-model="filterForm.data.grades"
+                            multiple
+                            placeholder=""
+                            style="width: 100%;"
+                            >
+                            <el-option
+                            v-for="item of  nameObj.grades.arr"
+                            :key="item.id"
+                            :value="item.name"
+                            :label="item.name"
+                            ></el-option>
+                            </el-select>
+                            </el-form-item>
                         </el-col>
+                      <el-col :span="6"
+                      v-if="filterForm.data.gx != 'XG'"
+                      >
+                          <el-form-item label="规格">
+                            <el-select
+                            filterable clearable
+                            v-model="filterForm.data.specifications"
+                            multiple
+                            placeholder=""
+                            style="width: 100%;"
+                            >
+                            <el-option
+                            v-for="item of  nameObj.specifications.arr"
+                            :key="item.id"
+                            :value="item.name"
+                            :label="item.name"
+                            ></el-option>
+                            </el-select>
+                            </el-form-item>
+                      </el-col>
+                      <el-col :span="6"
+                      v-if="filterForm.data.gx==='XG'"
+                      >
+                          <el-form-item label="宽度*高度">
+                            <el-select
+                            filterable clearable
+                            v-model="filterForm.data.lengthTimesWidth"
+                            multiple
+                            placeholder=""
+                            style="width: 100%;"
+                            >
+                            <el-option
+                            v-for="item of  nameObj.lengthTimeswidth.arr"
+                            :key="item.id"
+                            :value="item.name"
+                            :label="item.name"
+                            ></el-option>
+                            </el-select>
+                            </el-form-item>
+                      </el-col>
                     </el-row>
                 </el-form>
                 <div class="box-top-gjl">
@@ -65,7 +113,7 @@
                                     :loading="loading"
                                     v-if="butPrivilege.PUT && !isCheck"
                                 >复制</el-button>
-                                <el-button
+                                <!-- <el-button
                                      type="primary"
                                      size="mini"
                                      icon="el-icon-add-outline"
@@ -78,7 +126,14 @@
                                    icon="el-icon-add-outline"
                                    @click="issue(0)"
                                    :loading="loading"
-                                >取消下发</el-button>
+                                >取消下发</el-button> -->
+                                 <el-button
+                                     type="primary"
+                                     size="mini"
+                                     icon="el-icon-add-outline"
+                                    @click="submitaudit()"
+                                    :loading="loading"
+                                >提交审核</el-button>
                                 <el-button
                                     class="button"
                                     type="danger"
@@ -164,12 +219,22 @@
                             prop="id"
                             label="编号"
                             fixed="left"
+                            align="center"
                             width="120px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
                         <el-table-column
                             prop="jhTime"
                             label="排产日期"
+                            align="center"
+                            fixed="left"
+                            width="88px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="deliveryDate"
+                            label="交货日期"
+                            align="center"
                             fixed="left"
                             width="88px"
                             :show-overflow-tooltip="true"
@@ -177,6 +242,7 @@
                         <el-table-column
                             prop="state"
                             label="状态"
+                            align="center"
                             fixed="left"
                             width="88px"
                             :show-overflow-tooltip="true"
@@ -190,6 +256,7 @@
                         <el-table-column
                             prop="grades"
                             label="钢种"
+                            align="center"
                             fixed="left"
                             width="106px"
                             :show-overflow-tooltip="true"
@@ -221,7 +288,8 @@
                         <el-table-column
                             prop="specifications"
                             label="规格"
-                            width="105px"
+                            align="center"
+                            width="120px"
                             :show-overflow-tooltip="true"
                             v-if="filterForm.data.gx!='XG'"
                         >
@@ -249,10 +317,35 @@
                                 <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="lengths"
+                            label="长度(mm)"
+                            align="center"
+                            width="90px"
+                            :show-overflow-tooltip="true"
+                            v-if="filterForm.data.gx!='GX'"
+                        >
+                        <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection"
+                                    :prop="scope.row.seq + '.lengths'"
+                                    :rules="tableFormRules.lengths"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        v-model="tableFormDataObj[scope.row.seq].lengths"
+                                        @change="chnageApportvalue(scope.row.seq, tableFormDataObj[scope.row.seq].lengths, scope.$index)"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.lengths}}</span>
+                        </template>
+                        </el-table-column>
                         <el-table-column
                             prop="planweight"
+                            align="center"
                             label="计划量"
-                            width="110px"
+                            width="90px"
                             :show-overflow-tooltip="true"
                         >
                             <template slot-scope="scope">
@@ -274,6 +367,7 @@
                         <el-table-column
                             prop="lengthtimeswidth"
                             label="高度*宽度"
+                            align="center"
                             width="120px"
                             :show-overflow-tooltip="true"
                             v-if="filterForm.data.gx ==='XG'"
@@ -302,32 +396,10 @@
                                 <span v-else>{{ nameObj.lengthTimeswidth.obj[scope.row.lengthtimeswidth] ? nameObj.lengthTimeswidth.obj[scope.row.lengthtimeswidth].name : scope.row.lengthtimeswidth }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column
-                            prop="lengths"
-                            label="长度(mm)"
-                            width="120px"
-                            :show-overflow-tooltip="true"
-                            v-if="filterForm.data.gx!='GX'"
-                        >
-                        <template slot-scope="scope">
-                                <el-form-item
-                                    v-if="!isCheck && scope.row.isSelection"
-                                    :prop="scope.row.seq + '.lengths'"
-                                    :rules="tableFormRules.lengths"
-                                >
-                                    <el-input clearable
-                                        style="width: 100%;"
-                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                        v-model="tableFormDataObj[scope.row.seq].lengths"
-                                        @change="chnageApportvalue(scope.row.seq, tableFormDataObj[scope.row.seq].lengths, scope.$index)"
-                                    ></el-input>
-                                </el-form-item>
-                                <span v-else>{{scope.row.lengths}}</span>
-                        </template>
-                        </el-table-column>
                         <el-table-column
                             prop="transportType"
                             label="运输方式"
+                            align="center"
                             width="87px"
                             :show-overflow-tooltip="true"
                             v-if="filterForm.data.gx!='LG'"
@@ -359,6 +431,7 @@
                         <el-table-column
                             prop="purpose"
                             label="用途"
+                            align="center"
                             width="87px"
                             :show-overflow-tooltip="true"
                             v-if="filterForm.data.gx === 'GX'"
@@ -390,6 +463,7 @@
                         <el-table-column
                             prop="receivetime"
                             label="接收时间"
+                            align="center"
                             width="135px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
@@ -397,6 +471,7 @@
                         <el-table-column
                             prop="createman"
                             label="创建人"
+                            align="center"
                             width="77px"
                             :show-overflow-tooltip="true"
                         >
@@ -404,6 +479,7 @@
                         <el-table-column
                             prop="createtime"
                             label="创建时间"
+                            align="center"
                             width="135px"
                             :show-overflow-tooltip="true"
                         >
@@ -411,6 +487,7 @@
                          <el-table-column
                             prop="updatetime"
                             label="修改时间"
+                            align="center"
                             width="135px"
                             :show-overflow-tooltip="true"
                         >
@@ -418,12 +495,14 @@
                         <el-table-column
                             prop="updateman"
                             label="修改人"
+                            align="center"
                             width="77px"
                             :show-overflow-tooltip="true"
                         ></el-table-column>
                         <el-table-column
                             prop="memo"
                             label="备注"
+                            align="center"
                             width="170px"
                             :show-overflow-tooltip="true"
                         >
@@ -487,7 +566,21 @@
                     ></zj-timegran-date>
                 </el-form-item>
             </el-col>
-             <el-col :span="12">
+            <el-col :span="12">
+                  <el-form-item
+                    label="交货日期"
+                    prop="deliveryDate"
+                    >
+                    <zj-timegran-date
+                    v-model="dialog.editorBox.form.data.deliveryDate"
+                    style="width: 100%;"
+                    :timegranId="'DAY'"
+                    ></zj-timegran-date>
+                </el-form-item>
+            </el-col>
+        </el-row>
+        <el-row>
+            <el-col :span="12">
                <el-form-item
                label="钢种"
                prop="grades"
@@ -510,10 +603,6 @@
                     </el-select>
                </el-form-item>
              </el-col>
-        </el-row>
-        <el-row>
-        </el-row>
-        <el-row>
             <el-col :span="12">
                 <el-form-item
                  label="规格"
@@ -732,20 +821,9 @@ export default {
                     workprocid: [],
                     location: [],
                     networkid: [],
+                    lengthTimesWidth: [],
                     state: '',
-                    itemname: '',
-                    searchtype: '0',
-                    measureid: '',
-                    productid: '',
-                    may: '',
-                    weightMonth: '',
-                    weightDay: '',
                     unit: '',
-                    jxdays: '',
-                    createtime: '',
-                    createman: '',
-                    updatetime: '',
-                    updateman: '',
                     memo: '',
                     startTime: '',
                     endTime: '',
@@ -785,7 +863,8 @@ export default {
                             surfaceStandard: '',
                             dimension: '',
                             lengthTimesWidth: '',
-                            iateralArea: ''
+                            iateralArea: '',
+                            deliveryDate: ''
                         },
                          rules: {
                              planWeight: [
@@ -814,13 +893,11 @@ export default {
                             memo: [
                                 { required: true, message: '该项不能为空', trigger: 'change' }
                                 ],
-                            kxf_weight: [
-                                { required: true, message: '该项不能为空', trigger: 'change' },
-                                { validator: zCheckNumber1, trigger: 'change' }
+                            jhTime: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
                             ],
-                            yxf_weight: [
-                                { required: true, message: '该项不能为空', trigger: 'change' },
-                                { validator: zCheckNumber1, trigger: 'change' }
+                            deliveryDate: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
                             ]
                         }
                     }
@@ -892,22 +969,42 @@ export default {
                             color: '#7a7a7a'
                         },
                         '1': {
-                            name: '已下发',
+                            name: '正在审核',
                             color: 'rgb(28, 111, 217)'
                         },
                         '2': {
+                            name: '已下发',
+                            color: 'green'
+                        },
+                        '3': {
                             name: '已接收',
                             color: 'red'
+                        },
+                        '4': {
+                            name: '审核失败',
+                            color: 'red'
                         }
                     },
                     arr: [
                         {
-                            id: '1',
+                            id: '0',
                             name: '已编辑'
                         },
+                        {
+                            id: '1',
+                            name: '正在审核'
+                        },
                         {
                             id: '2',
-                            name: '已审核'
+                            name: '已下发'
+                        },
+                        {
+                            id: '3',
+                            name: '已接收'
+                        },
+                        {
+                            id: '4',
+                            name: '审核失败'
                         }
                     ]
                 },
@@ -1333,6 +1430,7 @@ export default {
                 lengths: that.dialog.editorBox.form.data.lengths,
                 purpose: that.dialog.editorBox.form.data.purpose,
                 iateralArea: that.dialog.editorBox.form.data.iateralArea,
+                deliveryDate: that.dialog.editorBox.form.data.deliveryDate,
                 lengthTimesWidth: that.dialog.editorBox.form.data.lengthTimesWidth,
                 dimension: that.dialog.editorBox.form.data.dimension,
                 surfaceStandard: that.dialog.editorBox.form.data.surfaceStandard,
@@ -1392,7 +1490,10 @@ export default {
                 pData = {
                    workprocType: that.filterForm.data.workproc_type,
                    startTime: that.filterForm.data.may[0],
-                   endTime: that.filterForm.data.may[1]
+                   endTime: that.filterForm.data.may[1],
+                   grades: that.filterForm.data.grades.toString(),
+                   specifications: that.filterForm.data.specifications.toString(),
+                   lengthTimesWidth: that.filterForm.data.lengthTimesWidth.toString()
                 };
                 for (let key in pData) {
                     if (pData[key]) {
@@ -1433,78 +1534,8 @@ export default {
                                 updatetime: item.updateTime,
                                 memo: item.memo,
                                 planweight: item.planWeight,
-                                dimension: item.dimension
-                            });
-                        }
-                        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 = {
-                    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
+                                dimension: item.dimension,
+                                deliveryDate: item.deliveryDate
                             });
                         }
                         that.total = res.data.total;
@@ -1523,7 +1554,6 @@ export default {
                     that.tableLoading = false;
                 });
         },
-        // 合并相同的用电地点
         arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
             let that = this;
             let tableData = this.$refs.singleTable.tableData
@@ -1533,7 +1563,6 @@ export default {
             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) {
@@ -1817,9 +1846,10 @@ export default {
                                 createMan: that.tableFormDataObj[key].createman,
                                 updateTime: that.tableFormDataObj[key].updatetime,
                                 updateMan: that.tableFormDataObj[key].updateman,
-                                state: that.tableFormDataObj[key].state,
+                                state: '0',
                                 lengths: that.tableFormDataObj[key].lengths,
                                 surfaceStandard: that.tableFormDataObj[key].surfacestandard,
+                                deliveryDate: that.tableFormDataObj[key].deliveryDate,
                                 dimension: that.tableFormDataObj[key].dimension,
                                 iateralArea: that.tableFormDataObj[key].iateralarea,
                                 lengthTimesWidth: that.tableFormDataObj[key].lengthtimeswidth
@@ -1869,6 +1899,7 @@ export default {
                                 createTime: that.tableFormDataObj[key].createTime,
                                 createMan: that.tableFormDataObj[key].createman,
                                 updateTime: that.tableFormDataObj[key].updateTime,
+                                deliveryDate: that.tableFormDataObj[key].deliveryDate,
                                 updateMan: that.tableFormDataObj[key].updateman,
                                 state: that.tableFormDataObj[key].state,
                                 lengths: that.tableFormDataObj[key].lengths,
@@ -1938,6 +1969,42 @@ export default {
                 this.$message.error('至少要选择一条数据');
             }
         },
+        submitaudit () {
+            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,
+                                workprocType: that.filterForm.data.workproc_type,
+                                state: '1'
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/submitaudit', 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;
@@ -1977,53 +2044,6 @@ export default {
                 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;

+ 4 - 13
src/views/energyPlan/components/supplyAndDemand/planProjectDataMonth.vue

@@ -1,6 +1,5 @@
 <template>
-<!-- 转供电实绩 -->
-<!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
+<!-- 月计划 -->
     <div class="outElectricity">
         <div class="box">
             <div class="box-top">
@@ -13,13 +12,6 @@
                     <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> -->
                                 <zj-timegran-date
                                     v-model="filterForm.data.may"
                                     style="width: 100%;"
@@ -174,7 +166,8 @@
                             :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>
+                              <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="productid"
@@ -935,10 +928,8 @@ export default {
             that.isCheck = false;
         }
         that.getNodeData();
-        // that.getLocation();
-         that.getUnitIdData();
+        that.getUnitIdData();
         that.getLocateIdData();
-        // that.getTableData();
     },
     methods: {
         //  计算树区域高度

+ 167 - 23
src/views/energyPlan/components/supplyAndDemand/planProjectRoundGx.vue

@@ -68,6 +68,12 @@
                         icon="el-icon-add-outline"
                         @click="issue()"
                     >下发</el-button>
+                    <el-button
+                        type="primary"
+                        size="mini"
+                        icon="el-icon-add-outline"
+                        @click="audit()"
+                    >审核</el-button>
                     <el-button
                         type="primary"
                         size="mini"
@@ -152,27 +158,27 @@
                             :show-overflow-tooltip="true"
                         ></el-table-column>
                         <el-table-column
-                                prop="grades"
-                                label="钢种"
-                                :show-overflow-tooltip="true"
-                                >
-                                </el-table-column>
-                                <el-table-column
-                                prop="specifications"
-                                label="规格"
-                                width="120px"
-                                :show-overflow-tooltip="true"
-                                v-if="filterForm.data.gx!='XG'"
-                            >
+                           sortable
+                            prop="deliveryDate"
+                            label="交货日期"
+                            width="80px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                        sortable
+                        prop="grades"
+                        label="钢种"
+                        :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                        sortable
+                        prop="specifications"
+                        label="规格"
+                        width="120px"
+                        :show-overflow-tooltip="true"
+                        >
                             </el-table-column>
-                            <!-- <el-table-column
-                                sortable
-                                    prop="chemicalStandard"
-                                    label="执行标准"
-                                    min-width="100px"
-                                    :show-overflow-tooltip="true"
-                                >
-                            </el-table-column> -->
                         <el-table-column
                         sortable
                             prop="planweight"
@@ -279,6 +285,13 @@
                                 </template>
                                 </el-table-column>
                                 <el-table-column
+                                sortable
+                                    prop="deliveryDate"
+                                    label="交货日期"
+                                    width="80px"
+                                    :show-overflow-tooltip="true"
+                                ></el-table-column>
+                                <el-table-column
                                 sortable
                                     prop="state"
                                     label="状态"
@@ -292,6 +305,19 @@
                                  </template>
                                 </el-table-column>
                                 <el-table-column
+                                sortable
+                                    prop="auditState"
+                                    label="审核状态"
+                                    min-width="100px"
+                                    :show-overflow-tooltip="true"
+                                >
+                                <template slot-scope="scope">
+                                <span
+                                    :style="{color: nameObj.auditState.obj[scope.row.auditState] ? nameObj.auditState.obj[scope.row.auditState].color : ''}"
+                                >{{ nameObj.auditState.obj[scope.row.auditState] ? nameObj.auditState.obj[scope.row.auditState].name : scope.row.auditState }}</span>
+                                 </template>
+                                </el-table-column>
+                                <el-table-column
                                 sortable
                                     prop="grades"
                                     label="钢种"
@@ -854,6 +880,44 @@ export default {
                     ]
                     }
                 },
+                auditState: {
+                    obj: {
+                        '0': {
+                            name: '未审核',
+                            color: '#7a7a7a'
+                        },
+                        '1': {
+                            name: '正在审核',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        '2': {
+                            name: '已通过',
+                            color: 'green'
+                        },
+                        '3': {
+                            name: '未通过',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                         {
+                            id: '0',
+                            name: '未审核'
+                        },
+                        {
+                            id: '1',
+                            name: '正在审核'
+                        },
+                        {
+                            id: '2',
+                            name: '审核通过'
+                        },
+                        {
+                            id: '3',
+                            name: '审核失败'
+                        }
+                    ]
+                },
                 grades: {
                     obj: {},
                     arr: []
@@ -1170,6 +1234,7 @@ export default {
                                 purpose: item.PURPOSE,
                                 updatetime: item.UPDATETIME,
                                 memo: item.MEMO,
+                                deliveryDate: item.DELIVERYDATE,
                                 planweight: item.PLANWEIGHT,
                                 dimension: item.DIMENSION,
                                 kxf_weight: item.KXF_WEIGHT,
@@ -1232,8 +1297,10 @@ export default {
                     createtime: item.createtime,
                     updateman: item.updateman,
                     updatetime: item.updatetime,
+                    deliveryDate: item.deliveryDate,
                     sqno: item.sqno,
-                    workprocType: item.workprocType
+                    workprocType: item.workprocType,
+                    auditState: item.auditState
                  });
                     }
                     that.rightTableData = arr;
@@ -1289,9 +1356,11 @@ export default {
                     createman: item.createman,
                     createtime: item.createtime,
                     updateman: item.updateman,
+                    deliveryDate: item.deliveryDate,
                     sqno: item.sqno,
                     updatetime: item.updatetime,
-                    workprocType: item.workprocType
+                    workprocType: item.workprocType,
+                    auditState: item.auditState
                  });
                     }
                     that.rightTableData = arr;
@@ -1519,6 +1588,7 @@ export default {
             that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
             if (valid) {
                 let SubmitData = [];
+                let auditStates = [];
                 for (let key in that.rightTableObj) {
                    SubmitData.push({
                         parentid: that.rightTableObj[key].parentid,
@@ -1535,6 +1605,7 @@ export default {
                         memo: that.rightTableObj[key].memo,
                         issuedTime: that.rightTableObj[key].issuedTime,
                         createman: that.rightTableObj[key].createman,
+                        auditState: that.rightTableObj[key].auditState,
                         createtime: that.rightTableObj[key].createtime,
                         updateman: that.rightTableObj[key].updateman,
                         updatetime: that.rightTableObj[key].updatetime,
@@ -1543,6 +1614,19 @@ export default {
                         sqno: that.rightTableObj[key].sqno
                    });
                 }
+                 let id = '';
+                for (let key in SubmitData) {
+                     if (SubmitData[key].auditState === '0') {
+                         auditStates[key] = SubmitData[key];
+                         id += SubmitData[key].roundid + ',';
+                     }
+                }
+                if (id !== '') {
+                that.$confirm('编号为[' + id + ']未审核,是否强制下发?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
                 that.loading = true;
                 that.axios.post('pass/ems/v1/emsprodplanrounds/issue', SubmitData, {
                     contentType: 'application/json'
@@ -1562,6 +1646,28 @@ export default {
                 }).catch(function () {
                  that.loading = false;
                 });
+                });
+                } else {
+                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 {
@@ -1798,7 +1904,9 @@ export default {
                         memo: that.tableFormDataObj[key].memo,
                         createMan: that.tableFormDataObj[key].createman,
                         createTime: that.tableFormDataObj[key].createtime,
-                        type: type
+                        deliveryDate: that.tableFormDataObj[key].deliveryDate,
+                        type: type,
+                        auditState: '0'
                   })
               }
                     that.loading = true;
@@ -1837,6 +1945,42 @@ export default {
             // setTimeout(() => {
             //     that.$refs['dialog_form'].clearValidate();
             // }, 100);
+        },
+        // 审核
+        audit () {
+            let that = this;
+            if (that.multipleSelection.length > 0) {
+                let SubmitData = [];
+                for (let key in that.rightTableObj) {
+                   SubmitData.push({
+                        parentid: that.rightTableObj[key].parentid,
+                        auditState: that.rightTableObj[key].auditState,
+                        id: that.rightTableObj[key].roundid,
+                        state: that.rightTableObj[key].state
+                   });
+                }
+                that.loading = true;
+                that.axios.put('pass/ems/v1/emsprodplanrounds/updateAuditState', 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_addNBJH () {
             let that = this;

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

@@ -16,7 +16,6 @@
                                     style="width: 100%;"
                                     :type="'daterange'"
                                     :oneFoo="getTableData"
-                                    :defaultOffset="-1"
                                 ></zj-timegran-date>
                             </el-form-item>
                         </el-col>

+ 1 - 0
src/views/energyPlan/components/supplyAndDemand/planProjectRoundXG.vue

@@ -1637,6 +1637,7 @@ export default {
                         updatetime: that.rightTableObj[key].updatetime,
                         id: that.rightTableObj[key].roundid,
                         state: that.rightTableObj[key].state,
+                        auditState: that.rightTableObj[key].auditState,
                         sqno: that.rightTableObj[key].sqno,
                         lengthTimesWidth: that.rightTableObj[key].lengthTimesWidth,
                         dimension: that.rightTableObj[key].dimension,

+ 1875 - 0
src/views/energyPlan/components/supplyAndDemand/weightAdjustment.vue

@@ -0,0 +1,1875 @@
+<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%;"
+                                    :type="'daterange'"
+                                    :timegranId="filterForm.data.timegranid"
+                                    :oneFoo="getTableData"
+                                ></zj-timegran-date>
+                            </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="8">
+                                <el-button
+                                     type="primary"
+                                     size="mini"
+                                     icon="el-icon-add-outline"
+                                     @click="submitaudit()"
+                                     v-privilege="activeMenu + 'audit'"
+                                    :loading="loading"
+                                >提交审核</el-button>
+                            </el-col>
+                            <el-col :span="8" style="float:right; text-align: right;">
+                                <div>
+                                    <el-button
+                                        class="button"
+                                        type="primary"
+                                        size="mini"
+                                        icon="el-icon-search"
+                                        v-if="butPrivilege.QUERY"
+                                        @click="getTableData()"
+                                    >查询</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"
+                        @expand-change="rowClick"
+                    >
+                        <el-table-column
+                        type="expand"
+                        width="40"
+                        align="center"
+                        v-if="spread"
+                        :key="Math.random()"
+                        fixed="left"
+                         >
+                        <template slot-scope="scope">
+                         <el-table
+                             id="singleTable"
+                             :data="expands[scope.row.id]"
+                             style="width: 100%;"
+                             size="mini"
+                             @cell-dblclick = "handleclickChange"
+                         >
+                        <el-table-column
+                            prop="id"
+                            label="轮次编号"
+                            fixed="left"
+                            width="130px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="grades"
+                            label="钢种"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="specifications"
+                            label="规格"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="planWeight"
+                            label="计划量"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="isClick"
+                                    :prop="scope.row.seq + '.planweight'"
+                                    :rules="tableFormRules.planWeight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        v-model="scope.row.planWeight"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.planWeight}}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="issuedTime"
+                            label="下发日期"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            label="操作"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                            <div>
+                                <el-button
+                                    type="primary"
+                                    size="mini"
+                                    @click="addSave(scope.row)"
+                                >保存</el-button>
+                            </div>
+                        </template>
+                        </el-table-column>
+                         </el-table>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            type="selection"
+                            width="40"
+                            align="center"
+                            v-if="checkstate"
+                            :selectable='checkboxT'
+                            fixed="left"
+                            class-name="cnspicuous"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="id"
+                            label="国贸订单编号"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="workprocType"
+                            label="工序"
+                            align="center"
+                            fixed="left"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                              <span>{{ nameObj.workprocid.obj[scope.row.workprocType] ? nameObj.workprocid.obj[scope.row.workprocType] : scope.row.workprocType }}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="jhTime"
+                            label="排产日期"
+                            align="center"
+                            fixed="left"
+                            width="88px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="deliveryDate"
+                            label="交货日期"
+                            align="center"
+                            fixed="left"
+                            width="88px"
+                            :show-overflow-tooltip="true"
+                        ></el-table-column>
+                        <el-table-column
+                            prop="grades"
+                            label="钢种"
+                            align="center"
+                            fixed="left"
+                            width="106px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="specifications"
+                            label="规格"
+                            fixed="left"
+                            align="center"
+                            width="105px"
+                            :show-overflow-tooltip="true"
+                            v-if="filterForm.data.gx!='XG'"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="lengths"
+                            label="长度"
+                            align="center"
+                            width="75px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="lengthtimesWidth"
+                            label="高度*宽度"
+                            align="center"
+                            width="110px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="planWeight"
+                            label="计划量"
+                            align="center"
+                            width="110px"
+                            :show-overflow-tooltip="true"
+                        >
+                        <template slot-scope="scope">
+                                <el-form-item
+                                    v-if="!isCheck && scope.row.isSelection"
+                                    :prop="scope.row.seq + '.planweight'"
+                                    :rules="tableFormRules.planWeight"
+                                >
+                                    <el-input clearable
+                                        style="width: 100%;"
+                                        @keydown.native="keyDown" :id="scope.$index + scope.column.id"
+                                        v-model="tableFormDataObj[scope.row.seq].planweight"
+                                        @change="chnageApportvalue(scope.row.seq, tableFormDataObj[scope.row.seq].planweight, scope.$index)"
+                                    ></el-input>
+                                </el-form-item>
+                                <span v-else>{{scope.row.planweight}}</span>
+                        </template>
+                        </el-table-column>
+                        <el-table-column
+                            prop="planWeightOld"
+                            label="原计划量"
+                            width="54px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="tzl"
+                            label="调整量"
+                            width="54px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="submitter"
+                            label="提交人"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                         <el-table-column
+                            prop="submitTime"
+                            label="提交时间"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="reviewer"
+                            label="审核人"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                         <el-table-column
+                            prop="state"
+                            label="审核状态"
+                            align="center"
+                            width="88px"
+                            :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="reviewerTime"
+                            label="审核时间"
+                            align="center"
+                            width="120px"
+                            :show-overflow-tooltip="true"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                        class-name="gn-TableDownloadExcel-none"
+                        label="操作"
+                        v-if="czstate"
+                        align="center"
+                        fixed="right"
+                        min-width="200px"
+                    >
+                        <template slot-scope="scope">
+                            <div>
+                                 <el-button
+                                    type="primary"
+                                    size="mini"
+                                    v-privilege="activeMenu + 'approve'"
+                                    @click="approval(scope.row)"
+                                >批准</el-button>
+                                <el-button
+                                    type="primary"
+                                    size="mini"
+                                    v-privilege="activeMenu + 'AGREE'"
+                                    @click="agreement(scope.row)"
+                                >同意</el-button>
+                                <el-button
+                                    type="danger"
+                                    size="mini"
+                                    v-privilege="activeMenu + 'reject'"
+                                    @click="rejected(scope.row)"
+                                >驳回</el-button>
+                            </div>
+                        </template>
+                    </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>
+    </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '@/utils/validator.js';
+import timegranDate from '@/components/zg/timegranDate.vue';
+import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
+import store from '@/store/index.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, // 是否为审核人
+            isClick: 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: '',
+                    gx: '',
+                    workproc_type: ''
+                },
+                rules: {
+                },
+                disabled: {
+                    networkid: false
+                }
+            },
+            dialog: {
+                fRow: null,
+                editorBox: {
+                    show: false,
+                    type: '',
+                    form: {
+                        default: {
+                            workprocid: ''
+                        },
+                        data: {
+                            workprocid: '',
+                            unitid: '',
+                            jxdays: '',
+                            memo: '',
+                            grades: '',
+                            specifications: '',
+                            transportType: '',
+                            chemicalStandard: '',
+                            purpose: '',
+                            planWeight: '',
+                            jhTime: '',
+                            lengths: '',
+                            surfaceStandard: '',
+                            dimension: '',
+                            lengthTimesWidth: '',
+                            iateralArea: '',
+                            deliveryDate: ''
+                        },
+                         rules: {
+                             planWeight: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            lengths: [
+                                { validator: zCheckNumber1, trigger: 'change' }
+                                ],
+                            weightDay: [
+                                { required: true, message: '该项不能为空', trigger: 'change' },
+                                { validator: zCheckNumber1, trigger: 'change' }
+                            ],
+                            specifications: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            may: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                            ],
+                            grades: [
+                                { required: true, message: '该项不能为空', trigger: 'change' }
+                                ],
+                            unitid: [
+                                { 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: [
+            ],
+            expands: {},
+            loading: false,
+            tableLoading: false,
+            multipleSelection: [],
+            tableFormDataObj: {},
+            tableFormRules: {
+                grades: [
+                     { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                lengths: [
+                     { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                mendvalue: [
+                    // { required: true, message: '该项不能为空', trigger: 'change' },
+                    { validator: zCheckNumber1, trigger: 'change' }
+                ],
+                specifications: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                planWeight: [
+                     { 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: 'rgb(28, 111, 217)'
+                        },
+                        '3': {
+                            name: '生产部已同意',
+                            color: 'green'
+                        },
+                        '4': {
+                             name: '审核失败',
+                            color: 'red'
+                        }
+                    },
+                    arr: [
+                        {
+                            name: '已编辑',
+                            color: '#7a7a7a'
+                        },
+                        {
+                            name: '待审核',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        {
+                            name: '部门领导已批准',
+                            color: 'rgb(28, 111, 217)'
+                        },
+                        {
+                            name: '生产部已同意',
+                            color: 'green'
+                        },
+                        {
+                             name: '审核失败',
+                             color: 'red'
+                        }
+                    ]
+                },
+                roleList: {
+                    obj: {},
+                    arr: []
+                },
+                type: {
+                    obj: {
+                        '0': '否',
+                        '1': '是'
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '否'
+                        },
+                        {
+                            id: '1',
+                            name: '是'
+                        }
+                    ]
+                },
+                 transportType: {
+                    obj: {'0': {name: '火运'}, '1': {name: '汽运'}, '2': {name: '汽运或者火运'}},
+                    arr: [
+                        {
+                            id: '0',
+                            name: '火运'
+                        },
+                        {
+                            id: '1',
+                            name: '汽运'
+                        },
+                        {
+                            id: '2',
+                            name: '汽运或者火运'
+                        }
+                    ]
+                },
+                workprocid: {
+                    obj: {},
+                    arr: []
+                },
+                location: {
+                    obj: {},
+                    arr: [],
+                    showDataArr: []
+                },
+                purpose: {
+                    obj: {
+                        '0': {name: '标准件'},
+                        '1': {name: '铁丝'},
+                        '2': {name: '钢丝、弹簧'}
+                    },
+                    arr: [
+                        {
+                            id: '0',
+                            name: '标准件'
+                        },
+                        {
+                            id: '1',
+                            name: '铁丝'
+                        },
+                        {
+                            id: '2',
+                            name: '钢丝、弹簧'
+                        }
+                    ]
+                },
+                locateid: {
+                    obj: {},
+                    arr: []
+                },
+                networkid: {
+                    obj: {},
+                    arr: []
+                },
+                userId: {
+                    obj: {},
+                    arr: []
+                },
+                unitid: {
+                    obj: {},
+                    arr: [],
+                    defaults: ''
+                },
+                 grades: {
+                    obj: {},
+                    arr: []
+                },
+                specifications: {
+                    obj: {},
+                    arr: []
+                },
+                lengthTimeswidth: {
+                    obj: {},
+                    arr: []
+                },
+                chemicalStandard: {
+                    obj: {},
+                    arr: []
+                }
+            },
+            butPrivilege: {
+                QUERY: false,
+                PUT: false,
+                CHECK: false,
+                UNDOCHECK: false
+            },
+            loginName: getCookie('loginName'),
+            userInfo: {},
+            userRoles: {},
+            qrRole: [],
+            spread: false,
+            checkstate: false,
+            czstate: false,
+            store
+        }
+    },
+    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.workproc_type) {
+            that.filterForm.data.workproc_type = that.$route.query.workproc_type;
+        }
+        // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
+        if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
+            that.isCheck = true;
+        }
+        // 管理员在这里录入数据
+        if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
+            that.isCheck = false;
+        }
+        // 接收路由参数
+        if (that.$route.query.gx) {
+            that.filterForm.data.gx = that.$route.query.gx;
+            let its = that.filterForm.data.gx.split(',');
+            if (its && its.length > 10) {
+                that.pageSize = 50;
+                that.custom = 0;
+            }
+        }
+        if (that.$route.query.gx !== 'LG') {
+             that.getGrades();
+             that.getSpecifications();
+             that.getStandards();
+        }
+        if (that.$route.query.gx === 'LG') {
+            that.getGradesASLg();
+            that.getSpecificationsAsLg();
+            that.getStandardsAsLg();
+        }
+        that.getNodeData();
+        // that.getLocation();
+        that.getUnitIdData();
+        that.getLocateIdData();
+        // that.getTableData();
+        that.getlengthTimesWidth();
+        that.getRoles();
+    },
+    methods: {
+        //  计算树区域高度
+        getRoleHeight (dom) {
+            return window.innerHeight - dom.offsetTop;
+        },
+        // 自定义的表格合计方法:只给指定列进行合计
+        getSummaries (param) {
+            const prop = ['planWeight', 'planWeightOld', 'tzl']; // 合计列绑定的prop
+            return commonSummaries(param, prop);
+        },
+        rowClick (row) {
+            if (row.state === '3') {
+             let that = this,
+             params = {
+                parentid: row.id
+             };
+            that.tableLoading = true;
+            let url = 'pass/ems/v1/emsprodplanrounds/getRounds';
+            that.axios.get(url, {
+                params: params
+            })
+                .then(function (res) {
+                    if (res.code === '0') {
+                        let chirItem = Object.keys(res.data[0])[0];
+                        that.expands[chirItem] = res.data[0][chirItem];
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                    that.tableLoading = false;
+                }).catch(function () {
+                    that.tableLoading = false;
+                });
+            }
+        },
+        // 获取高线钢种
+        getGrades () {
+            let that = this
+            let type = '';
+            if (that.filterForm.data.gx === 'GX') {
+               type = '高线'
+            }
+            if (that.filterForm.data.gx === 'XG') {
+               type = '型钢'
+            }
+            let url = 'pass/product/v1/emssteel/getGrades/?type=' + type;
+            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.steelName
+                            })
+                                obj[item.id] = {
+                                name: item.steelName,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.grades.arr = arr;
+                        that.nameObj.grades.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取高线规格
+        getSpecifications () {
+            let that = this
+            let url = 'pass/product/v1/emssteel/getSpecifications/?type=' + '高线';
+            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.specName
+                            })
+                            obj[item.id] = {
+                                name: item.specName,
+                                unitid: item.id
+                            }
+                        }
+                        that.nameObj.specifications.arr = arr;
+                        that.nameObj.specifications.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取高线执行标准
+         getStandards () {
+             let that = this
+            let url = 'pass/product/v1/emsstandard/getStandards';
+            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.basecode,
+                                name: item.basename
+                            })
+                        }
+                        that.nameObj.chemicalStandard.arr = arr;
+                        that.nameObj.chemicalStandard.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取炼钢钢种
+        getGradesASLg () {
+            let that = this
+            let url = 'pass/product/v1/emsvqcmbasesteel/getBase'
+            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] = {
+                                name: item.name,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.grades.arr = arr;
+                        that.nameObj.grades.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取炼钢规格
+        getSpecificationsAsLg () {
+            let that = this
+            let url = 'pass/product/v1/emsvqcmbasespecbillet/getbasespecbillet';
+            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] = {
+                                name: item.name,
+                                id: item.id
+                            }
+                        }
+                        that.nameObj.specifications.arr = arr;
+                        that.nameObj.specifications.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取炼钢化学成分标准
+        getStandardsAsLg () {
+            let that = this
+            let url = 'pass/product/v1/emsvqcmstdchem/getstdchem';
+            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.basecode,
+                                name: item.standardgb
+                            })
+                        }
+                        that.nameObj.chemicalStandard.arr = arr;
+                        that.nameObj.chemicalStandard.obj = obj;
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取型钢宽度*长度
+        getlengthTimesWidth () {
+            let that = this
+            let url = 'pass/ems/v1/emsprodplanrounds/getlengthTimesWidth';
+            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.lengthTimesWidth
+                            })
+                        }
+                        that.nameObj.lengthTimeswidth.arr = arr;
+                        that.nameObj.lengthTimeswidth.obj = obj;
+                        console.log(that.nameObj.lengthTimeswidth);
+                    } else {
+                        that.$message.error(res.message);
+                    }
+                });
+        },
+        // 获取工序列表
+        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 = {
+                jhTime: that.dialog.editorBox.form.data.jhTime,
+                grades: that.dialog.editorBox.form.data.grades,
+                unitid: '008',
+                chemicalStandard: that.dialog.editorBox.form.data.chemicalStandard,
+                planWeight: that.dialog.editorBox.form.data.planWeight,
+                specifications: that.dialog.editorBox.form.data.specifications,
+                transportType: that.dialog.editorBox.form.data.transportType,
+                memo: that.dialog.editorBox.form.data.memo,
+                workprocType: that.filterForm.data.workproc_type,
+                lengths: that.dialog.editorBox.form.data.lengths,
+                purpose: that.dialog.editorBox.form.data.purpose,
+                iateralArea: that.dialog.editorBox.form.data.iateralArea,
+                deliveryDate: that.dialog.editorBox.form.data.deliveryDate,
+                lengthTimesWidth: that.dialog.editorBox.form.data.lengthTimesWidth,
+                dimension: that.dialog.editorBox.form.data.dimension,
+                surfaceStandard: that.dialog.editorBox.form.data.surfaceStandard,
+                state: '0'
+            };
+            that.$refs['dialog_form'].validate((valid) => {
+               if (valid) {
+                        that.loading = true;
+                        that.axios.post('pass/ems/v1/emsgmpcjhs/', 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;
+                            });
+                }
+            });
+        },
+        // 获取位置
+        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 = {
+                   workprocType: that.filterForm.data.id,
+                   startTime: that.filterForm.data.may[0],
+                   endTime: that.filterForm.data.may[1]
+                };
+                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/emsgmpcjhs/getXsDdDate/?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,
+                                jhTime: item.JH_TIME,
+                                state: item.AUDIT_STATUS,
+                                grades: item.GRADES,
+                                specifications: item.SPECIFICATIONS,
+                                lengths: item.LENGTHS,
+                                workprocType: item.WORKPROC_TYPE,
+                                reviewer: item.REVIEWER,
+                                reviewerTime: item.REVIEWER_TIME,
+                                submitter: item.SUBMITTER,
+                                submitTime: item.SUBMIT_TIME,
+                                planweight: item.PLAN_WEIGHT,
+                                planWeightOld: item.PLAN_WEIGHT_OLD,
+                                deliveryDate: item.DELIVERYDATE,
+                                tzl: item.TZL
+                            });
+                        }
+                        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;
+            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.form.data.grades = '';
+            that.dialog.editorBox.form.data.transportType = '';
+            that.dialog.editorBox.form.data.specifications = '';
+            that.dialog.editorBox.form.data.unitid = '';
+            that.dialog.editorBox.form.data.memo = '';
+            that.dialog.editorBox.form.data.chemicalStandard = '';
+            that.dialog.editorBox.form.data.planWeight = '';
+            that.dialog.editorBox.form.data.lengths = '';
+            that.dialog.editorBox.form.data.lengthTimesWidth = '';
+            that.dialog.editorBox.form.data.memo = '';
+            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 (row.state === '3' && !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();
+        },
+        handleclickChange (row, column, cell, event) {
+            let that = this;
+            if (column.label === '计划量' && !this.isClick) {
+                 that.isClick = true;
+            } else {
+                 that.isClick = false;
+            }
+        },
+
+        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,
+                                jhTime: that.tableFormDataObj[key].jhTime,
+                                grades: that.tableFormDataObj[key].grades,
+                                transportType: that.tableFormDataObj[key].transportType,
+                                specifications: that.tableFormDataObj[key].specifications,
+                                unitid: that.tableFormDataObj[key].unitid,
+                                memo: that.tableFormDataObj[key].memo,
+                                workprocType: that.filterForm.data.workproc_type,
+                                chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
+                                planWeight: that.tableFormDataObj[key].planweight,
+                                createTime: that.tableFormDataObj[key].createtime,
+                                purpose: that.tableFormDataObj[key].purpose,
+                                createMan: that.tableFormDataObj[key].createman,
+                                updateTime: that.tableFormDataObj[key].updatetime,
+                                updateMan: that.tableFormDataObj[key].updateman,
+                                state: that.tableFormDataObj[key].state,
+                                lengths: that.tableFormDataObj[key].lengths,
+                                surfaceStandard: that.tableFormDataObj[key].surfacestandard,
+                                deliveryDate: that.tableFormDataObj[key].deliveryDate,
+                                dimension: that.tableFormDataObj[key].dimension,
+                                iateralArea: that.tableFormDataObj[key].iateralarea,
+                                lengthTimesWidth: that.tableFormDataObj[key].lengthtimeswidth
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/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('至少要选择一条数据');
+            }
+        },
+        getRoles () {
+            let that = this;
+            // 获取用户信息
+            this.store.dispatch('getUserInfo').then((res) => {
+                this.userInfo = res.data;
+                that.axios.get('pass/v1/sysuserroles/?userId=' + res.data.userId + '&pageNum=1&pageSize=100').then(rest => {
+                  if (rest) {
+                    for (let i = 0; i < rest.data.list.length; i++) {
+                      that.qrRole.push(rest.data.list[i].roleId)
+                    }
+                      that.userRoles = rest.data.list; // 获取用户角色关联信息
+                  }
+                    let roleId = this.nameObj.roleList.obj['生产部-生产处'].id;
+                    let gmywid = this.nameObj.roleList.obj['国贸-业务人员'].id;
+                    let gmldid = this.nameObj.roleList.obj['国贸-部门领导'].id;
+                    if (this.qrRole.includes(roleId)) {
+                        this.spread = true;
+                        this.czstate = true;
+                    }
+                    if (this.qrRole.includes(gmywid)) {
+                        this.checkstate = true;
+                    }
+                    if (this.qrRole.includes(gmldid)) {
+                        this.czstate = true;
+                    }
+        })
+            });
+            // 获取角色信息
+            this.store.dispatch('system/rolesManage/list').then(res => {
+              if (res.code === '0') {
+                this.nameObj.roleList.arr = res.data;
+                for (let obj of res.data) {
+                    this.nameObj.roleList.obj[obj.roleName] = {
+                        name: obj.roleName,
+                        id: obj.id
+                    };
+                }
+                } else {
+              this.$message.error(res.message);
+            }
+            });
+        },
+        // 批量复制
+        but_copy_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({
+                                jhTime: that.dialog.editorBox2.form.data.may,
+                                grades: that.tableFormDataObj[key].grades,
+                                transportType: that.tableFormDataObj[key].transportType,
+                                specifications: that.tableFormDataObj[key].specifications,
+                                unitid: that.tableFormDataObj[key].unitid,
+                                memo: that.tableFormDataObj[key].memo,
+                                workprocType: that.filterForm.data.workproc_type,
+                                chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
+                                planWeight: that.tableFormDataObj[key].planweight,
+                                createTime: that.tableFormDataObj[key].createTime,
+                                createMan: that.tableFormDataObj[key].createman,
+                                updateTime: that.tableFormDataObj[key].updateTime,
+                                deliveryDate: that.tableFormDataObj[key].deliveryDate,
+                                updateMan: that.tableFormDataObj[key].updateman,
+                                state: that.tableFormDataObj[key].state,
+                                lengths: that.tableFormDataObj[key].lengths,
+                                surfaceStandard: that.tableFormDataObj[key].surfacestandard,
+                                dimension: that.tableFormDataObj[key].dimension,
+                                iateralArea: that.tableFormDataObj[key].iateralarea,
+                                lengthTimesWidth: that.tableFormDataObj[key].lengthtimeswidth
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/batchcopy', SubmitData)
+                            .then(function (res) {
+                                if (res.code === '0') {
+                                    that.$message({
+                                        message: '复制成功',
+                                        type: 'success'
+                                    });
+                                    that.dialog.editorBox2.show = false;
+                                    that.getTableData();
+                                } else {
+                                    that.$message.error(res.message);
+                                }
+                                that.loading = false;
+                            }).catch(function () {
+                                that.loading = false;
+                            });
+                        }
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
+        },
+        // 保存数据
+        addSave (row) {
+         let that = this;
+         let SubmitData = {
+             id: row.id,
+             planWeight: row.planWeight
+         }
+         that.axios.put('pass/ems/v1/emsprodplanrounds/addSave', SubmitData)
+             .then(function (res) {
+               if (res.code === '0') {
+                    that.$message({
+                    message: '保存成功',
+                    type: 'success'
+                    });
+                    that.isClick = false;
+               } else {
+                   that.$message.error(res.message);
+               }
+             }).catch(function () {
+                that.loading = false;
+            });
+        },
+        // 提交审核
+         submitaudit () {
+            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,
+                                planWeight: that.tableFormDataObj[key].planweight,
+                                auditStatus: '1',
+                                planWeightOld: that.tableFormDataObj[key].planWeightOld,
+                                submitter: that.tableFormDataObj[key].submitter,
+                                submitTime: that.tableFormDataObj[key].submitTime,
+                                reviewer: that.tableFormDataObj[key].reviewer,
+                                reviewerTime: that.tableFormDataObj[key].reviewerTime
+                            });
+                           that.loading = true;
+                           that.axios.put('pass/ems/v1/emsprodplanweightadjustments/submitaudit', 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;
+                            });
+                        }
+                    }
+                });
+            }
+        },
+        approval (row) {
+        let that = this;
+        that.axios.put('pass/ems/v1/emsprodplanweightadjustments/approval/' + row.id)
+        .then(function (res) {
+            if (res.code === '0') {
+                that.$message({
+                    message: '操作成功',
+                    type: 'success'
+                });
+                that.getTableData();
+            } else {
+                 that.$message.error(res.message);
+            }
+        }).catch(function () {
+            that.loading = false;
+        });
+        },
+        rejected (row) {
+        let that = this;
+        that.axios.put('pass/ems/v1/emsprodplanweightadjustments/rejected/' + row.id)
+        .then(function (res) {
+            if (res.code === '0') {
+                that.$message({
+                    message: '操作成功',
+                    type: 'success'
+                });
+                that.getTableData();
+            } else {
+                 that.$message.error(res.message);
+            }
+        }).catch(function () {
+            that.loading = false;
+        });
+        },
+        agreement (row) {
+        let that = this;
+        that.axios.put('pass/ems/v1/emsprodplanweightadjustments/agreement/' + row.id)
+        .then(function (res) {
+            if (res.code === '0') {
+                that.$message({
+                    message: '操作成功',
+                    type: 'success'
+                });
+                that.getTableData();
+            } else {
+                 that.$message.error(res.message);
+            }
+        }).catch(function () {
+            that.loading = false;
+        });
+        },
+        // 下发
+         issue (state) {
+            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,
+                                workprocType: that.filterForm.data.workproc_type,
+                                state: state
+                            });
+                        }
+                        that.loading = true;
+                        that.axios.put('pass/ems/v1/emsgmpcjhs/updatestate', 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) {
+                    SubmitData.push({
+                        id: item.id,
+                        state: item.state,
+                        sqno: item.sqno
+                    });
+                }
+                that.$confirm('是否删除已选数据?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    state: 'warning'
+                }).then(() => {
+                    that.axios.delete('pass/ems/v1/emsgmpcjhs/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('至少要选择一条数据');
+            }
+        },
+        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>

+ 15 - 1
src/views/energyPlan/router/index.js

@@ -51,8 +51,12 @@ import PlanProjectRoundLG from '@/views/energyPlan/components/supplyAndDemand/pl
 import PlanProjectRoundXG from '@/views/energyPlan/components/supplyAndDemand/planProjectRoundXG.vue'
 // 国贸排产 H:\湖南视拓\安泰能源项目\xt-ems-front\src\views\energyPlan\components\supplyAndDemand\planProjectRoundXG.vue
 import planProjectCBD from '@/views/energyPlan/components/supplyAndDemand/planProjectCBD.vue'
-Vue.use(Router)
+// 轮次计划审核
+import planProjectAudit from '@/views/energyPlan/components/supplyAndDemand/planProjectAudit.vue'
+// 销售订单重量调整 H:\湖南视拓\安泰能源项目\xt-ems-front\src\views\energyPlan\components\supplyAndDemand\weightAdjustment.vue
+import weightAdjustment from '@/views/energyPlan/components/supplyAndDemand/weightAdjustment.vue'
 
+Vue.use(Router)
 export default new Router({
     routes: [{
         path: '/',
@@ -176,6 +180,16 @@ export default new Router({
                 path: 'planProjectCBD',
                 name: 'planProjectCBD',
                 component: planProjectCBD
+            },
+            {
+                path: 'planProjectAudit',
+                name: 'planProjectAudit',
+                component: planProjectAudit
+            },
+            {
+                path: 'weightAdjustment',
+                name: 'weightAdjustment',
+                component: weightAdjustment
             }
         ]
     }]