loulijun2021
2022-07-18 f35da7050efeaff1fd442c233008fdc00b10851f
1.优化项目修改bug2.实现缺陷前端页面
已添加10个文件
已修改10个文件
2779 ■■■■ 文件已修改
src/api/all.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/zzmx.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/error_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/sbbbb_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/succ.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/images/ws_icon.png 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ImportPicker/index.vue 438 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/icons/svg/bbgl.svg 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/permission.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bbgl/sczxbb.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/jsqd.vue 399 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/gd.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjy.vue 497 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjybz.vue 624 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjyxm.vue 497 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/wljy.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/zjbz.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/chda.vue 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/all.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
import request from '@/utils/request'
export function DownLoadExcel(params) {
  return request({
    url: 'ImportExcel/DownLoadExcel',
    method: 'GET',
    params: params
  })
}
export function ExcelCheckData(params) {
  return request({
    url: 'ImportExcel/ExcelCheckData',
    method: 'POST',
    data: params
  })
}
export function ExcelImportSubmit(params) {
  return request({
    url: 'ImportExcel/ExcelImportSubmit',
    method: 'POST',
    data: params
  })
}
src/api/zzmx.js
@@ -101,9 +101,9 @@
  })
}
// å­˜è´§æ¡£æ¡ˆå…³è”工艺路线提交
export function SaveInventoryFile(partcode, data) {
export function SaveInventoryFile(partcode, defaultroute_code, data) {
  return request({
    url: 'ProductModel/SaveInventoryFile?partcode=' + partcode,
    url: 'ProductModel/SaveInventoryFile?partcode=' + partcode + '&defaultroute_code=' + defaultroute_code,
    method: 'post',
    data
  })
src/assets/images/error_icon.png
src/assets/images/sbbbb_icon.png
src/assets/images/succ.png
src/assets/images/ws_icon.png
src/components/ImportPicker/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,438 @@
<template>
  <el-dialog
    :visible.sync="visible"
    :title="title"
    :code="code"
    @close="$emit('update:shows', false)"
  >
    <div>
      <el-steps :active="num" align-center style="margin-bottom:10px;">
        <el-step title="上传Excel" />
        <el-step title="数据验证" />
        <el-step title="导入数据" />
        <el-step title="完成" />
      </el-steps>
      <div v-if="div1" class="mb40">
        <h3>导入提示</h3>
        <p>1. å¯¼å…¥æ–‡ä»¶æ”¯æŒç±»åž‹ï¼š.xlsx,最大不能超10M</p>
        <p>2. è¯·å‹¿è°ƒæ•´å¯¼å…¥æ¨¡ç‰ˆä¸­å­—段的左右顺序或新增sheet页</p>
      </div>
      <div v-if="div2 && div2_state === &quot;300&quot;">
        <p><span class="gth_icon">!</span>文件中有<span style="color:red">{{ error_list.length }}</span>条错误数据,请修改后重新导入</p>
        <el-table class="table" :data="error_list" :header-cell-style="{background:'#f5f5f5'}">
          <el-table-column label="序号" prop="Seq" />
          <el-table-column label="行号" prop="RoeNumber" />
          <el-table-column label="错误字段" prop="ErrorField" />
          <el-table-column label="错误详情" prop="ErrorCont" />
        </el-table>
      </div>
      <div v-if="div2 && div2_state === '200'" style="position:relative;margin-top:100px;">
        <div class="progress_bar bar-color-a" />
        <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg4,}" />
        <div class="mt"><img src="@/assets/images/succ.png" class="img_position"> æ ¡éªŒæ•°æ® (成功)</div>
        <div class="mt">即将导入{{ total_num }}条数据</div>
      </div>
      <div v-if="div1" class="mb40">
        <h3>上传文件</h3>
        <el-upload
          style="display: inline-block;"
          action="/apis/importexcel/ExcelModelCheck"
          :show-file-list="false"
          :on-success="handleAvatarSuccess"
          :before-upload="beforeUpload"
          :data="{FileCode:code}"
        >
          <el-button class="but_style" icon="el-icon-upload2" size="small">{{ button_name }}</el-button>
        </el-upload>
        è¯·ç‚¹å‡»
        <el-button type="text" icon="el-icon-download" @click="clickDown(code)">下载数据模版</el-button>
        , å¹¶æŒ‰ç…§æ¨¡ç‰ˆç¼–辑导入数据
      </div>
      <p v-if="div1">{{ file_name }}</p>
      <div v-show="div1 && getDataing" class="yz">
        <ul>
          <li>
            <div class="progress_bar bar-color-a" />
            <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg1,'sb':sb1}" />
            <div v-if="json1 === 200" class="mt"><img src="@/assets/images/succ.png" class="img_position">文件上传 (成功)</div>
            <div v-if="json1 === 300" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">文件上传 (失败)</div>
            <div v-if="json1=== null" class="mt">文件上传(待校验)</div>
          </li>
          <!-- <li >
              <div class='progress_bar bar-color-a'></div>
              <div class='progress_bar ba r-color-c position_div' style="width:80%"></div>
          </li> -->
          <li>
            <div class="progress_bar bar-color-a" />
            <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg2,'sb':sb2}" />
            <div v-if="json2 === 200" class="mt"><img src="@/assets/images/succ.png" class="img_position">模版校验 (成功)</div>
            <div v-if="json2 === 300" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">模版校验 (失败)</div>
            <div v-if="json2 === null" class="mt">模版校验(待校验)</div>
          </li>
          <!-- <li v-if="json2 === 300">
              <div class='progress_bar bar-color-a'></div>
              <div class='progress_bar bar-color-c position_div' style="width:80%"></div>
          </li> -->
          <!-- <li v-if="json2 === null">
              <div class='progress_bar bar-color-a'></div>
              <div class='progress_bar position_div'></div>
              <div class='mt'>模版验证(待校验)</div>
          </li> -->
          <li>
            <div class="progress_bar bar-color-a" />
            <div :class="{'progress_bar':true, 'bar-color-b':true,'position_div':true,'cg':cg3,'sb':sb3}" />
            <div v-if="json3 === 200" class="mt"><img src="@/assets/images/succ.png" class="img_position">数据量校验 (成功)</div>
            <div v-if="json3 === 300" class="mt"><img src="@/assets/images/sbbbb_icon.png" class="img_position">数据量校验 (失败)</div>
            <div v-if="json3 === null" class="mt">数据量校验(待校验)</div>
          </li>
          <!-- <li v-if="json3 === 300">
              <div class='progress_bar bar-color-a'></div>
              <div class='progress_bar bar-color-c position_div' style="width:80%"></div>
          </li>
          <li v-if="json3 === null">
              <div class='progress_bar bar-color-a'></div>
              <div class='progress_bar position_div'></div>
          </li> -->
        </ul>
      </div>
      <div v-if="div3" class="div3_s">
        <img src="@/assets/images/ws_icon.png">
        <p>已成功导入数据{{ total_num }}条</p>
      </div>
      <div v-if="div3_sb" class="div3_s">
        <img src="@/assets/images/error_icon.png">
        <p>导入失败,失败的原因是{{ error_message }}!</p>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button v-if="button_text !=&quot;完成&quot;" @click="colos()">取 æ¶ˆ</el-button>
      <el-button
        type="primary"
        class="button_style"
        :disabled="disState"
        @click="nextStep(code)"
      >{{ button_text }}</el-button>
    </span>
  </el-dialog>
