浏览代码

钢产品执行标准页面前端筛选,前端树结构。轮次计划页面 轮次描述多选修改,修改rules验证逻辑。验证订单量是否超产提示

QuietShadow 3 年之前
父节点
当前提交
31da4f19c7

+ 680 - 0
src/views/basicInformation/components/executiveStandard.vue

@@ -0,0 +1,680 @@
+<template>
+  <!-- 钢产品执行标准维护 -->
+  <div class="executiveStandard">
+    <div class="box">
+      <div class="box-left" :style="leftTree.show ? null : {width: '22px'}">
+        <div class="box-left-bt" style="overflow: hidden;">
+          <span v-show="leftTree.show">钢产品类型</span>
+          <div style="float: right;height: 100%;padding-right: 4px;">
+            <span class="el-icon-d-arrow-right" style="cursor: pointer; transition: transform 0.3s ease-out, -webkit-trans;"
+            :style="leftTree.show ? { transform: 'rotate(180deg)'} : { transform: 'rotate(0deg)'}"
+            @click="leftTree.show = !leftTree.show;"></span>
+          </div>
+        </div>
+        <div class="box-left-tree">
+          <el-tree v-show="leftTree.show" :data="leftTree.data.arr" :props="leftTree.defaultProps" v-loading="leftTree.loading">
+            <span class="custom-tree-node" :class="{'tree-row-on': filterForm.data.product === data.label}"
+              style="width:100%; font-size:12px;" slot-scope="{ node, data }">
+              <p style="overflow:hidden; text-overflow:ellipsis; white-space:nowrap;"
+                :title="node.label" @click="queryByStandardId(data)" >{{ node.label }}</p>
+            </span>
+          </el-tree>
+        </div>
+      </div>
+      <div class="box-right" :style="leftTree.show ? null : { 'margin-left': '22px' }">
+        <div class="box-top">
+          <el-form style="overflow: hidden;" :style="filterForm.show ? null : { height: '0px' }"
+            class="box-top-form" size="mini" label-width="80px">
+            <el-row>
+              <el-col :span="6">
+                <el-form-item label="钢产品类型">
+                  <el-input clearable v-model="filterForm.data.product"
+                    placeholder="钢产品类型" style="width: 100%;" ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="钢种">
+                  <el-input clearable v-model="filterForm.data.brand"
+                    placeholder="钢种" style="width: 95%;" ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="表面执行标准">
+                  <el-input clearable v-model="filterForm.data.surfaceStandard"
+                    placeholder="表面执行标准" style="width: 95%;"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="出厂执行标准">
+                  <el-input clearable v-model="filterForm.data.factoryStandard"
+                    placeholder="出厂执行标准" style="width: 100%;" ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+          <div class="box-top-gjl">
+            <el-button class="button" type="primary" size="mini" icon="el-icon-plus"
+              v-privilege="activeMenu + 'ADD'" @click="but_add()" :loading="rightTable.loading" >新增</el-button>
+            <el-button class="button" type="primary" size="mini" icon="el-icon-edit-outline"
+              v-privilege="activeMenu + 'PUT'" @click="but_edit_plural()" :loading="rightTable.loading" >修改</el-button>
+            <el-button class="button" type="danger" size="mini" icon="el-icon-delete"
+              v-privilege="activeMenu + 'DELETE'" @click="but_del_plural()" :loading="rightTable.loading" >删除</el-button>
+            <div style="float:right; text-align: right;">
+                <el-button class="button" type="primary" size="mini" icon="el-icon-search"
+                  v-privilege="activeMenu + 'QUERY'" :loading="rightTable.loading" @click="getNodeTreeData()" >查询</el-button>
+                <el-button class="button" type="primary" size="mini" icon="el-icon-refresh"
+                  v-privilege="activeMenu + 'QUERY'" :loading="rightTable.loading" @click="tableDataCancel();" >重置</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>
+          </div>
+        </div>
+        <div class="box-bottom">
+          <el-form size="mini" ref="dialog_form_arr" label-width="0px" :model="tableFormDataObj">
+            <el-table stripe border highlight-current-row id="singleTable" ref="singleTable" style="width: 100%;" size="mini"
+              :data="frontEndPageChange" v-loading="rightTable.loading" :height="singleTableHeight"
+              @current-change="handleCurrentChange" @selection-change="handleSelectionChange">
+                <el-table-column type="selection" width="40" align="center" fixed="left" ></el-table-column>
+                <el-table-column sortable prop="product" label="钢产品类型" min-width="80px" align="center"
+                  :show-overflow-tooltip="true">
+                  <template slot-scope="scope">
+                    <el-form-item v-if="scope.row.isSelection" :prop="scope.row.id + '.product'" :rules="dialog.rules.isreal">
+                      <el-input clearable style="width: 100%;" v-model="tableFormDataObj[scope.row.id].product"></el-input>
+                        <template slot="error" slot-scope="scope">
+                          <p class="error" :title="scope.error" >{{ scope.error }}</p>
+                        </template>
+                    </el-form-item>
+                    <span v-else>{{scope.row.product}}</span>
+                  </template>
+                  </el-table-column>
+                <el-table-column sortable prop="brand" label="钢种" min-width="80px" align="center"
+                  :show-overflow-tooltip="true">
+                  <template slot-scope="scope">
+                    <el-form-item v-if="scope.row.isSelection" :prop="scope.row.id + '.brand'" :rules="dialog.rules.isreal">
+                      <el-input clearable style="width: 100%;" v-model="tableFormDataObj[scope.row.id].brand"></el-input>
+                        <template slot="error" slot-scope="scope">
+                          <p class="error" :title="scope.error" >{{ scope.error }}</p>
+                        </template>
+                    </el-form-item>
+                    <span v-else>{{scope.row.brand}}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column sortable prop="surfaceStandard" label="表面执行标准" min-width="100px" align="center"
+                  :show-overflow-tooltip="true">
+                  <template slot-scope="scope">
+                    <el-form-item v-if="scope.row.isSelection" :prop="scope.row.id + '.surfaceStandard'" >
+                      <el-input clearable style="width: 100%;" v-model="tableFormDataObj[scope.row.id].surfaceStandard"></el-input>
+                        <template slot="error" slot-scope="scope">
+                          <p class="error" :title="scope.error" >{{ scope.error }}</p>
+                        </template>
+                    </el-form-item>
+                    <span v-else>{{scope.row.surfaceStandard}}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column sortable prop="factoryStandard" label="出厂执行标准" min-width="100px" align="center"
+                  :show-overflow-tooltip="true">
+                  <template slot-scope="scope">
+                    <el-form-item v-if="scope.row.isSelection" :prop="scope.row.id + '.factoryStandard'" >
+                      <el-input clearable style="width: 100%;" v-model="tableFormDataObj[scope.row.id].factoryStandard"></el-input>
+                        <template slot="error" slot-scope="scope">
+                          <p class="error" :title="scope.error" >{{ scope.error }}</p>
+                        </template>
+                    </el-form-item>
+                    <span v-else>{{scope.row.factoryStandard}}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column sortable prop="memo" label="备注" min-width="130px" align="center"
+                  :show-overflow-tooltip="true">
+                  <template slot-scope="scope">
+                    <el-form-item v-if="scope.row.isSelection" :prop="scope.row.id + '.memo'" >
+                      <el-input clearable style="width: 100%;" v-model="tableFormDataObj[scope.row.id].memo"></el-input>
+                        <template slot="error" slot-scope="scope">
+                          <p class="error" :title="scope.error" >{{ scope.error }}</p>
+                        </template>
+                    </el-form-item>
+                    <span v-else>{{scope.row.memo}}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column sortable prop="createman" label="创建人" min-width="70px" align="center"
+                  :show-overflow-tooltip="true"></el-table-column>
+                <el-table-column sortable prop="createtime" label="创建时间" min-width="120px" align="center"
+                  max-width="140px" :show-overflow-tooltip="true" ></el-table-column>
+                <el-table-column sortable prop="updateman" label="修改人" min-width="70px" align="center"
+                  :show-overflow-tooltip="true" ></el-table-column>
+                <el-table-column sortable prop="updatetime" label="修改时间" min-width="120px" align="center"
+                  max-width="140px" :show-overflow-tooltip="true" ></el-table-column>
+            </el-table>
+          </el-form>
+          <el-pagination layout="total, sizes, prev, pager, next, jumper" style="text-align: right;margin-top: 10px;"
+            :page-sizes="[10, 20, 50, 100, 500, 1000]"
+            :total="rightTable.total" :page-size="rightTable.pageSize" :current-page.sync="rightTable.pageNum"
+            @size-change="tableSizeChange" @current-change="getTableData()" ></el-pagination>
+        </div>
+      </div>
+    </div>
+    <el-dialog :title="'钢产品执行标准 - ' + (dialog.type === 'add' ? '新增' : '修改')" width="600px"
+      :visible.sync="dialog.show" :close-on-click-modal="false" :show-close="!rightTable.loading">
+      <div>
+        <el-form ref="dialog_form" size="mini" label-width="120px"
+          :model="dialog.form.data" >
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="钢产品类型" prop="product" :rules="dialog.rules.isreal">
+                <el-input clearable style="width: 100%;" v-model="dialog.form.data.product"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="钢种" prop="brand" :rules="dialog.rules.isreal">
+                <el-input clearable style="width: 100%;" v-model="dialog.form.data.brand"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="表面执行标准" prop="surfaceStandard" >
+                <el-input clearable style="width: 100%;" v-model="dialog.form.data.surfaceStandard"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="出厂执行标准" prop="factoryStandard" >
+                <el-input clearable style="width: 100%;" v-model="dialog.form.data.factoryStandard"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="备注" prop="memo" >
+                <el-input clearable style="width: 100%;" v-model="dialog.form.data.memo"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+      </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialog.show = false" :loading="rightTable.loading" >取 消</el-button>
+        <el-button type="primary" @click="dataSave()" :loading="rightTable.loading">保 存</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { zCheckNumber1 } from '~/utils/validator.js';
+import store from '@/store/index.js';
+export default {
+  name: 'executiveStandard',
+  data () {
+    return {
+      activeMenu: '',
+      singleTableHeight: 100,
+      tableFormDataObj: {},
+      multipleSelection: [],
+      tableData: {
+          arr: [],
+          obj: {}
+        },
+      leftTree: {
+        show: true,
+        loading: false,
+        data: {
+          arr: [],
+          obj: {}
+        },
+        defaultProps: {
+          children: 'children',
+          label: 'label'
+        }
+      },
+      filterForm: {
+        show: true,
+        data: {
+          brand: '',
+          product: '',
+          surfaceStandard: '',
+          factoryStandard: ''
+        }
+      },
+      rightTable: {
+        total: 0,
+        pageNum: 1,
+        pageSize: 20,
+        loading: false,
+        tableLoading: false,
+        tableData: {
+          arr: [],
+          obj: {}
+        }
+      },
+      dialog: {
+        show: false,
+        type: '',
+        addRow: null,
+        form: {
+          data: {
+            id: null,
+            memo: '',
+            brand: '',
+            product: '',
+            surfaceStandard: '',
+            factoryStandard: ''
+          }
+        },
+        rules: {isreal: [{ required: true, message: '该项不能为空', trigger: 'change' }]}
+      }
+    }
+  },
+  created () {
+      this.activeMenu = window.localStorage.getItem('activeMenu');
+  },
+  mounted () {
+    let that = this;
+    window.PEDataObj = {
+      // 将数据绑定到window上,供main页面使用
+      vm: that,
+      // tableArr:用于导出成Excel的表格的信息
+      tableArr: [{
+        name: '',
+        id: 'singleTable'
+      }]
+    };
+    that.$nextTick(() => {
+      // 立即获取的height有一定偏差,通过setTimeout延迟来解决
+      setTimeout(() => {
+        that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
+      }, 1);
+    });
+    // 这里写页面加载需要调用的代码
+    that.getNodeTreeData();
+  },
+  computed: {
+    frontEndPageChange () {
+      let that = this;
+      let Tdata = [];
+      let start = (that.rightTable.pageNum - 1) * that.rightTable.pageSize;
+      if (start >= that.rightTable.tableData.arr.length) start = 0;
+      let end = that.rightTable.pageNum * that.rightTable.pageSize;
+      if (end >= that.rightTable.tableData.length) end = that.rightTable.tableData.arr.length;
+      // that.rightTable.tableData.arr = that.rightTable.tableData.arr.slice(start, end);
+      that.rightTable.total = that.rightTable.tableData.arr.length;
+      Tdata = that.rightTable.tableData.arr;
+      Tdata = Tdata.filter(data => !that.filterForm.data.product || data.product.toLowerCase()
+        .includes(that.filterForm.data.product.toLowerCase()));
+      Tdata = Tdata.filter(data => !that.filterForm.data.brand || data.brand.toLowerCase()
+        .includes(that.filterForm.data.brand.toLowerCase()));
+      Tdata = Tdata.filter(data => (!that.filterForm.data.surfaceStandard || !data.surfaceStandard) || data.surfaceStandard.toLowerCase()
+        .includes(that.filterForm.data.surfaceStandard.toLowerCase()));
+      Tdata = Tdata.filter(data => (!that.filterForm.data.factoryStandard || !data.factoryStandard) || data.factoryStandard.toLowerCase()
+        .includes(that.filterForm.data.factoryStandard.toLowerCase()));
+      that.rightTable.total = Tdata.length;
+      return Tdata.slice(start, end);
+    }
+  },
+  methods: {
+    //  计算树区域高度
+    getRoleHeight (dom) {
+        return window.innerHeight - dom.offsetTop;
+    },
+    // 获取钢种类型节点树
+    getNodeTreeData () {
+        let that = this, parameters = {}, obj = {};
+        parameters = {
+        }
+        let url = 'pass/ems/v1/emsproductsexecutivestandards/getTree/';
+        that.leftTree.loading = true;
+        that.axios.get(url, {params: parameters})
+          .then(function (res) {
+            if (res.code === '0') {
+              let treeData = that.treeDataUtil1(res.data);
+              that.leftTree.data.arr = [{
+                id: '',
+                label: '所有记录',
+                children: treeData,
+                data: res.data
+              }];
+              that.tableData.arr = res.data;
+              that.rightTable.tableData.arr = res.data;
+            } else {
+              that.$message.error(res.message);
+            }
+            that.leftTree.loading = false;
+          }).catch(function () {
+            that.leftTree.loading = false;
+          });
+    },
+    // 新增,弹出框显示
+    but_add () {
+      let that = this;
+      if (that.dialog.addRow) {
+        for (let key in that.dialog.form.data) {
+          if (that.dialog.addRow[key] || that.dialog.addRow[key] === 0) {
+            that.dialog.form.data[key] = that.dialog.addRow[key];
+          } else {
+            that.dialog.form.data[key] = '';
+          }
+        }
+        this.$refs['singleTable'].setCurrentRow();
+      } else {
+        for (let key in that.dialog.form.data) {
+            if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
+                that.dialog.form.data[key] = that.filterForm.data[key];
+            } else {
+                that.dialog.form.data[key] = '';
+            }
+        }
+      }
+      that.dialog.type = 'add';
+      that.dialog.show = true;
+      setTimeout(() => {
+        that.$refs['dialog_form'].clearValidate();
+      }, 100);
+    },
+    // 保存数据
+    dataSave () {
+      let that = this;
+      let SubmitData = {
+        id: that.dialog.form.data.id,
+        memo: that.dialog.form.data.memo,
+        brand: that.dialog.form.data.brand,
+        product: that.dialog.form.data.product,
+        surfaceStandard: that.dialog.form.data.surfaceStandard,
+        factoryStandard: that.dialog.form.data.factoryStandard
+      };
+      that.$refs['dialog_form'].validate((valid) => {
+        if (valid) {
+          if (that.dialog.type === 'add') {
+            let foorData = new FormData();
+            for (let key in SubmitData) {
+              foorData.append(key, SubmitData[key]);
+            }
+            that.rightTable.loading = true;
+            that.leftTree.loading = true;
+            that.axios.post('pass/ems/v1/emsproductsexecutivestandards/', foorData, {
+              headers: {'Content-Type': 'multipart/form-data'}
+              }).then(function (res) {
+                  if (res.code === '0') {
+                    that.$message({
+                      message: '新增成功',
+                      type: 'success'
+                    });
+                    that.getNodeTreeData();
+                    that.dialog.show = false;
+                  } else {
+                      that.$message.error(res.message);
+                    }
+                  that.leftTree.loading = false;
+                  that.rightTable.loading = false;
+                }).catch(function () {
+                    that.leftTree.loading = false;
+                    that.rightTable.loading = false;
+                  });
+          } else {
+            that.rightTable.loading = true;
+            that.leftTree.loading = true;
+            that.axios.put('pass/ems/v1/emsproductsexecutivestandards/' + SubmitData.id, SubmitData)
+              .then(function (res) {
+                if (res.code === '0') {
+                  that.$message({
+                    message: '修改成功',
+                    type: 'success'
+                  });
+                  that.getNodeTreeData();
+                } else {
+                    that.$message.error(res.message);
+                }
+                that.leftTree.loading = false;
+                that.rightTable.loading = false;
+              }).catch(function () {
+                that.leftTree.loading = false;
+                that.rightTable.loading = false;
+              });
+          }
+        }
+      });
+    },
+    // 批量修改
+    but_edit_plural () {
+      let that = this;
+      if (that.multipleSelection.length > 0) {
+        that.$refs['dialog_form_arr'].validate((valid) => {
+          if (valid) {
+            let SubmitData = [];
+            for (let key in that.tableFormDataObj) {
+              SubmitData.push({
+                id: that.tableFormDataObj[key].id,
+                memo: that.tableFormDataObj[key].memo,
+                brand: that.tableFormDataObj[key].brand,
+                product: that.tableFormDataObj[key].product,
+                createman: that.tableFormDataObj[key].createman,
+                createtime: that.tableFormDataObj[key].createtime,
+                surfaceStandard: that.tableFormDataObj[key].surfaceStandard,
+                factoryStandard: that.tableFormDataObj[key].factoryStandard
+              });
+            }
+            that.rightTable.loading = true;
+            that.leftTree.loading = true;
+            that.axios.put('pass/ems/v1/emsproductsexecutivestandards/batchupdate', SubmitData)
+              .then(function (res) {
+                if (res.code === '0') {
+                  that.$message({
+                      message: '修改成功',
+                      type: 'success'
+                  });
+                  that.getNodeTreeData();
+                } else {
+                  that.$message.error(res.message);
+                }
+                that.rightTable.loading = false;
+                that.leftTree.loading = false;
+              }).catch(function () {
+                that.rightTable.loading = false;
+                that.leftTree.loading = false;
+              });
+          }
+        });
+      }
+    },
+    // 批量删除
+    but_del_plural () {
+      let that = this;
+      if (that.multipleSelection.length > 0) {
+        let ids = [];
+        for (let item of that.multipleSelection) {
+            ids.push(item.id);
+        }
+        that.$confirm('是否删除已选数据?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          state: 'warning'
+        }).then(() => {
+          that.axios.delete('pass/ems/v1/emsproductsexecutivestandards/' + ids.toString())
+            .then(function (res) {
+              if (res.code === '0') {
+                that.$message({
+                  message: '删除成功',
+                  type: 'success'
+                });
+                that.getNodeTreeData();
+              } else {
+                that.$message.error(res.message);
+              }
+              that.rightTable.loading = false;
+              that.leftTree.loading = false;
+            }).catch(function () {
+              that.rightTable.loading = false;
+              that.leftTree.loading = false;
+            });
+        }).catch(() => {
+          that.$message({
+            type: 'info',
+            message: '已取消删除'
+          });
+        });
+      } else {
+        that.$message.error('至少要选择一条数据');
+      }
+    },
+    // 获取表格中的数据
+    getTableData (pageNum) {
+        let that = this, params = {}, obj = {};
+    },
+    // 根据树结构获取数据
+    queryByStandardId (data) {
+      let that = this;
+      if (data.label !== '所有记录') {
+        that.filterForm.data.product = data.label;
+      } else {
+        that.filterForm.data.product = '';
+      }
+      that.rightTable.tableData.arr = data.data;
+    },
+    // 改变表格显示条数
+    tableSizeChange (val) {
+        let that = this;
+        that.rightTable.pageSize = val;
+    },
+    // 选择添加时的模板
+    handleCurrentChange (row) {
+        let that = this;
+        that.dialog.addRow = row;
+    },
+    // 重置搜索
+    tableDataCancel () {
+      let that = this;
+      that.filterForm.data.product = '';
+      that.filterForm.data.brand = '';
+      that.filterForm.data.surfaceStandard = '';
+      that.filterForm.data.factoryStandard = '';
+    },
+    // 表格中多选按钮的相关方法
+    handleSelectionChange (val) {
+      let that = this;
+      let tableFormDataObj = {};
+      for (let item of that.rightTable.tableData.arr) {
+        item.isSelection = false;
+      }
+      for (let item of val) {
+        let obj = {};
+        let xId = item.id;
+        if (that.tableFormDataObj[xId]) {
+          tableFormDataObj[xId] = that.tableFormDataObj[xId];
+        } else {
+          for (let key in item) {
+            obj[key] = item[key];
+          }
+          tableFormDataObj[xId] = obj;
+        }
+        item.isSelection = true;
+      }
+      that.tableFormDataObj = JSON.parse(JSON.stringify(tableFormDataObj));
+      that.multipleSelection = val;
+    },
+    // 树结构方法
+    treeDataUtil1 (treeData) {
+      let that = this, data = [], children = [], name = '', i = 0, g = 0;
+      for (let item of treeData) {
+        i++;
+        if (name === '') {
+          name = item.product;
+        }
+        if (item.product != null && item.product === name) {
+          children.push(item);
+        } else {
+          g++;
+          data.push({
+            id: g,
+            label: name,
+            children: [],
+            data: children
+          });
+          children = [];
+          name = item.product;
+          children.push(item);
+          continue;
+        }
+        if (i < treeData.length) {
+          continue;
+        }
+        g++;
+        data.push({
+          id: g,
+          label: item.product,
+          children: [],
+          data: children
+        });
+      }
+      return data;
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.executiveStandard {
+  min-width: 700px;
+  height: 100%;
+  .box {
+    height: 100%;
+    padding: 15px 15px 0 15px;
+    .box-left {
+      float: left;
+      width: 200px;
+      height: calc(100% - 3px);
+      overflow: auto;
+      .box-left-bt {
+        line-height: 35px;
+        font-size: 16px;
+        border-bottom: 1px solid #ccc;
+      }
+      .box-left-tree {
+        height: calc(100% - 50px);
+        overflow: auto;
+        padding: 7px 7px 0 0;
+          .tree-row-on {
+            color: #3279e8;
+            font-weight: 600;
+          }
+      }
+    }
+    .box-right {
+      border-left: 1px solid #ccc;
+      margin-left: 200px;
+      .box-top {
+        .box-top-form {
+          padding-left: 7px;
+          .el-form-item {
+            margin-bottom: 7px;
+          }
+        }
+        .box-top-gjl {
+          overflow: hidden;
+          padding: 7px 0 7px 7px;
+          border-top: 1px solid #ccc;
+        }
+      }
+      .box-bottom {
+        padding-left: 7px;
+      }
+    }
+    .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;
+  }
+}
+</style>

+ 8 - 1
src/views/basicInformation/router/index.js

@@ -51,7 +51,9 @@ import indexItemType from '../components/indexItemType.vue'
 // 公式维护
 import equationMaintain from '../components/equationMaintain.vue'
 // 能源监控实时标准
-import nyjkbz from '../components/nyjkbz.vue'
+import nyjkbz from '../components/nyjkbz.vue'
+// 钢产品执行标准
+import executiveStandard from '../components/executiveStandard.vue'
 
 Vue.use(Router)
 
@@ -183,6 +185,11 @@ export default new Router({
                 path: 'nyjkbz',
                 name: 'nyjkbz',
                 component: nyjkbz
+            },
+            {
+                path: 'executiveStandard',
+                name: 'executiveStandard',
+                component: executiveStandard
             }
         ]
     }]

