1.生产管理完成部分功能2.自定义页面打印、二维码图形、水印显示实现了一个demo
已添加3个文件
已修改8个文件
1444 ■■■■ 文件已修改
package.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/icons/svg/report_work.svg 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/icons/svg/start_time.svg 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/TagsView/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/watermark.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gd.vue 415 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gdpg.vue 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/scdd.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/sckbg.vue 653 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/template.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -26,7 +26,11 @@
    "nprogress": "0.2.0",
    "path-to-regexp": "2.4.0",
    "postcss-px2rem": "^0.3.0",
    "qrcode": "^1.5.0",
    "qrcodejs2": "0.0.2",
    "vue": "2.6.10",
    "vue-easy-print": "0.0.8",
    "vue-print-nb": "^1.7.5",
    "vue-router": "3.0.6",
    "vuex": "3.1.0"
  },
src/icons/svg/report_work.svg
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1657000819014" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3263" xmlns:xlink="http://www.w3.org/1999/xlink" width="42" height="42"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M864 426.64a381.71 381.71 0 0 0-320-232l-0.09-66h159a32 32 0 1 0 0-64H319.57a32 32 0 1 0 0 64h160.32l0.09 66A382.12 382.12 0 0 0 363.3 927.3 382.19 382.19 0 0 0 864 426.64z m-352 466.7c-175.35 0-318-142.65-318-318s142.65-318 318-318 318 142.66 318 318-142.65 318-318 318z" p-id="3264"></path><path d="M635 409.17L534.66 509.94a70 70 0 1 0 44.22 46.29l101.51-101.9A32 32 0 1 0 635 409.17z" p-id="3265"></path></svg>
src/icons/svg/start_time.svg
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1657000626353" class="icon" viewBox="0 0 1280 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2623" width="52.5" height="42" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M288.191 694.923c-9.489 0-18.978-5.271-23.722-14.761-8.962-18.45-16.869-37.955-23.195-57.46-4.745-13.706 3.163-28.466 16.869-33.211 13.706-4.745 28.466 3.163 33.211 16.869 5.798 16.869 12.652 34.266 20.559 50.08 6.326 13.179 1.054 28.993-11.598 35.319-4.218 2.109-8.434 3.163-12.125 3.163z" fill="#42b983" p-id="2624"></path><path d="M641.913 914.22c-59.041 0-116.501-12.125-170.271-35.846-51.661-23.195-98.051-55.351-137.06-96.996-10.016-10.543-9.489-27.412 1.054-37.428 10.543-10.016 27.412-9.489 37.428 1.054 34.266 36.373 74.329 64.841 119.664 84.873 46.917 21.086 96.996 31.63 148.658 31.63 98.578 0 190.83-38.482 260.942-108.067 69.585-69.585 108.067-162.364 108.067-260.942s-38.482-190.83-108.067-260.942c-69.585-69.057-162.364-107.54-260.415-107.54-98.578 0-190.83 38.482-260.942 108.067-69.585 69.585-108.067 162.364-108.067 260.942 0 14.761-11.598 26.357-26.357 26.357-14.761 0-26.357-11.598-26.357-26.357 0-56.933 11.07-112.284 33.211-163.946 21.086-50.08 51.661-95.415 90.144-133.898s83.818-69.057 133.898-90.144c52.189-22.141 107.012-33.211 163.946-33.211 56.933 0 112.284 11.07 163.946 33.211 50.08 21.086 95.415 51.661 133.898 90.144 38.482 38.482 69.057 83.818 90.144 133.898 22.141 52.189 33.211 107.012 33.211 163.946 0 56.933-11.07 112.284-33.211 163.946-21.086 50.08-51.661 95.415-90.144 133.898-38.482 38.482-83.818 69.057-133.898 90.144-51.661 22.141-106.485 33.211-163.419 33.211z" fill="#42b983" p-id="2625"></path><path d="M521.194 700.194c-4.745 0-8.962-1.054-13.179-3.69-7.907-4.745-13.179-13.179-13.179-22.668V311.68c0-9.489 5.271-17.923 13.179-22.668 8.434-4.745 18.45-4.745 26.357 0L848.03 470.354c7.907 4.745 13.179 13.179 13.179 22.668s-5.271 17.923-13.179 22.668L534.372 697.032c-3.69 2.109-8.434 3.163-13.179 3.163z" fill="#42b983" p-id="2626"></path></svg>
src/layout/components/TagsView/index.vue
@@ -16,12 +16,12 @@
        <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
      </router-link>
    </scroll-pane>
    <!--    <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">-->
    <!--      <li @click="refreshSelectedTag(selectedTag)">刷新</li>-->
    <!--      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li>-->
    <!--      <li @click="closeOthersTags">关闭其他</li>-->
    <!--      <li @click="closeAllTags(selectedTag)">关闭所有</li>-->
    <!--    </ul>-->
    <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
      <li @click="refreshSelectedTag(selectedTag)">刷新</li>
      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li>
      <li @click="closeOthersTags">关闭其他</li>
      <li @click="closeAllTags(selectedTag)">关闭所有</li>
    </ul>
  </div>