</template>
<script>
import all from '@/api/all'
export default {
  props: {
    code: {
      type: String,
      default: null
    },
    shows: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: null
    },
    // num:{
    //     type:Number,
    //     default:0
    // },
    // nextStep:{
    //     type:Function,
    //     default:null
    // },
    colos: {
      type: Function,
      default: null
    }
    // mnList:{
    //     type:Array,
    //     default:[]
    // }
  },
  data() {
    return {
      cg1: false,
      sb1: false,
      cg2: false,
      sb2: false,
      cg3: false,
      sb3: false,
      cg4: false,
      background1: '',
      background2: '',
      background3: '',
      error_message: '',
      total_num: 0,
      file: '',
      div3_sb: false,
      div3: false,
      div2_state: '',
      num: 0,
      disState: true,
      visible: this.shows,
      file_name: '',
      div2: false,
      div1: true,
      button_name: '选择文件',
      json1: '',
      json2: '',
      json3: '',
      mnList: [],
      error_list: [],
      button_text: '下一步'
    }
  },
  watch: {
    shows() {
      this.visible = this.shows
    }
  },
  methods: {
    newDataFunc() {
      this.num = 0
      this.getDataing = false
      this.div1 = true
      this.div2 = false
      this.div3 = false
      this.div3_sb = false
      this.file_name = ''
      this.disState = true
      this.json1 = ''
      this.json2 = ''
      this.json3 = ''
      this.button_name = '选择文件'
      this.button_text = '下一步'
    },
    nextStep(code) {
      const data = {
        FileCode: code,
        FileName: this.file_name
      }
      if (this.num === 0) {
        this.div1 = false
        this.div2 = true
        this.ExcelCheckData(data)
        this.num += 1
        this.disState = true
      } else if (this.num === 1) {
        this.div2 = false
        this.ExcelImportSubmit(data)
      } else {
        this.colos()
      }
    },
    ExcelImportSubmit(data) {
      all.ExcelImportSubmit(data).then((res) => {
        if (res.statusCode === '200') {
          this.div3 = true
          this.num += 2
          this.button_text = '完成'
          this.disState = false
        } else {
          this.num += 1
          this.div3_sb = true
          this.disState = true
          this.error_message = res.message
        }
      })
    },
    ExcelCheckData(data) {
      all.ExcelCheckData(data).then((res) => {
        this.div2_state = res.StuCode
        setTimeout(() => {
          this.cg4 = true
        }, 2000)
        this.error_list = res.list
        this.total_num = res.Count
        if (res.StuCode === '200') {
          this.disState = false
        }
      })
    },
    beforeUpload(file) {
      this.file_name = file.name
      this.file = file
    },
    handleAvatarSuccess(res, file, fileList) {
      this.disState = true
      this.getDataing = true
      this.json1 = null
      this.json2 = null
      this.json3 = null
      this.cg1 = false
      this.sb1 = false
      this.cg2 = false
      this.sb2 = false
      this.cg3 = false
      this.sb3 = false
      setTimeout(() => {
        if (res.json1.statusCode === 200) {
          this.cg1 = true
        } else {
          this.sb1 = true
          this.json2 = null
          this.json3 = null
          this.button_name = '更新文件'
        }
      }, 500)
      setTimeout(() => {
        this.json1 = res.json1.statusCode
        this.json2 = null
        this.json3 = null
        if (res.json2.statusCode === 200) {
          this.cg2 = true
        } else {
          this.sb2 = true
          this.json3 = null
          this.button_name = '更新文件'
        }
      }, 2000)
      setTimeout(() => {
        this.json2 = res.json2.statusCode
        this.json3 = null
        if (res.json3.statusCode === 200) {
          this.cg3 = true
        } else {
          this.sb3 = true
          this.json3 = null
          this.button_name = '更新文件'
        }
      }, 4000)
      setTimeout(() => {
        this.json3 = res.json3.statusCode
      }, 6000)
      // if(res.json1.statusCode === 300){
      //     this.json2 = null
      //     this.json3 =null
      //     this.button_name = '更新文件'
      // }else{
      //     this.json2 = res.json2.statusCode
      // }
      // if(res.json2.statusCode === 300){
      //     this.json3 =null
      //     this.button_name = '更新文件'
      // }else{
      //     this.json3 = res.json3.statusCode
      // }
      setTimeout(() => {
        if (this.json1 === 200 && this.json2 === 200 && this.json3 === 200) {
          this.disState = false
        }
      }, 7000)
    },
    clickDown(code) {
      const data = {
        FileCode: code
      }
      all.DownLoadExcel(data).then((res) => {
        window.location.href = res
      })
    }
  }
}
</script>
<style scoped>
.yz ul {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}
.yz ul li {
  list-style: none;
  width: 32%;
  position: relative;
}
.progress_bar {
  height: 12px;
  width: 100%;
  border-radius: 10px;
}
.bar-color-a {
  background: #F1F1F1
}
.bar-color-b {
  background: #28C689
}
.bar-color-c {
  background: #EB8383
}
.position_div {
  position: absolute;
  top: 0;
  left: 0;
  width: 0px;
  border-radius: 10px;
}
.mt {
  margin-top: 10px;
}
.mb40 {
  margin-bottom: 40px;
}
.mb20 {
  margin-bottom: 20px;
}
.div3_s {
  margin-top: 100px;
  text-align: center;
}
.img_position {
  vertical-align: -1px;
  margin-right: 5px;
}
.cg {
  width: 100%;
  background: #28C689;
  transition: width 2s ease 0.3s;
}
.sb {
  width: 80%;
  background: #EB8383;
  transition: width 2s ease 0.3s;
}
.but_style {
  color: #00a79d;
  background-color: #FFFFFF;
  border-color: #00a79d;
}
.gth_icon {
  height: 20px;
  display: inline-block;
  background: #F7B500;
  color: #FFFFFF;
  border-radius: 100%;
  width: 20px;
  text-align: center;
  line-height: 20px;
  margin-right: 6px;
}
</style>
src/icons/svg/bbgl.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="1658133194496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2462" 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="M500.92 308.92L386 404.71l-98-98-150.63 150.66 45.25 45.26L288 397.25l94 94 164.36-136.89L608 416V256H448zM640 64H128a64.19 64.19 0 0 0-64 64v768a64.19 64.19 0 0 0 64 64h444a289.06 289.06 0 0 1-82.6-64H128.11l-0.11-0.11V128.11l0.11-0.11h511.78l0.11 0.11v295a288.9 288.9 0 0 1 64-7.11V128a64.19 64.19 0 0 0-64-64zM446 576H160v64h263.15A285.9 285.9 0 0 1 446 576zM160 768h263.15a288.91 288.91 0 0 1-7.15-64H160z" p-id="2463" fill="#42b983"></path><path d="M704 448c-141.38 0-256 114.62-256 256s114.62 256 256 256 256-114.62 256-256-114.62-256-256-256z m181 285.63L843.15 742a13.77 13.77 0 0 0-10.23 8.84q-2.08 5.72-4.64 11.2a13.78 13.78 0 0 0 1 13.49L852.92 811a13.71 13.71 0 0 1-1.71 17.3l-22.89 22.89a13.71 13.71 0 0 1-17.3 1.71l-35.49-23.66a13.78 13.78 0 0 0-13.49-1q-5.47 2.56-11.2 4.64a13.77 13.77 0 0 0-8.84 10.27L733.63 885a13.71 13.71 0 0 1-13.45 11h-32.37a13.71 13.71 0 0 1-13.45-11L666 843.15a13.77 13.77 0 0 0-8.84-10.23q-5.72-2.08-11.2-4.64a13.78 13.78 0 0 0-13.49 1L597 852.92a13.71 13.71 0 0 1-17.3-1.71l-22.89-22.89a13.71 13.71 0 0 1-1.71-17.3l23.66-35.49a13.78 13.78 0 0 0 1-13.49q-2.56-5.47-4.64-11.2a13.77 13.77 0 0 0-10.27-8.84L523 733.63a13.71 13.71 0 0 1-11-13.45v-32.37a13.71 13.71 0 0 1 11-13.45l41.85-8.36a13.77 13.77 0 0 0 10.23-8.84q2.08-5.72 4.64-11.2a13.78 13.78 0 0 0-1-13.49L555.08 597a13.71 13.71 0 0 1 1.71-17.3l22.89-22.89a13.71 13.71 0 0 1 17.3-1.71l35.49 23.66a13.78 13.78 0 0 0 13.49 1q5.47-2.56 11.2-4.64a13.77 13.77 0 0 0 8.84-10.27l8.37-41.85a13.71 13.71 0 0 1 13.45-11h32.37a13.71 13.71 0 0 1 13.45 11l8.36 41.85a13.77 13.77 0 0 0 8.84 10.23q5.72 2.08 11.2 4.64a13.78 13.78 0 0 0 13.49-1L811 555.08a13.71 13.71 0 0 1 17.3 1.71l22.89 22.89a13.71 13.71 0 0 1 1.71 17.3l-23.66 35.49a13.78 13.78 0 0 0-1 13.49q2.56 5.47 4.64 11.2a13.77 13.77 0 0 0 10.27 8.84l41.85 8.37a13.71 13.71 0 0 1 11 13.45v32.37a13.71 13.71 0 0 1-11 13.44zM704 621.71a82.29 82.29 0 1 0 58.19 24.1 81.75 81.75 0 0 0-58.19-24.1z" p-id="2464" fill="#42b983"></path></svg>
src/layout/components/Sidebar/index.vue
@@ -1,7 +1,7 @@
<template>
  <div :class="{'has-logo':showLogo}">
    <logo v-if="showLogo" :collapse="isCollapse"/>
    <logo v-if="showLogo" :collapse="isCollapse" />
    <el-scrollbar wrap-class="scrollbar-wrapper" style="margin-top:56px;height: 85%">
      <el-menu
        :default-active="activeMenu"