+ 306 - 87
src/views/energyPlan/components/supplyAndDemand/planProjectRoundGx.vue

@@ -25,7 +25,8 @@
                                 <el-input
                                     v-model="filterForm.data.Gmid"
                                     style="width: 100%;"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                             </el-form-item>
                         </el-col>
@@ -93,7 +94,16 @@
                             :label="item.name"
                             :value="item.id">
                             </el-option>
-                        </el-select>
+                        </el-select>
+                        <el-button
+                            class="button"
+                            type="primary"
+                            size="mini"
+                            icon="el-icon-edit-outline"
+                            @click="but_update"
+                            :loading="loading"
+                            v-privilege="activeMenu + 'PUT'"
+                        >修改轮次描述</el-button>
                      <div style="float:right; text-align: right;">
                         <el-radio-group v-model="radio" @change="radioChange()">
                             <el-radio :label="0">
@@ -350,7 +360,7 @@
                                 <el-form-item
                                  :prop="scope.row.seq + '.describe'"
                                  v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                  :rules="tableFormRules.describe"
+                                  :rules="tableFormRules.grades"
                                 >
                                     <el-input
                                     style="width: 100%;"
@@ -372,9 +382,9 @@
                                 >
                                 <template slot-scope="scope">
                                 <el-form-item