</template>
src/main.js
@@ -48,6 +48,14 @@
import '../public/static/theme/index.css' /* icofont */
// æ‰“印
import Print from 'vue-print-nb'
Vue.use(Print)
// æ°´å°
import watermark from './utils/watermark.js'
Vue.prototype.$watermark = watermark
new Vue({
  el: '#app',
  router,
src/utils/watermark.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
const watermark = {}
const setWatermark = (text, sourceBody) => {
  const id = Math.random() * 10000 + '-' + Math.random() * 10000 + '/' + Math.random() * 10000
  if (document.getElementById(id) !== null) {
    document.body.removeChild(document.getElementById(id))
  }
  const can = document.createElement('canvas')
  can.width = 100
  can.height = 100
  const cans = can.getContext('2d')
  // cans.rotate(0 * Math.PI / 180)
  // cans.rotate(-20 * Math.PI / 180)
  cans.font = '16px Vedana'
  can.fontWeight = 'bolder'
  cans.fillStyle = 'rgba(0, 0, 0, .5)'
  cans.textAlign = 'left'
  cans.textBaseline = 'Middle'
  cans.fillText(text, can.width / 6, can.height / 2)
  // cans.fillText(text, can.width/20, can.height)
  const water_div = document.createElement('div')
  water_div.id = id
  water_div.style.pointerEvents = 'none'
  // water_div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat'
  water_div.style.background = 'url(' + can.toDataURL('image/png') + ') repeat'
  if (sourceBody) {
    water_div.style.width = '100%'
    water_div.style.height = '100%'
    sourceBody.appendChild(water_div)
  } else {
    // water_div.style.top = '3px'
    // water_div.style.left = '0px'
    water_div.style.position = 'fixed'
    water_div.style.zIndex = '100000'
    water_div.style.width = document.documentElement.clientWidth + 'px'
    water_div.style.height = document.documentElement.clientHeight + 'px'
    document.body.appendChild(water_div)
  }
  return id
}
/**
 *  è¯¥æ–¹æ³•只允许调用一次
 *  @param:
 *  @text == æ°´å°å†…容
 *  @sourceBody == æ°´å°æ·»åŠ åœ¨å“ªé‡Œï¼Œä¸ä¼ å°±æ˜¯body
 * */
watermark.set = (text, sourceBody) => {
  let id = setWatermark(text, sourceBody)
  setInterval(() => {
    if (document.getElementById(id) === null) {
      id = setWatermark(text, sourceBody)
    }
  }, 2000)
  // window.onresize = () => {//防止水印重复添加
  //   setWatermark(text, sourceBody)
  // }
}
export default watermark
src/views/scgl/gd.vue
@@ -50,6 +50,7 @@
              <el-date-picker
                v-model="form.paydate"
                type="date"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 200px"
                placeholder="选择日期"
              />
@@ -61,6 +62,7 @@
              <el-date-picker
                v-model="form.createdate"
                type="date"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 200px"
                placeholder="选择日期"
              />
@@ -74,18 +76,13 @@
      </div>
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
        >同步ERP
        </el-button>
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button type="primary" icon="el-icon-connection" @click="send('send')">派发</el-button>
        <el-button
          type="primary"
          icon="el-icon-switch-button"
        >订单关闭
        </el-button>
        <!--        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <el-divider />
      <div class="elTableDiv">
@@ -107,12 +104,12 @@
          <el-table-column
            width="50"
          >
            <template scope="scope">
            <template slot-scope="{row}">
              <el-radio
                v-model="radioSelected"
                :label="scope.$index"
                :label="row.wo_code"
                style="color: #fff;padding-left: 10px; margin-right: -25px;"
                @change.native="getCurrentRow(scope.row)"
                @change.native="getCurrentRow(row.wo_code)"
              />
            </template>
          </el-table-column>
@@ -129,23 +126,28 @@
          >
            <template slot-scope="{row}">
              <div v-if="row.status==='NEW'">新工单</div>
              <div v-if="row.status==='ALLOC'">已派发</div>
              <div v-if="row.status==='START'">开工</div>
              <div v-if="row.status==='CLOSED'">完工</div>
              <div v-if="row.status==='CREATING'">执行中</div>
              <div v-if="row.status==='CREATED'">已关闭</div>
              <!--              <div v-if="row.status==='ALLOC'">已派发</div>-->
              <!--              <div v-if="row.status==='START'">开工</div>-->
              <!--              <div v-if="row.status==='CLOSED'">完工</div>-->
            </template>
          </el-table-column>
          <el-table-column
            prop="wo_code"
            label="工单编号"
            sortable="custom"
            width="160"
          />
          <el-table-column
            prop="partcode"
            label="产品编码"
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="partname"
            min-width="150"
            label="产品名称"
            sortable="custom"
          />
@@ -157,46 +159,61 @@
          />
          <el-table-column
            prop="plan_qty"
            label="工数量"
            label="工单数"
            sortable="custom"
          />
          <el-table-column
            prop="plan_qty"
            label="生产车间"
            sortable="custom"
            width="100"
          />
          <el-table-column
            prop="wkshp_name"
            label="工艺路线"
            label="生产车间"
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="route_name"
            label="生产车间"
            label="工艺路线"
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="paydate"
            label="要求交付时间"
            prop="plan_startdate"
            label="计划开始时间"
            sortable="custom"
            width="160"
          />
          <el-table-column
            prop="plan_enddate"
            label="计划结束时间"
            sortable="custom"
            width="160"
          />
          <el-table-column
            prop="piroque"
            label="工单等级"
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="createuser"
            label="创建人员"
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="createdate"
            label="创建时间"
            width="160"
            sortable="custom"
          />
          <el-table-column
            label="操作"
            width="120"
            fixed="right"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                <!--                <el-button type="text" @click="del(row)">删除</el-button>-->
                <el-button type="text" @click="check(row)">工序任务</el-button>
                <el-button v-if="row.status==='NEW'" type="text" @click="del(row)">删除</el-button>
              </div>
            </template>
          </el-table-column>
@@ -216,61 +233,139 @@
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'编辑'"
      :title="operation==='add'?'新增':'派发'"
      :visible.sync="dialogVisible"
      width="50%"
      width="60%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="订单状态" prop="OrgCode">
        <el-form-item
          label="订单状态"
          prop="mesorderstus"
        >
          <el-select
            v-model="form.partcode"
            disabled
            v-model="dialogForm.mesorderstus"
            :disabled="operation!=='add'"
            :popper-append-to-body="false"
            style="width: 220px"
            style="width: 200px"
            placeholder="请选择"
          >
            <el-option
              v-for="item in OrgTypeArr"
              v-for="item in erporderstusArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="订单编号" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" disabled style="width: 220px" />
        <el-form-item
          v-if="operation==='add'"
          label="产品信息"
          prop="partcode"
        >
          <el-select
            v-model="dialogForm.partcode"
            :disabled="operation!=='add'"
            :popper-append-to-body="false"
            style="width: 200px"
            placeholder="请选择"
            @change="partcodeChange"
          >
            <el-option
              v-for="item in partArr"
              :key="item.partcode"
              :label="item.partname"
              :value="item.partcode"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="产品编码" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" />
        <el-form-item label="工单编号" prop="mesordercode">
          <el-input v-model="dialogForm.mesordercode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="产品名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" />
        <el-form-item v-if="operation!=='add'" label="产品编码" prop="partcode">
          <el-input v-model="dialogForm.partcode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="订单数量" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" />
        <el-form-item v-if="operation!=='add'" label="产品名称" prop="partname">
          <el-input v-model="dialogForm.partname" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="产品规格" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" disabled style="width: 220px" />
        <el-form-item label="工单数量" prop="mesqty">
          <el-input
            v-model="dialogForm.mesqty"
            oninput="value=value.replace(/[^0-9.]/g,'')"
            :disabled="operation!=='add'"
            style="width: 200px"
          />
        </el-form-item>
        <el-form-item label="下达数量" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 220px" />
        <el-form-item v-if="operation!=='add'" label="产品规格" prop="partspec">
          <el-input v-model="dialogForm.partspec" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="下单数量" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 220px" />
        <el-form-item label="生产车间" prop="wkshopcode">
          <el-select
            v-model="dialogForm.wkshopcode"
            :popper-append-to-body="false"
            style="width: 200px"
            placeholder="请选择"
          >
            <el-option
              v-for="item in wkshopArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="交付时间" prop="OrgName">
        <el-form-item label="工艺路线" prop="routecode">
          <el-select
            v-model="dialogForm.routecode"
            :disabled="dialogForm.partcode===''"
            :popper-append-to-body="false"
            style="width: 200px"
            placeholder="请选择"
          >
            <el-option
              v-for="item in routeArr"
              :key="item.route_code"
              :label="item.route_name"
              :value="item.route_code"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="开始时间" prop="planstartdate">
          <el-date-picker
            v-model="dialogForm.OrgName"
            v-model="dialogForm.planstartdate"
            type="date"
            style="width: 220px"
            value-format="yyyy-MM-dd HH:mm:ss"
            style="width: 200px"
            placeholder="选择日期"
          />
          <!--          <el-input v-model="dialogForm.OrgName" style="width: 220px" />-->
        </el-form-item>
        <el-form-item label="结束时间" prop="planenddate">
          <el-date-picker
            v-model="dialogForm.planenddate"
            type="date"
            value-format="yyyy-MM-dd HH:mm:ss"
            style="width: 200px"
            placeholder="选择日期"
          />
        </el-form-item>
        <el-form-item label="工单等级" prop="orderlev">
          <el-select
            v-model="dialogForm.orderlev"
            :popper-append-to-body="false"
            style="width: 200px"
            placeholder="请选择"
          >
            <el-option
              v-for="item in orderlevArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
@@ -284,9 +379,9 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { ErpOrderSearch, MesOrderSearch } from '@/api/scgl'
import { DeleteMesOrder, MesOrderSearch } from '@/api/scgl'
import { WorkShopSelect } from '@/api/sbgl'
import { PartSelect, PartSelectRpute } from '@/api/zzmx'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -324,30 +419,71 @@
      },
      erporderstusArr: [
        { code: 'NEW', name: '新工单' },
        { code: 'ALLOC', name: '已派发' },
        { code: 'START', name: '开工' },
        { code: 'CLOSED', name: '完工' }
        { code: 'CREATING', name: '执行中' },
        { code: 'CREATED', name: '已关闭' }
        // { code: 'ALLOC', name: '已派发' },
        // { code: 'START', name: '开工' },
        // { code: 'CLOSED', name: '完工' }
      ],
      total: 10,
      radioSelected: '',
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// ä¸Šçº§å•位
        partname: '', // äº§å“åç§°
        partspec: '', // äº§å“è§„æ ¼
        wkshopname: '', // ç”Ÿäº§è½¦é—´åç§°
        routename: '', // å·¥è‰ºè·¯çº¿åç§°
        mesorderstus: '', // å·¥å•状态码
        mesordercode: '', // å·¥å•编号
        partcode: '', // äº§å“ç¼–码
        mesqty: '', // å·¥å•数量
        routecode: '', // å·¥è‰ºè·¯çº¿ç¼–码
        wkshopcode: '', // ç”Ÿäº§è½¦é—´ç¼–码
        planstartdate: '', // è®¡åˆ’开始时间
        planenddate: '', // è®¡åˆ’完成时间
        orderlev: '', // å·¥å•等级
        OperType: '' // æ“ä½œç±»åž‹
      },
      partArr: [], // äº§å“ä¿¡æ¯
      wkshopArr: [], // ç”Ÿäº§è½¦é—´æ•°ç»„
      routeArr: [], // å·¥è‰ºè·¯çº¿æ•°ç»„
      orderlevArr: [
        { code: '101', name: '一般' },
        { code: '102', name: '重要' },
        { code: '103', name: '特级' }
      ], // å·¥å•等级数组
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        mesorderstus: [
          { required: true, message: '请选择订单状态', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
        partcode: [
          { required: true, message: '请选择产品信息', trigger: ['blur', 'change'] }
        ],
        mesordercode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        OrgName: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        mesqty: [
          { required: true, message: '请输入工单数量', trigger: ['blur', 'change'] }
        ],
        wkshopcode: [
          { required: true, message: '请选择生产车间', trigger: ['blur', 'change'] }
        ],
        routecode: [
          { required: true, message: '请选择工艺路线', trigger: ['blur', 'change'] }
        ],
        planstartdate: [
          { required: true, message: '请选择开始时间', trigger: ['blur', 'change'] }
        ],
        planenddate: [
          { required: true, message: '请选择结束时间', trigger: ['blur', 'change'] }
        ],
        orderlev: [
          { required: true, message: '请选择工单等级', trigger: ['blur', 'change'] }
        ]
      }
@@ -356,6 +492,7 @@
  },
  created() {
    this.getMesOrderSearch()
    this.getSelect()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
@@ -366,6 +503,15 @@
      const res = await MesOrderSearch(this.form)
      this.tableData = res.data
      this.total = res.count
    },
    async  getSelect() {
      // èŽ·å–äº§å“ä¿¡æ¯
      const { data: res1 } = await PartSelect()
      this.partArr = res1
      // èŽ·å–ç”Ÿäº§è½¦é—´æ•°ç»„
      const { data: res2 } = await WorkShopSelect()
      this.wkshopArr = res2
    },
    // æŽ’序改变时
    sortChange({ column, prop, order }) {
@@ -384,11 +530,9 @@
    search() {
      this.getMesOrderSearch()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
    reset(val) {
      this.form.erporderstus = ''
      this.form.erpordercode = ''
      this.form.partcode = ''
@@ -400,49 +544,99 @@
      this.getMesOrderSearch()
    },
    // å•选框选中获取当前行信息
    getCurrentRow(row) {
      console.log(row, 1)
      this.radioSelected = row
    getCurrentRow(wo_code) {
      this.radioSelected = wo_code
    },
    // æ–°å¢žæŒ‰é’®
    add(operation) {
    async add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // ä¿®æ”¹æŒ‰é’®
    edit(operation, row) {
    // äº§å“ä¿¡æ¯å€¼æ”¹å˜
    async partcodeChange(val) {
      const { data: res } = await PartSelectRpute({ partcode: val })
      this.routeArr = res
      this.dialogForm.routecode = ''
    },
    // å·¥åºä»»åŠ¡
    check() {
    },
    // æ´¾å‘
    send(operation) {
      if (this.radioSelected.length < 1) {
        return this.$message.info('请先选择工单!')
      }
      const row = this.tableData.find(item => item.wo_code === this.radioSelected)
      if (row.status !== 'NEW') {
        return this.$message.info('此工单为非未开始状态,不可派发!')
      }
      this.operation = operation
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
        this.dialogForm.mesorderstus = row.status
        this.dialogForm.mesordercode = row.wo_code
        this.dialogForm.partcode = row.partcode
        this.partcodeChange(row.partcode)
        this.dialogForm.partname = row.partname
        this.dialogForm.mesqty = row.plan_qty
        this.dialogForm.partspec = row.partspec
        this.dialogForm.routecode = row.route_code// å·¥è‰ºè·¯çº¿ä»£ç 
        this.dialogForm.wkshopcode = row.wkshp_code// ç”Ÿäº§è½¦é—´ä»£ç 
        // handleDatatime(row.plan_startdate.toString().length > 0)
        this.dialogForm.planstartdate = row.plan_startdate
        this.dialogForm.planenddate = row.plan_enddate
        this.dialogForm.orderlev = row.piroque // ç­‰çº§
      })
    },
    // åˆ é™¤æŒ‰é’®
    async del(row) {
      // if (row.status !== 'NEW') {
      //   return this.$message.success('')
      // }
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getMesOrderSearch()
          }
        })
        console.log(row, 1)
        const data = {
          wocode: row.wo_code,
          m_po: row.m_po,
          orderqty: row.plan_qty
        }
        console.log(data, 2)
        // DeleteMesOrder(data).then(res => {
        //   if (res.code === '200') {
        //     this.$message.success('删除成功!')
        //     this.getMesOrderSearch()
        //   }
        // })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.dialogForm.partname = '' // äº§å“åç§°
      this.dialogForm.partspec = '' // äº§å“è§„æ ¼
      this.dialogForm.wkshopname = '' // ç”Ÿäº§è½¦é—´åç§°
      this.dialogForm.routename = '' // å·¥è‰ºè·¯çº¿åç§°
      this.dialogForm.mesorderstus = '' // å·¥å•状态码
      this.dialogForm.mesordercode = '' // å·¥å•编号
      this.dialogForm.partcode = '' // äº§å“ç¼–码
      this.dialogForm.mesqty = '' // å·¥å•数量
      this.dialogForm.routecode = '' // å·¥è‰ºè·¯çº¿ç¼–码
      this.dialogForm.wkshopcode = '' // ç”Ÿäº§è½¦é—´ç¼–码
      this.dialogForm.planstartdate = '' // è®¡åˆ’开始时间
      this.dialogForm.planenddate = '' // è®¡åˆ’完成时间
      this.dialogForm.orderlev = '' // å·¥å•等级
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
@@ -454,20 +648,33 @@
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
            partname: this.dialogForm.partname, // äº§å“åç§°
            partspec: this.dialogForm.partspec, // äº§å“è§„æ ¼
            wkshopname: this.dialogForm.wkshopname, // ç”Ÿäº§è½¦é—´åç§°
            routename: this.dialogForm.routename, // å·¥è‰ºè·¯çº¿åç§°
            mesorderstus: this.dialogForm.mesorderstus, // å·¥å•状态码
            mesordercode: this.dialogForm.mesordercode, // å·¥å•编号
            partcode: this.dialogForm.partcode, // äº§å“ç¼–码
            mesqty: this.dialogForm.mesqty, // å·¥å•数量
            routecode: this.dialogForm.routecode, // å·¥è‰ºè·¯çº¿ç¼–码
            wkshopcode: this.dialogForm.wkshopcode, // ç”Ÿäº§è½¦é—´ç¼–码
            planstartdate: this.dialogForm.planstartdate, // è®¡åˆ’开始时间
            planenddate: this.dialogForm.planenddate, // è®¡åˆ’完成时间
            orderlev: this.dialogForm.orderlev, // å·¥å•等级
            OperType: this.operation === 'add' ? 'Add' : 'Update'
          }
          AddUpdateOrganization(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.getMesOrderSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
          console.log(data, 1)
          // AddUpdateMesOrder(data).then(res => {
          //   if (res.code === '200') {
          //     this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
          //     this.dialogVisible = false
          //     this.getMesOrderSearch()
          //   } else {
          //     this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
          //   }
          // })
        }
      })
    },