@@ -20,14 +20,14 @@
        <!--          :item="route"-->
        <!--          :base-path="route.path"-->
        <!--        />-->
        <sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path"/>
        <sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" />
      </el-menu>
    </el-scrollbar>
    <div style="position: absolute;bottom: 20px;left: 30px;">
      <div>
        <el-button type="text">新凯迪制造V1.0.01</el-button>
<!--        <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">新凯迪制造V1.0.01</a></el-button>-->
        <!--        <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">新凯迪制造V1.0.01</a></el-button>-->
      </div>
    </div>
@@ -35,15 +35,15 @@
</template>
<script>
import {mapGetters} from 'vuex'
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import {LoginMenu} from '@/api/user'
import {removeCookie, setCookie} from '@/utils/auth'
import { LoginMenu } from '@/api/user'
import { removeCookie, setCookie } from '@/utils/auth'
export default {
  components: {SidebarItem, Logo},
  components: { SidebarItem, Logo },
  data() {
    return {
      routers: []
@@ -59,7 +59,7 @@
    },
    activeMenu() {
      const route = this.$route
      const {meta, path} = route
      const { meta, path } = route
      // if set path, the sidebar will highlight the path you set
      removeCookie('ruleCode')
      setCookie('ruleCode', meta.code)// å°†ç¼–码规则code存到cookie里面
@@ -89,6 +89,7 @@
.el-button--text:focus {
  color: white;
}
#app .sidebar-container .el-submenu .el-menu-item {
src/router/index.js
@@ -441,10 +441,41 @@
        code: '1084',
        component: () => import('@/views/zlgl/qxsj'),
        meta: { code: '1084', title: '缺陷统计', icon: '', keepAlive: true }
      },
      {
        path: 'gxjybz',
        name: '',
        code: '1085',
        component: () => import('@/views/zlgl/gxjybz'),
        meta: { code: '1085', title: '工序检验标准', icon: '', keepAlive: true }
      },
      {
        path: 'gxjyxm',
        name: '',
        code: '1086',
        component: () => import('@/views/zlgl/gxjyxm'),
        meta: { code: '1086', title: '工序检验项目', icon: '', keepAlive: true }
      }
    ]
  },
  {
    path: '/bbgl',
    component: Layout,
    redirect: '/bbgl/sczxbb',
    name: '报表管理',
    code: '1008',
    meta: { code: '1008', title: '报表管理', icon: 'bbgl' },
    alwaysShow: true,
    children: [
      {
        path: 'sczxbb',
        name: 'BMGZCancel',
        code: '1090',
        component: () => import('@/views/bbgl/sczxbb'),
        meta: { code: '1090', title: '生产执行报表', icon: '', keepAlive: true }
      }]
  },
  {
    path: '/xtsz',
    component: Layout,
    redirect: '/xtsz/bmgz',
src/store/modules/permission.js
@@ -16,16 +16,21 @@
 * @param {*} menu
 */
export function getAsyncRoutes(routes, menu) {
  // menu  ä¸­flag  "0" è¡¨ç¤º true  "1"表示false
  const menuCode = []// å°†åŽç«¯code取出存成数组形式
  const menuNameAndCode = []// å°†åŽç«¯code与name取出存成数组形式
  menu.forEach(item => {
    menuCode.push(item.code)
    menuNameAndCode.push({ code: item.code, name: item.name })
    if (item.children && item.children.length > 0) {
      item.children.forEach(it => {
        menuCode.push(it.code)
        menuNameAndCode.push({ code: it.code, name: it.name })
      })
    if (item.flag === '0') {
      menuCode.push(item.code)
      menuNameAndCode.push({ code: item.code, name: item.name })
      if (item.children && item.children.length > 0) {
        item.children.forEach(it => {
          if (it.flag === '0') {
            menuCode.push(it.code)
            menuNameAndCode.push({ code: it.code, name: it.name })
          }
        })
      }
    }
  })
src/views/bbgl/sczxbb.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
<template />
<script>
export default {
  name: 'Sczxbb'
}
</script>
<style scoped>
</style>
src/views/jcsz/jsqd.vue
@@ -633,7 +633,9 @@
        children: 'children',
        label: 'name',
        value: 'code'
      }
      },
      PCTrue: false, // æ˜¯å¦å±•示
      APPTrue: false// æ˜¯å¦å±•示
    }
  },
  created() {
@@ -973,125 +975,229 @@
        type: ''
      }
      const { data: res } = await RoleAssociationRight(data)// æŽ¥å£èŽ·å–æ•°æ®
      this.dialogFormRight.rightPCArr = res[0]
      this.dialogFormRight.rightAPPArr = res[1]
      // '0'显示  '1' ä¸æ˜¾ç¤º
      this.dialogFormRight.rightPCArr = res[0][0].is_delete === '0' ? res[0] : []
      this.dialogFormRight.rightAPPArr = res[1][0].is_delete === '0' ? res[1] : []
      this.PCTrue = res[0][0].is_delete === '0'
      this.APPTrue = res[1][0].is_delete === '0'
      if (this.PCTrue) {
        this.dialogFormRight.rightPCArr[0].children.forEach((item, index) => {
          if (item.is_delete === '1') {
            this.dialogFormRight.rightPCArr[0].children.splice(index, 1)
          } else {
            if (item.children.length > 0 && item.children) {
              item.children.forEach((it, ind) => {
                if (it.is_delete === '1') {
                  item.children.splice(ind, 1)
                }
              })
            }
            if (item.children.length === 0) {
              this.dialogFormRight.rightPCArr[0].children.splice(index, 1)
            }
          }
        })
      }
      if (this.APPTrue) {
        this.dialogFormRight.rightAPPArr[0].children.forEach((item, index) => {
          if (item.is_delete === '1') {
            this.dialogFormRight.rightAPPArr[0].children.splice(index, 1)
          } else {
            if (item.children.length > 0 && item.children) {
              item.children.forEach((it, ind) => {
                if (it.is_delete === '1') {
                  item.children.splice(ind, 1)
                }
              })
            }
            if (item.children.length === 0) {
              this.dialogFormRight.rightAPPArr[0].children.splice(index, 1)
            }
          }
        })
      }
      // åˆ¤æ–­å“ªä¸ªæ˜¯é«˜äº®
      let pcIsSelected1 = false
      let pcIsSelected2 = false
      let appIsSelected1 = false
      let appIsSelected2 = false
      const rightPCArrFlag = res[0][0].flag
      const rightAPPArrFlag = res[1][0].flag
      let rightPCArrFlag
      let rightAPPArrFlag
      if (this.PCTrue) {
        rightPCArrFlag = this.dialogFormRight.rightPCArr[0].flag
      }
      if (this.APPTrue) {
        rightAPPArrFlag = this.dialogFormRight.rightAPPArr[0].flag
      }
      let waitFlag = false// å›žæ˜¾ç­‰å¾…是否放行
      // 1.第一种情况PC和APP都一次都没选中时    PC未选中,APP未选中
      if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') {
        pcIsSelected1 = true
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
      }
      // 2.第二种情况PC已选中,APP未选中
      if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'N') {
        pcIsSelected1 = true
        pcIsSelected2 = true
        const interval = setInterval(() => {
          if ($("input[name='PC']").length > 0) {
            waitFlag = true
          }
          if (waitFlag) {
            clearInterval(interval)
            this.$nextTick(() => {
              $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
            })
          }
        }, 100)
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
      }
      // 3.第三种情况PC未选中,APP已选中
      if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'Y') {
        appIsSelected1 = true
        appIsSelected2 = true
        const interval = setInterval(() => {
          if ($("input[name='APP']").length > 0) {
            waitFlag = true
          }
          if (waitFlag) {
            clearInterval(interval)
            this.$nextTick(() => {
              $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
            })
          }
        }, 100)
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code
      }
      // 4.第四种情况PC已选中,APP已选中
      if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'Y') {
        pcIsSelected1 = true
        pcIsSelected2 = true
        appIsSelected1 = false
        appIsSelected2 = true
        const interval = setInterval(() => {
          if ($("input[name='PC']").length > 0) {
            waitFlag = true
          }
          if (waitFlag) {
            clearInterval(interval)
            this.$nextTick(() => {
              $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
            })
          }
        }, 100)
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
      }
      this.dialogFormRight.rightOperationArr.push({
        isSelected1: pcIsSelected1,
        isSelected2: pcIsSelected2,
        code: this.dialogFormRight.rightPCArr[0].code,
        flag: rightPCArrFlag,
        name: this.dialogFormRight.rightPCArr[0].name
      }, {
        isSelected1: appIsSelected1,
        isSelected2: appIsSelected2,
        code: this.dialogFormRight.rightAPPArr[0].code,
        flag: rightAPPArrFlag,
        name: this.dialogFormRight.rightAPPArr[0].name
      })
      this.dialogFormRight.rightPCArr[0].name = '全部'
      this.dialogFormRight.rightAPPArr[0].name = '全部'
      this.dialogFormRight.rightPCArr[0].children.forEach(item => {
        if (item.children && item.children.length > 0 && item.flag === 'Y') {
          item.children.forEach(it => {
            if (it.flag === 'Y') {
              this.dialogFormRight.rightPCArrSelected.push(it.code)
            }
          })
        } else if (item.children && item.children.length === 0 && item.flag === 'Y') {
          this.dialogFormRight.rightPCArrSelected.push(item.code)
      if (this.PCTrue && this.APPTrue) {
        // 1.第一种情况PC和APP都一次都没选中时    PC未选中,APP未选中
        if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') {
          pcIsSelected1 = true
          this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
        }
      })
      this.dialogFormRight.rightAPPArr[0].children.forEach(item => {
        if (item.children && item.children.length > 0 && item.flag === 'Y') {
          item.children.forEach(it => {
            if (it.flag === 'Y') {
              this.dialogFormRight.rightAPPArrSelected.push(it.code)
        // 2.第二种情况PC已选中,APP未选中
        if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'N') {
          pcIsSelected1 = true
          pcIsSelected2 = true
          const interval = setInterval(() => {
            if ($("input[name='PC']").length > 0) {
              waitFlag = true
            }
          })
        } else if (item.children && item.children.length === 0 && item.flag === 'Y') {
          this.dialogFormRight.rightAPPArrSelected.push(item.code)
            if (waitFlag) {
              clearInterval(interval)
              this.$nextTick(() => {
                $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              })
            }
          }, 100)
          this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
        }
      })
        // 3.第三种情况PC未选中,APP已选中
        if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'Y') {
          appIsSelected1 = true
          appIsSelected2 = true
          const interval = setInterval(() => {
            if ($("input[name='APP']").length > 0) {
              waitFlag = true
            }
            if (waitFlag) {
              clearInterval(interval)
              this.$nextTick(() => {
                $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              })
            }
          }, 100)
          this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code
        }
        // 4.第四种情况PC已选中,APP已选中
        if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'Y') {
          pcIsSelected1 = true
          pcIsSelected2 = true
          appIsSelected1 = false
          appIsSelected2 = true
          const interval = setInterval(() => {
            if ($("input[name='PC']").length > 0) {
              waitFlag = true
            }
            if (waitFlag) {
              clearInterval(interval)
              this.$nextTick(() => {
                $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              })
            }
          }, 100)
          this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
        }
      }
      if (this.PCTrue && !this.APPTrue) {
        if (rightPCArrFlag === 'Y') {
          pcIsSelected1 = true
          pcIsSelected2 = true
          const interval = setInterval(() => {
            if ($("input[name='PC']").length > 0) {
              waitFlag = true
            }
            if (waitFlag) {
              clearInterval(interval)
              this.$nextTick(() => {
                $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              })
            }
          }, 100)
          this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
        }
      }
      if (!this.PCTrue && this.APPTrue) {
        if (rightAPPArrFlag === 'Y') {
          appIsSelected1 = true
          appIsSelected2 = true
          const interval = setInterval(() => {
            if ($("input[name='APP']").length > 0) {
              waitFlag = true
            }
            if (waitFlag) {
              clearInterval(interval)
              this.$nextTick(() => {
                $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              })
            }
          }, 100)
          this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code
        }
      }
      if (this.PCTrue) {
        this.dialogFormRight.rightOperationArr.push({
          isSelected1: pcIsSelected1,
          isSelected2: pcIsSelected2,
          code: this.dialogFormRight.rightPCArr[0].code,
          flag: rightPCArrFlag,
          name: this.dialogFormRight.rightPCArr[0].name
        })
      }
      if (this.APPTrue) {
        this.dialogFormRight.rightOperationArr.push({
          isSelected1: appIsSelected1,
          isSelected2: appIsSelected2,
          code: this.dialogFormRight.rightAPPArr[0].code,
          flag: rightAPPArrFlag,
          name: this.dialogFormRight.rightAPPArr[0].name
        })
      }
      if (this.PCTrue) {
        this.dialogFormRight.rightPCArr[0].name = '全部'
      }
      if (this.APPTrue) {
        this.dialogFormRight.rightAPPArr[0].name = '全部'
      }
      // æ ‘形回显部分
      if (this.PCTrue) {
        this.dialogFormRight.rightPCArr[0].children.forEach(item => {
          if (item.children && item.children.length > 0 && item.flag === 'Y') {
            item.children.forEach(it => {
              if (it.flag === 'Y') {
                this.dialogFormRight.rightPCArrSelected.push(it.code)
              }
            })
          } else if (item.children && item.children.length === 0 && item.flag === 'Y') {
            this.dialogFormRight.rightPCArrSelected.push(item.code)
          }
        })
      }
      if (this.APPTrue) {
        this.dialogFormRight.rightAPPArr[0].children.forEach(item => {
          if (item.children && item.children.length > 0 && item.flag === 'Y') {
            item.children.forEach(it => {
              if (it.flag === 'Y') {
                this.dialogFormRight.rightAPPArrSelected.push(it.code)
              }
            })
          } else if (item.children && item.children.length === 0 && item.flag === 'Y') {
            this.dialogFormRight.rightAPPArrSelected.push(item.code)
          }
        })
      }
      this.$nextTick(() => {
        if (this.$refs.rightPCRef) {
          this.$refs.rightPCRef.setCheckedKeys(this.dialogFormRight.rightPCArrSelected)
@@ -1114,6 +1220,8 @@
      if (this.$refs.rightAPPRef) {
        this.$refs.rightAPPRef.setCheckedKeys([])
      }
      this.PCTrue = false
      this.APPTrue = false
    },
    // æƒé™å¯¹è¯æ¡†å–消事件
    rightDialogVisibleCancel() {
@@ -1123,46 +1231,49 @@
    async rightDialogVisibleConfirm() {
      const rightPCArrSelected = []// ä¿å­˜æäº¤æ ‘选中 PC
      const rightAPPArrSelected = []// ä¿å­˜æäº¤æ ‘选中 APP
      this.dialogFormRight.rightPCArr[0].children.forEach(item => {
        if (item.children && item.children.length > 0) {
          const children = []
          let flag = false // è¡¨ç¤ºchildren里有值push进去了
          item.children.forEach(it => {
            if (this.dialogFormRight.rightPCArrSelected.includes(it.code) || this.dialogFormRight.rightPCArrSelected.includes('PC')) {
              flag = true
              children.push(
                { code: it.code, name: it.name, flag: 'Y' }
              )
            }
          })
          if (flag) {
            rightPCArrSelected.push({
              code: item.code, name: item.name, flag: 'Y', children: children
      if (this.PCTrue) {
        this.dialogFormRight.rightPCArr[0].children.forEach(item => {
          if (item.children && item.children.length > 0) {
            const children = []
            let flag = false // è¡¨ç¤ºchildren里有值push进去了
            item.children.forEach(it => {
              if (this.dialogFormRight.rightPCArrSelected.includes(it.code) || this.dialogFormRight.rightPCArrSelected.includes('PC')) {
                flag = true
                children.push(
                  { code: it.code, name: it.name, flag: 'Y' }
                )
              }
            })
          }
        }
      })
      this.dialogFormRight.rightAPPArr[0].children.forEach(item => {
        if (item.children && item.children.length > 0) {
          const children = []
          let flag = false // è¡¨ç¤ºchildren里有值push进去了
          item.children.forEach(it => {
            if (this.dialogFormRight.rightAPPArrSelected.includes(it.code) || this.dialogFormRight.rightAPPArrSelected.includes('APP')) {
              flag = true
              children.push(
                { code: it.code, name: it.name, flag: 'Y' }
              )
            if (flag) {
              rightPCArrSelected.push({
                code: item.code, name: item.name, flag: 'Y', children: children
              })
            }
          })
          if (flag) {
            rightAPPArrSelected.push({
              code: item.code, name: item.name, flag: 'Y', children: children
            })
          }
        }
      })
        })
      }
      if (this.APPTrue) {
        this.dialogFormRight.rightAPPArr[0].children.forEach(item => {
          if (item.children && item.children.length > 0) {
            const children = []
            let flag = false // è¡¨ç¤ºchildren里有值push进去了
            item.children.forEach(it => {
              if (this.dialogFormRight.rightAPPArrSelected.includes(it.code) || this.dialogFormRight.rightAPPArrSelected.includes('APP')) {
                flag = true
                children.push(
                  { code: it.code, name: it.name, flag: 'Y' }
                )
              }
            })
            if (flag) {
              rightAPPArrSelected.push({
                code: item.code, name: item.name, flag: 'Y', children: children
              })
            }
          }
        })
      }
      // æœ€ç»ˆè¦æäº¤çš„æ•°æ®
      let rightSubmit = []
src/views/scgl/gd.vue
@@ -349,9 +349,9 @@
              >
                <el-option
                  v-for="item in routeArr"
                  :key="item.route_code"
                  :label="item.route_name"
                  :value="item.route_code"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
@@ -556,14 +556,12 @@
import Pagination from '@/components/Pagination'
import {
  AddUpdateMesOrder,
  ClosedErpOrder,
  ClosedMesOrder,
  DeleteMesOrder,
  MesOrderSearch, RouteSelectWkshop, SearchWorkStep,
  MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep,
  SelectRouteStep
} from '@/api/scgl'
import { WorkShopSelect } from '@/api/sbgl'
import { PartSelect, PartSelectRpute } from '@/api/zzmx'
import { PartSelect } from '@/api/zzmx'
import { handleDatetime } from '@/utils/global'
import { getCookie } from '@/utils/auth'
import { MesOrderPrintSearch1 } from '@/api/utils'
@@ -788,9 +786,20 @@
    // äº§å“ä¿¡æ¯å€¼æ”¹å˜
    async partcodeChange(val) {
      const { data: res } = await PartSelectRpute({ partcode: val })
      const { data: res } = await PartSelectRoute({ partcode: val })
      this.routeArr = res
      this.dialogForm.routecode = ''
      let flag = false
      this.routeArr.forEach(item => {
        if (item.code === item.default_route) {
          this.dialogForm.routecode = item.code
          flag = true
        }
      })
      if (!flag) {
        this.dialogForm.routecode = ''
      }
      this.dialogForm.wkshopcode = ''
    },
    // å·¥è‰ºè·¯çº¿å€¼æ”¹å˜
@@ -834,8 +843,6 @@
        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// ç”Ÿäº§è½¦é—´ä»£ç 
        this.dialogForm.planstartdate = row.plan_startdate !== null ? row.plan_startdate : handleDatetime(new Date())
        this.dialogForm.planenddate = row.plan_enddate !== null ? row.plan_enddate : handleDatetime(new Date())
src/views/zlgl/gxjy.vue
@@ -1,497 +0,0 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div style="padding: 10px 5px 0 0">
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="项目编码" style=" display: flex;">
              <el-input v-model="form.defectcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="项目名称" style=" display: flex;">
              <el-input v-model="form.itemname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="项目描述" style=" display: flex;">
              <el-input v-model="form.itemdescr" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
      </div>
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <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">
        <el-table
          :data="tableData"
          :height="tableHeight+'px'"
          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
            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"
          >
            <template slot-scope="{row}">
              <div v-if="row.description==='F'">工厂</div>
              <div v-if="row.description==='D'">部门</div>
              <div v-if="row.description==='W'">车间</div>
              <div v-if="row.description==='K'">科室</div>
              <div v-if="row.description==='L'">生产线</div>
            </template>
          </el-table-column>
          <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="getDedectSearch"
      />
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="800px"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <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 label="项目描述" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
        </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 { DedectSearch } from '@/api/zlgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'GXJY',
  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()
        }
      }
    }
    return {
      mainHeight: 0,
      tableHeight: 0,
      form: {
        itemcode: '', // é¡¹ç›®ä»£ç 
        itemname: '', // é¡¹ç›®åç§°
        itemdescr: '', // é¡¹ç›®æè¿°
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      OrgTypeArr: [
        { label: '工厂', value: 'F' },
        { label: '部门', value: 'D' },
        { label: '车间', value: 'W' },
        { label: '科室', value: 'K' },
        { label: '生产线', value: 'L' }
      ],
      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'] }
        ]
      }
    }
  },
  created() {
    this.getDedectSearch()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getDedectSearch() {
      const res = await DedectSearch(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.getDedectSearch()
    },
    // æŸ¥è¯¢
    search() {
      this.getDedectSearch()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.getDedectSearch()
    },
    // æ–°å¢žæŒ‰é’®
    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.getDedectSearch()
          }
        })
      }).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.getDedectSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
      })
    }
  }
}
</script>
<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/zlgl/gxjybz.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,624 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div style="padding: 10px 5px 0 0">
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="标准代码" style=" display: flex;">
              <el-input v-model="form.stanedcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="标准名称" style=" display: flex;">
              <el-input v-model="form.stanedname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="标准描述" style=" display: flex;">
              <el-input v-model="form.staneddescr" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
      </div>
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <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">
        <el-table
          :data="tableData"
          :height="tableHeight+'px'"
          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
            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="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="check('check',row)">查看</el-button>
                <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="getStepCheckStanedSearch"
      />
    </div>
    <el-dialog
      :title="operation==='add'?'新增':(operation==='edit'?'编辑':'查看')"
      :visible.sync="dialogVisible"
      width="800"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <div style="margin-bottom: 10px">
        <i class="el-icon-s-comment" style="color:#42b983;" /> æ ‡å‡†ä¿¡æ¯ï¼š
      </div>
      <el-form ref="dialogForm" style="margin-left: 80px" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <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 label="描述">
          <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
        </el-form-item>
      </el-form>
      <div style="margin-bottom: 10px">
        <i class="el-icon-s-comment" style="color:#42b983;" /> æ£€éªŒé¡¹ä¿¡æ¯ï¼š
      </div>
      <div style="margin-bottom: 10px">
        <el-button type="primary" @click="JYadd">新增</el-button>
      </div>
      <div>
        <el-table
          :data="JYTableData"
          height="260px"
          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
            prop="RowNum"
            label="序号"
            width="100"
          />
          <el-table-column
            prop="mc"
            label="检验标准名称"
          >
            <template slot-scope="{row}">
              <div v-if="row.isVisible===0">{{ row.mc }}</div>
              <el-input v-if="row.isVisible===1" v-model="row.mc" />
            </template>
          </el-table-column>
          <el-table-column
            prop="ms"
            label="检验描述描述"
          >
            <template slot-scope="{row}">
              <div v-if="row.isVisible===0">{{ row.ms }}</div>
              <el-input v-if="row.isVisible===1" v-model="row.ms" />
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button v-if="row.isVisible===0" type="text" @click="JYedit(row)">编辑</el-button>
                <el-button v-if="row.isVisible===0" type="text" @click="JYdel(row)">删除</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="JYsave(row)">保存</el-button>
                <el-button v-if="row.isVisible===1" type="text" @click="Jycancel(row)">取消</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <!--      <pagination-->
      <!--        v-show="JYtotal>0"-->
      <!--        :total="JYtotal"-->
      <!--        :page.sync="JYfrom.page"-->
      <!--        :limit.sync="JYfrom.rows"-->
      <!--        align="right"-->
      <!--        layout="prev, pager, next,sizes"-->
      <!--        popper-class="select_bottom"-->
      <!--        @pagination="getStepCheckItemSelect"-->
      <!--      />-->
      <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 { StepCheckStanedSearch } from '@/api/zlgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'ZJBZ',
  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,
      form: {
        stanedcode: '', // æ ‡å‡†ä»£ç 
        stanedname: '', // æ ‡å‡†åç§°
        staneddescr: '', // æ ‡å‡†æè¿°
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      OrgTypeArr: [
        { label: '工厂', value: 'F' },
        { label: '部门', value: 'D' },
        { label: '车间', value: 'W' },
        { label: '科室', value: 'K' },
        { label: '生产线', value: 'L' }
      ],
      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'] }
        ]
      },
      JYTableData: [
        { RowNum: 1, mc: 'xxx1', ms: 'aaaa' }
      ], // å¯¹è¯æ¡†æ£€éªŒä¿¡æ¯è¡¨æ ¼
      JYfrom: {
        page: 1,
        rows: 10
      },
      JYtotal: 10
    }
  },
  created() {
    this.getStepCheckStanedSearch()
    this.getStepCheckItemSelect()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getStepCheckStanedSearch() {
      const res = await StepCheckStanedSearch(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.getStepCheckStanedSearch()
    },
    // æŸ¥è¯¢
    search() {
      this.getStepCheckStanedSearch()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.getStepCheckStanedSearch()
    },
    // æ–°å¢žæŒ‰é’®
    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
      })
    },
    // æŸ¥çœ‹
    check(operation, row) {
      this.operation = operation
      this.dialogVisible = true
    },
    // åˆ é™¤æŒ‰é’®
    async del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getStepCheckStanedSearch()
          }
        })
      }).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.getStepCheckStanedSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
      })
    },
    //  èŽ·å–æ£€éªŒé¡¹ä¿¡æ¯è¡¨
    getStepCheckItemSelect() {
      // let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
      // number = number === 0 ? (10 + Math.random()) : number
      this.JYTableData.forEach(item => {
        item.isVisible = 0
      })
    },
    // æ£€éªŒæ–°å¢ž
    JYadd() {
      let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
      number = number === 0 ? (10 + Math.random()) : number
      const data = { mc: '', ms: '', isVisible: 1, number }
      this.JYTableData.unshift(data)
    },
    JYedit(row) {
      this.JYTableData.forEach((item, index) => {
        if (item.mc === row.mc) {
          item.isVisible = 1
        }
      })
    },
    JYdel(row) {
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          this.JYTableData.splice(index, 1)
        }
      })
    },
    JYsave(row) {
      this.JYTableData.forEach(item => {
        if (item.number === row.number) {
          item.isVisible = 0
        }
      })
    },
    Jycancel(row) {
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          this.JYTableData.splice(index, 1)
        }
      })
    }
  }
}
</script>
<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-dialog__body {
  padding: 20px 20px !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/zlgl/gxjyxm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,497 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div style="padding: 10px 5px 0 0">
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="项目编码" style=" display: flex;">
              <el-input v-model="form.defectcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="项目名称" style=" display: flex;">
              <el-input v-model="form.itemname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="项目描述" style=" display: flex;">
              <el-input v-model="form.itemdescr" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
      </div>
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <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">
        <el-table
          :data="tableData"
          :height="tableHeight+'px'"
          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
            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"
          >
            <template slot-scope="{row}">
              <div v-if="row.description==='F'">工厂</div>
              <div v-if="row.description==='D'">部门</div>
              <div v-if="row.description==='W'">车间</div>
              <div v-if="row.description==='K'">科室</div>
              <div v-if="row.description==='L'">生产线</div>
            </template>
          </el-table-column>
          <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="getStepCheckItemSearch"
      />
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="800px"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <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 label="项目描述" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
        </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 { DedectSearch } from '@/api/zlgl'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Xxxx',
  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()
        }
      }
    }
    return {
      mainHeight: 0,
      tableHeight: 0,
      form: {
        itemcode: '', // é¡¹ç›®ä»£ç 
        itemname: '', // é¡¹ç›®åç§°
        itemdescr: '', // é¡¹ç›®æè¿°
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      OrgTypeArr: [
        { label: '工厂', value: 'F' },
        { label: '部门', value: 'D' },
        { label: '车间', value: 'W' },
        { label: '科室', value: 'K' },
        { label: '生产线', value: 'L' }
      ],
      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'] }
        ]
      }
    }
  },
  created() {
    this.getStepCheckItemSearch()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getStepCheckItemSearch() {
      const res = await StepCheckItemSearch(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.getStepCheckItemSearch()
    },
    // æŸ¥è¯¢
    search() {
      this.getStepCheckItemSearch()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.getStepCheckItemSearch()
    },
    // æ–°å¢žæŒ‰é’®
    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.getStepCheckItemSearch()
          }
        })
      }).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.getStepCheckItemSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
      })
    }
  }
}
</script>
<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/zlgl/wljy.vue
@@ -1,11 +1,38 @@
<template />
<!--<template>-->
<!--  <div>-->
<!--    <div style="margin: 100px;">-->
<!--      <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />-->
<!--    </div>-->
<!--  </div>-->
<!--</template>-->
<script>
export default {
  name: 'Wljy'
}
</script>
<!--<script>-->
<!--import ImportPicker from '@/components/ImportPicker'-->
<style scoped>
<!--export default {-->
<!--  name: 'Wljy',-->
<!--  components: {-->
<!--    ImportPicker-->
<!--  },-->
<!--  data() {-->
<!--    return {-->
<!--      title_value: '数据导入 / ç”¨æˆ·è§’色',-->
<!--      code: '2',-->
<!--      shows: false-->
<!--    }-->
<!--  },-->
<!--  mounted() {-->
<!--    this.shows = true-->
<!--    this.$refs.importPickerFunc.newDataFunc()-->
<!--  },-->
<!--  methods: {-->
<!--    colos() {-->
<!--      this.shows = false-->
<!--    }-->
<!--  }-->
<!--}-->
<!--</script>-->
</style>
<!--<style scoped>-->
<!--</style>-->
src/views/zlgl/zjbz.vue
@@ -1,11 +0,0 @@
<template />
<script>
export default {
  name: 'Zjbz'
}
</script>
<style scoped>
</style>
src/views/zzmx/chda.vue
@@ -472,6 +472,26 @@
          <!--            onClick="event.cancelBubble = true"-->
        </div>
      </div>
      <el-divider />
      <div>
        <i class="el-icon-s-operation" style="color:#42b983;" /> é»˜è®¤å·¥è‰ºè·¯çº¿
      </div>
      <div style="margin-top: 20px">
        <el-select
          v-model="defaultroute_code"
          filterable
          style="width: 200px"
          placeholder="请选择"
        >
          <el-option
            v-for="item in defaultroute_codeArr"
            :key="item.code"
            :label="item.name"
            :value="item.code"
          />
        </el-select>
      </div>
      <el-divider />
      <div style="margin-bottom: 10px">
        <i class="el-icon-s-operation" style="color:#42b983;" /> å·¥åºåˆ—表