-                                 :prop="scope.row.seq + '.describe'"
+                                 :prop="scope.row.seq + '.may'"
                                  v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                  :rules="tableFormRules.describe"
+                                  :rules="tableFormRules.grades"
                                 >
                                 <el-date-picker
                                     value-format="yyyy-MM-dd"
@@ -429,7 +439,7 @@
                                     prop="grades"
                                     label="钢种"
                                     align="center"
-                                    min-width="126px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -444,7 +454,8 @@
                                     clearable
                                     v-model="rightTableObj[scope.row.seq].grades"
                                      @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                    placeholder=""
+                                    placeholder=""
+                                    @change = "((data) =>{gradesChange(data,scope)})"
                                     >
                                     <el-option
                                     v-for="item of nameObj.grades.arr"
@@ -469,7 +480,7 @@
                                     <el-form-item
                                   :prop="scope.row.seq + '.specifications'"
                                    v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                   :rules="tableFormRules.specifications"
+                                   :rules="tableFormRules.grades"
                                   >
                                     <el-select
                                     allow-create
@@ -495,7 +506,7 @@
                                     prop="planWeight"
                                     label="计划量"
                                     align="center"
-                                    min-width="75px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -508,7 +519,8 @@
                                     style="width: 100%;"
                                     v-model="rightTableObj[scope.row.seq].planWeight"
                                      @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                                 </el-form-item>
                                 <span v-else>{{scope.row.planWeight}}</span>
@@ -813,7 +825,55 @@
         :loading="loading"
         >保 存</el-button>
     </span>
-        </el-dialog>
+        </el-dialog>
+    <el-dialog
+       title="炼钢轮次描述-修改"
+       :visible.sync="dialog.editorBox3.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading">
+         <div>
+        <el-form
+         :model="dialog.editorBox3.form.data"
+         ref="dialog_form3"
+         size="mini"
+         label-width="300px"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="20">
+                  <el-form-item
+                    label="轮次描述"
+                    prop="describe"
+                    label-width="100px"
+                    :rules="dialog.editorBox3.form.rules.describe"
+                    >
+                    <el-input clearable
+                        style="width: 100%;"
+                        v-model="dialog.editorBox3.form.data.describe"
+                        refcous="true"
+                    ></el-input>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox3.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
      <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
     </div>
 </template>
@@ -872,8 +932,8 @@ export default {
                 }
             },
             options: {
-                obj:{'2':{id:'2',name:"已下发"},'3':{id:'3',name:"已接收"}},
-                arr: [{id:'2',name:'已下发'},{id:'3',name:'已接收'}]
+                obj: {'2': {id: '2', name: '已下发'}, '3': {id: '3', name: '已接收'}},
+                arr: [{id: '2', name: '已下发'}, {id: '3', name: '已接收'}]
             },
              rules: {
                 },
@@ -884,7 +944,8 @@ export default {
             pageSize1: 100,
             total1: 0,
             singleTableHeight: 100,
-            leftTableData: [],
+            leftTableData: [],
+            leftTableDataObj: {},
             leftTableLoading: false,
             leftTableWidth: 550,
             difference: 0,
@@ -1055,6 +1116,10 @@ export default {
                             name: '应急'
                         }
                     ]
+                },
+                ExecutiveStandard: {
+                    obj: {},
+                    arr: []
                 }
             },
             loading: false,
@@ -1123,6 +1188,18 @@ export default {
                             ]
                         }
                     }
+                },
+                editorBox3: {
+                    show: false,
+                    type: '',
+                    form: {
+                        data: {
+                            describe: ''
+                        },
+                        rules: {
+                            describe: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
                 }
             }
         }
@@ -1157,13 +1234,14 @@ export default {
                 that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
             }, 1);
         });
-        that.getTimeGranData();
-        that.getEnergyIdData();
-        that.getPropertyIdData();
+        // that.getTimeGranData();
+        // that.getEnergyIdData();
+        // that.getPropertyIdData();
         that.getGrades();
         that.getSpecifications();
-        that.getStandards();
-        that.getUnitIdData();
+        that.getStandards();
+        that.getExecutiveStandard();
+        // that.getUnitIdData();
     },
     methods: {
         //  计算树区域高度
@@ -1301,7 +1379,8 @@ export default {
             })
                 .then(function (res) {
                     if (res.code === '0') {
-                        let arr = [];
+                        let arr = [];
+                        let obj = {};
                         for (let i = 0; i < res.data.list.length; i++) {
                              let item = res.data.list[i];
                             arr.push({
@@ -1331,9 +1410,37 @@ export default {
                                 kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
                                 yxf_weight: item.YXF_WEIGHT,
                                 tag: item.TAG ? item.TAG : '0'
-                            })
+                            });
+                            obj[item.ID] = {seq: i,
+                                id: item.ID,
+                                jhTime: item.JHTIME,
+                                state: item.STATE,
+                                grades: item.GRADES,
+                                specifications: item.SPECIFICATIONS,
+                                lengths: item.LENGTHS,
+                                chemicalStandard: item.CHEMICALSTANDARD,
+                                surfaceStandard: item.SURFACESTANDARD,
+                                workprocType: item.WORKPROCTYPE,
+                                iateralarea: item.IATERALAREA,
+                                lengthtimeswidth: item.LENGTHTIMESWIDTH,
+                                transportType: item.TRANSPORTTYPE,
+                                receivetime: item.RECEIVETIME,
+                                createman: item.CREATEMAN,
+                                createtime: item.CREATETIME,
+                                updateman: item.UPDATEMAN,
+                                purpose: item.PURPOSE,
+                                updatetime: item.UPDATETIME,
+                                memo: item.MEMO,
+                                planweight: item.PLANWEIGHT,
+                                deliveryDate: item.DELIVERYDATE,
+                                dimension: item.DIMENSION,
+                                kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
+                                yxf_weight: item.YXF_WEIGHT,
+                                tag: item.TAG ? item.TAG : '0'
+                                };
                         }
-                        that.leftTableData = arr;
+                        that.leftTableData = arr;
+                        that.leftTableDataObj = obj;
                         that.total1 = res.data.total;
                         that.dialog.fRow = null;
                     } else {
@@ -1344,10 +1451,10 @@ export default {
                     that.leftTableLoading = false;
                 });
         },