@@ -646,8 +853,8 @@
  border-color: $main_color;
}
.elTableDiv{
  ::v-deep .el-radio__label{
.elTableDiv {
  ::v-deep .el-radio__label {
    display: none;
  }
}
src/views/scgl/gdpg.vue
@@ -1,11 +1,195 @@
<template />
<template>
  <div>
    <el-button type="primary" @click="clickMe">点击我</el-button>
    <el-dialog
      title="预览"
      :visible.sync="dialogVisible"
      width="70%"
    >
      <!-- è¦æ‰“印的区域 -->
      <div id="printMe">
        <div style="display: flex;justify-content: space-around">
          <!--          äºŒç»´ç éƒ¨åˆ†-->
          <div>
            <div id="qrCode" ref="qrCodeDiv" />
            <!--            <img :src="QRImgUrl">-->
            <div style="font-size: 18px;width: 100px;text-align: center;margin-top: 10px">MO-79601</div>
          </div>
          <!--          å…¬å¸åç§°åŠæ‰“印单类型-->
          <div
            style="height: 100px;display: flex;justify-content:space-between;align-items: center;flex-direction: column;font-weight: bolder"
          >
            <div style="font-size: 26px;">永康新凯迪工业互联有限公司</div>
            <div style="font-size: 22px;">委外派单</div>
          </div>
          <!--右侧水印及姓名日期-->
          <div>
            <div ref="watermark" style="width: 100px;height:100px;" />
            <div style="font-weight: bolder">
              <div>姓名:张三</div>
              <div>日期:2022-07-05</div>
            </div>
          </div>
        </div>
        <el-divider />
        <el-table
          :data="tableData"
          border
          style="width: 100%"
        >
          <el-table-column
            prop="date"
            label="日期"
            width="180"
          />
          <el-table-column
            prop="name"
            label="姓名"
            width="180"
          />
          <el-table-column
            prop="address"
            label="地址"
          />
        </el-table>
      </div>
      <!--      <vue-easy-print ref="printRef" :button-show="true">-->
      <!--        x-->
      <!--      </vue-easy-print>-->
      <!-- æ‰“印的按钮,显示打印预览 -->
      <!--    <el-button v-print="'#printMe'">打印</el-button>-->
      <el-button v-print="printObj">打印</el-button>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="dialogVisible = false">ç¡® å®š</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import vueEasyPrint from 'vue-easy-print'
import QRCode from 'qrcodejs2'
// import QRCode from 'qrcode'
export default {
  name: 'Gdpg'
  name: 'Gdpg',
  components: {
    vueEasyPrint
  },
  data() {
    return {
      firstWatermark: true, // ç¬¬ä¸€æ¬¡æ˜¾ç¤ºæ°´å°
      firstbindQRCode: true, // ç¬¬ä¸€æ¬¡æ˜¾ç¤ºäºŒç»´ç 
      form: {
        describle: ''
      },
      QRImgUrl: '',
      QRlink: 'www.xxx.com',
      dialogVisible: false,
      printObj: {
        id: 'printMe',
        popTitle: '打印模板',
        extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>'
        // id: 'printMe',
        // popTitle: '打印', // æ‰“印配置页上方标题
        // extraHead: '', // æœ€ä¸Šæ–¹çš„头部文字,附加在head标签上的额外标签,使用逗号分隔
        // preview: '', // æ˜¯å¦å¯åŠ¨é¢„è§ˆæ¨¡å¼ï¼Œé»˜è®¤æ˜¯false(开启预览模式,可以先预览后打印)
        // previewTitle: '', // æ‰“印预览的标题(开启预览模式后出现),
        // previewPrintBtnLabel: '', // æ‰“印预览的标题的下方按钮文本,点击可进入打印(开启预览模式后出现)
        // zIndex: '', // é¢„览的窗口的z-index,默认是 20002(此值要高一些,这涉及到预览模式是否显示在最上面)
        // previewBeforeOpenCallback() {}, // é¢„览窗口打开之前的callback(开启预览模式调用)
        // previewOpenCallback() {}, // é¢„览窗口打开之后的callback(开启预览模式调用)
        // beforeOpenCallback() {}, // å¼€å¯æ‰“印前的回调事件
        // openCallback() {}, // è°ƒç”¨æ‰“印之后的回调事件
        // closeCallback() {}, // å…³é—­æ‰“印的回调事件(无法确定点击的是确认还是取消)
        // url: '',
        // standard: '',
        // extraCss: ''
      },
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 å¼„'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 å¼„'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 å¼„'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 å¼„'
      }]
    }
  },
  mounted() {
  },
  methods: {
    addWatermark() {
      if (this.firstWatermark) {
        console.log(this.firstWatermark)
        this.$watermark.set('凯迪制造', this.$refs.watermark)
        this.firstWatermark = false
      }
    },
    clickMe() {
      this.dialogVisible = true
      this.$nextTick(() => {
        this.bindQRCode()
        this.addWatermark()
      })
    },
    bindQRCode() {
      if (this.firstbindQRCode) {
        new QRCode(this.$refs.qrCodeDiv, {
          // text: 'Vue实现生成二维码!',
          text: 'Vue实现生成二维码!',
          width: 100,
          height: 100,
          colorDark: '#333333', // äºŒç»´ç é¢œè‰²
          colorLight: '#ffffff', // äºŒç»´ç èƒŒæ™¯è‰²
          correctLevel: QRCode.CorrectLevel.L// å®¹é”™çŽ‡ï¼ŒL/M/H
        })
        this.firstbindQRCode = false
      }
      // const opts = {
      //   errorCorrectionLevel: 'L', // å®¹é”™çº§åˆ«
      //   type: 'image/png', // ç”Ÿæˆçš„二维码类型
      //   quality: 0.3, // äºŒç»´ç è´¨é‡
      //   margin: 5, // äºŒç»´ç ç•™ç™½è¾¹è·
      //   width: 128, // å®½
      //   height: 128, // é«˜
      //   text: 'http://www.baidu.com', // äºŒç»´ç å†…容
      //   color: {
      //     dark: '#666666', // å‰æ™¯è‰²
      //     light: '#fff'// èƒŒæ™¯è‰²
      //   }
      // }
      // // this.QRlink ç”Ÿæˆçš„二维码地址url
      // QRCode.toDataURL(this.QRlink, opts, (err, url) => {
      //   if (err) throw err
      //   // å°†ç”Ÿæˆçš„二维码路径复制给data的QRImgUrl
      //   this.QRImgUrl = url
      // })
    }
  }
}
</script>
<style scoped>
</style>
src/views/scgl/scdd.vue
@@ -31,15 +31,6 @@
            <el-form-item label="产品编码" style=" display: flex;">
              <el-input v-model="form.partcode" style="width: 200px" placeholder="请输入" />
              <!--              <el-select v-model="form.partcode" :popper-append-to-body="false" style="width: 200px" placeholder="请选择">-->
              <!--                <el-option-->
              <!--                  v-for="item in partArr"-->
              <!--                  :key="item.code"-->
              <!--                  :label="item.name"-->
              <!--                  :value="item.code"-->
              <!--                />-->
              <!--              </el-select>-->
            </el-form-item>
            <el-form-item label="产品名称" style=" display: flex;">
              <el-input v-model="form.partname" style="width: 200px" placeholder="请输入" />