@@ -480,7 +500,7 @@
        <el-table
          :data="projectTableData"
          border
          height="400"
          height="300"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
@@ -516,6 +536,7 @@
        </div>
      </span>
    </el-dialog>
  </div>
</template>
@@ -646,6 +667,8 @@
        routeOperationArr: [] // å·¥è‰ºè·¯çº¿é›†åˆ
        // routeOperationSelectedArr: [] // å·¥è‰ºè·¯çº¿é€‰ä¸­é›†åˆæ•°ç»„
      },
      defaultroute_code: '', // é»˜è®¤å·¥è‰ºè·¯çº¿é€‰ä¸­å€¼
      defaultroute_codeArr: '', // é»˜è®¤å·¥è‰ºè·¯çº¿æ•°ç»„
      projectTableData: []// è®¾å¤‡åˆ—表
    }
  },
@@ -822,94 +845,13 @@
    // å·¥è‰ºè·¯çº¿ç‚¹å‡»
    async routeClick(row) {
      console.log(row)
      this.defaultroute_code = row.default_route
      this.dialogFormRoute.projectCode = row.partcode
      this.dialogFormRoute.projectName = row.partname
      this.dialogVisibleRoute = true
      const { data: res } = await InventoryFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode })
      this.dialogFormRoute.routeOperationArr = res
      // let waitFlag = false// å›žæ˜¾ç­‰å¾…是否放行
      this.dialogFormRoute.routeOperationArrTest = [
        {
          'flag': 'Y', code: '001', name: '测试1 ',
          'Data': [
            {
              'seq': 1,
              'stepcode': 'Step01',
              'stepname': '测试工序一',
              'enable': 'Y'
            }, {
              'seq': 2,
              'stepcode': 'Step02',
              'stepname': '测试工序二',
              'enable': 'Y'
            }, {
              'seq': 3,
              'stepcode': 'Step03',
              'stepname': '测试工序三',
              'enable': 'N'
            }
          ]
        },
        {
          'flag': 'Y', code: '002', name: '测试2 ',
          'Data': [
            {
              'seq': 1,
              'stepcode': 'Step01',
              'stepname': '测试工序一',
              'enable': 'Y'
            }, {
              'seq': 2,
              'stepcode': 'Step02',
              'stepname': '测试工序二',
              'enable': 'Y'
            }, {
              'seq': 3,
              'stepcode': 'Step03',
              'stepname': '测试工序三',
              'enable': 'N'
            }, {
              'seq': 4,
              'stepcode': 'Step02',
              'stepname': '测试工序二',
              'enable': 'Y'
            }, {
              'seq': 5,
              'stepcode': 'Step03',
              'stepname': '测试工序三',
              'enable': 'N'
            }
          ]
        },
        {
          'flag': 'N', code: '003', name: '测试3 ',
          'Data': [
            {
              'seq': 1,
              'stepcode': 'Step01',
              'stepname': '测试工序一',
              'enable': 'Y'
            }
          ]
        },
        {
          'flag': 'Y', code: '004', name: '测试4 ',
          'Data': [
            {
              'seq': 1,
              'stepcode': 'Step01',
              'stepname': '测试工序一',
              'enable': 'Y'
            }, {
              'seq': 2,
              'stepcode': 'Step02',
              'stepname': '测试工序二',
              'enable': 'Y'
            }
          ]
        }
      ]
      this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
        item.isSelected1 = false