-        //切换查询方法
-        chageMethod(){
+        // 切换查询方法
+        chageMethod () {
             let that = this;
-            if (that.leftTableShow == true){
+            if (that.leftTableShow === true) {
                that.getTableDetailDatas(that.pageNum);
             } else {
                that.getTableDetailAsRadio(that.pageNum)
@@ -1416,21 +1523,23 @@ export default {
             });
             }
         },
-         //展开自动查询
-        getTableDetailAsRadio(pageNum){
+         // 展开自动查询
+        getTableDetailAsRadio (pageNum) {
             let that = this;
             let ids = [];
             that.leftTableData.forEach((element) => {
                 ids.push(element.id);
             });
            that.pageNum = pageNum || that.pageNum;
-           let url = 'pass/ems/v1/emsprodplanrounds/getTableDetailAsRadio/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+           let url = 'pass/ems/v1/emsprodplanrounds/getTableDetailAsRadio/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+           // state 是不等于
            that.axios.get(url, {
                params: {
-                   id: ids.join(',')
+                   id: ids.join(','),
+                   state: 2
                }
            }).then(function (res) {
-               if (res.code == '0') {
+               if (res.code === '0') {
                            let arr = [];
             for (let i = 0; i < res.data.list.length; i++) {
                 let item = res.data.list[i];
@@ -1614,7 +1723,20 @@ export default {
                         obj[key] = item[key];
                     }
                     item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
-                    rightTableObj[xId] = obj;
+                    rightTableObj[xId] = obj;
+                    try {
+                      if (item.grades != null && item.grades !== '') {
+                        if (item.surfaceStandard === '' || item.surfaceStandard === null) {
+                          rightTableObj[xId].surfaceStandard = that.nameObj.ExecutiveStandard.obj[item.grades].surface;
+                        }
+                        if (item.chemicalStandard === '' || item.chemicalStandard === null) {
+                          rightTableObj[xId].chemicalStandard = that.nameObj.ExecutiveStandard.obj[item.grades].factory;
+                        }
+                      }
+                    } catch (e) {
+                      rightTableObj[xId].chemicalStandard = '';
+                      console.log('没有对应')
+                    }
                 }
                 item.isSelection = true;
             }
@@ -1796,10 +1918,11 @@ export default {
         issue () {
             let that = this;
             if (that.multipleSelection.length > 0) {
-            that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
+            that.$refs['dialog_form_arr_2'].validate(async (valid, obj) => {
             if (valid) {
                 let SubmitData = [];
-                let auditStates = [];
+                let auditStates = [];
+                let messageRoundid = '';
                 for (let key in that.rightTableObj) {
                    SubmitData.push({
                         parentid: that.rightTableObj[key].parentid,
@@ -1823,27 +1946,55 @@ export default {
                         id: that.rightTableObj[key].roundid,
                         state: that.rightTableObj[key].state,
                         sqno: that.rightTableObj[key].sqno
-                   });
+                   });
+                   try {
+                     if (that.rightTableObj[key].planWeight > that.leftTableDataObj[that.rightTableObj[key].parentid].kxf_weight) {
+                       messageRoundid += that.rightTableObj[key].roundid + ',';
+                     }
+                   } catch (e) {
+                     console.log(that.rightTableObj[key].parentid + '判断错误')
+                   }
                 }
-                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.chageMethod();
-                 } else {
-                that.$message.error(res.message);
-            }
-                that.loading = false;
-                }).catch(function () {
-                 that.loading = false;
-                });
+                that.loading = true;
+                let down = false;
+                if (messageRoundid !== '') {
+                  await that.$confirm('计划编号' + messageRoundid + '本次下发量已超出订单可下发量,是否继续下发?', '提示', {
+                      confirmButtonText: '确定',
+                      cancelButtonText: '取消',
+                      type: 'warning'
+                    }).then(() => {
+                      down = true;
+                    }).catch(() => {
+                      down = false;
+                      that.$message({
+                        type: 'info',
+                        message: '已取消下发'
+                      });
+                      that.loading = false;
+                    });
+                } else {
+                  down = true;
+                }
+                if (down) {
+                 await 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.chageMethod();
+                  } else {
+                    that.$message.error(res.message);
+                  }
+                  that.loading = false;
+                  }).catch(function () {
+                    that.loading = false;
+                  });
+                }
             }
           });
              } else {
@@ -2063,30 +2214,30 @@ export default {
             }
         },
       but_add (type) {
-          let that = this;
-              let SubmitData = [];
-			  if(that.multipleSelectionAscLeft.length >0 ) {
-			  for(let key in that.tableFormDataObj) {
-                  SubmitData.push({
-                        parentid: that.tableFormDataObj[key].id,
-                        may: that.tableFormDataObj[key].jhTime,
-                        describe: that.tableFormDataObj[key].describe,
-                        state: that.tableFormDataObj[key].state,
-                        grades: that.tableFormDataObj[key].grades,
-                        specifications: that.tableFormDataObj[key].specifications,
-                        transportType: that.tableFormDataObj[key].transportType,
-                        workprocType: that.tableFormDataObj[key].workprocType,
-                        purpose: that.tableFormDataObj[key].purpose,
-                        chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
-                        memo: that.tableFormDataObj[key].memo,
-                        createMan: that.tableFormDataObj[key].createman,
-                        planweight: that.tableFormDataObj[key].planweight,
-                        createTime: that.tableFormDataObj[key].createtime,
-                        deliveryDate: that.tableFormDataObj[key].deliveryDate,
-                        auditState: '0',
-                        tag: that.tableFormDataObj[key].tag ? that.tableFormDataObj[key].tag : '0'
-                  })
-				  }
+        let that = this;
+        let SubmitData = [];
+        if (that.multipleSelectionAscLeft.length > 0) {
+          for (let key in that.tableFormDataObj) {
+            SubmitData.push({
+                  parentid: that.tableFormDataObj[key].id,
+                  may: that.tableFormDataObj[key].jhTime,
+                  describe: that.tableFormDataObj[key].describe,
+                  state: that.tableFormDataObj[key].state,
+                  grades: that.tableFormDataObj[key].grades,
+                  specifications: that.tableFormDataObj[key].specifications,
+                  transportType: that.tableFormDataObj[key].transportType,
+                  workprocType: that.tableFormDataObj[key].workprocType,
+                  purpose: that.tableFormDataObj[key].purpose,
+                  chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
+                  memo: that.tableFormDataObj[key].memo,
+                  createMan: that.tableFormDataObj[key].createman,
+                  planweight: that.tableFormDataObj[key].planweight,
+                  createTime: that.tableFormDataObj[key].createtime,
+                  deliveryDate: that.tableFormDataObj[key].deliveryDate,
+                  auditState: '0',
+                  tag: that.tableFormDataObj[key].tag ? that.tableFormDataObj[key].tag : '0'
+            })
+          }
                     that.loading = true;
                     that.axios.post('pass/ems/v1/emsprodplanrounds/', SubmitData, {
                             contentType: 'application/json'
@@ -2106,9 +2257,9 @@ export default {
                             }).catch(function () {
                                 that.loading = false;
                     });
-					} else {
-                         this.$message.error('至少要选择一条数据');
-                    }
+          } else {
+            this.$message.error('至少要选择一条数据');
+          }
         },
         // 审核
         audit () {
@@ -2188,16 +2339,16 @@ export default {
                     });
             }
         },