@@ -51,6 +42,7 @@
              <el-date-picker
                v-model="form.paydate"
                type="date"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 200px"
                placeholder="选择日期"
              />
@@ -62,6 +54,7 @@
              <el-date-picker
                v-model="form.createdate"
                type="date"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 200px"
                placeholder="选择日期"
              />
@@ -78,7 +71,7 @@
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          @click="reset"
          @click="reset('update')"
        >同步ERP
        </el-button>
        <el-button
@@ -212,8 +205,9 @@
    <el-dialog
      :title="operation==='add'?'新增':'下达'"
      :visible.sync="dialogVisible"
      width="50%"
      width="60%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
@@ -300,10 +294,8 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { ClosedErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/scgl'
import { PartSelect } from '@/api/zzmx'
import { handleDatatime } from '@/utils/global'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -340,7 +332,6 @@
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      // partArr: [],
      erporderstusArr: [
        { code: 'NEW', name: '新订单' },
        { code: 'CREATING', name: '创建中' },
@@ -348,7 +339,6 @@
        { code: 'CLOSED', name: '已关闭' }
      ],
      total: 10,
      // radioSelected: {},
      radioSelected: '',
      tableData: [],
      dialogVisible: false,
@@ -403,13 +393,6 @@
      this.tableData = res.data
      this.total = res.count
    },
    // syncGetErpOrderSearch() {
    //   this.getErpOrderSearch()
    // },
    // async getPartSelect() {
    //   const { data: res } = await PartSelect()
    //   this.partArr = res
    // },
    // æŽ’序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