@@ -937,10 +879,15 @@
          // }, 100)
        }
      })
      this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y')
      console.log(this.defaultroute_codeArr, 123)
    },
    // å¯¹è¯æ¡†å…³é—­
    handleCloseRoute() {
      this.dialogFormRoute.routeOperationArr = []
      this.defaultroute_codeArr = []
    },
    // å–消
    routeDialogVisibleCancel() {
@@ -948,13 +895,20 @@
    },
    // ç¡®å®š
    async routeDialogVisibleConfirm() {
      const temp = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2)
      if (this.defaultroute_code === '' && temp.length > 0) {
        return this.$message.info('默认工艺路线不能为空!')
      }
      // æäº¤æ ¼å¼
      const data = []
      this.dialogFormRoute.routeOperationArr.forEach(item => {
        if (item.isSelected2) {
          data.push({ code: item.code, name: item.name })
        }
      })
      const res = await SaveInventoryFile(this.dialogFormRoute.projectCode, data)
      const res = await SaveInventoryFile(this.dialogFormRoute.projectCode, this.defaultroute_code, data)
      if (res.code === '200') {
        this.$message.success('保存成功!')
        await this.getInventoryFileSelect()
@@ -974,6 +928,16 @@
    myCheckboxInputClick(val) {
      console.log(val, 2)
      val.isSelected2 = !val.isSelected2
      this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
        if (val.code === item.code) {
          item.flag = !item.flag
        }
      })
      if (val.code === this.defaultroute_code) {
        this.defaultroute_code = ''
      }
      this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2)
    },
    /* å•位模块*/
    // å•位按钮点击事件