loulijun2021
2023-05-30 a169bda5b19db4714d2aa476504e58105228cc40
1.对接移动端
已添加8个文件
已修改8个文件
3824 ■■■■ 文件已修改
src/api/zlgl.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/DndList/index.vue 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/TableColumnSettings/index.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/el-drag-dialog/drag.js 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/el-drag-dialog/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/waves/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/waves/waves.css 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/directive/waves/waves.js 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/jsqd.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scgl/sckbg.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjy.vue 1321 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/gxjyjl.vue 527 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zlgl/zjfa.vue 1413 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/zlgl.js
@@ -123,6 +123,7 @@
    params: data
  })
}
// ç”Ÿäº§å¼€æŠ¥å·¥,工序检验提交保存
export function SaveMesOrderStepCheckItem(data) {
  return request({
@@ -140,6 +141,7 @@
    params: data
  })
}
// å·¥åºæ£€éªŒè®°å½•列表查询
export function StepCheckTableSubSearch(data) {
  return request({
@@ -148,6 +150,7 @@
    params: data
  })
}
// å·¥åºæ£€éªŒè®°å½•导出
export function StepCheckTableOutExcel(data) {
  return request({
@@ -157,3 +160,39 @@
  })
}
// è´¨æ£€æ–¹æ¡ˆåˆ—表查询
export function QualityInspectionSearch(data) {
  return request({
    url: 'QualityManagement/QualityInspectionSearch',
    method: 'get',
    params: data
  })
}
// è´¨æ£€æ–¹æ¡ˆæŸ¥çœ‹ç¼–辑
export function QualityInspectionSeeEdit(data) {
  return request({
    url: 'QualityManagement/QualityInspectionSeeEdit',
    method: 'get',
    params: data
  })
}
// è´¨æ£€æ–¹æ¡ˆæ–°å¢ž/编辑提交
export function QualityInspectionAddEditSave(data) {
  return request({
    url: 'QualityManagement/QualityInspectionAddEditSave',
    method: 'post',
    data
  })
}
// è´¨æ£€æ–¹æ¡ˆåˆ é™¤
export function QualityInspectionDelete(data) {
  return request({
    url: 'QualityManagement/QualityInspectionDelete',
    method: 'post',
    params: data
  })
}
src/components/DndList/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,193 @@
<template>
  <div class="dndList">
    <div :style="{width:'100%'}" class="dndList-list">
      <div style="display: flex;justify-content: space-between;">
        <el-checkbox v-model="checkedAll" @change="checkedAllChange">列展示</el-checkbox>
        <div style="cursor: pointer" :style="{color:$store.state.settings.theme}" @click="resetColumn">重置</div>
      </div>
      <el-checkbox-group v-model="checkedList" @change="checkedListChange">
        <draggable :set-data="setData" :list="list1" class="dragArea" animation="300" @end="draggableEnded">
          <div v-for="item in list1" :key="item.id" class="list-complete-item">
            <div style="display: flex">
              <div style="width: 20px;height: 20px;margin-right: 4px;cursor:move;"><i
                style="font-weight: bolder"
                class="el-icon-rank"
              /></div>
              <el-checkbox :label="item.label" class="list-complete-item-handle" />
            </div>
            <div>
              <el-tooltip class="item" effect="dark" content="固定到左侧" placement="bottom">
                <i
                  style="transform:rotate(90deg);cursor:pointer;font-weight: bolder"
                  class="el-icon-download"
                  :style="{color:item.fixed==='left'?$store.state.settings.theme:''}"
                  @click="fixedToLeft(item.label)"
                />
              </el-tooltip>
              <el-divider direction="vertical" />
              <el-tooltip class="item" effect="dark" content="固定到右侧" placement="bottom">
                <i
                  style="transform:rotate(-90deg);cursor:pointer;font-weight: bolder"
                  class="el-icon-download"
                  :style="{color:item.fixed==='right'?$store.state.settings.theme:''}"
                  @click="fixedToRight(item.label)"
                />
              </el-tooltip>
            </div>
          </div>
        </draggable>
      </el-checkbox-group>
    </div>
  </div>
</template>
<script>
import draggable from 'vuedraggable'
export default {
  name: 'DndList',
  components: { draggable },
  props: {
    list1: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      checkedList: this.list1.map(i => i.show ? i.label : '').filter(i => i !== ''), // åˆ—展示值
      checkedListDefaultLabel: this.list1.map(i => i.show ? i.label : '').filter(i => i !== ''), // é‡ç½®é»˜è®¤å€¼label
      checkedListDefaultFixed: this.list1.map(i => i.fixed), // é‡ç½®é»˜è®¤å€¼fixed
      checkedAll: true
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    setData(dataTransfer) {
      // to avoid Firefox bug
      // Detail see : https://github.com/RubaXa/Sortable/issues/1012
      dataTransfer.setData('Text', '')
    },
    // é‡ç½®
    resetColumn() {
      this.checkedList = this.checkedListDefaultLabel
      this.list1.sort((a, b) => a.id - b.id)// æŽ’序
      this.list1.forEach((i, j) => {
        i.show = !!this.checkedListDefaultLabel.includes(i.label)
      })
      this.checkedListDefaultFixed.forEach((i, j) => {
        this.list1[j].fixed = i
      })
      this.$emit('tableColumnUpdate', this.checkedListDefaultLabel)
    },
    // åˆ—展示
    checkedAllChange() {
      this.list1.forEach(i => {
        if (this.checkedAll) {
          i.show = true
          this.checkedList = this.list1.map(j => j.label)
        } else {
          i.show = false
          this.checkedList = []
        }
      })
      this.$emit('tableColumnUpdate', this.checkedList)
    },
    // å›ºå®šåˆ°å·¦ä¾§
    fixedToLeft(val) {
      if (this.list1.find(i => i.label === val).show) {
        this.list1.find(i => i.label === val).fixed = this.list1.find(i => i.label === val).fixed !== 'left' ? 'left' : false
      }
      this.$emit('tableColumnUpdate', this.checkedList)
    },
    // å›ºå®šåˆ°å³ä¾§
    fixedToRight(val) {
      if (this.list1.find(i => i.label === val).show) {
        this.list1.find(i => i.label === val).fixed = this.list1.find(i => i.label === val).fixed !== 'right' ? 'right' : false
      }
      this.$emit('tableColumnUpdate', this.checkedList)
    },
    // æ‹–动结束事件
    draggableEnded({ to, from, item, clone, oldIndex, newIndex }) {
      // console.log(to, from, item, clone, oldIndex, newIndex)
      this.$emit('tableColumnUpdate', this.list1, true)// ä¼ ç»™çˆ·çˆ·  isCopyTrue:复值给爷爷
    },
    // å¤šé€‰æ¡†å€¼æ”¹å˜äº‹ä»¶
    checkedListChange(val) {
      this.checkedAll = val.length !== 0
      this.list1.forEach((i, j) => {
        i.show = !!val.includes(i.label)
      })
      this.$emit('tableColumnUpdate', val)
    }
  }
}
</script>
<style lang="scss" scoped>
.dndList {
  background: #fff;
  //padding-bottom: 40px;
  &:after {
    content: "";
    display: table;
    clear: both;
  }
  .dndList-list {
    float: left;
    //padding-bottom: 30px;
    &:first-of-type {
      margin-right: 2%;
    }
    .dragArea {
      margin-top: 15px;
      min-height: 50px;
      //padding-bottom: 30px;
    }
  }
}
.list-complete-item {
  cursor: pointer;
  position: relative;
  font-size: 14px;
  padding: 5px 5px;
  margin-top: 4px;
  //border: 1px solid #bfcbd9;
  transition: all 1s;
  display: flex;
  justify-content: space-between;
}
.list-complete-item-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 50px;
}
.list-complete-item.sortable-chosen {
  background: #b0e2f6;
}
.list-complete-item.sortable-ghost {
  background: #e6f7ff;
}
.list-complete-enter,
.list-complete-leave-active {
  opacity: 0;
}
</style>
src/components/TableColumnSettings/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
<template>
  <div>
    <el-popover
      placement="bottom-end"
      width="265"
      trigger="click"
    >
      <!--      <dnd-list :list1="list1" v-bind="$attrs" v-on="$listeners" />-->
      <dnd-list v-bind="$attrs" v-on="$listeners" />
      <el-button
        slot="reference"
        style="cursor: pointer;position: absolute;padding:0;top:11px;right: 60px;z-index: 99;"
      >
        <el-tooltip class="item" effect="dark" content="列设置" placement="top">
          <i class="el-icon-s-tools" />
        </el-tooltip>
      </el-button>
    </el-popover>
  </div>
</template>
<script>
import DndList from '@/components/DndList'
export default {
  name: 'Index',
  components: { DndList }
  // props: {
  //   list1: {
  //     type: Array,
  //     default() {
  //       return []
  //     }
  //   }
  // }
}
</script>
<style scoped lang="scss">
</style>
src/directive/el-drag-dialog/drag.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
export default {
  bind(el, binding, vnode) {
    const dialogHeaderEl = el.querySelector('.el-dialog__header')
    const dragDom = el.querySelector('.el-dialog')
    dialogHeaderEl.style.cssText += ';cursor:move;'
    dragDom.style.cssText += ';top:0px;'
    // èŽ·å–åŽŸæœ‰å±žæ€§ ie dom元素.currentStyle ç«ç‹è°·æ­Œ window.getComputedStyle(dom元素, null);
    const getStyle = (function() {
      if (window.document.currentStyle) {
        return (dom, attr) => dom.currentStyle[attr]
      } else {
        return (dom, attr) => getComputedStyle(dom, false)[attr]
      }
    })()
    dialogHeaderEl.onmousedown = (e) => {
      // é¼ æ ‡æŒ‰ä¸‹ï¼Œè®¡ç®—当前元素距离可视区的距离
      const disX = e.clientX - dialogHeaderEl.offsetLeft
      const disY = e.clientY - dialogHeaderEl.offsetTop
      const dragDomWidth = dragDom.offsetWidth
      const dragDomHeight = dragDom.offsetHeight
      const screenWidth = document.body.clientWidth
      const screenHeight = document.body.clientHeight
      const minDragDomLeft = dragDom.offsetLeft
      const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
      const minDragDomTop = dragDom.offsetTop
      const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
      // èŽ·å–åˆ°çš„å€¼å¸¦px æ­£åˆ™åŒ¹é…æ›¿æ¢
      let styL = getStyle(dragDom, 'left')
      let styT = getStyle(dragDom, 'top')
      if (styL.includes('%')) {
        styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
        styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
      } else {
        styL = +styL.replace(/\px/g, '')
        styT = +styT.replace(/\px/g, '')
      }
      document.onmousemove = function(e) {
        // é€šè¿‡äº‹ä»¶å§”托,计算移动的距离
        let left = e.clientX - disX
        let top = e.clientY - disY
        // è¾¹ç•Œå¤„理
        if (-(left) > minDragDomLeft) {
          left = -minDragDomLeft
        } else if (left > maxDragDomLeft) {
          left = maxDragDomLeft
        }
        if (-(top) > minDragDomTop) {
          top = -minDragDomTop
        } else if (top > maxDragDomTop) {
          top = maxDragDomTop
        }
        // ç§»åŠ¨å½“å‰å…ƒç´ 
        dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
        // emit onDrag event
        vnode.child.$emit('dragDialog')
      }
      document.onmouseup = function(e) {
        document.onmousemove = null
        document.onmouseup = null
      }
    }
  }
}
src/directive/el-drag-dialog/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
import drag from './drag'
const install = function(Vue) {
  Vue.directive('el-drag-dialog', drag)
}
if (window.Vue) {
  window['el-drag-dialog'] = drag
  Vue.use(install); // eslint-disable-line
}
drag.install = install
export default drag
src/directive/waves/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
import waves from './waves'
const install = function(Vue) {
  Vue.directive('waves', waves)
}
if (window.Vue) {
  window.waves = waves
  Vue.use(install); // eslint-disable-line
}
waves.install = install
export default waves
src/directive/waves/waves.css
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
.waves-ripple {
    position: absolute;
    border-radius: 100%;
    background-color: rgba(0, 0, 0, 0.15);
    background-clip: padding-box;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transform: scale(0);
    -ms-transform: scale(0);
    transform: scale(0);
    opacity: 1;
}
.waves-ripple.z-active {
    opacity: 0;
    -webkit-transform: scale(2);
    -ms-transform: scale(2);
    transform: scale(2);
    -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
    transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
    transition: opacity 1.2s ease-out, transform 0.6s ease-out;
    transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
}
src/directive/waves/waves.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
import './waves.css'
const context = '@@wavesContext'
function handleClick(el, binding) {
  function handle(e) {
    const customOpts = Object.assign({}, binding.value)
    const opts = Object.assign({
      ele: el, // æ³¢çº¹ä½œç”¨å…ƒç´ 
      type: 'hit', // hit ç‚¹å‡»ä½ç½®æ‰©æ•£ center中心点扩展
      color: 'rgba(0, 0, 0, 0.15)' // æ³¢çº¹é¢œè‰²
    },
    customOpts
    )
    const target = opts.ele
    if (target) {
      target.style.position = 'relative'
      target.style.overflow = 'hidden'
      const rect = target.getBoundingClientRect()
      let ripple = target.querySelector('.waves-ripple')
      if (!ripple) {
        ripple = document.createElement('span')
        ripple.className = 'waves-ripple'
        ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
        target.appendChild(ripple)
      } else {
        ripple.className = 'waves-ripple'
      }
      switch (opts.type) {
        case 'center':
          ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px'
          ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px'
          break
        default:
          ripple.style.top =
            (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop ||
              document.body.scrollTop) + 'px'
          ripple.style.left =
            (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft ||
              document.body.scrollLeft) + 'px'
      }
      ripple.style.backgroundColor = opts.color
      ripple.className = 'waves-ripple z-active'
      return false
    }
  }
  if (!el[context]) {
    el[context] = {
      removeHandle: handle
    }
  } else {
    el[context].removeHandle = handle
  }
  return handle
}
export default {
  bind(el, binding) {
    el.addEventListener('click', handleClick(el, binding), false)
  },
  update(el, binding) {
    el.removeEventListener('click', el[context].removeHandle, false)
    el.addEventListener('click', handleClick(el, binding), false)
  },
  unbind(el) {
    el.removeEventListener('click', el[context].removeHandle, false)
    el[context] = null
    delete el[context]
  }
}
src/layout/components/Sidebar/index.vue
@@ -28,7 +28,7 @@
    </el-scrollbar>
    <div style="position: absolute;bottom: 20px;left: 30px;">
      <div>
        <el-button v-if="$store.state.app.sidebar.opened" type="text" style="font-size: 14px;cursor: pointer">新凯迪制造V1.0.01</el-button>
        <el-button v-if="$store.state.app.sidebar.opened" type="text" style="font-size: 14px;cursor: pointer">新凯迪制造V1.5.21</el-button>
        <!--        <el-button type="text"><a href="http://www.ykxkd.com/" target="_blank">新凯迪制造V1.0.01</a></el-button>-->
      </div>
    </div>