@@ -428,7 +411,7 @@
      this.getErpOrderSearch()
    },
    // é‡ç½®
    reset() {
    reset(val) {
      this.form.erporderstus = ''
      this.form.erpordercode = ''
      this.form.partcode = ''
@@ -438,6 +421,9 @@
      this.form.creatuser = ''
      this.form.createdate = ''
      this.getErpOrderSearch()
      if (val.length > 0) {
        this.$message.success('ERP已同步!')
      }
    },
    // å•选框选中获取当前行信息
    getCurrentRow(wo) {
@@ -445,29 +431,31 @@
    },
    // è®¢å•关闭
    async  orderClose() {
      console.log(this.radioSelected, 1)
      this.$confirm('是否确认关闭订单?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.tableData.forEach((item, index) => {
          if (this.radioSelected === item.wo) {
            if (item.status !== 'NEW') {
              return this.$message.info('此订单非新订单,无法关闭!')
            }
      if (this.radioSelected.length < 1) {
        return this.$message.info('请先选择订单!')
      }
      this.tableData.find(item => {
        if (item.wo === this.radioSelected) {
          if (item.status !== 'NEW') {
            return this.$message.info('此订单非新订单,无法关闭!')
          } else {
            this.$confirm('是否确认关闭订单?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => {
                if (res.code === '200') {
                  this.$message.success('订单关闭成功!')
                  this.getErpOrderSearch()
                  // this.radioSelected = ''
                }
              })
            }).catch(() => {
              this.$message.info('已取消关闭!')
            })
          }
        })
        ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getErpOrderSearch()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
        }
      })
    },
    // æ–°å¢žæŒ‰é’®