-        radioChange(){
+        radioChange () {
             let that = this;
             let leftwith = 0;
             let rightwith = 550;
-            if(that.radio == 0){
+            if (that.radio === 0) {
                 that.leftTableWidth = leftwith;
                 that.leftTableShow = false;
                 that.getTableDetailAsRadio(1);
             }
-            if(that.radio == 1){
+            if (that.radio === 1) {
                 that.leftTableWidth = rightwith;
                 that.leftTableShow = true;
                 that.rightTableData = [];
@@ -2226,7 +2377,6 @@ export default {
                 this.$nextTick(() => {
                     $(id).click();
                 });
-                console.log('下键')
             } else if (event.keyCode === 38) { // 键盘上键
                 let index = parseInt(this.rowIndex);
                 if (index !== this.seqArr[0]) {
@@ -2237,18 +2387,15 @@ export default {
                         }
                     }
                 }
-                console.log('上键')
                 this.editSetFlag = index + this.columnId;
                 let id = '#' + this.editSetFlag;
                 this.$nextTick(() => {
                     $(id).click();
                 });
             } else if (event.keyCode === 37) { // 键盘左键
-                console.log('左键')
                 $(tdTarget).prevAll().find('input:text').last().click();
             } else if (event.keyCode === 39) { // 键盘右键
                 $(tdTarget).nextAll().find('input').eq(0).click();
-                console.log('右键')
             }
         },
         cellClick (row, column, cell, event) {
@@ -2272,6 +2419,75 @@ export default {
         openDetails (row) {
           let that = this;
           that.leftData = row;
+        },
+        getExecutiveStandard () {
+          let that = this;
+          let url = 'pass/ems/v1/emsproductsexecutivestandards/?pageNum=1&pageSize=999';
+          that.axios.get(url)
+          .then(function (res) {
+              if (res.code === '0') {
+                  let arr = [];
+                  let obj = {};
+                  for (let item of res.data.list) {
+                      arr.push({
+                          brand: item.brand,
+                          factory: item.factoryStandard,
+                          surface: item.surfaceStandard
+                      });
+                      obj[item.brand] = {
+                          brand: item.brand,
+                          factory: item.factoryStandard,
+                          surface: item.surfaceStandard
+                      };
+                  }
+                  that.nameObj.ExecutiveStandard.arr = arr;
+                  that.nameObj.ExecutiveStandard.obj = obj;
+              } else {
+                  that.$message.error(res.message);
+              }
+          });
+        },
+        gradesChange (data, scope) {
+          let that = this;
+          let obj = that.rightTableObj[scope.row.seq];
+          // 化学成分执行标准 / 出厂执行标准
+          let factory = obj.chemicalStandard;
+          // 表面执行标准
+          let surface = obj.surfaceStandard;
+          // if(factory === '' || factory === null)
+          // {
+            try {
+              obj.chemicalStandard = that.nameObj.ExecutiveStandard.obj[data].factory;
+              // }
+              // if(surface === '' || surface === null) {
+                obj.surfaceStandard = that.nameObj.ExecutiveStandard.obj[data].surface;
+              // }
+            } catch (e) {
+              obj.chemicalStandard = '';
+              console.log('没有对应');
+            }
+        },
+        but_update () {
+              let that = this;
+              if (that.multipleSelection.length > 0) {
+                  setTimeout(() => {
+                      that.$refs['dialog_form3'].clearValidate();
+                  }, 100);
+                  that.dialog.editorBox3.show = true;
+              } else {
+                  this.$message.error('至少要选择一条数据');
+              }
+        },
+        but_copy () {
+          let that = this;
+          that.$refs['dialog_form3'].validate((valid) => {
+          if (valid) {
+          for (let key in that.rightTableObj) {
+            that.rightTableObj[key].describe = that.dialog.editorBox3.form.data.describe;
+          }
+            that.dialog.editorBox3.show = false;
+          }
+          });
         }
     }
 }
@@ -2331,6 +2547,9 @@ function sortNumber (a, b) {
         thead .el-table-column--selection .cell {
             display: none;
         }
+    }
+    td .el-form-item__error {
+      position: static;
     }
 }
 </style>

+ 330 - 84
src/views/energyPlan/components/supplyAndDemand/planProjectRoundLG.vue

@@ -25,7 +25,8 @@
                                 <el-input
                                     v-model="filterForm.data.Gmid"
                                     style="width: 100%;"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                             </el-form-item>
                         </el-col>
@@ -85,7 +86,24 @@
                             icon="el-icon-plus"
                             v-privilege="activeMenu + 'ADD'"
                             @click="but_add(1)"
-                        >新增子计划</el-button>
+                        >新增子计划</el-button>
+                        <el-select v-model ="filterForm.data.options" clearable @change="getTableData()" size="mini">
+                            <el-option
+                            v-for="item of options.arr"
+                            :key="item.id"
+                            :label="item.name"
+                            :value="item.id">
+                            </el-option>
+                        </el-select>
+                        <el-button
+                            class="button"
+                            type="primary"
+                            size="mini"
+                            icon="el-icon-edit-outline"
+                            @click="but_update"
+                            :loading="loading"
+                            v-privilege="activeMenu + 'PUT'"
+                        >修改轮次描述</el-button>
                     <div style="float:right; text-align: right;">
                         <el-radio-group v-model="radio" @change="radioChange()">
                             <el-radio :label="0">
@@ -210,7 +228,7 @@
                             prop="grades"
                             align="center"
                             label="钢种"
-                            width="71"
+                            width="71px"
                             :show-overflow-tooltip="true"
                         >
                         </el-table-column>
@@ -327,7 +345,7 @@
                                     prop="describe"
                                     label="轮次描述"
                                     align="center"
-                                    min-width="146px"
+                                    min-width="160px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -340,7 +358,8 @@
                                     style="width: 100%;"
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                     v-model="rightTableObj[scope.row.seq].describe"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                                 </el-form-item>
                                 <span v-else>{{scope.row.describe}}</span>
@@ -356,9 +375,9 @@
                                 >
                                 <template slot-scope="scope">
                                 <el-form-item
-                                 :prop="scope.row.seq + '.describe'"
+                                 :prop="scope.row.seq + '.may'"
                                  v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                  :rules="tableFormRules.describe"
+                                 :rules="tableFormRules.may"
                                 >
                                 <el-date-picker
                                     value-format="yyyy-MM-dd"
@@ -405,7 +424,7 @@
                                     prop="grades"
                                     label="钢种"
                                     align="center"
-                                    min-width="126px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -420,7 +439,8 @@
                                     clearable
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                     v-model="rightTableObj[scope.row.seq].grades"
-                                    placeholder=""
+                                    placeholder=""
+                                    @change = "((data) =>{gradesChange(data,scope)})"
                                     >
                                     <el-option
                                     v-for="item of nameObj.grades.arr"
@@ -471,20 +491,21 @@
                                     prop="lengths"
                                     label="长度"
                                     align="center"
-                                    min-width="85px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
                                 <el-form-item
                                  :prop="scope.row.seq + '.lengths'"
                                  v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                  :rules="tableFormRules.lengths"
+                                  :rules="tableFormRules.planWeight"
                                 >
                                     <el-input
                                     style="width: 100%;"
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                     v-model="rightTableObj[scope.row.seq].lengths"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                                 </el-form-item>
                                 <span v-else>{{scope.row.lengths}}</span>
@@ -495,7 +516,7 @@
                                     prop="planWeight"
                                     label="计划量"
                                     align="center"
-                                    min-width="75px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -508,7 +529,8 @@
                                     style="width: 100%;"
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                     v-model="rightTableObj[scope.row.seq].planWeight"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                                 </el-form-item>
                                 <span v-else>{{scope.row.planWeight}}</span>
@@ -526,7 +548,7 @@
                                     <el-form-item
                                     :prop="scope.row.seq + '.surfaceStandard'"
                                      v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                     :rules="tableFormRules.surfaceStandard"
+                                     :rules="tableFormRules.chemicalStandard"
                                   >
                                     <el-select
                                     allow-create
@@ -556,13 +578,15 @@
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
-                                   <el-form-item
+                                   <el-form-item
+                                   :prop="scope.row.seq + '.chemicalStandard'"
                                    v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
                                    :rules="tableFormRules.chemicalStandard"
                                   >
                                     <el-select
                                     allow-create
-                                    clearable
+                                    clearable
+                                    filterable
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                     v-model="rightTableObj[scope.row.seq].chemicalStandard"
                                     placeholder=""
@@ -637,7 +661,7 @@
                                 <el-form-item
                                    :prop="scope.row.seq + '.goinfo'"
                                    v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                  :rules="tableFormRules.goinfo"
+                                  :rules="tableFormRules.chemicalStandard"
                                 >
                                     <el-select
                                     filterable clearable
@@ -832,7 +856,55 @@
         :loading="loading"
         >保 存</el-button>
     </span>
-        </el-dialog>
+        </el-dialog>
+        <el-dialog
+           title="炼钢轮次描述-修改"
+           :visible.sync="dialog.editorBox3.show"
+           width="400px"
+           :close-on-click-modal="false"
+           :show-close="!loading">
+             <div>
+            <el-form
+             :model="dialog.editorBox3.form.data"
+             ref="dialog_form3"
+             size="mini"
+             label-width="300px"
+             >
+             <el-row>
+                 <el-col>
+                     <el-col :span="20">
+                      <el-form-item
+                        label="轮次描述"
+                        prop="describe"
+                        label-width="100px"
+                        :rules="dialog.editorBox3.form.rules.describe"
+                        >
+                        <el-input clearable
+                            style="width: 100%;"
+                            v-model="dialog.editorBox3.form.data.describe"
+                            refcous="true"
+                        ></el-input>
+                    </el-form-item>
+                </el-col>
+                 </el-col>
+             </el-row>
+             </el-form>
+             </div>
+             <span
+            slot="footer"
+            class="dialog-footer"
+                >
+            <el-button
+            :loading="loading"
+            @click="dialog.editorBox3.show = false"
+            >取 消</el-button>
+            <el-button
+            type="primary"
+            @click="but_copy"
+            :loading="loading"
+            >保 存</el-button>
+        </span>
+         </el-dialog>
      <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
     </div>
 </template>
@@ -856,7 +928,7 @@ export default {
             columnId: '',
             focusTarget: null,
             radio: '1',
-            gridData:[],
+            gridData: [],
             leftTableShow: true,
             seqArr: [],
             filterForm: {
@@ -887,8 +959,13 @@ export default {
                     purpose: '',
                     sqno: '',
                     show: false,
-                    goinfo: ''
+                    goinfo: '',
+                    options: ''
                 }
+            },
+            options: {
+                obj: {'2': {id: '2', name: '已下发'}, '3': {id: '3', name: '已接收'}},
+                arr: [{id: '2', name: '已下发'}, {id: '3', name: '已接收'}]
             },
              rules: {
                 },
@@ -899,7 +976,8 @@ export default {
             total: 0,
             total1: 0,
             singleTableHeight: 100,
-            leftTableData: [],
+            leftTableData: [],
+            leftTableDataObj: {},
             leftTableLoading: false,
             leftTableWidth: 550,
             difference: 0,
@@ -930,6 +1008,12 @@ export default {
                 ],
                 chemicalStandard: [
                     { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                describe: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
+                ],
+                may: [
+                    { required: true, message: '该项不能为空', trigger: 'change' }
                 ]
             },
             nameObj: {
@@ -994,6 +1078,10 @@ export default {
                 surfaceStandard: {
                     obj: {},
                     arr: []
+                },
+                ExecutiveStandard: {
+                    obj: {},
+                    arr: []
                 },
 
                 goinfo: {
@@ -1150,6 +1238,18 @@ export default {
                             ]
                         }
                     }
+                },
+                editorBox3: {
+                    show: false,
+                    type: '',
+                    form: {
+                        data: {
+                            describe: ''
+                        },
+                        rules: {
+                            describe: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
                 }
             }
         }
@@ -1184,15 +1284,16 @@ export default {
                 that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
             }, 1);
         });
-        that.getTimeGranData();
-        that.getEnergyIdData();
-        that.getPropertyIdData();
+        // that.getTimeGranData();
+        // that.getEnergyIdData();
+        // that.getPropertyIdData();
         that.getGrades();
         that.getSpecifications();
         that.getStandards();
-        that.getUnitIdData();
+        // that.getUnitIdData();
         that.getsurfaceStandard();
-        that.gethxcf();
+        that.gethxcf();
+        that.getExecutiveStandard();
     },
     methods: {
         //  计算树区域高度
@@ -1284,10 +1385,10 @@ export default {
                     }
                 });
         },
-        gethxcfDate(row){
+        gethxcfDate (row) {
          let that = this;
          let url = 'pass/ems/v1/chemicalconstituentss/getDataByGmid';
-         let params ={};
+         let params = {};
          params = {
              gmid: row.parentid ? row.parentid : row.id
          }
@@ -1297,7 +1398,7 @@ export default {
             }).then(function (res) {
                 if (res.code === '0') {
                     let arr = [];
-                    for(let i = 0 ; i < res.data.length; i++){
+                    for (let i = 0; i < res.data.length; i++) {
                         let item = res.data[i];
                         arr.push({
                             seq: i,
@@ -1308,7 +1409,7 @@ export default {
                         })
                     }
                     that.gridData = arr;
-                    that.filterForm.cf = that.gridData.length>0 ? true :false
+                    that.filterForm.cf = that.gridData.length > 0
                     that.gridDataLoading = false;
                 } else {
                     that.$message.error(res.message);
@@ -1352,7 +1453,8 @@ export default {
                    endTime: that.filterForm.data.clock[1],
                    id: that.filterForm.data.Gmid,
                    grades: that.filterForm.data.grades.join(','),
-                   specifications: that.filterForm.data.specifications.join(',')
+                   specifications: that.filterForm.data.specifications.join(','),
+                   state: that.filterForm.data.options
                 };
             that.pageNum1 = pageNum1 || that.pageNum1;
             that.leftTableLoading = true;
@@ -1362,7 +1464,8 @@ export default {
             })
                 .then(function (res) {
                     if (res.code === '0') {
-                        let arr = [];
+                        let arr = [];
+                        let obj = {};
                         for (let i = 0; i < res.data.list.length; i++) {
                              let item = res.data.list[i];
                             arr.push({
@@ -1392,9 +1495,37 @@ export default {
                                 kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
                                 yxf_weight: item.YXF_WEIGHT,
                                 tag: item.TAG ? item.TAG : '0'
-                            })
+                            });
+                            obj[item.ID] = {seq: i,
+                                id: item.ID,
+                                jhTime: item.JHTIME,
+                                state: item.STATE,
+                                grades: item.GRADES,
+                                specifications: item.SPECIFICATIONS,
+                                lengths: item.LENGTHS,
+                                chemicalStandard: item.CHEMICALSTANDARD,
+                                surfaceStandard: item.SURFACESTANDARD,
+                                workprocType: item.WORKPROCTYPE,
+                                iateralarea: item.IATERALAREA,
+                                lengthtimeswidth: item.LENGTHTIMESWIDTH,
+                                transportType: item.TRANSPORTTYPE,
+                                receivetime: item.RECEIVETIME,
+                                createman: item.CREATEMAN,
+                                createtime: item.CREATETIME,
+                                updateman: item.UPDATEMAN,
+                                purpose: item.PURPOSE,
+                                updatetime: item.UPDATETIME,
+                                memo: item.MEMO,
+                                planweight: item.PLANWEIGHT,
+                                deliveryDate: item.DELIVERYDATE,
+                                dimension: item.DIMENSION,
+                                kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
+                                yxf_weight: item.YXF_WEIGHT,
+                                tag: item.TAG ? item.TAG : '0'
+                                };
                         }
-                        that.leftTableData = arr;
+                        that.leftTableData = arr;
+                        that.leftTableDataObj = obj;
                         that.total1 = res.data.total;
                         that.dialog.fRow = null;
                     } else {
@@ -1405,10 +1536,10 @@ export default {
                     that.leftTableLoading = false;
                 });
         },
-         //切换查询方法
-        chageMethod(){
+         // 切换查询方法
+        chageMethod () {
             let that = this;
-            if (that.leftTableShow == true){
+            if (that.leftTableShow === true) {
                that.getTableDetailDatas(that.pageNum);
             } else {
                that.getTableDetailAsRadio(that.pageNum)
@@ -1646,8 +1777,21 @@ export default {
                     for (let key in item) {
                         obj[key] = item[key];
                     }
-                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
-                    rightTableObj[xId] = obj;
+                    item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
+                    rightTableObj[xId] = obj;
+                    try {
+                      if (item.grades !== null && item.grades !== '') {
+                        if (item.surfaceStandard === '' || item.surfaceStandard === null) {
+                          rightTableObj[xId].surfaceStandard = that.nameObj.ExecutiveStandard.obj[item.grades].surface;
+                        }
+                        if (item.chemicalStandard === '' || item.chemicalStandard === null) {
+                          rightTableObj[xId].chemicalStandard = that.nameObj.ExecutiveStandard.obj[item.grades].factory;
+                        }
+                      }
+                    } catch (e) {
+                      rightTableObj[xId].chemicalStandard = '';
+                      console.log('没有对应')
+                    }
                 }
                 item.isSelection = true;
             }
@@ -1857,18 +2001,18 @@ export default {
                         }
                         that.nameObj.surfaceStandard.arr = arr;
                         that.nameObj.surfaceStandard.obj = obj;
-                        console.log(that.nameObj.surfaceStandard);
                     } else {
                         that.$message.error(res.message);
                     }
                 });
         },
-        issue () {
-            let that = this;
-            if (that.multipleSelection.length > 0) {
-            that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
+       issue () {
+          let that = this;
+          if (that.multipleSelection.length > 0) {
+           that.$refs['dialog_form_arr_2'].validate(async (valid, obj) => {
             if (valid) {
-                let SubmitData = [];
+                let SubmitData = [];
+                let messageRoundid = '';
                 for (let key in that.rightTableObj) {
                    SubmitData.push({
                         parentid: that.rightTableObj[key].parentid,
@@ -1894,32 +2038,60 @@ export default {
                         lengths: that.rightTableObj[key].lengths,
                         surfaceStandard: that.rightTableObj[key].surfaceStandard,
                         goinfo: that.rightTableObj[key].goinfo
-                   });
+                   });
+                   try {
+                     if (that.rightTableObj[key].planWeight > that.leftTableDataObj[that.rightTableObj[key].parentid].kxf_weight) {
+                       messageRoundid += that.rightTableObj[key].roundid + ',';
+                     }
+                   } catch (e) {
+                     console.log(that.rightTableObj[key].parentid + '判断错误')
+                   }
+                }
+                that.loading = true;
+                let down = false;
+                if (messageRoundid !== '') {
+                  await that.$confirm('计划编号' + messageRoundid + '本次下发量已超出订单可下发量,是否继续下发?', '提示', {
+                      confirmButtonText: '确定',
+                      cancelButtonText: '取消',
+                      type: 'warning'
+                    }).then(() => {
+                      down = true;
+                    }).catch(() => {
+                      down = false;
+                      that.$message({
+                        type: 'info',
+                        message: '已取消下发'
+                      });
+                      that.loading = false;
+                    });
+                } else {
+                  down = true;
+                }
+               if (down) {
+                await 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.chageMethod();
+                    } else {
+                      that.$message.error(res.message);
+                    }
+                    that.loading = false;
+                  }).catch(function () {
+                    that.loading = false;
+                  });
                 }
-                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.chageMethod();
-                } else {
-                that.$message.error(res.message);
-            }
-                that.loading = false;
-                }).catch(function () {
-                 that.loading = false;
-                });
             }
-          });
-             } else {
-                  this.$message.error('至少要选择一条数据');
-             }
+            });
+          } else {
+            this.$message.error('至少要选择一条数据');
+          }
         },
         offissue () {
             let that = this;
@@ -2139,8 +2311,8 @@ export default {
       but_add (type) {
           let that = this;
               let SubmitData = [];
-              if(that.multipleSelectionAscLeft.length >0 ) {
-                  for(let key in that.tableFormDataObj) {
+              if (that.multipleSelectionAscLeft.length > 0) {
+                  for (let key in that.tableFormDataObj) {
                   SubmitData.push({
                         parentid: that.tableFormDataObj[key].id,
                         may: that.tableFormDataObj[key].jhTime,
@@ -2236,8 +2408,8 @@ export default {
                     });
             }
         },
-        //展开自动查询
-        getTableDetailAsRadio(pageNum){
+        // 展开自动查询
+        getTableDetailAsRadio (pageNum) {
             let that = this;
             let ids = [];
             that.leftTableData.forEach((element) => {
@@ -2245,12 +2417,14 @@ export default {
             });
            that.pageNum = pageNum || that.pageNum;
            let url = 'pass/ems/v1/emsprodplanrounds/getTableDetailAsRadio/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+           // state 是不等于
            that.axios.get(url, {
-               params: {
-                   id: ids.join(',')
+               params: {
+                   id: ids.join(','),
+                   state: 2
                }
            }).then(function (res) {
-               if (res.code == '0') {
+               if (res.code === '0') {
                            let arr = [];
             for (let i = 0; i < res.data.list.length; i++) {
                 let item = res.data.list[i];
@@ -2293,16 +2467,16 @@ export default {
                     that.tableLoading = false;
            });
         },
-        radioChange(){
+        radioChange () {
             let that = this;
             let leftwith = 0;
             let rightwith = 550;
-            if(that.radio == 0){
+            if (that.radio === 0) {
                 that.leftTableWidth = leftwith;
                 that.leftTableShow = false;
                 that.getTableDetailAsRadio(1);
             }
-            if(that.radio == 1){
+            if (that.radio === 1) {
                 that.leftTableWidth = rightwith;
                 that.leftTableShow = true;
                 that.rightTableData = [];
@@ -2331,7 +2505,7 @@ export default {
                 this.$nextTick(() => {
                     $(id).click();
                 });
-                console.log('下键')
+                // console.log('下键')
             } else if (event.keyCode === 38) { // 键盘上键
                 let index = parseInt(this.rowIndex);
                 if (index !== this.seqArr[0]) {
@@ -2342,18 +2516,18 @@ export default {
                         }
                     }
                 }
-                console.log('上键')
+                // console.log('上键')
                 this.editSetFlag = index + this.columnId;
                 let id = '#' + this.editSetFlag;
                 this.$nextTick(() => {
                     $(id).click();
                 });
             } else if (event.keyCode === 37) { // 键盘左键
-                console.log('左键')
+                // console.log('左键')
                 $(tdTarget).prevAll().find('input:text').last().click();
             } else if (event.keyCode === 39) { // 键盘右键
                 $(tdTarget).nextAll().find('input').eq(0).click();
-                console.log('右键')
+                // console.log('右键')
             }
         },
         cellClick (row, column, cell, event) {
@@ -2377,6 +2551,75 @@ export default {
         openDetails (row) {
           let that = this;
           that.leftData = row;
+        },
+        getExecutiveStandard () {
+          let that = this;
+          let url = 'pass/ems/v1/emsproductsexecutivestandards/?pageNum=1&pageSize=999';
+          that.axios.get(url)
+          .then(function (res) {
+              if (res.code === '0') {
+                  let arr = [];
+                  let obj = {};
+                  for (let item of res.data.list) {
+                      arr.push({
+                          brand: item.brand,
+                          factory: item.factoryStandard,
+                          surface: item.surfaceStandard
+                      });
+                      obj[item.brand] = {
+                          brand: item.brand,
+                          factory: item.factoryStandard,
+                          surface: item.surfaceStandard
+                      };
+                  }
+                  that.nameObj.ExecutiveStandard.arr = arr;
+                  that.nameObj.ExecutiveStandard.obj = obj;
+              } else {
+                  that.$message.error(res.message);
+              }
+          });
+        },
+        gradesChange (data, scope) {
+          let that = this;
+          let obj = that.rightTableObj[scope.row.seq];
+          // 化学成分执行标准 / 出厂执行标准
+          let factory = obj.chemicalStandard;
+          // 表面执行标准
+          let surface = obj.surfaceStandard;
+          // if(factory === '' || factory === null)
+          // {
+            try {
+              obj.chemicalStandard = that.nameObj.ExecutiveStandard.obj[data].factory;
+              // }
+              // if(surface === '' || surface === null) {
+                obj.surfaceStandard = that.nameObj.ExecutiveStandard.obj[data].surface;
+              // }
+            } catch (e) {
+              obj.chemicalStandard = '';
+              console.log('没有对应');
+            }
+        },
+        but_update () {
+              let that = this;
+              if (that.multipleSelection.length > 0) {
+                  setTimeout(() => {
+                      that.$refs['dialog_form3'].clearValidate();
+                  }, 100);
+                  that.dialog.editorBox3.show = true;
+              } else {
+                  this.$message.error('至少要选择一条数据');
+              }
+        },
+        but_copy () {
+          let that = this;
+          that.$refs['dialog_form3'].validate((valid) => {
+          if (valid) {
+          for (let key in that.rightTableObj) {
+            that.rightTableObj[key].describe = that.dialog.editorBox3.form.data.describe;
+          }
+            that.dialog.editorBox3.show = false;
+          }
+          });
         }
     }
 }
@@ -2436,6 +2679,9 @@ function sortNumber (a, b) {
         thead .el-table-column--selection .cell {
             display: none;
         }
+    }
+    td .el-form-item__error {
+      position: static;
     }
 }
 </style>

+ 295 - 61
src/views/energyPlan/components/supplyAndDemand/planProjectRoundXG.vue

@@ -25,7 +25,8 @@
                                 <el-input
                                     v-model="filterForm.data.Gmid"
                                     style="width: 100%;"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                             </el-form-item>
                         </el-col>
@@ -85,7 +86,24 @@
                             icon="el-icon-plus"
                             v-privilege="activeMenu + 'ADD'"
                             @click="but_add(1)"
-                        >新增子计划</el-button>
+                        >新增子计划</el-button>
+                        <el-select v-model ="filterForm.data.options" clearable @change="getTableData()" size="mini">
+                            <el-option
+                            v-for="item of options.arr"
+                            :key="item.id"
+                            :label="item.name"
+                            :value="item.id">
+                            </el-option>
+                        </el-select>
+                        <el-button
+                            class="button"
+                            type="primary"
+                            size="mini"
+                            icon="el-icon-edit-outline"
+                            @click="but_update"
+                            :loading="loading"
+                            v-privilege="activeMenu + 'PUT'"
+                        >修改轮次描述</el-button>
                     <div style="float:right; text-align: right;">
                         <el-radio-group v-model="radio" @change="radioChange()">
                             <el-radio :label="0">
@@ -369,7 +387,7 @@
                                 <el-form-item
                                  :prop="scope.row.seq + '.may'"
                                  v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                 :rules="tableFormRules.may"
+                                 :rules="tableFormRules.grades"
                                 >
                                 <el-date-picker
                                     value-format="yyyy-MM-dd"
@@ -421,7 +439,7 @@
                                 sortable
                                     prop="grades"
                                     label="钢种"
-                                    min-width="126px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -436,7 +454,8 @@
                                     clearable
                                     v-model="rightTableObj[scope.row.seq].grades"
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                    placeholder=""
+                                    placeholder=""
+                                    @change = "((data) =>{gradesChange(data,scope)})"
                                     >
                                     <el-option
                                     v-for="item of nameObj.grades.arr"
@@ -494,13 +513,14 @@
                                  <el-form-item
                                  :prop="scope.row.seq + '.lengths'"
                                  v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '3'"
-                                 :rules="tableFormRules.lengths"
+                                 :rules="tableFormRules.planWeight"
                                 >
                                     <el-input
                                     style="width: 100%;"
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
                                     v-model="rightTableObj[scope.row.seq].lengths"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                                 </el-form-item>
                                 <span v-else>{{scope.row.lengths}}</span>
@@ -511,7 +531,7 @@
                                     prop="planWeight"
                                     label="计划量"
                                     align="center"
-                                    min-width="75px"
+                                    min-width="100px"
                                     :show-overflow-tooltip="true"
                                 >
                                 <template slot-scope="scope">
@@ -524,7 +544,8 @@
                                     style="width: 100%;"
                                     v-model="rightTableObj[scope.row.seq].planWeight"
                                     @keydown.native="keyDown" :id="scope.$index + scope.column.id"
-                                    refcous="true"
+                                    refcous="true"
+                                    clearable
                                     ></el-input>
                                 </el-form-item>
                                 <span v-else>{{scope.row.planWeight}}</span>
@@ -834,7 +855,55 @@
         :loading="loading"
         >保 存</el-button>
     </span>
-        </el-dialog>
+        </el-dialog>
+    <el-dialog
+       title="炼钢轮次描述-修改"
+       :visible.sync="dialog.editorBox3.show"
+       width="400px"
+       :close-on-click-modal="false"
+       :show-close="!loading">
+         <div>
+        <el-form
+         :model="dialog.editorBox3.form.data"
+         ref="dialog_form3"
+         size="mini"
+         label-width="300px"
+         >
+         <el-row>
+             <el-col>
+                 <el-col :span="20">
+                  <el-form-item
+                    label="轮次描述"
+                    prop="describe"
+                    label-width="100px"
+                    :rules="dialog.editorBox3.form.rules.describe"
+                    >
+                    <el-input clearable
+                        style="width: 100%;"
+                        v-model="dialog.editorBox3.form.data.describe"
+                        refcous="true"
+                    ></el-input>
+                </el-form-item>
+            </el-col>
+             </el-col>
+         </el-row>
+         </el-form>
+         </div>
+         <span
+        slot="footer"
+        class="dialog-footer"
+            >
+        <el-button
+        :loading="loading"
+        @click="dialog.editorBox3.show = false"
+        >取 消</el-button>
+        <el-button
+        type="primary"
+        @click="but_copy"
+        :loading="loading"
+        >保 存</el-button>
+    </span>
+     </el-dialog>
      <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
     </div>
 </template>
@@ -888,8 +957,13 @@ export default {
                     parentid: '',
                     purpose: '',
                     sqno: '',
-                    show: false
+                    show: false,
+                    options: ''
                 }
+            },
+            options: {
+                obj: {'2': {id: '2', name: '已下发'}, '3': {id: '3', name: '已接收'}},
+                arr: [{id: '2', name: '已下发'}, {id: '3', name: '已接收'}]
             },
              rules: {
                 },
@@ -900,7 +974,8 @@ export default {
             pageSize1: 100,
             total1: 0,
             singleTableHeight: 100,
-            leftTableData: [],
+            leftTableData: [],
+            leftTableDataObj: {},
             leftTableLoading: false,
             leftTableWidth: 550,
             difference: 0,
@@ -1074,6 +1149,10 @@ export default {
                             name: '应急'
                         }
                     ]
+                },
+                ExecutiveStandard: {
+                    obj: {},
+                    arr: []
                 }
             },
             loading: false,
@@ -1142,6 +1221,18 @@ export default {
                             ]
                         }
                     }
+                },
+                editorBox3: {
+                    show: false,
+                    type: '',
+                    form: {
+                        data: {
+                            describe: ''
+                        },
+                        rules: {
+                            describe: [{ required: true, message: '该项不能为空', trigger: 'change' }]
+                        }
+                    }
                 }
             }
         }
@@ -1176,15 +1267,16 @@ export default {
                 that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
             }, 1);
         });
-        that.getTimeGranData();
-        that.getEnergyIdData();
-        that.getPropertyIdData();
+        // that.getTimeGranData();
+        // that.getEnergyIdData();
+        // that.getPropertyIdData();
         that.getGrades();
         that.getStandards();
-        that.getUnitIdData();
+        // that.getUnitIdData();
         that.getiateralArea();
         that.getdimension();
-        that.getlengthTimesWidth();
+        that.getlengthTimesWidth();
+        that.getExecutiveStandard();
     },
     methods: {
         //  计算树区域高度
@@ -1292,7 +1384,6 @@ export default {
                         }
                         that.nameObj.dimension.arr = arr;
                         that.nameObj.dimension.obj = obj;
-                        console.log(that.nameObj.dimension);
                     } else {
                         that.$message.error(res.message);
                     }
@@ -1378,7 +1469,8 @@ export default {
                    endTime: that.filterForm.data.clock[1],
                    id: that.filterForm.data.Gmid,
                    grades: that.filterForm.data.grades.join(','),
-                   specifications: that.filterForm.data.specifications.join(',')
+                   specifications: that.filterForm.data.specifications.join(','),
+                   state: that.filterForm.data.options
                 };
             that.pageNum1 = pageNum1 || that.pageNum1;
             that.leftTableLoading = true;
@@ -1388,7 +1480,8 @@ export default {
             })
                 .then(function (res) {
                     if (res.code === '0') {
-                        let arr = [];
+                        let arr = [];
+                        let obj = {};
                         for (let i = 0; i < res.data.list.length; i++) {
                              let item = res.data.list[i];
                             arr.push({
@@ -1418,9 +1511,37 @@ export default {
                                 kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
                                 yxf_weight: item.YXF_WEIGHT,
                                 tag: item.TAG ? item.TAG : '0'
-                            })
+                            });
+                            obj[item.ID] = {seq: i,
+                                id: item.ID,
+                                jhTime: item.JHTIME,
+                                state: item.STATE,
+                                grades: item.GRADES,
+                                specifications: item.SPECIFICATIONS,
+                                lengths: item.LENGTHS,
+                                chemicalStandard: item.CHEMICALSTANDARD,
+                                surfaceStandard: item.SURFACESTANDARD,
+                                workprocType: item.WORKPROCTYPE,
+                                iateralarea: item.IATERALAREA,
+                                lengthtimeswidth: item.LENGTHTIMESWIDTH,
+                                transportType: item.TRANSPORTTYPE,
+                                receivetime: item.RECEIVETIME,
+                                createman: item.CREATEMAN,
+                                createtime: item.CREATETIME,
+                                updateman: item.UPDATEMAN,
+                                purpose: item.PURPOSE,
+                                updatetime: item.UPDATETIME,
+                                memo: item.MEMO,
+                                planweight: item.PLANWEIGHT,
+                                deliveryDate: item.DELIVERYDATE,
+                                dimension: item.DIMENSION,
+                                kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
+                                yxf_weight: item.YXF_WEIGHT,
+                                tag: item.TAG ? item.TAG : '0'
+                                };
                         }
-                        that.leftTableData = arr;
+                        that.leftTableData = arr;
+                        that.leftTableDataObj = obj;
                         that.total1 = res.data.total;
                         that.dialog.fRow = null;
                     } else {
@@ -1431,10 +1552,10 @@ export default {
                     that.leftTableLoading = false;
                 });
         },
-        //切换查询方法
-        chageMethod(){
+        // 切换查询方法
+        chageMethod () {
             let that = this;
-            if (that.leftTableShow == true){
+            if (that.leftTableShow === true) {
                that.getTableDetailDatas(that.pageNum);
             } else {
                that.getTableDetailAsRadio(that.pageNum)
@@ -1566,8 +1687,8 @@ export default {
                     that.tableLoading = false;
             });
         },
-        //展开自动查询
-        getTableDetailAsRadio(pageNum){
+        // 展开自动查询
+        getTableDetailAsRadio (pageNum) {
             let that = this;
             let ids = [];
             that.leftTableData.forEach((element) => {
@@ -1575,12 +1696,14 @@ export default {
             });
            that.pageNum = pageNum || that.pageNum;
            let url = 'pass/ems/v1/emsprodplanrounds/getTableDetailAsRadio/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
+           // state 是不等于
            that.axios.get(url, {
                params: {
-                   id: ids.join(',')
+                   id: ids.join(','),
+                   state: 2
                }
            }).then(function (res) {
-               if (res.code == '0') {
+               if (res.code === '0') {
                            let arr = [];
             for (let i = 0; i < res.data.list.length; i++) {
                 let item = res.data.list[i];
@@ -1705,7 +1828,20 @@ export default {
                         obj[key] = item[key];
                     }
                     item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
-                    rightTableObj[xId] = obj;
+                    rightTableObj[xId] = obj;
+                    try {
+                      if (item.grades != null && item.grades !== '') {
+                        if (item.surfaceStandard === '' || item.surfaceStandard === null) {
+                          rightTableObj[xId].surfaceStandard = that.nameObj.ExecutiveStandard.obj[item.grades].surface;
+                        }
+                        if (item.chemicalStandard === '' || item.chemicalStandard === null) {
+                          rightTableObj[xId].chemicalStandard = that.nameObj.ExecutiveStandard.obj[item.grades].factory;
+                        }
+                      }
+                    } catch (e) {
+                      rightTableObj[xId].chemicalStandard = '';
+                      console.log('没有对应')
+                    }
                 }
                 item.isSelection = true;
             }
@@ -1874,9 +2010,10 @@ export default {
         issue () {
             let that = this;
             if (that.multipleSelection.length > 0) {
-            that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
+            that.$refs['dialog_form_arr_2'].validate(async (valid, obj) => {
             if (valid) {
-                let SubmitData = [];
+                let SubmitData = [];
+                let messageRoundid = '';
                 for (let key in that.rightTableObj) {
                    SubmitData.push({
                         parentid: that.rightTableObj[key].parentid,
@@ -1904,27 +2041,56 @@ export default {
                         dimension: that.rightTableObj[key].dimension,
                         iateralArea: that.rightTableObj[key].iateralArea,
                         lengths: that.rightTableObj[key].lengths
-                   });
+                   });
+                   try {
+                     if (that.rightTableObj[key].planWeight > that.leftTableDataObj[that.rightTableObj[key].parentid].kxf_weight) {
+                       messageRoundid += that.rightTableObj[key].roundid + ',';
+                     }
+                   } catch (e) {
+                     console.log(that.rightTableObj[key].parentid + '判断错误')
+                   }
+                }
+                that.loading = true;
+                let down = false;
+                if (messageRoundid !== '') {
+                  await that.$confirm('计划编号' + messageRoundid + '本次下发量已超出订单可下发量,是否继续下发?', '提示', {
+                      confirmButtonText: '确定',
+                      cancelButtonText: '取消',
+                      type: 'warning'
+                    }).then(() => {
+                      down = true;
+                    }).catch(() => {
+                      down = false;
+
+                      that.$message({
+                        type: 'info',
+                        message: '已取消下发'
+                      });
+                      that.loading = false;
+                    });
+                } else {
+                  down = true;
+                }
+                if (down) {
+                 await 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.chageMethod();
+                    } else {
+                      that.$message.error(res.message);
+                    }
+                    that.loading = false;
+                  }).catch(function () {
+                  that.loading = false;
+                  });
                 }
-                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.chageMethod();
-                } else {
-                that.$message.error(res.message);
-            }
-                that.loading = false;
-                }).catch(function () {
-                 that.loading = false;
-                });
             }
           });
              } else {
@@ -2150,8 +2316,8 @@ export default {
       but_add (type) {
           let that = this;
               let SubmitData = [];
-              if(that.multipleSelectionAscLeft.length >0 ) {
-                  for(let key in that.tableFormDataObj) {
+              if (that.multipleSelectionAscLeft.length > 0) {
+                  for (let key in that.tableFormDataObj) {
                   SubmitData.push({
                         parentid: that.tableFormDataObj[key].id,
                         may: that.tableFormDataObj[key].jhTime,
@@ -2240,16 +2406,16 @@ export default {
                     });
             }
         },
-         radioChange(){
+         radioChange () {
             let that = this;
             let leftwith = 0;
             let rightwith = 550;
-            if(that.radio == 0){
+            if (that.radio === 0) {
                 that.leftTableWidth = leftwith;
                 that.leftTableShow = false;
                 that.getTableDetailAsRadio(1);
             }
-            if(that.radio == 1){
+            if (that.radio === 1) {
                 that.leftTableWidth = rightwith;
                 that.leftTableShow = true;
                 that.rightTableData = [];
@@ -2278,7 +2444,6 @@ export default {
                 this.$nextTick(() => {
                     $(id).click();
                 });
-                console.log('下键')
             } else if (event.keyCode === 38) { // 键盘上键
                 let index = parseInt(this.rowIndex);
                 if (index !== this.seqArr[0]) {
@@ -2289,18 +2454,15 @@ export default {
                         }
                     }
                 }
-                console.log('上键')
                 this.editSetFlag = index + this.columnId;
                 let id = '#' + this.editSetFlag;
                 this.$nextTick(() => {
                     $(id).click();
                 });
             } else if (event.keyCode === 37) { // 键盘左键
-                console.log('左键')
                 $(tdTarget).prevAll().find('input:text').last().click();
             } else if (event.keyCode === 39) { // 键盘右键
                 $(tdTarget).nextAll().find('input').eq(0).click();
-                console.log('右键')
             }
         },
         cellClick (row, column, cell, event) {
@@ -2324,6 +2486,75 @@ export default {
         openDetails (row) {
           let that = this;
           that.leftData = row;
+        },
+        getExecutiveStandard () {
+          let that = this;
+          let url = 'pass/ems/v1/emsproductsexecutivestandards/?pageNum=1&pageSize=999';
+          that.axios.get(url)
+          .then(function (res) {
+              if (res.code === '0') {
+                  let arr = [];
+                  let obj = {};
+                  for (let item of res.data.list) {
+                      arr.push({
+                          brand: item.brand,
+                          factory: item.factoryStandard,
+                          surface: item.surfaceStandard
+                      });
+                      obj[item.brand] = {
+                          brand: item.brand,
+                          factory: item.factoryStandard,
+                          surface: item.surfaceStandard
+                      };
+                  }
+                  that.nameObj.ExecutiveStandard.arr = arr;
+                  that.nameObj.ExecutiveStandard.obj = obj;
+              } else {
+                  that.$message.error(res.message);
+              }
+          });
+        },
+        gradesChange (data, scope) {
+          let that = this;
+          let obj = that.rightTableObj[scope.row.seq];
+          // 化学成分执行标准 / 出厂执行标准
+          let factory = obj.chemicalStandard;
+          // 表面执行标准
+          let surface = obj.surfaceStandard;
+          // if(factory === '' || factory === null)
+          // {
+          try {
+            obj.chemicalStandard = that.nameObj.ExecutiveStandard.obj[data].factory;
+            // }
+            // if(surface === '' || surface === null) {
+              obj.surfaceStandard = that.nameObj.ExecutiveStandard.obj[data].surface;
+            // }
+          } catch (e) {
+            obj.chemicalStandard = '';
+            console.log('没有对应');
+          }
+        },
+        but_update () {
+              let that = this;
+              if (that.multipleSelection.length > 0) {
+                  setTimeout(() => {
+                      that.$refs['dialog_form3'].clearValidate();
+                  }, 100);
+                  that.dialog.editorBox3.show = true;
+              } else {
+                  this.$message.error('至少要选择一条数据');
+              }
+        },
+        but_copy () {
+          let that = this;
+          that.$refs['dialog_form3'].validate((valid) => {
+          if (valid) {
+          for (let key in that.rightTableObj) {
+            that.rightTableObj[key].describe = that.dialog.editorBox3.form.data.describe;
+          }
+            that.dialog.editorBox3.show = false;
+          }
+          });
         }
     }
 }
@@ -2383,6 +2614,9 @@ function sortNumber (a, b) {
         thead .el-table-column--selection .cell {
             display: none;
         }
+    }
+    td .el-form-item__error {
+      position: static;
     }
 }
 </style>