src/router/index.js
@@ -1170,6 +1170,12 @@
        code: '1087',
        component: () => import('@/views/zlgl/gxjyjl'),
        meta: { code: '1087', title: '工序检验记录', icon: '', keepAlive: true }
      }, {
        path: 'zjfa',
        name: 'ZJFACancel',
        code: '1088',
        component: () => import('@/views/zlgl/zjfa'),
        meta: { code: '1088', title: '质检方案', icon: '', keepAlive: true }
      }
    ]
  },
src/views/jcsz/jsqd.vue
@@ -287,7 +287,12 @@
          sortable="custom"
        >
          <template slot-scope="{row}">
            <el-input v-if="row.isVisible===1" v-model="row.roletype_code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="请输入" />
            <el-input
              v-if="row.isVisible===1"
              v-model="row.roletype_code"
              oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')"
              placeholder="请输入"
            />
            <div v-else> {{ row.roletype_code }}</div>
          </template>
        </el-table-column>
@@ -1132,7 +1137,7 @@
            this.PCTrue = res.data[0][0].is_delete === '0'
            this.APPTrue = res.data[1][0].children.filter(item => item.is_delete === '0').length === 0 ? false : res.data[1][0].is_delete === '0'
            console.log(this.APPTrue, 1)
            // '0'显示  '1' ä¸æ˜¾ç¤º   è¿‡æ»¤å‡ºç›¸å¯¹åº”的菜单
            if (this.PCTrue) {
              this.dialogFormRight.rightPCArr[0].children = this.dialogFormRight.rightPCArr[0].children.filter(item => item.is_delete === '0')
@@ -1204,13 +1209,13 @@
                pcIsSelected2 = true
                const interval = setInterval(() => {
                  if ($("input[name='PC']").length > 0) {
                  if ($('input[name=\'PC\']').length > 0) {
                    waitFlag = true
                  }
                  if (waitFlag) {
                    clearInterval(interval)
                    this.$nextTick(() => {
                      $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                      $('input[name=\'PC\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                    })
                  }
                }, 100)
@@ -1223,13 +1228,13 @@
                appIsSelected2 = true
                const interval = setInterval(() => {
                  if ($("input[name='APP']").length > 0) {
                  if ($('input[name=\'APP\']').length > 0) {
                    waitFlag = true
                  }
                  if (waitFlag) {
                    clearInterval(interval)
                    this.$nextTick(() => {
                      $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                      $('input[name=\'APP\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                    })
                  }
                }, 100)
@@ -1244,14 +1249,14 @@
                appIsSelected2 = true
                const interval = setInterval(() => {
                  if ($("input[name='PC']").length > 0) {
                  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)// è‡ªå®šä¹‰å•选框回显
                      $('input[name=\'PC\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                      $('input[name=\'APP\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                    })
                  }
                }, 100)
@@ -1268,13 +1273,13 @@
                pcIsSelected2 = true
                const interval = setInterval(() => {
                  if ($("input[name='PC']").length > 0) {
                  if ($('input[name=\'PC\']').length > 0) {
                    waitFlag = true
                  }
                  if (waitFlag) {
                    clearInterval(interval)
                    this.$nextTick(() => {
                      $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                      $('input[name=\'PC\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                    })
                  }
                }, 100)
@@ -1290,13 +1295,13 @@
                appIsSelected2 = true
                const interval = setInterval(() => {
                  if ($("input[name='APP']").length > 0) {
                  if ($('input[name=\'APP\']').length > 0) {
                    waitFlag = true
                  }
                  if (waitFlag) {
                    clearInterval(interval)
                    this.$nextTick(() => {
                      $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                      $('input[name=\'APP\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                    })
                  }
                }, 100)
@@ -1552,10 +1557,10 @@
            this.$nextTick(() => {
              if (item.name === 'PC') {
                $("input[name='PC']").eq(0).prop('checked', false)// è‡ªå®šä¹‰å•选框回显
                $('input[name=\'PC\']').eq(0).prop('checked', false)// è‡ªå®šä¹‰å•选框回显
              }
              if (item.name === 'APP') {
                $("input[name='APP']").eq(0).prop('checked', false)// è‡ªå®šä¹‰å•选框回显
                $('input[name=\'APP\']').eq(0).prop('checked', false)// è‡ªå®šä¹‰å•选框回显
              }
              // $("input[name='APP']").eq(0).prop('checked', false)// è‡ªå®šä¹‰å•选框回显
              // $('input:checkbox').eq(index).prop('checked', false)// è‡ªå®šä¹‰å•选框回显
@@ -1578,10 +1583,10 @@
            item.isSelected2 = true
            this.$nextTick(() => {
              if (item.name === 'PC') {
                $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                $('input[name=\'PC\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              }
              if (item.name === 'APP') {
                $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                $('input[name=\'APP\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              }
              // $('input:checkbox').eq(index).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
            })
@@ -1604,10 +1609,10 @@
            item.isSelected2 = true
            this.$nextTick(() => {
              if (item.name === 'PC') {
                $("input[name='PC']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                $('input[name=\'PC\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              }
              if (item.name === 'APP') {
                $("input[name='APP']").eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
                $('input[name=\'APP\']').eq(0).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
              }
              // $('input:checkbox').eq(index).prop('checked', true)// è‡ªå®šä¹‰å•选框回显
            })
@@ -1713,10 +1718,11 @@
<!--公共页面样式-->
<style lang="scss" scoped>
$main_color: #42b983;
::v-deep .el-button--text{
  font-size: 14px ;
  cursor: pointer ;
::v-deep .el-button--text {
  font-size: 14px;
  cursor: pointer;
}
.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
  color: $main_color;
  cursor: pointer;
@@ -1805,23 +1811,25 @@
  margin-bottom: 0;
}
.tableFixed{
  ::v-deep .el-table__fixed-right{
.tableFixed {
  ::v-deep .el-table__fixed-right {
    height: 100% !important;
  }
  ::v-deep .el-table__fixed{
  ::v-deep .el-table__fixed {
    height: 100% !important;
  }
}
</style>
<style>
.osloading{
.osloading {
  font-size: 26px !important;
}
.el-loading-text{
.el-loading-text {
  font-size: 26px !important;
}
.el-table .custom-row {
  background: #f8f8fa;
}
src/views/scgl/sckbg.vue
@@ -117,7 +117,7 @@
              </el-table-column>
              <el-table-column
                prop="good_qty"
                label="已报工数量"
                label="合格数量"
                sortable="custom"
                width="160"
              />
@@ -440,7 +440,7 @@
              />
              <el-table-column
                prop="good_qty"
                label="已报工数量"
                label="合格数量"
                sortable="custom"
                min-width="160"
              />
@@ -592,7 +592,7 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item v-if="dialogTitle==='自制报工'" label="报工数量:" prop="startqty">
        <el-form-item v-if="dialogTitle==='自制报工'" label="合格数量:" prop="startqty">
          <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />
          <!--          <el-input v-model="dialogForm.noreportqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />-->
        </el-form-item>
@@ -1002,7 +1002,7 @@
        <el-form-item label="任务数量:">
          <div style="width: 200px">{{ badDialogForm.plan_qty }}</div>
        </el-form-item>
        <el-form-item label="报工数量:">
        <el-form-item label="合格数量:">
          <div style="width: 200px">{{ badDialogForm.good_qty }}</div>
        </el-form-item>
        <el-form-item label="不良数量:">
@@ -1062,7 +1062,7 @@
            width="80"
          />
          <el-table-column
            label="报工数量"
            label="合格数量"
            width="80"
            prop="report_qty"
          />
@@ -2065,8 +2065,8 @@
              taskqty: this.dialogForm.planqty, // ä»»åŠ¡æ•°é‡
              // startqty: this.dialogForm.startqty, // å¼€å·¥æ•°é‡
              startqty: this.dialogForm.reportqty, // å¼€å·¥æ•°é‡
              // reportqty: this.dialogForm.reportqty, // æŠ¥å·¥æ•°é‡
              reportqty: this.dialogForm.startqty, // æŠ¥å·¥æ•°é‡
              // reportqty: this.dialogForm.reportqty, // åˆæ ¼æ•°é‡
              reportqty: this.dialogForm.startqty, // åˆæ ¼æ•°é‡
              remarks: this.dialogForm.remarks, // å¤‡æ³¨
              ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // ä¸è‰¯æ•°é‡
              badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// ä¸è‰¯åŽŸå› 
@@ -2229,7 +2229,7 @@
        this.badDialogForm.nextstepcode = res.data1.nextstepcode
        this.badDialogForm.nextstepname = res.data1.nextstepname
        this.badDialogForm.plan_qty = res.data1.planqty
        this.badDialogForm.good_qty = res.data1.noreportqty // æŠ¥å·¥æ•°é‡
        this.badDialogForm.good_qty = res.data1.noreportqty // åˆæ ¼æ•°é‡
        this.badDialogForm.ng_qty = res.data1.noputqty // ä¸è‰¯æ•°é‡
        this.badTableDataDialog = res.data2
src/views/zlgl/gxjy.vue
@@ -1,410 +1,336 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div style="padding-top: 10px;display: flex;flex-direction: column">
        <div style="margin-bottom: 15px;font-size: 14px">
          <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />扫码信息
        </div>
        <div style="display: flex;align-items: center">
          <div style="width: 90px;display: flex">
            <div style="color: red;width:10px">*</div>
            æ‰«ææ¡ç ï¼š
          </div>
          <el-input
            v-model="form.orderstepqrcode"
            name="GXproduceCode"
            style="width: 300px"
            @keyup.enter.native="val=>enterNative(val,'GXproduceCode')"
          />
          <!--          @keyup.native="e=>judgeIsScanning(e,'GXproduceCode')"-->
    <div class="body" :style="{height:mainHeight+'px'}" style="background-color: #eaecef">
      <div
        style="background-color: #f8f8fa;margin: 10px 0;
         overflow-y:auto;overflow-x: hidden;
        display: flex;flex-direction: column"
        :style="{height:mainHeight+'px'}"
      >
        <div class="content1">
          <div>
            <i class="el-icon-s-operation" style="font-size: 14px" :style="{color:$store.state.settings.theme}" />
          </div>
          <div class="title">
            æ‰«æä¿¡æ¯
          </div>
        </div>
        <!--        å…­é¡¹ä¿¡æ¯      -->
        <div v-if="!isIpad" style="background:#f8f8fa ;display:flex;margin-top: 10px;align-items: center; line-height: 50px">
          <div style="display: flex; margin-left: 10px">
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">工单编码:</div>
              <div style="width: 150px">{{ form.wo_code }}</div>
            </div>
            <div style="display: flex;">
              <div style="width: 90px">产品编码:</div>
              <div style="width: 150px">{{ form.partcode }}</div>
            </div>
        <div class="content2">
          <el-form :inline="true" label-width="80px">
            <el-form-item label="检验类型">
              <el-select
                v-model="form.checktype"
                style="width: 160px;"
                placeholder="请选择"
                filterable
              >
                <el-option
                  v-for="item in checktypeArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="扫码条码">
              <el-input
                v-model="form.orderstepqrcode"
                name="GXproduceCode"
                style="width: 250px"
                placeholder="请扫码工单工序码"
                @keyup.enter.native="enterNative"
              />
            </el-form-item>
          </el-form>
        </div>
        <div class="content1">
          <div>
            <i class="el-icon-s-operation" style="font-size: 14px" :style="{color:$store.state.settings.theme}" />
          </div>
          <div style="display: flex;margin-left: 30px;">
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">产品名称:</div>
              <div style="width: 150px">{{ form.partname }}</div>
            </div>
            <div style="display: flex;">
              <div style="width: 90px">产品规格:</div>
              <div style="width: 150px">{{ form.partspec }}</div>
            </div>
          <div class="title">
            å·¥å•信息
          </div>
          <div style=" display: flex;margin-left: 30px;">
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">工序编码:</div>
              <div style="width: 150px">{{ form.stepcode }}</div>
            </div>
            <div style="display: flex;">
              <div style="width: 90px">工序名称:</div>
              <div style="width: 150px">{{ form.stepname }}</div>
            </div>
        </div>
        <div class="content2" style="width: 60%;margin-left: 30px;">
          <div class="orderMsg">单据编号:{{ form.wocode }}</div>
          <div class="orderMsg">物料编码:{{ form.partcode }}</div>
          <div class="orderMsg">物料名称:{{ form.partname }}</div>
        </div>
        <div class="content2" style="width: 60%;margin-left: 30px;">
          <div class="orderMsg">物料规格:{{ form.partspec }}</div>
          <div class="orderMsg">工序编码:{{ form.stepcode }}</div>
          <div class="orderMsg">工序名称:{{ form.stepname }}</div>
        </div>
        <div class="content1">
          <div>
            <i class="el-icon-s-operation" style="font-size: 14px" :style="{color:$store.state.settings.theme}" />
          </div>
          <div class="title">
            è´¨æ£€æ–¹æ¡ˆ
          </div>
        </div>
        <div class="content2" style="width: 60%;margin-left: 30px;">
          <div class="orderMsg">方案名称:{{ form.checkstandname }}</div>
          <div class="orderMsg">抽样方式:{{
            form.sampmethod === 'FIXED' ? '固时抽检' : form.sampmethod === 'SCARE' ? '比例抽检' : ''
          }}
          </div>
        </div>
        <div class="content2" style="width: 60%;margin-left: 30px;">
          <div class="orderMsg">报工数量:{{ form.good_qty }}</div>
          <div class="orderMsg">样本数量:
            <el-input-number
              v-if="form.good_qty"
              v-model="form.sampscare"
              :max="form.good_qty"
              :min="1"
              size="medium"
              @change="numberChange"
            />
          </div>
        </div>
        <div
          v-if="checkItemArr.length>0"
          class="content1"
        >
          <div>
            <i class="el-icon-s-operation" style="font-size: 14px" :style="{color:$store.state.settings.theme}" />
          </div>
          <div class="title">
            æ£€éªŒé¡¹ç›®
          </div>
        </div>
        <div
          v-if="isIpad"
          style="display:flex;margin-top: 10px;align-items: center;line-height: 30px; flex-direction: column"
          v-if="form.sampscare!==1&&checkItemArr.length>0"
          class="content2"
          style="width: 60%;"
        >
          <div style="display: flex; justify-content: flex-start;width: 100%">
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">工单编码:</div>
              <div style="width: 200px">{{ form.wo_code }}</div>
            </div>
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">产品编码:</div>
              <div style="width: 200px">{{ form.partcode }}</div>
            </div>
            <div style="display: flex;">
              <div style="width: 90px">产品名称:</div>
              <div style="width: 200px">{{ form.partname }}</div>
            </div>
          </div>
          <div style=" display: flex; justify-content: flex-start;margin-top: 10px;width: 100%">
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">产品规格:</div>
              <div style="width: 200px">{{ form.partspec }}</div>
            </div>
            <div style="display: flex;margin-right: 50px">
              <div style="width: 90px">工序编码:</div>
              <div style="width: 200px">{{ form.stepcode }}</div>
            </div>
            <div style="display: flex;">
              <div style="width: 90px">工序名称:</div>
              <div style="width: 200px">{{ form.stepname }}</div>
            </div>
          </div>
          <el-link :underline="false" :disabled="!(stepActive>0)" style="width: 60px;margin-top: 5px" @click="pre">上一件
          </el-link>
          <el-steps :active="stepActive" style="width: 70%;margin:0 10px;" finish-status="success">
            <el-step v-for="item in form.sampscare" :key="item" title="" />
          </el-steps>
          <el-link
            :underline="false"
            :disabled="!(stepActive < form.sampscare-1)"
            style="width: 60px;margin-top: 5px"
            @click="next"
          >下一件
          </el-link>
        </div>
        <div style="margin: 15px 0;font-size: 14px">
          <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />检验标准信息
        </div>
        <div style="display: flex;align-items: center">
          <div style="width: 90px;display: flex">
            <div style="color: red;width:10px">*</div>
            æ£€éªŒæ ‡å‡†ï¼š
          </div>
          <el-select
            v-model="checkStandard"
            style="width: 200px;"
            placeholder="请选择"
            filterable
            @change="changeCheckStandard"
        <div
          class="content2"
          style="flex-direction: column;justify-content:flex-start;width: 480px;margin-top: 10px;"
        >
          <div
            v-for="(item,index) in checkItemArr"
            v-if="stepActive+1===item.checkNumber"
            :key="item.code+(stepActive+1).toString()"
            :style="{borderBottom:(index+1)%checkItemArr.map(i=>i.checkNumber===1).filter(i=>i).length!==0?`1px solid rgba(48,49,51,0.2)`:''}"
            class="checkItem"
          >
            <el-option
              v-for="item in checkStandardSelect"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
          <div style="width: 90px;margin-left: 50px;display: flex">
            <div style="color: red;width:10px">*</div>
            æ£€éªŒäººå‘˜ï¼š
          </div>
          <el-select
            v-model="checkUser"
            style="width: 200px;"
            placeholder="请选择"
            filterable
          >
            <el-option
              v-for="item in checkUserSelect"
              :key="item.usercode"
              :label="item.username"
              :value="item.usercode"
            />
          </el-select>
          <div style="width: 90px;margin-left: 50px;display: flex">
            <div style="color: red;width:10px">*</div>
            æ£€éªŒæ•°é‡ï¼š
          </div>
          <el-input v-model="checkqty" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
        </div>
        <!--   æ£€éªŒç»“æžœ   å’Œ  æ£€éªŒå¤‡æ³¨      -->
        <div style="display: flex;margin-top: 20px;align-items: center">
            <div style="display: flex;justify-content: space-between;align-items: center">
              <div style="display: flex;width: 300px;">
                <div class="serialNumber">{{ item.stepcheckitem_seq }}</div>
                <div style="display: flex;align-items: center">{{ item.name }}</div>
              </div>
          <div style="display: flex;margin-right: 50px;align-items: center">
            <div style="width: 90px;display: flex">
              <div style="color: red;width:10px">*</div>
              æ£€éªŒç»“果:
              <div v-show="item.numberjudge==='N'" style="width: 150px;display: flex;padding-left: 20px">
                <el-button
                  type="primary"
                  size="mini"
                  :plain="!item.check_result"
                  @click="checkResultClick('OK',item)"
                >合格
                </el-button>
                <el-button
                  type="warning"
                  size="mini"
                  :plain="item.check_result"
                  @click="checkResultClick('NG',item)"
                >不合格
                </el-button>
              </div>
              <div v-show="item.numberjudge!=='N'" style="width: 150px;" />
            </div>
            <el-select
              v-model="checkResult"
              style="width: 200px;"
              placeholder="请选择"
              filterable
            >
              <el-option
                v-for="item in checkResultSelect"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
          </div>
          <div style="display: flex;align-items: center">
            <div style="width: 90px">检验备注:</div>
            <el-input v-model="checkdescr" style="width: 540px" placeholder="请输入" />
          </div>
        </div>
        <div style="margin: 15px 0;font-size: 14px">
          <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />检验项信息
        </div>
        <div>
          <el-button type="primary" @click="add">新增</el-button>
        </div>
        <div style="margin-top: 10px">
          <el-table
            ref="multipleTable"
            :data="JYTableData"
            :height="tableHeight+'px'"
            border
            :row-class-name="tableRowClassName"
            :style="{width: 100+'%',height:tableHeight+'px',}"
            highlight-current-row
            :header-cell-style="this.$headerCellStyle"
            :cell-style="this.$cellStyle"
            @selection-change="handleSelectionChange"
            @cell-dblclick="cellDblclick"
          >
            <el-table-column
              type="index"
              label="序号"
              width="100"
              fixed
            />
            <!--            <el-table-column-->
            <!--              prop="code"-->
            <!--              label="检验项目编码(名称)"-->
            <!--            >-->
            <!--              <template slot-scope="{row}">-->
            <!--                <div v-if="row.isVisible===0" style="display: flex;">-->
            <!--                  <div>{{ row.code }}</div>-->
            <!--                  <div style="margin-left: 10px">{{ row.name }}</div>-->
            <!--                </div>-->
            <!--                <el-select-->
            <!--                  v-if="row.isVisible===1"-->
            <!--                  v-model="row.code"-->
            <!--                  filterable-->
            <!--                  style="width: 400px;"-->
            <!--                  placeholder="请选择"-->
            <!--                  @change="val=>changeCode(val,row)"-->
            <!--                >-->
            <!--                  <el-option-->
            <!--                    v-for="item in JYSelectArr"-->
            <!--                    :key="item.code"-->
            <!--                    :label="item.code+''+item.name"-->
            <!--                    :value="item.code"-->
            <!--                  />-->
            <!--                </el-select>-->
            <!--              </template>-->
            <!--            </el-table-column>-->
            <el-table-column
              prop="code"
              label="检验标准编码"
            >
              <template slot-scope="{row}">
                <div v-if="row.isVisible===0">{{ row.code }}</div>
                <el-select
                  v-if="row.isVisible===1"
                  v-model="row.code"
                  style="width: 200px;"
                  placeholder="请选择"
                  @change="val=>changeName(val,row)"
                >
                  <el-option
                    v-for="item in JYSelectArr"
                    :key="item.name"
                    :label="item.code"
                    :value="item.name"
            <div style="display: flex;margin-bottom: 5px">
              <div style="display: flex;flex-direction: column">
                <div v-if="item.standvalue" class="itemTitle">标准值</div>
                <div v-if="item.uppervalue" class="itemTitle">上限值</div>
                <div v-if="item.lowervalue" class="itemTitle">下限值</div>
                <div v-if="item.stepcheckitem_desc" class="itemTitle">描述</div>
                <div v-if="item.numberjudge!=='N'" class="itemTitle">实测值
                  <el-input
                    v-model="item.real_value"
                    size="mini"
                    oninput="value=value.replace(/[^0-9]/g,'')"
                    style="width: 100px;margin-left: 5px"
                    @input="val=>inputChange(val,item)"
                  />
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              prop="name"
              label="检验标准名称"
            >
              <template slot-scope="{row}">
                <div v-if="row.isVisible===0">{{ row.name }}</div>
                <el-select
                  v-if="row.isVisible===1"
                  v-model="row.name"
                  style="width: 200px;"
                  placeholder="请选择"
                  @change="val=>changeName(val,row)"
                >
                  <el-option
                    v-for="item in JYSelectArr"
                    :key="item.code"
                    :label="item.name"
                    :value="item.code"
                  />
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              prop="stepcheckitem_desc"
              label="检验标准描述"
            >
              <template slot-scope="scope">
                <el-input
                  v-if="scope.row.isVisible===1||scope.row.index === tabClickIndex && tabClickLabel === '检验标准描述'"
                  v-model="scope.row.stepcheckitem_desc"
                  placeholder="请输入"
                  @keyup.enter.native="val=>keyUpEnterNative(val,scope.row)"
                />
                <div
                  v-else
                > {{ scope.row.stepcheckitem_desc }}
                </div>
              </div>
              <div style="display: flex;flex-direction: column">
                <div v-if="item.standvalue" class="itemContent">{{ item.standvalue }}</div>
                <div v-if="item.uppervalue" class="itemContent">{{ item.uppervalue }}</div>
                <div v-if="item.lowervalue" class="itemContent">{{ item.lowervalue }}</div>
                <div v-if="item.stepcheckitem_desc" class="itemContent">{{ item.stepcheckitem_desc }}</div>
              </template>
            </el-table-column>
            <el-table-column
              prop="result"
              label="检验结果"
              width="100"
            >
              <template slot-scope="{row}">
                <div v-if="row.result==='OK'">合格</div>
                <div v-if="row.result==='NG'">不良</div>
              </template>
              <!--              <template slot-scope="{row}">-->
              <!--                <el-radio-group-->
              <!--                  v-model="row.result"-->
              <!--                  size="small"-->
              <!--                  @change="a=>changeRadioValue(a,row)"-->
              <!--                >-->
              <!--                  <el-radio-->
              <!--                    :label="0"-->
              <!--                    @change="clickRadio(0,row)"-->
              <!--                  >-->
              <!--                    åˆæ ¼-->
              <!--                  </el-radio>-->
              <!--                  <el-radio-->
              <!--                    :label="1"-->
              <!--                    @change="clickRadio(1,row)"-->
              <!--                  >-->
              <!--                    ä¸è‰¯-->
              <!--                  </el-radio>-->
              <!--                </el-radio-group>-->
              <!--              </template>-->
            </el-table-column>
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column
              label="操作"
              fixed="right"
            >
              <template slot-scope="{row}">
                <div class="operationClass">
                  <el-button v-if="row.isVisible===0" type="text" @click="del(row)">删除</el-button>
                  <el-button v-if="row.isVisible===1" type="text" @click="confirm(row)">确认</el-button>
                  <el-button v-if="row.isVisible===1" type="text" @click="cancel(row)">取消</el-button>
                <div v-show="item.numberjudge!=='N'" class="itemContent" style="width: 150px;display: flex">
                  <el-button
                    type="primary"
                    size="mini"
                    :disabled="item.required==='Y'&&!item.real_value"
                    :plain="!item.check_result"
                    @click="checkResultClick('OK',item)"
                  >合格
                  </el-button>
                  <el-button
                    type="warning"
                    size="mini"
                    :disabled="item.required==='Y'&&!item.real_value"
                    :plain="item.check_result"
                    @click="checkResultClick('NG',item)"
                  >
                    ä¸åˆæ ¼
                  </el-button>
                </div>
              </template>
            </el-table-column>
          </el-table>
              </div>
            </div>
          </div>
        </div>
        <div style="display: flex;margin: 30px 0;align-items: center">
          <el-button type="primary" @click="submitButton('FirstCheck')">首检保存</el-button>
          <el-button type="primary" style="margin-left: 50px" @click="submitButton('PatroCheck')">巡检保存</el-button>
          <el-button type="primary" style="margin-left: 50px" @click="submitButton('EndCheck')">完工检保存</el-button>
          <el-button type="info" style="margin-left: 50px" @click="submitButton('Cancel')">取消</el-button>
        <div
          v-if="checkItemArr.filter(i=>i.check_result!=='').length===checkItemArr.length&&checkItemArr.length>0"
          class="content1"
        >
          <div>
            <i class="el-icon-s-operation" style="font-size: 14px" :style="{color:$store.state.settings.theme}" />
          </div>
          <div class="title">
            æ£€éªŒç»“æžœ
          </div>
        </div>
        <div
          v-if="checkItemArr.filter(i=>i.check_result!=='').length===checkItemArr.length&&checkItemArr.length>0"
          class="content2"
          style="width: 60%;margin-left: 30px;"
        >
          <div class="orderMsg2">样本数量:{{ form.sampscare }}</div>
          <div class="orderMsg2">合格数量:{{ form.goodqty }}</div>
          <div class="orderMsg2">不合格数量:{{ form.ngqty }}</div>
          <div style="width: 290px;display: flex;align-items: center" class="resultButton">
            <div style="width: 70px;">判定结果:</div>
            <el-button type="primary" size="medium" :plain="!check_result" @click="check_result=true">合格</el-button>
            <el-button type="warning" size="medium" :plain="check_result" @click="check_result=false">不合格</el-button>
          </div>
        </div>
        <div
          v-if="checkItemArr.filter(i=>i.check_result!=='').length===checkItemArr.length&&checkItemArr.length>0"
          class="content2   submitButton"
          style="margin-top: 10px;margin-bottom: 10px;"
        >
          <el-button
            v-waves
            type="primary"
            @click="submitButton"
          >提交
          </el-button>
        </div>
      </div>
    </div>
    </div>
  </div>
</template>
<script>
// import Pagination from '@/components/Pagination'
// const SER_HZ = /^[\u4e00-\u9fa5]+$/
import waves from '@/directive/waves'
import $ from 'jquery'
import {
  MesOrderStepCheckItemList,
  MesOrderStepCheckSearch,
  MesOrderStepCheckSelect, SaveMesOrderStepCheckItem,
  StepCheckItemSelect
} from '@/api/zlgl'
import { MesOrderSelectUser } from '@/api/scgl'
import { MesOrderStepCheckItemList, MesOrderStepCheckSearch, SaveMesOrderStepCheckItem } from '@/api/zlgl'
import { getCookie } from '@/utils/auth'
export default {
  name: 'QXDY',
  // components: {
  //   Pagination
  // },
  name: 'Zzjg',
  directives: { waves },
  data() {
    return {
      isIpad: false,
      mouseHoverType: 'mouseout',
      isExpandForm: false,
      mainHeight: 0,
      tableHeight: 0,
      form: { // å·¥åº
        // MO-2022-07-0001_1;001
        orderstepqrcode: '', // æ‰«æçš„二维码信息
        wo_code: '', // å·¥å•编码
        partcode: '', // äº§å“ç¼–码
        partname: '', // äº§å“åç§°
        partspec: '', // äº§å“è§„æ ¼
        stepcode: '', // å·¥åºç¼–码
        stepname: ''// å·¥åºåç§°
      },
      checkStandard: '', // æ£€éªŒæ ‡å‡†
      checkStandardSelect: [], // æ£€éªŒæ ‡å‡†ä¸‹æ‹‰æ•°ç»„
      checkUser: getCookie('navTabId'), // æ£€éªŒäººå‘˜
      checkqty: 0, // æ£€éªŒæ•°é‡
      checkUserSelect: [], // æ£€éªŒäººå‘˜ä¸‹æ‹‰æ•°ç»„
      checkResult: '', // æ£€éªŒç»“æžœ
      checkResultSelect: [
        { code: 'OK', name: '合格' },
        { code: 'NG', name: '不良' }
      ], // æ£€éªŒç»“果下拉数组
      checkdescr: '', // æ£€éªŒå¤‡æ³¨ï¼ˆæè¿°ï¼‰
      JYTableData: [], // æ£€éªŒé¡¹ä¿¡æ¯è¡¨æ ¼
      JYSelectArr: [], // æ£€éªŒä¸‹æ‹‰æ•°ç»„
      // JYSelectedArr: [], // å·²é€‰æ£€éªŒé¡¹ç›®æ•°ç»„
      JYIsCancel: true,
      multipleSelection: [], // è¡¨æ ¼å¤šé€‰æ¡†
      tabClickIndex: null, // ç‚¹å‡»çš„单元格
      tabClickLabel: '', // å½“前点击的列名
      isCancel: false, // æ˜¯å¦ç‚¹å‡»å–消按钮
      judgeIsScanningArr: []// åˆ¤æ–­æ˜¯å¦æ‰«ç æ•°ç»„
      form: {
        orderstepqrcode: '', // æ‰«æå·¥åºäºŒç»´ç ä¿¡æ¯
        checktype: 'FirstCheck',
        wocode: '',
        partcode: '',
        partname: '',
        partspec: '',
        stepcode: '',
        stepname: '',
        checkstandcode: '',
        checkstandname: '',
        check_type: '',
        sampmethod: '', // FIXED(固时抽检)  SCARE(比例抽检)
        sampscare: '',
        qualitystatus: '',
        good_qty: '', // æŒ‡çš„æŠ¥å·¥æ•°é‡
        sampleqty: '',
        goodqty: '', // åˆæ ¼æ•°é‡
        ngqty: '', // ä¸è‰¯æ•°é‡
        // checkitemcont: [],
        username: getCookie('admin')
      },
      checktypeArr: [
        { code: 'FirstCheck', name: '首检' },
        { code: 'PatroCheck', name: '巡检' },
        { code: 'EndCheck', name: '完工检' }
      ],
      stepActive: 0, // å½“前处于第几件
      checkItemArr: [],
      check_result: ''
    }
  },
  watch: {
    'checkItemArr': {
      deep: true, // æ·±åº¦ç›‘听时  ç›‘听到属性              å½“不为深度监听时,可监听长度
      handler: function(val) {
        // do something with the new and old value of myArray
        this.form.goodqty = 0
        for (var i = 0; i < this.form.sampscare; i++) {
          const flag = this.checkItemArr.filter(j => j.checkNumber === i + 1).every(j => j.check_result)
          if (flag) {
            this.form.goodqty++
          }
        }
        this.form.ngqty = this.form.sampscare - this.form.goodqty
      }
    }
  },
  created() {
    this.handleRequest()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
@@ -413,371 +339,236 @@
    this.getFocus()
  },
  methods: {
    handleRequest() {
      this.getMesOrderStepCheckSelect().then(res => {
        if (res.code === '200') {
          this.getMesOrderSelectUser()
          this.getJYSelectArr()
        }
      })
    },
    // èŽ·å–èšç„¦
    getFocus() {
      this.$nextTick(() => {
        $("input[name='GXproduceCode']")[0].focus()
        $('input[name=\'GXproduceCode\']')[0].focus()
      })
    },
    // èŽ·å–æ£€éªŒæ ‡å‡†ä¸‹æ‹‰æ•°ç»„
    async getMesOrderStepCheckSelect() {
      const res = await MesOrderStepCheckSelect()
      this.checkStandardSelect = res.data
      return { code: res.code }
    },
    // èŽ·å–æ£€éªŒäººå‘˜ä¸‹æ‹‰
    async getMesOrderSelectUser() {
      const { data: res } = await MesOrderSelectUser()
      this.checkUserSelect = res
    },
    // èŽ·å–æ£€éªŒé¡¹ä¸‹æ‹‰æ•°ç»„
    async getJYSelectArr() {
      const { data: res } = await StepCheckItemSelect()
      this.JYSelectArr = res
    },
    // æ£€éªŒæ ‡å‡†ä¸‹æ‹‰å€¼æ”¹å˜
    async changeCheckStandard(val) {
      await this.getJYSelectArr()
      this.isCancel = false
      const { data: res } = await MesOrderStepCheckItemList({ checkstandcode: val })
      this.JYTableData = res
      // let arr = […b].filter(x => […a].every(y => y.id !== x.id));
      this.JYSelectArr = [...this.JYSelectArr].filter(x => [...this.JYTableData].every(y => y.code !== x.code))
      this.JYTableData.forEach(item => {
        let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
        number = number === 0 ? (10 + Math.random()) : number
        // item.result = 0 // 0合格  1不良
        item.result = 'OK'
        item.isVisible = 0
        item.number = number
      })
      this.$refs.multipleTable.toggleAllSelection()
    },
    // changeRadioValue(val, row) {
    //   console.log(val, row.result, 20000)
    // },
    // clickRadio(e, row) {
    //   console.log(e, row.result, 10000)
    //   row.result = e
    // },
    handleSelectionChange(val) {
      this.multipleSelection = val
      const arr = this.multipleSelection.map(i => i.number)
      this.JYTableData.forEach(it => {
        if (arr.includes(it.number)) {
          it.result = 'OK'
        } else {
          it.result = 'NG'
        }
      })
      if (this.multipleSelection.length > 0 && this.multipleSelection.length === this.JYTableData.length) {
        this.checkResult = 'OK'
      } else {
        this.checkResult = 'NG'
    async enterNative() {
      const data = {
        orderstepqrcode: this.form.orderstepqrcode,
        checktype: this.form.checktype
      }
      if (this.isCancel) {
        this.checkResult = ''
      }
      const { data: res } = await MesOrderStepCheckSearch(data)
      this.form.wocode = res.labcont[0].wo_code
      this.form.partcode = res.labcont[0].partcode
      this.form.partname = res.labcont[0].partname
      this.form.partspec = res.labcont[0].partspec ? res.labcont[0].partspec : '/'
      this.form.stepcode = res.labcont[0].stepcode
      this.form.stepname = res.labcont[0].stepname
      this.form.good_qty = res.labcont[0].good_qty
      this.form.checkstandcode = res.chekstand[0].checkstandcode
      this.form.checkstandname = res.chekstand[0].checkstandname
      this.form.sampmethod = res.chekstand[0].sampmethod
      this.form.sampscare = res.chekstand[0].sampmethod === 'FIXED' ? res.chekstand[0].sampscare
        : res.labcont[0].good_qty * res.chekstand[0].sampscare / 100
      this.form.sampscare = this.form.sampscare <= this.form.good_qty ? this.form.sampscare : this.form.good_qty
      await this.getMesOrderStepCheckItemList()
    },
    // æ£€éªŒé¡¹ç›®ç¼–码(名称)
    changeName(val, row) {
      const res = this.JYSelectArr.find(item => {
        return item.code === val || item.name === val
      })
      row.code = res.code
      row.name = res.name
      row.stepcheckitem_desc = res.descr
    },
    // é˜²æŠ–      //扫码用的是防抖
    fnThrottle(method, delay, duration, belong) {
      var that = this
      var timer = this.timer
      var begin = new Date().getTime()
      return function() {
        var current = new Date().getTime()
        clearTimeout(timer)
        if (current - begin >= duration) {
          // method()
          // that.VALUE()
          begin = current
        } else {
          that.timer = setTimeout(function() {
            // method()
            that.enterNative(that.form.orderstepqrcode, belong)
          }, delay)
        }
      }
    },
    // åˆ¤æ–­æ˜¯å¦æ˜¯æ‰«ç æžªæ‰«ç 
    judgeIsScanning(e, belong) {
      const timenow = e.timeStamp
      let flag = true
      this.judgeIsScanningArr.push(timenow)
      let i
      for (i in this.judgeIsScanningArr) {
        flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
        if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
          if (flag) {
            this.fnThrottle(this.enterNative, 500, 2000, belong)()
            return
          }
        }
      }
    },
    // æ‰«ç é”®ç›˜å›žè½¦äº‹ä»¶
    async enterNative(val, belong) {
      if (belong === 'GXproduceCode') {
        const res = await MesOrderStepCheckSearch({ orderstepqrcode: this.form.orderstepqrcode })
        this.form.wo_code = res.data[0].wo_code
        this.form.partcode = res.data[0].partcode
        this.form.partname = res.data[0].partname
        this.form.partspec = res.data[0].partspec
        this.form.stepcode = res.data[0].stepcode
        this.form.stepname = res.data[0].stepname
      }
    },
    async getMesOrderStepCheckItemList() {
      const { data: res } = await MesOrderStepCheckItemList({ checkstandcode: this.form.checkstandcode })
      // this.checkItemArr = res
      this.checkItemArr = []
      for (let i = 0; i < this.form.sampscare; i++) {
        res.forEach(j => {
          this.checkItemArr.push({
            checkNumber: i + 1,
            stepcheckitem_seq: j.stepcheckitem_seq,
            name: j.name,
            code: j.code,
            standvalue: j.standvalue,
            lowervalue: j.lowervalue,
            uppervalue: j.uppervalue,
    //  æ–°å¢ž
    add() {
      if (this.JYTableData.length === 0) {
        return this.$message.info('请先选择检验标准!')
      }
      if (this.JYTableData.length > 0 && this.JYTableData[this.JYTableData.length - 1].isVisible === 1) {
        return this.$message.info('请先确定或取消本条记录!')
      }
      let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
      number = number === 0 ? (10 + Math.random()) : number
      const data = { result: 'OK', code: '', name: '', stepcheckitem_desc: '', isVisible: 1, number }
      this.JYTableData.push(data)
      this.$refs.multipleTable.toggleRowSelection(data, true)
      this.JYIsCancel = false
    },
    //  ç¡®è®¤
    confirm(row) {
      if (row.code === '') {
        return this.$message.info('检验项目编码不能为空!')
      }
      if (row.name === '') {
        return this.$message.info('检验项目名称不能为空!')
      }
      this.JYSelectArr.forEach((item, index) => {
        if (item.code === row.code) {
          this.JYSelectArr.splice(index, 1)
        }
      })
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          item.isVisible = 0
          item.code = row.code
          item.name = row.name
          item.result = row.result
          item.stepcheckitem_desc = row.stepcheckitem_desc
        }
      })
      if (this.multipleSelection.length > 0 && this.multipleSelection.length === this.JYTableData.length) {
        this.checkResult = 'OK'
      } else {
        this.checkResult = 'NG'
      }
    },
    //  å–消
    cancel(row) {
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          this.JYTableData.splice(index, 1)
        }
      })
      if (this.JYIsCancel && row.code.toString().length > 0) {
        this.JYSelectArr.splice(0, 0, {
          code: row.code,
          name: row.name,
          descr: row.stepcheckitem_desc
            unit: j.unit,
            stepcheckitem_desc: j.stepcheckitem_desc,
            required: j.required, // æ˜¯å¦å¿…å¡«
            numberjudge: j.numberjudge, // æ•°å€¼åˆ¤æ–­
            real_value: '',
            check_result: j.numberjudge === 'Y' ? '' : true
          })
        })
      }
      this.JYIsCancel = true
      if (this.checkItemArr.every(i => i.check_result)) {
        this.check_result = true
      } else {
        this.check_result = ''
      }
    },
    // åˆ é™¤
    del(row) {
      this.JYSelectArr.splice(0, 0, {
        code: row.code,
        name: row.name,
        descr: row.stepcheckitem_desc
      })
    numberChange(currentValue, oldValue) {
      const t = this.checkItemArr.filter(i => i.checkNumber === 1)
      this.JYTableData.forEach((item, index) => {
        if (item.number === row.number) {
          this.JYTableData.splice(index, 1)
        }
      })
    },
    // æäº¤
    submitButton(val) {
      if (val !== 'Cancel') {
        if (this.form.orderstepqrcode.length < 1) {
          return this.$message.info('扫描条码不能为空!')
        }
        if (this.form.wo_code.toString().length === 0) {
          return this.$message.info('未获得工单编码!')
        }
        if (this.checkStandard.length < 1) {
          return this.$message.info('检验标准不能为空!')
        }
        if (this.checkUser.length < 1) {
          return this.$message.info('检验人员不能为空!')
        }
        if (parseFloat(this.checkqty) <= 0) {
          return this.$message.info('检验数量必须要大于零!')
        }
        if (this.JYTableData.length < 1) {
          return this.$message.info('检验项信息不能为空!')
        }
        if (this.checkResult.length < 1) {
          return this.$message.info('检验结果不能为空!')
        }
      // ä»¶æ•°å˜å°‘时执行
      if (currentValue < this.checkItemArr.length / t.length) {
        this.checkItemArr.reverse()
        this.checkItemArr.splice(0, t.length * (oldValue - currentValue))
        this.checkItemArr.reverse()
        const text = val === 'FirstCheck' ? '首检保存' : (val === 'PatroCheck' ? '巡检保存' : '完工检保存')
        this.$confirm('是否确认' + text + '?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const arr = []
          this.JYTableData = this.JYTableData.filter(item => item.code !== '')
          this.JYTableData.forEach((item, index) => {
            arr.push({
              code: item.code,
              name: item.name,
              seq: (index + 1),
              descr: item.stepcheckitem_desc,
              checkresult: item.result
        this.stepActive = currentValue - 1
      }
      // ä»¶æ•°å˜å¤šæ—¶æ‰§è¡Œ
      if (currentValue > this.checkItemArr.length / t.length) {
        for (let i = currentValue; i > oldValue; i--) {
          t.forEach(j => {
            this.checkItemArr.push({
              checkNumber: i,
              name: j.name,
              code: j.code,
              standvalue: j.standvalue,
              lowervalue: j.lowervalue,
              uppervalue: j.uppervalue,
              unit: j.unit,
              stepcheckitem_desc: j.stepcheckitem_desc,
              required: j.required, // æ˜¯å¦å¿…å¡«
              numberjudge: j.numberjudge, // æ•°å€¼åˆ¤æ–­
              real_value: '',
              check_result: j.numberjudge === 'Y' ? '' : true
            })
          })
          const data = {
            'mesordercode': this.form.wo_code, // å·¥å•编号
            'partcode': this.form.partcode, // äº§å“ç¼–码
            'stepcode': this.form.stepcode, // å·¥åºç¼–码
            'checkstanedcode': this.checkStandard, // æ£€éªŒæ ‡å‡†ç¼–码
            'checkusercode': this.checkUser, // æ£€éªŒäººå‘˜ç¼–码
            'checkqty': this.checkqty, // æ£€éªŒæ•°é‡
            'checktypecode': val, // æ£€éªŒç±»åž‹ç¼–码
            'checkresult': this.checkResult, // æ£€éªŒç»“æžœ(OK(合格) NG(不良))
            'checkdescr': this.checkdescr, // æ£€éªŒæè¿°
            'data': arr
        }
        this.checkItemArr.sort((a, b) => a.checkNumber - b.checkNumber)
      }
    },
    pre() {
      if (this.stepActive > 0) {
        this.stepActive--
      }
    },
    next() {
      if (this.stepActive < this.form.sampscare) {
        this.stepActive++
      }
    },
    inputChange(val, item) {
      if (val !== '') {
        if (item.numberjudge === 'Y') { // å¦‚果需要进行数值判断
          if (item.uppervalue === '' && item.lowervalue === '') { // ä¸Šé™å€¼ä¸ºç©ºï¼Œä¸‹é™å€¼ä¸ºç©º
            item.check_result = parseFloat(val) === parseFloat(item.standvalue)
          }
          SaveMesOrderStepCheckItem(data).then(res => {
            if (res.code === '200') {
              this.$message.success(text + '成功!')
              this.clearContent()
              this.getFocus()
              this.getJYSelectArr()
            }
          if (item.uppervalue !== '' && item.lowervalue !== '') { // ä¸Šé™å€¼ä¸ä¸ºç©ºï¼Œä¸‹é™å€¼ä¸ä¸ºç©º
            item.check_result = parseFloat(val) >= parseFloat(item.lowervalue) && parseFloat(val) <=
              parseFloat(item.uppervalue)
          }
          if (item.uppervalue !== '' && item.lowervalue === '') { // ä¸Šé™å€¼ä¸ä¸ºç©ºï¼Œä¸‹é™å€¼ä¸ºç©º
            item.check_result = parseFloat(val) <= parseFloat(item.uppervalue)
          }
          if (item.uppervalue === '' && item.lowervalue !== '') { // ä¸Šé™å€¼ä¸ºç©ºï¼Œä¸‹é™å€¼ä¸ä¸ºç©º
            item.check_result = parseFloat(val) >= parseFloat(item.lowervalue)
          }
        }
      }
      if (val === '') {
        item.check_result = ''
      }
      this.check_result = !!this.checkItemArr.every(i => i.check_result)
    },
    checkResultClick(val, item) {
      item.check_result = val === 'OK'
      if (this.checkItemArr.filter(i => i.check_result !== '').length === this.checkItemArr.length) {
        this.check_result = !!this.checkItemArr.every(i => i.check_result)
      }
    },
    submitButton() {
      this.$confirm('是否确认提交?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const checkitemcont = []
        this.checkItemArr.forEach((i, index) => {
          checkitemcont.push({
            checknum: i.checkNumber + '/' + this.checkItemArr.length / this
              .checkItemArr.filter(j => j.checkNumber === 1).length,
            checkiem_seq: i.stepcheckitem_seq,
            checkitem_code: i.code,
            checkitem_name: i.name,
            check_value: i.real_value ? i.real_value : '',
            check_result: i.check_result ? 'OK' : 'NG',
            checkitem_descr: ''
          })
        }).catch(() => {
          this.$message.info('已取消保存')
        })
      } else {
        this.clearContent()
        this.getFocus()
        this.getJYSelectArr()
      }
    },
    // æ¸…空页面内容
    clearContent() {
      this.JYTableData = []
      this.multipleSelection = []
      this.checkdescr = ''
      this.checkUser = getCookie('navTabId')
      this.checkqty = 0
      this.checkResult = ''
      this.checkStandard = ''
      this.form.orderstepqrcode = ''
      this.form.wo_code = ''
      this.form.partcode = ''
      this.form.partname = ''
      this.form.partspec = ''
      this.form.stepcode = ''
      this.form.stepname = ''
      this.judgeIsScanningArr = []
        const data = {
          wocode: this.form.wocode,
          partcode: this.form.partcode,
          stepcode: this.form.stepcode,
          checkstandcode: this.form.checkstandcode,
          check_type: this.form.checktype,
          sampmethod: this.form.sampmethod,
          qualitystatus: this.check_result ? 'OK' : 'NG',
          good_qty: this.form.good_qty,
          sampleqty: this.form.sampscare,
          goodqty: this.form.goodqty,
          ngqty: this.form.ngqty,
          admin: this.form.username,
          checkitemcont
        }
      this.isCancel = true
        SaveMesOrderStepCheckItem(data).then(res => {
          if (res.code === '200') {
            this.form.orderstepqrcode = ''
            this.form.wocode = ''
            this.form.partcode = ''
            this.form.partname = ''
            this.form.partspec = ''
            this.form.stepcode = ''
            this.form.stepname = ''
            this.form.checkstandcode = ''
            this.form.checkstandname = ''
            this.form.check_type = ''
            this.form.sampmethod = ''// FIXED(固时抽检)  SCARE(比例抽检)
            this.form.sampscare = ''
            this.form.qualitystatus = ''
            this.form.good_qty = '' // æŒ‡çš„æŠ¥å·¥æ•°é‡
            this.form.sampleqty = ''
            this.form.goodqty = '' // åˆæ ¼æ•°é‡
            this.form.ngqty = '' // ä¸è‰¯æ•°é‡
            this.stepActive = 0
            this.checkItemArr = []
            this.check_result = ''
            this.$message.success('检验成功!')
            this.getFocus()
          }
        })
      })
    },
    // å•元格被点击时
    cellDblclick(row, column, cell, event) {
      console.log(row, column, cell, event)
      console.log(column.label)
      console.log(row.index)
      switch (column.label) {
        case '检验标准描述':
          this.tabClickIndex = row.index
          this.tabClickLabel = column.label
          break
        // case '判责金额(元)':
        //   this.tabClickIndex = row.index
        //   this.tabClickLabel = column.label
        //   break
        default:
          return
      }
    },
    // å›žè½¦äº‹ä»¶
    keyUpEnterNative(val, row) {
      this.tabClickLabel = ''
    },
    tableRowClassName({ row, rowIndex }) {
      // æŠŠæ¯ä¸€è¡Œçš„索引放进row
      row.index = rowIndex
      return 'custom-row'
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 450
        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
        this.tableHeight = this.mainHeight - 255
      })
    },
    tableRowClassName({ row, rowIndex }) {
      return 'custom-row'
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-select .el-input .el-select__caret {
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
<!--公共页面样式-->
<style lang="scss" scoped>
$main_color: #42b983;
.el-button--text {
::v-deep .el-button--text {
  font-size: 14px;
  cursor: pointer;
}
@@ -791,15 +582,41 @@
  margin-right: 15px;
}
::v-deep .el-button--primary, .el-button--default, .el-button--info {
  height: 34px;
::v-deep .el-button--primary, .el-button--warning, .el-button--default, .el-button--info {
  //height: 34px;
  //display: flex;
  //align-items: center;
  //padding: 0 15px;
  width: 58px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  justify-content: center;
}
::v-deep .el-button--primary {
  //background-color: $main_color !important;
.submitButton {
  ::v-deep .el-button--primary {
    width: 160px;
    letter-spacing: 10px;
    padding-left: 25px;
    font-size: 18px;
    //display: flex;
    //justify-content: center;
    //align-items: center;
  }
}
.resultButton {
  ::v-deep .el-button--primary {
    width: 100px;
    letter-spacing: 4px;
    padding-left: 22px;
  }
  ::v-deep .el-button--warning {
    width: 100px;
    letter-spacing: 4px;
    padding-left: 22px;
  }
}
::v-deep .el-button--default {
@@ -853,7 +670,8 @@
}
::v-deep .el-form--inline .el-form-item__label {
  color: #a7a7a7;
  //color: #a7a7a7;
  //font-size: 16px;
}
.body ::v-deep .el-divider {
@@ -870,7 +688,110 @@
  margin-bottom: 0;
}
::v-deep .el-select__caret {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tableFixed {
  ::v-deep .el-table__fixed-right {
    height: 100% !important;
  }
  ::v-deep .el-table__fixed {
    height: 100% !important;
  }
}
</style>
<style lang="scss" scoped>
.content1 {
  display: flex;
  align-items: center;
  margin: 10px 0 0 10px;
  .title {
    font-size: 14px;
    font-weight: bold;
    margin-left: 5px;
  }
}
.content2 {
  margin: 10px 0 0 20px;
  display: flex;
  font-size: 14px;
  width: 100%;
  align-items: center;
}
.orderMsg {
  width: 33.33%;
  display: flex;
  align-items: center;
}
::v-deep .el-input-number--medium {
  line-height: 32px;
  width: 120px;
}
.checkItem {
  display: flex;
  justify-content: space-between;
  min-height: 36px;
  align-items: center;
  flex-direction: column;
  margin-top: 5px;
}
.serialNumber {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #42B983;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}
.itemTitle {
  width: 300px;
  padding-left: 40px;
  height: 26px;
  color: #909399;
  display: flex;
  align-items: center;
  ::v-deep .el-input--mini {
    line-height: 24px;
    height: 24px;
  }
  ::v-deep .el-input__inner {
    line-height: 24px;
    height: 24px;
  }
}
.itemContent {
  width: 150px;
  height: 26px;
  padding-left: 20px;
  display: flex;
  align-items: center;
}
.orderMsg2 {
  width: 200px;
}
</style>
<style>
.el-table .custom-row {
src/views/zlgl/gxjyjl.vue
@@ -2,9 +2,9 @@
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
        <el-button type="primary" icon="el-icon-download" @click="download">导出</el-button>
        <!--        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
        <!--        <el-button icon="el-icon-download" @click="upload">导入</el-button>-->
        <el-button v-waves type="primary" icon="el-icon-download" @click="download">导出</el-button>
        <!--        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
        <!--        <el-button v-waves icon="el-icon-download" @click="upload">导入</el-button>-->
      </div>
      <div class="bodyTopFormGroup">
@@ -13,10 +13,10 @@
          :model="form"
          label-width="100px"
          inline
          style="display: flex;justify-content: space-between"
          style="display: flex;"
        >
          <div class="elForm">
            <el-form-item label-width="70px" label="工单编号" style=" display: flex;">
            <el-form-item label="工单编号" style=" display: flex;">
              <el-input v-model="form.wocode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="产品编码" style=" display: flex;">
@@ -28,7 +28,7 @@
            <el-form-item label="规格型号" style=" display: flex;">
              <el-input v-model="form.partapec" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label-width="70px" label="工序名称" style=" display: flex;">
            <el-form-item v-show="isExpandForm" label="工序名称" style=" display: flex;">
              <el-input v-model="form.stepname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="标准名称" style=" display: flex;">
@@ -55,9 +55,9 @@
              </el-select>
            </el-form-item>
          </div>
          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
            <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 class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}">
            <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
@@ -80,8 +80,14 @@
        </div>
      </div>
      <div class="elTableDiv">
      <div class="elTableDiv" style="position:relative;">
        <TableColumnSettings
          v-if="false"
          :list1="tableColumnSettingsArray"
          @tableColumnUpdate="tableColumnUpdate"
        />
        <el-table
          :key="tableTimeStampKey"
          ref="tableDataRef"
          class="tableFixed"
          :data="tableData"
@@ -94,137 +100,54 @@
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <!--          <el-table-column-->
          <!--            type="selection"-->
          <!--            width="50"-->
          <!--            fixed-->
          <!--          />-->
          <el-table-column
            prop="RowNum"
            width="50"
            label="序号"
            fixed
          />
          <el-table-column
            prop="wo_code"
            label="工单编码"
            width="160"
            sortable="custom"
          />
          <el-table-column
            prop="partcode"
            width="160"
            label="产品编码"
            sortable="custom"
          />
          <el-table-column
            prop="partname"
            label="产品名称"
            width="160"
            sortable="custom"
          />
          <el-table-column
            prop="partspec"
            label="产品规格"
            width="160"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.partspec">{{ row.partspec }} </div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="step_code"
            label="工序编码"
            width="120"
            sortable="custom"
          />
          <el-table-column
            prop="stepname"
            label="工序名称"
            width="120"
            sortable="custom"
          />
          <el-table-column
            prop="checkstaned_code"
            label="标准编码"
            width="120"
            sortable="custom"
          />
          <el-table-column
            prop="checkstaned_name"
            label="标准名称"
            width="120"
            sortable="custom"
          />
          <el-table-column
            prop="check_type"
            label="检验类型"
            sortable="custom"
            width="120"
          >
            <template slot-scope="{row}">
              <div v-if="row.check_type==='FirstCheck'">首检</div>
              <div v-if="row.check_type==='PatroCheck'">巡检</div>
              <div v-if="row.check_type==='EndCheck'">完工检</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="check_result"
            label="检验结果"
            sortable="custom"
            width="120"
          >
            <template slot-scope="{row}">
              <div v-if="row.check_result==='NG'"> <i class="el-icon-circle-close" style="color:red;" /> ä¸è‰¯</div>
              <div v-if="row.check_result==='OK'">  <i class="el-icon-circle-check" style="color: #42b983" /> åˆæ ¼</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="check_descr"
            label="检验备注"
            width="120"
            v-for="item in tableColumnSettingsArray"
            v-if="item.show"
            :key="item.id"
            :sortable="item.sortable"
            :prop="item.prop"
            :min-width="item.minWidth"
            :label="item.label"
            :width="item.width"
            show-tooltip-when-overflow
            sortable="custom"
            :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
          >
            <template slot-scope="{row}">
              <div v-if="row.check_descr">{{ row.check_descr }} </div>
              <div v-else>/</div>
              <div v-if="!row[item.prop]">/</div>
              <div v-else-if="item.prop==='check_type'">
                {{ checktypeArr.find(i=>i.code===row[item.prop]).name }}
              </div>
              <div v-else-if="item.prop==='check_result'">
                <div v-if="row.check_result==='OK'"><svg-icon icon-class="circleYes" style="margin-right: 2px" />合格</div>
                <div v-if="row.check_result==='NG'"><svg-icon icon-class="circleNo" style="margin-right: 2px" />不良</div>
                <!--                <div v-if="row.check_result==='NG'">-->
                <!--                  <i class="el-icon-info" style="margin-right: 2px" />-->
                <!--                  ä¸è‰¯-->
                <!--                </div>-->
                <!--                <div v-if="row.check_result==='OK'">-->
                <!--                  <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
                <!--                  åˆæ ¼-->
                <!--                </div>-->
              </div>
              <div v-else>{{ row[item.prop] }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="check_qty"
            label="检验数量"
            width="120"
            sortable="custom"
          />
          <el-table-column
            prop="lm_user"
            label="检验人员"
            sortable="custom"
            width="120"
          />
          <el-table-column
            prop="lm_date"
            label="检验时间"
            width="160"
            sortable="custom"
          />
          <el-table-column
            label="操作"
            fixed="right"
            width="80"
            width="120"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <!--                <el-button type="text" @click="check(row)">查看</el-button>-->
                <!--                <el-button type="text" @click="del(row)">删除</el-button>-->
                <!--                <el-button v-waves type="text" @click="check(row)">查看</el-button>-->
                <!--                <el-button v-waves type="text" @click="del(row)">删除</el-button>-->
                <el-tooltip class="item" effect="dark" content="查看" placement="top">
                  <i
                    class="el-icon-view"
                    style="color: #42b983;cursor: pointer;margin-right: 15px;"
                    style="cursor: pointer;margin-right: 15px;color:#42b983"
                    @click="check(row)"
                  />
                </el-tooltip>
@@ -246,6 +169,7 @@
    </div>
    <el-dialog
      v-el-drag-dialog
      title="工序检验明细"
      :visible.sync="dialogVisible"
      width="900px"
@@ -256,6 +180,7 @@
    >
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef2"
          :data="tableDataDialog"
          :height="(tableHeight-100)+'px'"
          border
@@ -277,58 +202,142 @@
            fixed
          />
          <el-table-column
            prop="checkitem_code"
            label="检验项目编号"
            width="120"
          />
          <!--          <el-table-column-->
          <!--            prop="checkitem_code"-->
          <!--            show-tooltip-when-overflow-->
          <!--            label="检验项目编号"-->
          <!--            width="120"-->
          <!--          />-->
          <el-table-column
            prop="checkitem_name"
            label="检验项目名称"
          />
          <el-table-column
            prop="checkitem_descr"
            label="检验项目描述"
          />
          <el-table-column
            prop="check_result"
            label="检验结果"
            width="120"
          >
            <template slot-scope="{row}">
              <div v-if="row.check_result==='NG'"> <i class="el-icon-circle-close" style="color:red;" /> ä¸è‰¯</div>
              <div v-if="row.check_result==='OK'">  <i class="el-icon-circle-check" style="color: #42b983" /> åˆæ ¼</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="lm_user"
            label="检验人员"
            width="120"
          />
          <el-table-column
            prop="lm_date"
            label="检验时间"
            width="160"
            fixed
            show-tooltip-when-overflow
          />
          <!--          <el-table-column-->
          <!--            label="操作"-->
          <!--            fixed="right"-->
          <!--            width="120"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div class="operationClass">-->
          <!--                <el-button type="text" @click="check(row)">查看</el-button>-->
          <!--                &lt;!&ndash;                <el-button type="text" @click="del(row)">删除</el-button>&ndash;&gt;-->
          <!--              </div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--            prop="checkitem_descr"-->
          <!--            label="检验项目描述"-->
          <!--            show-tooltip-when-overflow-->
          <!--          />-->
          <el-table-column
            prop="standvalue"
            label="标准要求"
            fixed
            min-width="120"
            show-tooltip-when-overflow
          >
            <template slot-scope="{row}">
              <!--        ~当三个值都有    -->
              <div v-if="row.standvalue&&row.uppervalue&&row.lowervalue">{{ row.standvalue }}({{
                row.lowervalue
              }}~{{ row.uppervalue }})
              </div>
              <!--            ~当只有标准值和上限值时  -->
              <div v-else-if="row.standvalue&&row.uppervalue">{{ row.standvalue }}(~{{ row.uppervalue }})</div>
              <!--            ~当只有标准值和下限值时-->
              <div v-else-if="row.standvalue&&row.lowervalue">{{ row.standvalue }}({{ row.lowervalue }}~)</div>
              <!--            ~当只有上限值和下限值时-->
              <div v-else-if="row.uppervalue&&row.lowervalue">({{ row.lowervalue }}~{{ row.uppervalue }})</div>
              <!--            ~当只有标准值时     -->
              <div v-else-if="row.standvalue">{{ row.standvalue }}</div>
              <!--            ~当只有上限值时       -->
              <div v-else-if="row.uppervalue">(~{{ row.uppervalue }})</div>
              <!--            ~当只有下限值时      -->
              <div v-else-if="row.lowervalue">({{ row.lowervalue }}~)</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            v-for="(item,index) in dialogTableArrayCol"
            :key="item"
            :prop="(index+1)+'/'+ dialogTableNumberCol"
            :label="'第'+(index+1)+'ä»¶'"
            show-tooltip-when-overflow
            min-width="100"
          >
            <template slot-scope="{row}">
              <div style="display: flex;align-items: center">
                <i
                  :class="row.check_result==='OK'?'el-icon-success':'el-icon-error'"
                  :style="{color:row.check_result==='OK'?'#42b983':'red'}"
                  style="margin-right: 2px"
                />
                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
              </div>
              <!--            &lt;!&ndash;        ~当三个值都有    &ndash;&gt;-->
              <!--            <div v-if="row.standvalue&&row.uppervalue&&row.lowervalue&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              &lt;!&ndash;            <div v-if="row[(index + 1) + '/' + dialogTableNumberCol]>=row.lowervalue&&row[(index + 1) + '/' + dialogTableNumberCol]<=row.uppervalue">&ndash;&gt;-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有标准值和上限值时  &ndash;&gt;-->
              <!--            <div v-else-if="row.standvalue&&row.uppervalue&&row.lowervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有标准值和下限值时&ndash;&gt;-->
              <!--            <div v-else-if="row.standvalue&&row.lowervalue&&row.uppervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有上限值和下限值时&ndash;&gt;-->
              <!--            <div v-else-if="row.uppervalue&&row.lowervalue&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有标准值时     &ndash;&gt;-->
              <!--            <div v-else-if="row.standvalue&&row.uppervalue===''&&row.lowervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])===parseFloat(row.standvalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有上限值时       &ndash;&gt;-->
              <!--            <div v-else-if="row.uppervalue&&row.lowervalue===''&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有下限值时      &ndash;&gt;-->
              <!--            <div v-else-if="row.lowervalue&& row.uppervalue===''&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div></div>-->
              <!--            <div v-else>-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-error" style="color: red;margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
            </template>
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <!--          <el-button @click="dialogVisibleCancel">取 æ¶ˆ</el-button>-->
          <!--          <el-button type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>-->
          <el-button @click="dialogVisibleBack">返 å›ž</el-button>
          <!--          <el-button v-waves @click="dialogVisibleCancel">取 æ¶ˆ</el-button>-->
          <!--          <el-button v-waves type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>-->
          <el-button v-waves @click="dialogVisibleBack">返 å›ž</el-button>
        </div>
      </span>
    </el-dialog>
@@ -352,13 +361,17 @@
import { getCookie } from '@/utils/auth'
import ImportPicker from '@/components/ImportPicker'
import { StepCheckTableOutExcel, StepCheckTableSearch, StepCheckTableSubSearch } from '@/api/zlgl'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import TableColumnSettings from '@/components/TableColumnSettings'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Zzjg',
  components: {
    Pagination, ImportPicker
    Pagination, ImportPicker, TableColumnSettings
  },
  directives: { elDragDialog, waves },
  data() {
    return {
      mouseHoverType: 'mouseout',
@@ -380,6 +393,8 @@
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      checktypeArr: [
        { code: 'InCheck', name: '入厂检验' },
        { code: 'OutCheck', name: '出厂检验' },
        { code: 'FirstCheck', name: '首检' },
        { code: 'PatroCheck', name: '巡检' },
        { code: 'EndCheck', name: '完工检' }
@@ -391,11 +406,149 @@
      total: 10,
      tableData: [],
      tableColumnSettingsArray: [
        { minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // éšè—åˆ—  show: false隐藏,true显示
        { minWidth: 25, width: 50, prop: 'RowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom
        {
          minWidth: 160,
          width: false,
          prop: 'wo_code',
          label: '工单编号',
          id: 3,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'partcode',
          label: '产品编码',
          id: 4,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'partname',
          label: '产品名称',
          id: 5,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'partspec',
          label: '产品规格',
          id: 6,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'step_code',
          label: '工序编码',
          id: 7,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'stepname',
          label: '工序名称',
          id: 8,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'checkstaned_code',
          label: '标准编码',
          id: 9,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'checkstaned_name',
          label: '标准名称',
          id: 10,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'check_type',
          label: '检验类型',
          id: 11,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'check_result',
          label: '检验结果',
          id: 12,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'check_descr',
          label: '检验备注',
          id: 13,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'check_qty',
          label: '检验数量',
          id: 14,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'lm_user',
          label: '检验人员',
          id: 15,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 160,
          width: false,
          prop: 'lm_date',
          label: '检验时间',
          id: 16,
          show: true,
          fixed: false,
          sortable: true
        }
      ],
      tableTimeStampKey: new Date().getTime(), // è¡¨æ ¼key
      dialogVisible: false,
      tableDataDialog: [],
      title_value: '数据导入 / ç‚¹æ£€éƒ¨ä½',
      code: '4',
      shows: false
      shows: false,
      dialogTableNumberCol: 0, // å¯¹è¯æ¡†åŠ¨æ€çš„åˆ—æ•°
      dialogTableArrayCol: []// å¯¹è¯æ¡†åŠ¨æ€çš„æ•°ç»„
    }
  },
@@ -414,6 +567,13 @@
    this.getHeight()
  },
  methods: {
    tableColumnUpdate(val, isCopyTrue) {
      if (isCopyTrue) {
        this.tableColumnSettingsArray = val
      }
      this.tableTimeStampKey = new Date().getTime()
      this.$refs.tableDataRef.doLayout()
    },
    async getStepCheckTableSearch() {
      const res = await StepCheckTableSearch(this.form)
      this.tableData = res.data
@@ -459,10 +619,29 @@
    async check(row) {
      // this.operation = operation
      this.dialogVisible = true
      console.log(row, 1)
      const res = await StepCheckTableSubSearch({ id: row.id })
      this.tableDataDialog = res.data
      this.dialogVisible = true
      this.tableDataDialog.forEach((item, index) => {
        for (const it in item) {
          if (it.indexOf('/') !== -1) {
            const i = it.split('/')[1]
            this.dialogTableNumberCol = i
          }
        }
      })
      this.dialogTableArrayCol = []
      for (let i = 0; i < this.dialogTableNumberCol; i++) {
        this.dialogTableArrayCol.push(i)
      }
      this.$nextTick(() => {
        this.$refs.tableDataRef2.doLayout()
      })
    },
    // æ–°å¢žæŒ‰é’®
@@ -503,11 +682,7 @@
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.$refs.dialogForm.clearValidate()
      this.tableDataDialog = []
    },
    // å¯¹è¯æ¡†å–消
    dialogVisibleCancel() {
src/views/zlgl/zjfa.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1413 @@
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
      </div>
      <div class="bodyTopFormGroup">
        <el-form
          ref="form"
          :model="form"
          label-width="100px"
          inline
          style="display: flex;"
        >
          <div class="elForm" style="justify-content: flex-start;">
            <el-form-item label="质检方案编码" style=" display: flex;">
              <el-input v-model="form.qualityinsptcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="质检方案名称" style=" display: flex;">
              <el-input v-model="form.qualityinsptname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="有效状态" style=" display: flex;">
              <el-select v-model="form.status" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in whetherOrNot"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="质检类型" style=" display: flex;">
              <el-select v-model="form.checktype" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in checktypeArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="抽样方式" style=" display: flex;">
              <el-select v-model="form.sampltype" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in sampltypeArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item v-show="isExpandForm" label="适用对象" style=" display: flex;">
              <el-select v-model="form.suitobject" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in suitobjectArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
          </div>
          <div
            class="bodySearchReset"
            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
          >
            <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
        <div
          class="bodyTopFormExpand"
        >
          <svg-icon
            v-show="mouseHoverType==='mouseout'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
            @mouseenter="mouseHoverType=$event.type"
          />
          <svg-icon
            v-show="mouseHoverType==='mouseenter'"
            style="cursor: pointer"
            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
            @click="isExpandForm=!isExpandForm"
            @mouseout="mouseHoverType=$event.type"
          />
        </div>
      </div>
      <div class="elTableDiv" style="position: relative;">
        <TableColumnSettings
          v-if="false"
          :list1="tableColumnSettingsArray"
          @tableColumnUpdate="tableColumnUpdate"
        />
        <el-table
          :key="tableTimeStampKey"
          ref="tableDataRef"
          class="tableFixed"
          :data="tableData"
          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
          border
          :row-class-name="tableRowClassName"
          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <!--          <el-table-column-->
          <!--            prop="RowNum"-->
          <!--            width="50"-->
          <!--            fixed-->
          <!--            label="序号"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="code"-->
          <!--            label="质检方案编码"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="name"-->
          <!--            label="质检方案名称"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="status"-->
          <!--            label="有效状态"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.status==='Y'"><i-->
          <!--                class="el-icon-success"-->
          <!--                :style="{color:$store.state.settings.theme}"-->
          <!--                style="margin-right:5px"-->
          <!--              />是-->
          <!--              </div>-->
          <!--              <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />否</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="checktype"-->
          <!--            label="质检类型"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.checktype">{{ checktypeArr.find(i => i.code === row.checktype).name }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="sampmethod"-->
          <!--            label="抽样方式"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.sampmethod">{{ sampltypeArr.find(i => i.code === row.sampmethod).name }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="suitobject"-->
          <!--            label="适用对象"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.suitobject">{{ suitobjectArr.find(i => i.code === row.suitobject).name }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="username"-->
          <!--            label="创建人员"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="lm_date"-->
          <!--            label="创建时间"-->
          <!--            width="160"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            v-for="item in tableColumnSettingsArray"
            v-if="item.show"
            :key="item.id"
            :sortable="item.sortable"
            :prop="item.prop"
            :min-width="item.minWidth"
            :label="item.label"
            :width="item.width"
            show-tooltip-when-overflow
            :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
          >
            <template slot-scope="{row}">
              <div v-if="!row[item.prop]">/</div>
              <div v-else-if="item.prop==='checktype'">
                {{ checktypeArr.find(i => i.code === row[item.prop]).name }}
              </div>
              <div v-else-if="item.prop==='sampmethod'">
                {{ sampltypeArr.find(i => i.code === row[item.prop]).name }}
              </div>
              <!--              é€‚用对象-->
              <div v-else-if="item.prop==='suitobject'">
                {{ suitobjectArr.find(i => i.code === row.suitobject).name }}
              </div>
              <div v-else-if="item.prop==='status'">
                <div v-if="row.status==='Y'"><svg-icon icon-class="circleYes" style="margin-right: 2px" />是</div>
                <div v-if="row.status==='N'"><svg-icon icon-class="circleNo" style="margin-right: 2px" />否</div>
                <!--                <div v-if="row.status==='Y'"><i-->
                <!--                  class="el-icon-success"-->
                <!--                  :style="{color:$store.state.settings.theme}"-->
                <!--                  style="margin-right:5px"-->
                <!--                />是-->
                <!--                </div>-->
                <!--                <div v-else-if="row.status==='N'">-->
                <!--                  <i class="el-icon-info" style="margin-right: 5px" />否-->
                <!--                </div>-->
                <!--                <div v-else>/</div>-->
              </div>
              <div v-else>{{ row[item.prop] }}</div>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            width="120"
            fixed="right"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="查看" placement="top">
                  <i
                    class="el-icon-view"
                    style="margin-right:15px;cursor: pointer;color:#42b983"
                    @click="check('check',row)"
                  />
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="编辑" placement="top">
                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
                  <i class="el-icon-delete" @click="del(row)" />
                </el-tooltip>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <pagination
        :total="total"
        :page.sync="form.page"
        :limit.sync="form.rows"
        align="right"
        layout="total,prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getQualityInspectionSearch"
      />
    </div>
    <el-dialog
      v-el-drag-dialog
      :title="operation==='add'?'新增':operation==='check'?'查看':'编辑'"
      :visible.sync="dialogVisible"
      width="1260px"
      :close-on-click-modal="false"
      top="5vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <!--      <div>-->
      <!--        <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />基础资料:-->
      <!--      </div>-->
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px">
        <el-form-item label="质检方案编码" prop="qualityinsptcode">
          <el-input v-model="dialogForm.qualityinsptcode" :disabled="operation!=='add'" style="width: 200px" />
        </el-form-item>
        <el-form-item label="质检方案名称" prop="qualityinsptname">
          <el-input v-model="dialogForm.qualityinsptname" style="width: 200px" />
        </el-form-item>
        <br>
        <el-form-item prop="status" label="有效状态">
          <el-select
            v-model="dialogForm.status"
            style="width: 200px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in whetherOrNot"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <br>
        <el-form-item prop="checktype" label="质检类型">
          <el-radio-group v-model="dialogForm.checktype">
            <!--            <el-radio label="InCheck">入厂检验</el-radio>-->
            <!--            <el-radio label="OutCheck">出厂检验</el-radio>-->
            <el-radio label="FirstCheck">首检检验</el-radio>
            <el-radio label="PatroCheck">巡检</el-radio>
            <el-radio label="EndCheck">完工检</el-radio>
          </el-radio-group>
        </el-form-item>
        <br>
        <el-form-item prop="sampmethod" label="抽样方式">
          <el-radio-group v-model="dialogForm.sampmethod" style="width: 200px;">
            <el-radio label="FIXED">固时抽检</el-radio>
            <el-radio label="SCARE">比例抽检</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-if="dialogForm.sampmethod==='FIXED'" label="样本数量" prop="sampnum">
          <el-input v-model="dialogForm.sampnum" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
        </el-form-item>
        <el-form-item v-if="dialogForm.sampmethod==='SCARE'" label="抽检比例" prop="sampscale">
          <el-input v-model="dialogForm.sampscale" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 180px" />
          %
        </el-form-item>
        <br>
        <el-form-item prop="suitobject" label="适用对象">
          <el-radio-group v-model="dialogForm.suitobject" style="width: 200px;" @change="suitobjectChange">
            <el-radio label="PY">物料类别</el-radio>
            <el-radio label="P">物料</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          prop="suitpart"
          :label="dialogForm.suitobject==='P'?'适用物料':'适用物料类别'"
        >
          <el-select
            v-model="dialogForm.suitpart"
            style="width: 200px"
            multiple
            filterable
            collapse-tags
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in PartSelectArr"
              v-if="dialogForm.suitobject==='P'"
              :key="item.partcode"
              :label="item.partname"
              :value="item.partcode"
            />
            <el-option
              v-for="item in StockTypeSelectArr"
              v-if="dialogForm.suitobject==='PY'"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <br>
        <el-form-item
          v-if="dialogForm.checktype==='FirstCheck'||dialogForm.checktype==='PatroCheck'||dialogForm.checktype==='EndCheck'"
          label="工序名称"
          prop="stepcode"
        >
          <el-select
            v-model="dialogForm.stepcode"
            style="width: 200px"
            filterable
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in StepSelectArr"
              :key="item.stepcode"
              :label="item.stepname"
              :value="item.stepcode"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="检验方案描述">
          <el-input v-model="dialogForm.descr" type="textarea" :autosize="{ minRows: 2 }" />
        </el-form-item>
      </el-form>
      <div style="display: flex;align-items: center;margin-bottom: 10px;">
        <div>
          <i
            class="el-icon-s-operation"
            :style="{color:$store.state.settings.theme}"
            style="margin:0 10px 0 0px;"
          />
        </div>
        <div>质检列表:</div>
        <el-button
          v-if="operation!=='check'"
          v-waves
          type="primary"
          style="margin-left: 20px;"
          icon="el-icon-circle-plus-outline"
          @click="addZjlb"
        >新增
        </el-button>
      </div>
      <el-table
        ref="tableDataRef2"
        class="tableFixed"
        :data="checkitem"
        height="250"
        style="height:250px"
        border
        :row-class-name="tableRowClassName"
        highlight-current-row
        :header-cell-style="this.$headerCellStyle"
        :cell-style="this.$cellStyle"
      >
        <el-table-column
          type="index"
          width="50"
          fixed
          label="序号"
        />
        <!--        <el-table-column-->
        <!--          prop="jyxmbm"-->
        <!--          width="105"-->
        <!--          label="检验项目编码"-->
        <!--        >-->
        <!--          <template slot-scope="{row}">-->
        <!--            <el-select-->
        <!--              v-if="row.isVisible===1"-->
        <!--              v-model="row.jyxmbm"-->
        <!--              filterable-->
        <!--              placeholder="请选择"-->
        <!--              @change="val=>tableChange(val,row)"-->
        <!--            >-->
        <!--              <el-option-->
        <!--                v-for="item in PartSelectArr"-->
        <!--                :key="item.partname"-->
        <!--                :label="item.partcode"-->
        <!--                :value="item.partname"-->
        <!--              />-->
        <!--            </el-select>-->
        <!--            <div v-if="row.isVisible===0">{{ row.jyxmbm }}</div>-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <!--        <el-table-column-->
        <!--          prop="jyxmmc"-->
        <!--          width="105"-->
        <!--          label="检验项目名称"-->
        <!--        >-->
        <!--          <template slot-scope="{row}">-->
        <!--            <el-select-->
        <!--              v-if="row.isVisible===1"-->
        <!--              v-model="row.jyxmmc"-->
        <!--              filterable-->
        <!--              placeholder="请选择"-->
        <!--              @change="val=>tableChange(val,row)"-->
        <!--            >-->
        <!--              <el-option-->
        <!--                v-for="item in PartSelectArr"-->
        <!--                :key="item.partname"-->
        <!--                :label="item.partcode"-->
        <!--                :value="item.partname"-->
        <!--              />-->
        <!--            </el-select>-->
        <!--            <div v-if="row.isVisible===0">{{ row.jyxmmc }}</div>-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <el-table-column
          prop="stepcheckitem_code"
          width="250"
          label="检验项目 / ç¼–码"
        >
          <template slot-scope="{row}">
            <el-select
              v-if="row.isVisible===1"
              v-model="row.stepcheckitem_code"
              filterable
              placeholder="请选择"
              style="width: 100%;"
            >
              <!--              @change="val=>tableChange(val,row)"-->
              <el-option
                v-for="item in CheckItemSelectArr"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
            <div v-else>{{
              CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code).name
            }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          prop="required"
          width="85"
          label="是否必填"
        >
          <template slot-scope="{row}">
            <el-select
              v-if="row.isVisible===1"
              v-model="row.required"
              filterable
              placeholder="请选择"
            >
              <el-option
                v-for="item in whetherOrNot"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
            <div v-else>{{ row.required === 'Y' ? '是' : '否' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="numberjudge"
          width="85"
          label="数值判定"
        >
          <template slot-scope="{row}">
            <el-select
              v-if="row.isVisible===1"
              v-model="row.numberjudge"
              filterable
              placeholder="请选择"
              @change="val=>szpdChange(val,row)"
            >
              <el-option
                v-for="item in whetherOrNot"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
            <div v-else>{{ row.numberjudge === 'Y' ? '是' : '否' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="unit"
          label="单位"
        >
          <template slot-scope="{row}">
            <!--            <el-select-->
            <!--              v-if="row.isVisible===1"-->
            <!--              v-model="row.unit"-->
            <!--              filterable-->
            <!--              :disabled="row.numberjudge==='N'"-->
            <!--              placeholder="请选择"-->
            <!--            >-->
            <!--              <el-option-->
            <!--                v-for="item in UomSelectArr"-->
            <!--                :key="item.code"-->
            <!--                :label="item.name"-->
            <!--                :value="item.code"-->
            <!--              />-->
            <!--            </el-select>-->
            <!--            <div v-if="row.isVisible===0">{{-->
            <!--                row.numberjudge === 'Y' ? UomSelectArr.find(i => i.code === row.unit).name : '/'-->
            <!--              }}-->
            <!--            </div>-->
            <el-input
              v-if="row.isVisible===1"
              v-model="row.unit"
              placeholder="请选择"
              :disabled="row.numberjudge==='N'"
            />
            <div v-else>{{ row.unit ? row.unit : '/' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="decimalnum"
          width="85"
          label="小数位数"
        >
          <template slot-scope="{row}">
            <!--            <el-select-->
            <!--              v-if="row.isVisible===1"-->
            <!--              v-model="row.decimalnum"-->
            <!--              filterable-->
            <!--              placeholder="请选择"-->
            <!--            >-->
            <!--              <el-option-->
            <!--                v-for="item in PartSelectArr"-->
            <!--                :key="item.partname"-->
            <!--                :label="item.partcode"-->
            <!--                :value="item.partname"-->
            <!--              />-->
            <!--            </el-select>-->
            <el-input
              v-if="row.isVisible===1"
              v-model="row.decimalnum"
              :disabled="row.numberjudge==='N'"
              oninput="value=value.replace(/[^0-9]/g,'')"
              placeholder="请输入"
            />
            <div v-else>{{ row.numberjudge === 'Y' ? row.decimalnum : '/' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="standvalue"
          label="标准值"
        >
          <template slot-scope="{row}">
            <el-input
              v-if="row.isVisible===1"
              v-model="row.standvalue"
              :disabled="row.numberjudge==='N'"
              oninput="value=value.replace(/[^0-9.]/g,'')"
              placeholder="请输入"
            />
            <div v-else>{{ row.standvalue ? row.standvalue : '/' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="uppervalue"
          label="上限值"
        >
          <template slot-scope="{row}">
            <el-input
              v-if="row.isVisible===1"
              v-model="row.uppervalue"
              :disabled="row.numberjudge==='N'"
              oninput="value=value.replace(/[^0-9.]/g,'')"
              placeholder="请输入"
            />
            <div v-else>{{ row.uppervalue ? row.uppervalue : '/' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="lowervalue"
          label="下限值"
        >
          <template slot-scope="{row}">
            <el-input
              v-if="row.isVisible===1"
              v-model="row.lowervalue"
              :disabled="row.numberjudge==='N'"
              oninput="value=value.replace(/[^0-9.]/g,'')"
              placeholder="请输入"
            />
            <div v-else>{{ row.lowervalue ? row.lowervalue : '/' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="stepcheckitem_desc"
          label="描述"
          show-tooltip-when-overflow
        >
          <template slot-scope="{row}">
            <el-input
              v-if="row.isVisible===1"
              v-model="row.stepcheckitem_desc"
              placeholder="请输入"
            />
            <div v-else>{{ row.stepcheckitem_desc ? row.stepcheckitem_desc : '/' }}</div>
          </template>
        </el-table-column>
        <el-table-column
          v-if="operation!=='check'"
          label="操作"
          width="120"
          fixed="right"
        >
          <template slot-scope="{row}">
            <div class="operationClass">
              <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveZjlbRow(row)">确认</el-button>
              <el-button v-if="row.isVisible===1&&isCancel" v-waves type="text" @click="cancelZjlbRow(row)">取消
              </el-button>
              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="editZjlbRow(row)">编辑</el-button>
              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="delZjlbRow(row)">删除</el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button v-if="operation!=='check'" v-waves @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button
            v-if="operation!=='check'"
            v-waves
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            type="primary"
            @click="dialogVisibleConfirm"
          >保 å­˜</el-button>
          <el-button v-if="operation==='check'" v-waves @click="dialogVisibleCancel">返 å›ž</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { PartSelect, StepSelect, StockTypeSelect, UomSelect } from '@/api/zzmx'
import {
  QualityInspectionAddEditSave,
  QualityInspectionDelete,
  QualityInspectionSearch, QualityInspectionSeeEdit,
  StepCheckItemSelect
} from '@/api/zlgl'
import TableColumnSettings from '@/components/TableColumnSettings'
export default {
  name: 'Zzjg',
  components: {
    Pagination, TableColumnSettings
  },
  directives: { elDragDialog, waves },
  data() {
    return {
      mouseHoverType: 'mouseout',
      isExpandForm: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
        qualityinsptcode: '', // è´¨æ£€æ–¹æ¡ˆç¼–码
        qualityinsptname: '', // è´¨æ£€æ–¹æ¡ˆåç§°
        status: '', // æœ‰æ•ˆçŠ¶æ€
        checktype: '', // è´¨æ£€ç±»åž‹
        sampltype: '', // æŠ½æ ·æ–¹å¼
        suitobject: '', // é€‚用对象
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      checktypeArr: [
        { code: 'InCheck', name: '入厂检验' },
        { code: 'OutCheck', name: '出厂检验' },
        { code: 'FirstCheck', name: '首检' },
        { code: 'PatroCheck', name: '巡检' },
        { code: 'EndCheck', name: '完工检' }
      ],
      sampltypeArr: [
        { code: 'FIXED', name: '固定抽检' },
        { code: 'SCARE', name: '比例抽检' }
      ],
      suitobjectArr: [
        { code: 'P', name: '物料' },
        { code: 'PY', name: '物料类型' }
      ],
      total: 10,
      tableData: [],
      tableColumnSettingsArray: [
        // { minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // éšè—åˆ—  show: false隐藏,true显示
        { minWidth: 25, width: 50, prop: 'RowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom
        {
          minWidth: 130,
          width: false,
          prop: 'code',
          label: '质检方案编码',
          id: 3,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 130,
          width: false,
          prop: 'name',
          label: '质检方案名称',
          id: 4,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'status',
          label: '有效状态',
          id: 5,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'checktype',
          label: '质检类型',
          id: 6,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'sampmethod',
          label: '抽样方式',
          id: 7,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'suitobject',
          label: '适用对象',
          id: 8,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'stepcode',
          label: '工序编码',
          id: 9,
          show: false,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'stepname',
          label: '工序名称',
          id: 10,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'username',
          label: '创建人员',
          id: 11,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 160,
          prop: 'lm_date',
          label: '创建时间',
          id: 12,
          show: true,
          fixed: false,
          sortable: true
        }
      ],
      tableTimeStampKey: new Date().getTime(), // è¡¨æ ¼key
      dialogVisible: false,
      dialogForm: {
        qualityinsptcode: '', // è´¨æ£€æ–¹æ¡ˆç¼–码
        qualityinsptname: '', // è´¨æ£€æ–¹æ¡ˆåç§°
        status: 'Y', // æœ‰æ•ˆçŠ¶æ€
        checktype: '', // æ£€éªŒç±»åž‹
        sampmethod: 'FIXED', // æŠ½æ£€æ–¹å¼
        sampnum: '', // æ ·æœ¬æ•°é‡
        sampscale: '', // æŠ½æ£€æ¯”例
        suitobject: 'P', // é€‚用对象
        suitpart: [], // é€‚用物料
        stepcode: '', // å·¥åº
        descr: '' // /描述
      },
      operation: '',
      dialogFormRules: {
        status: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        qualityinsptcode: [
          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
        ],
        qualityinsptname: [
          { required: true, message: '请输入质检方案名称', trigger: ['blur', 'change'] }
        ],
        checktype: [
          { required: true, message: '请选择质检方式', trigger: ['blur', 'change'] }
        ],
        sampmethod: [
          { required: true, message: '请选择抽样方式', trigger: ['blur', 'change'] }
        ],
        sampnum: [
          { required: true, message: '请输入样本数量', trigger: ['blur', 'change'] }
        ],
        sampscale: [
          { required: true, message: '请输入抽检比例', trigger: ['blur', 'change'] }
        ],
        suitobject: [
          { required: true, message: '请选择适用对象', trigger: ['blur', 'change'] }
        ],
        suitpart: [
          { required: true, message: '请选择物料或物料类别', trigger: ['blur', 'change'] }
        ],
        stepcode: [
          { required: true, message: '请选择工序名称', trigger: ['blur', 'change'] }
        ]
      },
      checkitem: [],
      whetherOrNot: [ // æ˜¯æˆ–否
        { code: 'Y', name: '是' },
        { code: 'N', name: '否' }
      ],
      PartSelectArr: [], // ç‰©æ–™ä¸‹æ‹‰æ•°ç»„
      StockTypeSelectArr: [], // ç‰©æ–™ç±»åˆ«ä¸‹æ‹‰æ•°ç»„
      UomSelectArr: [], // å•位下拉数组
      CheckItemSelectAllArr: [], // æ£€éªŒé¡¹ç›®(所有)
      CheckItemSelectArr: [], // æ£€éªŒé¡¹ç›®
      StepSelectArr: [], // å·¥åºåç§°ä¸‹æ‹‰æ‰€æœ‰
      isCancel: true// æ˜¯å¦å¯å–消
    }
  },
  created() {
    this.handleRequest()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    tableColumnUpdate(val, isCopyTrue) {
      if (isCopyTrue) {
        this.tableColumnSettingsArray = val
      }
      this.tableTimeStampKey = new Date().getTime()
      this.$refs.tableDataRef.doLayout()
    },
    handleRequest() {
      this.getQualityInspectionSearch().then(res => {
        if (res.code === '200') {
          // this.getUomSelect()
          this.getStepCheckItemSelect()
          this.getPartSelect()
          this.getStockTypeSelect()
          this.getStepSelect()
        }
      })
    },
    async getStepSelect() {
      const { data: res } = await StepSelect()
      this.StepSelectArr = res
    },
    async getQualityInspectionSearch() {
      const res = await QualityInspectionSearch(this.form)
      this.tableData = res.data
      this.total = res.count
      return { code: res.code }
    },
    // æŽ’序改变时
    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.getQualityInspectionSearch()
    },
    // æŸ¥è¯¢
    search() {
      this.getQualityInspectionSearch()
    },
    // é‡ç½®
    reset() {
      this.form.qualityinsptcode = ''
      this.form.qualityinsptname = ''
      this.form.status = ''
      this.form.checktype = ''
      this.form.sampltype = ''
      this.form.suitobject = ''
      this.getQualityInspectionSearch()
    },
    // æ–°å¢žæŒ‰é’®
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // æŸ¥çœ‹
    async check(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      const { data: res } = await QualityInspectionSeeEdit({ qualityinsptcode: row.code })
      this.$nextTick(() => {
        this.dialogForm.qualityinsptcode = row.code
        this.dialogForm.qualityinsptname = row.name
        this.dialogForm.status = row.status
        this.dialogForm.stepcode = row.stepcode
        this.dialogForm.checktype = row.checktype
        this.dialogForm.sampmethod = row.sampmethod
        // this.dialogForm.sampscare =  row.sampscare
        if (this.dialogForm.sampmethod === 'FIXED') {
          this.dialogForm.sampnum = row.sampscare
        } else {
          this.dialogForm.sampscale = row.sampscare
        }
        this.dialogForm.suitobject = row.suitobject
        this.dialogForm.suitpart = row.suitpart.split(',')
        this.dialogForm.descr = row.descr
        this.checkitem = res
        this.$refs.tableDataRef2.doLayout()
      })
    },
    // ä¿®æ”¹æŒ‰é’®
    async edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      const { data: res } = await QualityInspectionSeeEdit({ qualityinsptcode: row.code })
      const tempCodeArr = []
      res.forEach(i => {
        let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
        number = number === 0 ? (10 + Math.random()) : number
        i.number = number
        i.isVisible = 0
        tempCodeArr.push(i.stepcheckitem_code)
      })
      this.CheckItemSelectArr = []
      this.CheckItemSelectAllArr.forEach(i => {
        if (!tempCodeArr.includes(i.code)) {
          this.CheckItemSelectArr.push(i)
        }
      })
      this.$nextTick(() => {
        this.dialogForm.qualityinsptcode = row.code
        this.dialogForm.qualityinsptname = row.name
        this.dialogForm.status = row.status
        this.dialogForm.stepcode = row.stepcode
        this.dialogForm.checktype = row.checktype
        this.dialogForm.sampmethod = row.sampmethod
        if (this.dialogForm.sampmethod === 'FIXED') {
          this.dialogForm.sampnum = row.sampscare
        } else {
          this.dialogForm.sampscale = row.sampscare
        }
        this.dialogForm.suitobject = row.suitobject
        this.dialogForm.suitpart = row.suitpart.split(',')
        this.dialogForm.descr = row.descr
        this.checkitem = res
        // console.log(this.checkitem, 2)
        this.$refs.tableDataRef2.doLayout()
      })
    },
    // åˆ é™¤æŒ‰é’®
    async del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        QualityInspectionDelete({ qualityinsptcode: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            if (this.form.page > 1 && this.tableData.length === 1) {
              this.form.page--
            }
            this.getQualityInspectionSearch()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // ç‰©æ–™ä¸‹æ‹‰
    async getPartSelect() {
      const { data: res } = await PartSelect()
      this.PartSelectArr = res
    },
    // ç‰©æ–™ç±»åˆ«ä¸‹æ‹‰
    async getStockTypeSelect() {
      const { data: res } = await StockTypeSelect()
      this.StockTypeSelectArr = res
    },
    // èŽ·å–å•ä½ä¸‹æ‹‰æŽ¥å£
    async getUomSelect() {
      const { data: res } = await UomSelect()
      this.UomSelectArr = res
    },
    // é€‚用对象值改变是
    suitobjectChange() {
      this.dialogForm.suitpart = []
    },
    // èŽ·å–æ£€éªŒé¡¹ç›®ä¸‹æ‹‰æŽ¥å£
    async getStepCheckItemSelect() {
      const { data: res } = await StepCheckItemSelect()
      res.forEach(i => {
        this.CheckItemSelectArr.push({
          code: i.code,
          name: i.name + ' / ' + i.code,
          descr: i.descr
        })
      })
      this.CheckItemSelectAllArr = JSON.parse(JSON.stringify(this.CheckItemSelectArr))
    },
    // æ•°å€¼åˆ¤å®š
    szpdChange(val, row) {
      if (val === 'N') {
        row.unit = ''
        row.decimalnum = ''
        row.standvalue = ''
        row.uppervalue = ''
        row.lowervalue = ''
      }
    },
    // è¡¨æ ¼å€¼æ”¹å˜æ—¶
    tableChange(val, row) {
      console.log(val, row)
    },
    // è´¨æ£€åˆ—表  æ–°å¢žè¡Œ
    addZjlb() {
      if (this.checkitem.find(i => i.isVisible === 1)) {
        return this.$message.info('请先保存当前行数据!')
      }
      let number = Math.random() * Math.random()// ä½œä¸ºåˆ é™¤æ—¶çš„æ ‡è¯†ç¬¦
      number = number === 0 ? (10 + Math.random()) : number
      this.checkitem.push({
        number,
        isVisible: 1,
        // jyxmbm: '',
        // jyxmmc: '',
        stepcheckitem_code: '', // æ£€éªŒé¡¹ç›®ç¼–码
        required: 'Y', // æ˜¯å¦å¿…å¡«
        numberjudge: 'Y', // æ˜¯å¦æ•°å€¼åˆ¤æ–­
        unit: '', // å•位
        decimalnum: '', // å°æ•°ä½æ•°
        standvalue: '', // æ ‡å‡†å€¼
        uppervalue: '', // ä¸Šé™å€¼
        lowervalue: '', // ä¸‹é™å€¼
        stepcheckitem_desc: ''// æ£€éªŒé¡¹ç›®æè¿°
      })
    },
    // åˆ é™¤è´¨æ£€åˆ—表行
    delZjlbRow(row) {
      const t = this.CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code)
      this.CheckItemSelectArr.unshift(t)
      this.checkitem = this.checkitem.filter(i => i.number !== row.number)
    },
    // ä¿å­˜è¡Œ
    saveZjlbRow(row) {
      if (!row.stepcheckitem_code) {
        return this.$message.info('检验项目不能为空!')
      }
      if (row.numberjudge === 'Y' && !row.unit) {
        return this.$message.info('单位不能为空!')
      }
      if (row.numberjudge === 'Y' && !row.decimalnum) {
        return this.$message.info('小数位数不能为空!')
      }
      if (row.numberjudge === 'Y') {
        if (!row.standvalue && !row.uppervalue && !row.lowervalue) {
          return this.$message.info('标准值、上限值、下限值其中一项不能为空!')
        }
      }
      this.CheckItemSelectArr = this.CheckItemSelectArr.filter(i => i.code !== row.stepcheckitem_code)
      row.isVisible = 0
      this.isCancel = true
    },
    // å–消行
    cancelZjlbRow(row) {
      this.checkitem = this.checkitem.filter(i => i.number !== row.number)
    },
    // ç¼–辑行
    editZjlbRow(row) {
      if (this.checkitem.find(i => i.isVisible === 1)) {
        return this.$message.info('请先保存当前行数据!')
      }
      row.isVisible = 1
      this.isCancel = false
      const t = this.CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code)
      this.CheckItemSelectArr.unshift(t)
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm = {
        qualityinsptcode: '',
        qualityinsptname: '',
        status: 'Y',
        checktype: '',
        sampmethod: 'FIXED',
        sampnum: '',
        stepcode: '',
        sampscale: '',
        suitobject: 'P',
        suitpart: [],
        descr: ''
      }
      this.isCancel = true
      this.checkitem = []
      this.CheckItemSelectArr = JSON.parse(JSON.stringify(this.CheckItemSelectAllArr))
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          if (this.checkitem.length < 1) {
            return this.$message.info('质检列表不能为空!')
          }
          const checkitem = []
          this.checkitem.forEach((item, index) => {
            checkitem.push({
              stepcheckitem_seq: index + 1,
              stepcheckitem_code: item.stepcheckitem_code,
              stepcheckitem_desc: item.stepcheckitem_desc,
              required: item.required,
              numberjudge: item.numberjudge,
              unit: item.unit,
              decimalnum: item.decimalnum,
              standvalue: item.standvalue,
              uppervalue: item.uppervalue,
              lowervalue: item.lowervalue
            })
          })
          const data = {
            qualityinsptcode: this.dialogForm.qualityinsptcode,
            qualityinsptname: this.dialogForm.qualityinsptname,
            status: this.dialogForm.status,
            stepcode: this.dialogForm.checktype === 'InCheck' || this.dialogForm.checktype === 'OutCheck' ? '' : this.dialogForm.stepcode,
            checktype: this.dialogForm.checktype,
            sampmethod: this.dialogForm.sampmethod,
            sampscare: this.dialogForm.sampnum ? this.dialogForm.sampnum : this.dialogForm.sampscale,
            suitobject: this.dialogForm.suitobject,
            suitpart: this.dialogForm.suitpart.join(','),
            type: this.operation === 'add' ? 'Add' : 'Update',
            descr: this.dialogForm.descr,
            checkitem
          }
          this.$store.state.app.buttonIsDisabled = true
          QualityInspectionAddEditSave(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '保存成功!' : '修改成功!')
              this.dialogVisible = false
              this.getQualityInspectionSearch()
              this.$store.state.app.buttonIsDisabled = false
            } else {
              this.$message.error(this.operation === 'add' ? '保存失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 255
        this.$refs.tableDataRef.doLayout()
      })
    },
    tableRowClassName({ row, rowIndex }) {
      return 'custom-row'
    }
  }
}
</script>
<!--公共页面样式-->
<style lang="scss" scoped>
$main_color: #42b983;
::v-deep .el-button--text {
  font-size: 14px;
  cursor: pointer;
}
.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
  color: $main_color;
  cursor: pointer;
}
.el-icon-edit-outline {
  margin-right: 15px;
}
::v-deep .el-button--primary, .el-button--default, .el-button--info {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 15px;
}
::v-deep .el-button--primary {
  //background-color: $main_color !important;
}
::v-deep .el-button--default {
  background-color: #f8f8fa;
  border: none;
}
::v-deep .el-input__inner {
  height: 34px;
  line-height: 34px;
  //color: #a7a7a7;
}
//::v-deep .el-dialog__body {
//  padding: 20px 100px !important;
//}
::v-deep .dialogVisibleRoles .el-dialog__body {
  padding: 20px 20px !important;
}
::v-deep .importPickerClass .el-dialog__body {
  padding: 20px 20px !important;
}
::v-deep .el-dialog__footer {
  display: flex;
  justify-content: flex-end;
}
::v-deep .el-table .caret-wrapper {
  transform: scale(0.8);
}
::v-deep .cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
::v-deep .el-table::before {
  height: 0;
}
::v-deep .el-table__body-wrapper {
  background-color: #f8f8fa;
}
::v-deep .el-table__body .el-table__row.hover-row td {
  background-color: #eaecef;
}
::v-deep .el-form--inline .el-form-item__label {
  color: #a7a7a7;
}
.body ::v-deep .el-divider {
  border: 1px solid #eee;
  width: 99%;
  margin: 10px auto;
}
.body ::v-deep .el-form-item {
  margin-bottom: 0;
}
.userDialogVisible ::v-deep .el-form-item {
  margin-bottom: 0;
}
::v-deep .el-select__caret {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tableFixed {
  ::v-deep .el-table__fixed-right {
    height: 100% !important;
  }
  ::v-deep .el-table__fixed {
    height: 100% !important;
  }
}
</style>
<style>
.el-table .custom-row {
  background: #f8f8fa;
}
</style>
vue.config.js
@@ -50,8 +50,8 @@
    },
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        // target: 'http://121.196.36.24:8007', // è¯·æ±‚的第三⽅接⼝地址      æœ¬åœ°æœåС噍(富尔达)
        target: 'http://192.168.16.246:8001', // è¯·æ±‚的第三⽅接⼝地址      å®¢æˆ·æœåС噍(富尔达)  (未上云)
        target: 'http://121.196.36.24:8007', // è¯·æ±‚的第三⽅接⼝地址      æœ¬åœ°æœåС噍(富尔达)
        // target: 'http://192.168.16.246:8001', // è¯·æ±‚的第三⽅接⼝地址      å®¢æˆ·æœåС噍(富尔达)  (未上云)
        // target: 'http://pn3963.natappfree.cc', // è¯·æ±‚的第三⽅接⼝地址      å®¢æˆ·æœåС噍(富尔达)  (上云)
        changeOrigin: true, // è¯·æ±‚跨域时,需 é…ç½®æ­¤é¡¹