@@ -521,6 +509,13 @@
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      if (this.dialogForm.markqty < 1 || this.dialogForm.markqty > this.dialogForm.erpqty - this.dialogForm.relse_qty) {
        return this.$message.info('下单数量超出可下单数的范围!')
      }
      if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) {
        return this.$message.info('下单单数超出可下单单数的范围!')
      }
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
src/views/scgl/sckbg.vue
@@ -1,11 +1,658 @@
<template />
<template>
  <div>
    <div class="body" style="padding: 0;height: 100%" :style="{height:mainHeight+'px'}">
      <el-tabs type="border-card">
        <el-tab-pane label="生产列表">
          <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between">
            <div style="display: flex;align-items: center">
              <div style="width: 70px">工序码:</div>
              <el-input
                v-model="produceCode"
                oninput="value=value.replace(/[^0-9.]/g,'')"
                name="produceCode"
                style="width: 500px"
              />
            </div>
            <div style="display: flex;padding-right: 10px">
              <el-button><svg-icon icon-class="start_time" style="margin-right: 2px" />开始</el-button>
              <el-button><svg-icon icon-class="report_work" style="margin-right: 2px" />报工</el-button>
            </div>
          </div>
          <el-divider />
          <div class="elTableDiv">
            <el-table
              :data="tableData"
              :height="tableHeight"
              border
              stripe
              :style="{width: 100+'%',height:tableHeight+'px',}"
              highlight-current-row
              :header-cell-style="this.$headerCellStyle"
              :cell-style="this.$cellStyle"
              @sort-change="sortChange"
            >
              <!--          <el-table-column-->
              <!--            type="selection"-->
              <!--            width="50"-->
              <!--          />-->
              <el-table-column
                width="50"
              >
                <template slot-scope="{row}">
                  <!--                  <el-radio-->
                  <!--                    v-model="radioSelected"-->
                  <!--                    :label="row.wo"-->
                  <!--                    style="color: #fff;padding-left: 10px; margin-right: -25px;"-->
                  <!--                    @change.native="getCurrentRow(row.wo)"-->
                  <!--                  />-->
                </template>
              </el-table-column>
              <el-table-column
                prop="RowNum"
                width="50"
                label="序号"
              />
              <el-table-column
                prop="org_code"
                label="状态"
                sortable="custom"
              />
              <el-table-column
                prop="org_name"
                label="工单号"
                sortable="custom"
              />
              <el-table-column
                prop="description"
                label="产品编码"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="产品名称"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="工序"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="工序描述"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="任务数量"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="已报工数量"
                sortable="custom"
              />
              <el-table-column
                prop="lm_user"
                label="不良数量"
                sortable="custom"
              />
              <el-table-column
                prop="lm_date"
                label="计划开工日期"
                sortable="custom"
              />
              <el-table-column
                label="操作"
              >
                <template slot-scope="{row}">
                  <div class="operationClass">
                    <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                    <el-button type="text" @click="del(row)">删除</el-button>
                  </div>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <!--分页-->
          <pagination
            v-show="total>0"
            :total="total"
            :page.sync="form.page"
            :limit.sync="form.rows"
            align="right"
            layout="prev, pager, next,sizes"
            popper-class="select_bottom"
            @pagination="getMesOrderStepSearch"
          />
        </el-tab-pane>
        <el-tab-pane label="外协列表">
          <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between">
            <div style="display: flex;align-items: center">
              <div style="width: 70px">工序码:</div>
              <el-input
                v-model="produceCode"
                oninput="value=value.replace(/[^0-9.]/g,'')"
                name="produceCode"
                style="width: 500px"
              />
            </div>
            <div style="display: flex;padding-right: 10px">
              <el-button><svg-icon icon-class="start_time" style="margin-right: 2px" />发料</el-button>
              <el-button><svg-icon icon-class="report_work" style="margin-right: 2px" />收料</el-button>
            </div>
          </div>
          <el-divider />
          <div class="elTableDiv">
            <el-table
              :data="tableData"
              :height="tableHeight"
              border
              stripe
              :style="{width: 100+'%',height:tableHeight+'px',}"
              highlight-current-row
              :header-cell-style="this.$headerCellStyle"
              :cell-style="this.$cellStyle"
              @sort-change="sortChange"
            >
              <!--          <el-table-column-->
              <!--            type="selection"-->
              <!--            width="50"-->
              <!--          />-->
              <el-table-column
                width="50"
              >
                <template slot-scope="{row}">
                  <!--                  <el-radio-->
                  <!--                    v-model="radioSelected"-->
                  <!--                    :label="row.wo"-->
                  <!--                    style="color: #fff;padding-left: 10px; margin-right: -25px;"-->
                  <!--                    @change.native="getCurrentRow(row.wo)"-->
                  <!--                  />-->
                </template>
              </el-table-column>
              <el-table-column
                prop="RowNum"
                width="50"
                label="序号"
              />
              <el-table-column
                prop="org_code"
                label="状态"
                sortable="custom"
              />
              <el-table-column
                prop="org_name"
                label="工单号"
                sortable="custom"
              />
              <el-table-column
                prop="description"
                label="产品编码"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="产品名称"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="工序"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="工序描述"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="任务数量"
                sortable="custom"
              />
              <el-table-column
                prop="parentorg_name"
                label="已报工数量"
                sortable="custom"
              />
              <el-table-column
                prop="lm_user"
                label="不良数量"
                sortable="custom"
              />
              <el-table-column
                prop="lm_date"
                label="计划开工日期"
                sortable="custom"
              />
              <el-table-column
                label="操作"
              >
                <template slot-scope="{row}">
                  <div class="operationClass">
                    <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                    <el-button type="text" @click="del(row)">删除</el-button>
                  </div>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <!--分页-->
          <pagination
            v-show="total>0"
            :total="total"
            :page.sync="form.page"
            :limit.sync="form.rows"
            align="right"
            layout="prev, pager, next,sizes"
            popper-class="select_bottom"
            @pagination="getMesOrderStepSearch"
          />
        </el-tab-pane>
      </el-tabs>
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="60%"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="组织类型" prop="OrgType" />
        <el-form-item label="组织编码" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="组织名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        </el-form-item>
        <el-form-item prop="SupUnit" label="上级单位">
          <el-select
            v-model="dialogForm.SupUnit"
            style="width: 200px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in SupUnitArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import $ from 'jquery'
import { MesOrderStepSearch } from '@/api/scgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Sckbg'
  name: 'Zzjg',
  components: {
    Pagination
  },
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请输入编码'))
      } else {
        if (SER_HZ.test(value)) {
          return callback(new Error('编码不能为中文'))
        } else {
          callback()
        }
      }
    }
    const validateTypeCode = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请选择上级'))
      } else {
        callback()
      }
    }
    return {
      mainHeight: 0,
      tableHeight: 0,
      produceCode: '', // å·¥åºç 
      form: {
        orderstepqrcode: '', // æ‰«æçš„二维码信息
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      total: 10,
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// ä¸Šçº§å•位
      },
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        OrgName: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ],
        SupUnit: [
          { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
        ]
      }
    }
  },
  created() {
    this.getMesOrderStepSearch()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    this.$nextTick(() => {
      $("input[name='produceCode']").focus()
    })
  },
  methods: {
    async getMesOrderStepSearch() {
      // const res = await MesOrderStepSearch(this.form)
      // this.tableData = res.data
      // this.total = res.count
    },
    // æŽ’序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
        order = 'desc'
      } else if (order === 'ascending') {
        order = 'asc'
      } else {
        order = 'desc'
      }
      this.form.order = order
      this.form.prop = prop
      this.getMesOrderStepSearch()
    },
    getCurrentRow() {
    },
    // æŸ¥è¯¢
    search() {
      this.getMesOrderStepSearch()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.getMesOrderStepSearch()
    },
    // æ–°å¢žæŒ‰é’®
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // ä¿®æ”¹æŒ‰é’®
    edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
      })
    },
    // åˆ é™¤æŒ‰é’®
    async del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getMesOrderStepSearch()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
          }
          AddUpdateOrganization(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.getMesOrderStepSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
      })
    }
  }
}
</script>
<style scoped>
<style lang="scss" scoped>
$main_color: #42b983;
::v-deep .el-button--primary {
  background-color: $main_color !important;
  height: 30px;
  display: flex;
  align-items: center;
  //border: 1px solid $main_color;
  border: none;
  padding: 0 20px;
}
::v-deep .el-button--primary:hover {
  border: none;
}
::v-deep .el-button--info {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: $main_color !important;
}
::v-deep .el-dialog__footer {
  display: flex;
  justify-content: flex-end;
}
.footerButton {
  display: flex;
  justify-content: end;
}
::v-deep .el-button--default {
  background-color: #ffffff !important;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
::v-deep .el-button--default:hover {
  color: #606266;
}
::v-deep .el-dialog__body {
  padding: 20px 100px !important;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  background-color: $main_color;
  border-color: $main_color;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
  color: $main_color !important;
}
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
  border-color: $main_color;
  background-color: $main_color;
}
::v-deep .el-input__inner {
  height: 30px;
  line-height: 30px;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-table .caret-wrapper {
  transform: scale(0.8);
}
::v-deep .cell {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
::v-deep .el-button--text {
  color: $main_color;
  font-size: 14px;
  cursor: pointer;
}
.operationClass {
  height: 23px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-icon-share {
  color: $main_color;
  cursor: pointer;
}
.el-checkbox.is-bordered.is-checked {
  border-color: $main_color;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  border-color: $main_color;
  background: $main_color;
}
::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  border-color: $main_color;
  background: $main_color;
}
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
  color: $main_color !important;
}
::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
  margin: 10px 30px 0px 0;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
  color: $main_color;
}
::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
  margin: 10px 30px 0px 0;
}
.body ::v-deep .el-divider {
  border: 1px solid #eee;
  width: 99%;
  margin: 10px auto;
}
.body ::v-deep .el-form-item {
  margin-bottom: 0;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-select .el-input__inner:focus{
  border-color: $main_color;
}
::v-deep .el-select-dropdown__item.selected{
  color: $main_color;
}
::v-deep .el-checkbox__inner:hover{
  border-color: $main_color;
}
::v-deep .el-textarea__inner:focus{
  border-color: $main_color;
}
</style>
src/views/template.vue
@@ -129,7 +129,7 @@
    <el-dialog
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="50%"
      width="60%"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
@@ -137,15 +137,15 @@
      <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="组织类型" prop="OrgType" />
        <el-form-item label="组织编码" prop="OrgCode">
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 220px" />
          <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="组织名称" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 220px" />
          <el-input v-model="dialogForm.OrgName" style="width: 200px" />
        </el-form-item>
        <el-form-item prop="SupUnit" label="上级单位">
          <el-select
            v-model="dialogForm.SupUnit"
            style="width: 220px"
            style="width: 200px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >