1.制造模型:工艺路线(新增、删除、预览)功能开发 2.制造模型:工序定义(查询) 功能开发 3.系统设置:编码规则(查询)功能开发4.修改实施部提出的bug
已添加1个文件
已修改20个文件
1820 ■■■■ 文件已修改
src/api/sbgl.js 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/wlgl.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/xtsz.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/zzmx.js 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/TagsView/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/permission.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/jsqd.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/wldw.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/yhqd.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jcsz/zzjg.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sbgl/sbqd.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wlgl/ckdy.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wlgl/kwdy.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/xtsy/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/xtsz/bmgz.vue 512 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/chda.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/gxdy.vue 591 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/gylx.vue 421 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/zzmx/wllx.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sbgl.js
@@ -3,7 +3,7 @@
// è®¾å¤‡ç±»åž‹æŸ¥è¯¢
export function DeviceTypeSearch(data) {
  return request({
    url: 'BasicSetting/DeviceTypeSearch',
    url: 'DeviceManager/DeviceTypeSearch',
    method: 'get',
    params: data
  })
@@ -11,7 +11,7 @@
// è®¾å¤‡ç±»åž‹æ–°å¢ž
export function AddUpdateDeviceType(data) {
  return request({
    url: 'BasicSetting/AddUpdateDeviceType',
    url: 'DeviceManager/AddUpdateDeviceType',
    method: 'post',
    data
  })
@@ -19,7 +19,7 @@
// è®¾å¤‡ç±»åž‹åˆ é™¤
export function DeleteDeviceType(data) {
  return request({
    url: 'BasicSetting/DeleteDeviceType',
    url: 'DeviceManager/DeleteDeviceType',
    method: 'post',
    params: data
  })
@@ -27,14 +27,14 @@
// è®¾å¤‡ç±»åž‹ä¸‹æ‹‰æ¡†æŽ¥å£
export function DeviceTypeSelect() {
  return request({
    url: 'BasicSetting/DeviceTypeSelect',
    url: 'DeviceManager/DeviceTypeSelect',
    method: 'get'
  })
}
// è®¾å¤‡ç»„查询
export function DeviceGroupSearch(data) {
  return request({
    url: 'BasicSetting/DeviceGroupSearch',
    url: 'DeviceManager/DeviceGroupSearch',
    method: 'get',
    params: data
  })
@@ -42,7 +42,7 @@
// è®¾å¤‡ç»„新增
export function AddUpdateDeviceGroup(data) {
  return request({
    url: 'BasicSetting/AddUpdateDeviceGroup',
    url: 'DeviceManager/AddUpdateDeviceGroup',
    method: 'post',
    data
  })
@@ -50,7 +50,7 @@
// è®¾å¤‡ç»„删除
export function DeleteDeviceGroup(data) {
  return request({
    url: 'BasicSetting/DeleteDeviceGroup',
    url: 'DeviceManager/DeleteDeviceGroup',
    method: 'post',
    params: data
  })
@@ -58,7 +58,7 @@
// è®¾å¤‡ç±»åž‹æŸ¥æ‰¾è®¾å¤‡ç»„
export function DeviceTypeSelectGroup(data) {
  return request({
    url: 'BasicSetting/DeviceTypeSelectGroup',
    url: 'DeviceManager/DeviceTypeSelectGroup',
    method: 'get',
    params: data
  })
@@ -66,7 +66,7 @@
// è®¾å¤‡æ¸…单查询
export function DeviceMangerSearch(data) {
  return request({
    url: 'BasicSetting/DeviceMangerSearch',
    url: 'DeviceManager/DeviceMangerSearch',
    method: 'get',
    params: data
  })
@@ -74,7 +74,7 @@
// è®¾å¤‡æ¸…单新增编辑
export function AddUpdateDeviceManger(data) {
  return request({
    url: 'BasicSetting/AddUpdateDeviceManger',
    url: 'DeviceManager/AddUpdateDeviceManger',
    method: 'post',
    data
  })
@@ -82,7 +82,7 @@
// è®¾å¤‡æ¸…单删除
export function DeleteDeviceManger(data) {
  return request({
    url: 'BasicSetting/DeleteDeviceManger',
    url: 'DeviceManager/DeleteDeviceManger',
    method: 'post',
    params: data
  })
@@ -90,14 +90,14 @@
// æ‰€å±žè½¦é—´ä¸‹æ‹‰æŽ¥å£
export function WorkShopSelect() {
  return request({
    url: 'BasicSetting/WorkShopSelect',
    url: 'DeviceManager/WorkShopSelect',
    method: 'get'
  })
}
// æ‰€å±žè½¦é—´æŸ¥æ‰¾æ‰€å±žäº§çº¿æŽ¥å£
export function WorkShopSelectLine(data) {
  return request({
    url: 'BasicSetting/WorkShopSelectLine',
    url: 'DeviceManager/WorkShopSelectLine',
    method: 'get',
    params: data
  })
src/api/wlgl.js
@@ -3,7 +3,7 @@
// ä»“库定义查询
export function WareHouseDefSearch(data) {
  return request({
    url: 'BasicSetting/WareHouseDefSearch',
    url: 'MaterialManager/WareHouseDefSearch',
    method: 'get',
    params: data
  })
@@ -12,7 +12,7 @@
// ä»“库定义新增编辑
export function AddUpdateWareHouseDef(data) {
  return request({
    url: 'BasicSetting/AddUpdateWareHouseDef',
    url: 'MaterialManager/AddUpdateWareHouseDef',
    method: 'post',
    data
  })
@@ -21,7 +21,7 @@
// ä»“库删除
export function DeleteWareHouseDef(data) {
  return request({
    url: 'BasicSetting/DeleteWareHouseDef',
    url: 'MaterialManager/DeleteWareHouseDef',
    method: 'post',
    params: data
  })
@@ -30,7 +30,7 @@
// æ‰€å±žä»“库接口
export function WareHouseSelect() {
  return request({
    url: 'BasicSetting/WareHouseSelect',
    url: 'MaterialManager/WareHouseSelect',
    method: 'get'
  })
}
@@ -38,7 +38,7 @@
// åº“位定义查询
export function StorageDefSearch(data) {
  return request({
    url: 'BasicSetting/StorageDefSearch',
    url: 'MaterialManager/StorageDefSearch',
    method: 'get',
    params: data
  })
@@ -46,7 +46,7 @@
// åº“位定义新增编辑
export function AddUpdateStorageDef(data) {
  return request({
    url: 'BasicSetting/AddUpdateStorageDef',
    url: 'MaterialManager/AddUpdateStorageDef',
    method: 'post',
    data
  })
@@ -54,7 +54,7 @@
// åº“位删除
export function DeleteStorageDef(data) {
  return request({
    url: 'BasicSetting/DeleteStorageDef',
    url: 'MaterialManager/DeleteStorageDef',
    method: 'post',
    params: data
  })
src/api/xtsz.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
import request from '@/utils/request'
// ç¼–码规则查询
export function EncodingRules(data) {
  return request({
    url: 'SystemSetting/EncodingRules',
    method: 'get',
    params: data
  })
}
// ç¼–码规则编辑保存
export function SaveEncodingRules(data) {
  return request({
    url: 'SystemSetting/SaveEncodingRules',
    method: 'post',
    data
  })
}
// èŽ·å–è§„åˆ™ç”Ÿæˆçš„ç¼–ç 
export function NewEncodingRules(data) {
  return request({
    url: 'SystemSetting/NewEncodingRules',
    method: 'get',
    params: data
  })
}
src/api/zzmx.js
@@ -3,7 +3,7 @@
// å­˜è´§ç±»åž‹æŽ¥å£
export function StockTypeSelect() {
  return request({
    url: 'BasicSetting/StockTypeSelect',
    url: 'ProductModel/StockTypeSelect',
    method: 'get'
  })
}
@@ -11,7 +11,7 @@
// ç‰©æ–™ç±»åž‹æŸ¥è¯¢
export function MaterialTypeSearch(data) {
  return request({
    url: 'BasicSetting/MaterialTypeSearch',
    url: 'ProductModel/MaterialTypeSearch',
    method: 'get',
    params: data
  })
@@ -20,7 +20,7 @@
// ç‰©æ–™ç±»åž‹æ–°å¢žç¼–辑
export function AddUpdateMaterialType(data) {
  return request({
    url: 'BasicSetting/AddUpdateMaterialType',
    url: 'ProductModel/AddUpdateMaterialType',
    method: 'post',
    data
  })
@@ -29,7 +29,7 @@
// ç‰©æ–™ç±»åž‹åˆ é™¤
export function DeleteMaterialType(data) {
  return request({
    url: 'BasicSetting/DeleteMaterialType',
    url: 'ProductModel/DeleteMaterialType',
    method: 'post',
    params: data
  })
@@ -38,7 +38,7 @@
// å•位列表查询
export function UomSearch(data) {
  return request({
    url: 'BasicSetting/UomSearch',
    url: 'ProductModel/UomSearch',
    method: 'get',
    params: data
  })
@@ -46,7 +46,7 @@
// å•位新增
export function UomAdd(data) {
  return request({
    url: 'BasicSetting/UomAdd',
    url: 'ProductModel/UomAdd',
    method: 'post',
    data
  })
@@ -54,7 +54,7 @@
// å•位删除
export function UomDelete(data) {
  return request({
    url: 'BasicSetting/UomDelete',
    url: 'ProductModel/UomDelete',
    method: 'post',
    params: data
  })
@@ -62,7 +62,7 @@
// å­˜ç±»åž‹æŸ¥æ‰¾ç‰©æ–™ç±»åž‹
export function StockTypeSelectMaterialType(data) {
  return request({
    url: 'BasicSetting/StockTypeSelectMaterialType',
    url: 'ProductModel/StockTypeSelectMaterialType',
    method: 'get',
    params: data
  })
@@ -70,7 +70,7 @@
// å­˜è´§æ¡£æ¡ˆæŸ¥è¯¢
export function InventoryFileSelect(data) {
  return request({
    url: 'BasicSetting/InventoryFileSelect',
    url: 'ProductModel/InventoryFileSelect',
    method: 'get',
    params: data
  })
@@ -79,7 +79,7 @@
// å­˜è´§æ¡£æ¡ˆæ–°å¢žç¼–辑
export function AddUpdateInventoryFile(data) {
  return request({
    url: 'BasicSetting/AddUpdateInventoryFile',
    url: 'ProductModel/AddUpdateInventoryFile',
    method: 'post',
    data
  })
@@ -87,7 +87,7 @@
// å­˜è´§æ¡£æ¡ˆåˆ é™¤
export function DeleteInventoryFile(data) {
  return request({
    url: 'BasicSetting/DeleteInventoryFile',
    url: 'ProductModel/DeleteInventoryFile',
    method: 'post',
    params: data
  })
@@ -95,7 +95,7 @@
// å­˜è´§æ¡£æ¡ˆå…³è”工艺路线查询
export function InventoryFileAssociationRoute(data) {
  return request({
    url: 'BasicSetting/InventoryFileAssociationRoute',
    url: 'ProductModel/InventoryFileAssociationRoute',
    method: 'get',
    params: data
  })
@@ -103,7 +103,7 @@
// å­˜è´§æ¡£æ¡ˆå…³è”工艺路线提交
export function SaveInventoryFile(partcode, data) {
  return request({
    url: 'BasicSetting/SaveInventoryFile?partcode=' + partcode,
    url: 'ProductModel/SaveInventoryFile?partcode=' + partcode,
    method: 'post',
    data
  })
@@ -111,7 +111,7 @@
// å·¥è‰ºè·¯çº¿æŸ¥è¯¢
export function RouteSearch(data) {
  return request({
    url: 'BasicSetting/RouteSearch',
    url: 'ProductModel/RouteSearch',
    method: 'get',
    params: data
  })
@@ -119,7 +119,7 @@
// å·¥è‰ºè·¯çº¿é¢„览
export function ViewRoute(data) {
  return request({
    url: 'BasicSetting/ViewRoute',
    url: 'ProductModel/ViewRoute',
    method: 'get',
    params: data
  })
@@ -127,7 +127,7 @@
// å·¥è‰ºè·¯çº¿æ–°å¢žç¼–辑
export function AddUpdateRoute(id, opertype, data) {
  return request({
    url: 'BasicSetting/AddUpdateRoute?id=' + id + '&opertype=' + opertype,
    url: 'ProductModel/AddUpdateRoute?id=' + id + '&opertype=' + opertype,
    method: 'post',
    data
  })
@@ -136,7 +136,7 @@
// å·¥è‰ºè·¯çº¿åˆ é™¤
export function DeleteRoute(data) {
  return request({
    url: 'BasicSetting/DeleteRoute',
    url: 'ProductModel/DeleteRoute',
    method: 'post',
    params: data
  })
@@ -144,7 +144,7 @@
// å·¥åºæŸ¥è¯¢
export function StepSearch(data) {
  return request({
    url: 'BasicSetting/StepSearch',
    url: 'ProductModel/StepSearch',
    method: 'get',
    params: data
  })
@@ -152,7 +152,7 @@
// å·¥åºæ–°å¢žç¼–辑
export function AddUpdateStep(data) {
  return request({
    url: 'BasicSetting/AddUpdateStep',
    url: 'ProductModel/AddUpdateStep',
    method: 'post',
    data
  })
@@ -160,7 +160,7 @@
// å·¥åºåˆ é™¤
export function DeleteStep(data) {
  return request({
    url: 'BasicSetting/DeleteStep',
    url: 'ProductModel/DeleteStep',
    method: 'post',
    params: data
  })
@@ -169,7 +169,7 @@
// å·¥åºå®šä¹‰å…³è”工作站查询
export function StepAssociationEqp(data) {
  return request({
    url: 'BasicSetting/StepAssociationEqp',
    url: 'ProductModel/StepAssociationEqp',
    method: 'get',
    params: data
  })
@@ -177,7 +177,7 @@
// å·¥åºå®šä¹‰å…³è”工作站提交
export function SaveStepAssociationEqp(stepcode, data) {
  return request({
    url: 'BasicSetting/SaveStepAssociationEqp?stepcode=' + stepcode,
    url: 'ProductModel/SaveStepAssociationEqp?stepcode=' + stepcode,
    method: 'post',
    data
  })
@@ -185,7 +185,7 @@
// å·¥åºå…³è”缺陷查询
export function StepAssociationDefect(data) {
  return request({
    url: 'BasicSetting/StepAssociationDefect',
    url: 'ProductModel/StepAssociationDefect',
    method: 'get',
    params: data
  })
@@ -193,7 +193,7 @@
// å·¥åºå…³è”缺陷提交
export function SaveStepAssociationDefect(stepcode, data) {
  return request({
    url: 'BasicSetting/SaveStepAssociationDefect?stepcode=' + stepcode,
    url: 'ProductModel/SaveStepAssociationDefect?stepcode=' + stepcode,
    method: 'post',
    data
  })
@@ -201,14 +201,14 @@
// äº§å“ä¿¡æ¯ä¸‹æ‹‰æ¡†æŸ¥è¯¢
export function PartSelect() {
  return request({
    url: 'BasicSetting/PartSelect',
    url: 'ProductModel/PartSelect',
    method: 'get'
  })
}
// äº§å“ç¼–码查找工艺路线下拉框
export function PartSelectRpute(data) {
  return request({
    url: 'BasicSetting/PartSelectRpute',
    url: 'ProductModel/PartSelectRpute',
    method: 'get',
    params: data
  })
@@ -216,7 +216,7 @@
// æ ¹æ®å·¥è‰ºè·¯çº¿ç¼–码查找关联工序集合
export function RouteSelectStep(data) {
  return request({
    url: 'BasicSetting/RouteSelectStep',
    url: 'ProductModel/RouteSelectStep',
    method: 'get',
    params: data
  })
@@ -224,7 +224,7 @@
// æ ¹æ®å·¥åºçº¿ç¼–码查找关联设备集合
export function StepSelectEqp(data) {
  return request({
    url: 'BasicSetting/StepSelectEqp',
    url: 'ProductModel/StepSelectEqp',
    method: 'get',
    params: data
  })
@@ -232,7 +232,7 @@
// èŠ‚æ‹å·¥ä»·æŸ¥è¯¢
export function BeatRateSearch(data) {
  return request({
    url: 'BasicSetting/BeatRateSearch',
    url: 'ProductModel/BeatRateSearch',
    method: 'get',
    params: data
  })
@@ -240,7 +240,7 @@
// èŠ‚æ‹å·¥ä»·æäº¤
export function SaveBeatRate(data) {
  return request({
    url: 'BasicSetting/SaveBeatRate',
    url: 'ProductModel/SaveBeatRate',
    method: 'post',
    data
  })
@@ -248,7 +248,7 @@
// èŠ‚æ‹å·¥ä»·åˆ é™¤
export function DeleteBeatRate(data) {
  return request({
    url: 'BasicSetting/DeleteBeatRate',
    url: 'ProductModel/DeleteBeatRate',
    method: 'post',
    params: data
  })
@@ -257,14 +257,14 @@
// å­˜è´§æ¡£æ¡ˆä½¿ç”¨å•位下拉
export function UomSelect() {
  return request({
    url: 'BasicSetting/UomSelect',
    url: 'ProductModel/UomSelect',
    method: 'get'
  })
}
// å·¥è‰ºè·¯çº¿å·¥è‰ºè®¾ç½®ä¸‹æ‹‰
export function RouteSelect() {
export function StepSelect() {
  return request({
    url: 'BasicSetting/RouteSelect',
    url: 'ProductModel/StepSelect',
    method: 'get'
  })
}
src/layout/components/Sidebar/index.vue
@@ -39,6 +39,7 @@
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { LoginMenu } from '@/api/user'
import { setCookie } from '@/utils/auth'
export default {
  components: { SidebarItem, Logo },
@@ -59,6 +60,7 @@
      const route = this.$route
      const { meta, path } = route
      // if set path, the sidebar will highlight the path you set
      setCookie('ruleCode', meta.code)// å°†ç¼–码规则code存到cookie里面
      if (meta.activeMenu) {
        return meta.activeMenu
      }
src/layout/components/TagsView/index.vue
@@ -16,12 +16,12 @@
        <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
      </router-link>
    </scroll-pane>
    <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
      <li @click="refreshSelectedTag(selectedTag)">刷新</li>
      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li>
      <li @click="closeOthersTags">关闭其他</li>
      <li @click="closeAllTags(selectedTag)">关闭所有</li>
    </ul>
    <!--    <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">-->
    <!--      <li @click="refreshSelectedTag(selectedTag)">刷新</li>-->
    <!--      <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li>-->
    <!--      <li @click="closeOthersTags">关闭其他</li>-->
    <!--      <li @click="closeAllTags(selectedTag)">关闭所有</li>-->
    <!--    </ul>-->
  </div>
</template>
src/router/index.js
@@ -73,7 +73,7 @@
    redirect: '/jcsz/zzjg',
    name: '基础设置',
    code: '1001',
    meta: { title: '基础设置', icon: 'tree' },
    meta: { code: '1001', title: '基础设置', icon: 'tree' },
    alwaysShow: true, // å½“children只有一个时,也显示父菜单
    children: [
      {
@@ -81,31 +81,31 @@
        name: '组织架构',
        code: '1010',
        component: () => import('@/views/jcsz/zzjg'),
        meta: { title: '组织架构', icon: '' }
        meta: { code: '1010', title: '组织架构', icon: '' }
      }, {
        path: 'yhqd',
        name: '用户清单',
        code: '1011',
        component: () => import('@/views/jcsz/yhqd'),
        meta: { title: '用户清单', icon: '' }
        meta: { code: '1011', title: '用户清单', icon: '' }
      }, {
        path: 'jsqd',
        name: '角色清单',
        code: '1012',
        component: () => import('@/views/jcsz/jsqd'),
        meta: { title: '角色清单', icon: '' }
        meta: { code: '1012', title: '角色清单', icon: '' }
      }, {
        path: 'wldw',
        name: '往来单位',
        code: '1013',
        component: () => import('@/views/jcsz/wldw'),
        meta: { title: '往来单位', icon: '' }
        meta: { code: '1013', title: '往来单位', icon: '' }
      }, {
        path: 'adsz',
        name: '安灯设置',
        code: '1014',
        component: () => import('@/views/jcsz/adsz'),
        meta: { title: '安灯设置', icon: '' }
        meta: { code: '1014', title: '安灯设置', icon: '' }
      }
    ]
  },
@@ -115,7 +115,7 @@
    redirect: '/sbgl/sblx',
    name: '设备管理',
    code: '1002',
    meta: { title: '设备管理', icon: 'example' },
    meta: { code: '1002', title: '设备管理', icon: 'example' },
    alwaysShow: true,
    children: [
      {
@@ -123,68 +123,68 @@
        name: '设备类型',
        code: '1020',
        component: () => import('@/views/sbgl/sblx'),
        meta: { title: '设备类型', icon: '' }
        meta: { code: '1020', title: '设备类型', icon: '' }
      },
      {
        path: 'wxjl',
        code: '1029',
        name: '维修记录',
        component: () => import('@/views/sbgl/wxjl'),
        meta: { title: '维修记录', icon: '' }
        meta: { code: '1029', title: '维修记录', icon: '' }
      }, {
        path: 'sbz',
        name: '设备组',
        code: '1021',
        component: () => import('@/views/sbgl/sbz'),
        meta: { title: '设备组', icon: '' }
        meta: { code: '1021', title: '设备组', icon: '' }
      }, {
        path: 'sbqd',
        name: '设备清单',
        code: '1022',
        component: () => import('@/views/sbgl/sbqd'),
        meta: { title: '设备清单', icon: '' }
        meta: { code: '1022', title: '设备清单', icon: '' }
      },
      {
        path: 'djbz',
        name: '点检标准',
        code: '1023',
        component: () => import('@/views/sbgl/djbz'),
        meta: { title: '点检标准', icon: '' }
        meta: { code: '1023', title: '点检标准', icon: '' }
      },
      {
        path: 'djbw',
        name: '点检部位',
        code: '1024',
        component: () => import('@/views/sbgl/djbw'),
        meta: { title: '点检部位', icon: '' }
        meta: { code: '1024', title: '点检部位', icon: '' }
      },
      {
        path: 'bybz',
        name: '保养标准',
        code: '1025',
        component: () => import('@/views/sbgl/bybz'),
        meta: { title: '保养标准', icon: '' }
        meta: { code: '1025', title: '保养标准', icon: '' }
      },
      {
        path: 'bybw',
        name: '保养部位',
        code: '1026',
        component: () => import('@/views/sbgl/bybw'),
        meta: { title: '保养部位', icon: '' }
        meta: { code: '1026', title: '保养部位', icon: '' }
      },
      {
        path: 'djjl',
        name: '点检记录',
        code: '1027',
        component: () => import('@/views/sbgl/djjl'),
        meta: { title: '点检记录', icon: '' }
        meta: { code: '1027', title: '点检记录', icon: '' }
      },
      {
        path: 'byjl',
        name: '保养记录',
        code: '1028',
        component: () => import('@/views/sbgl/byjl'),
        meta: { title: '保养记录', icon: '' }
        meta: { code: '1028', title: '保养记录', icon: '' }
      }
    ]
  },
@@ -194,7 +194,7 @@
    redirect: '/gzgl/gzlx',
    name: '工装管理',
    code: '1003',
    meta: { title: '工装管理', icon: 'component' },
    meta: { code: '1003', title: '工装管理', icon: 'component' },
    alwaysShow: true,
    children: [
      {
@@ -202,67 +202,67 @@
        name: '工装类型',
        code: '1030',
        component: () => import('@/views/gzgl/gzlx'),
        meta: { title: '工装类型', icon: '' }
        meta: { code: '1030', title: '工装类型', icon: '' }
      }, {
        path: 'sjxj',
        name: '上机下机',
        code: '1039',
        component: () => import('@/views/gzgl/sjxj'),
        meta: { title: '上机下机', icon: '' }
        meta: { code: '1039', title: '上机下机', icon: '' }
      }, {
        path: 'ckrk',
        name: '出库入库',
        code: '1040',
        component: () => import('@/views/gzgl/ckrk'),
        meta: { title: '出库入库', icon: '' }
        meta: { code: '1040', title: '出库入库', icon: '' }
      }, {
        path: 'gzqd',
        name: '工装清单',
        code: '1031',
        component: () => import('@/views/gzgl/gzqd'),
        meta: { title: '工装清单', icon: '' }
        meta: { code: '1031', title: '工装清单', icon: '' }
      }, {
        path: 'djbz',
        name: '点检标准',
        code: '1032',
        component: () => import('@/views/gzgl/djbz'),
        meta: { title: '点检标准', icon: '' }
        meta: { code: '1032', title: '点检标准', icon: '' }
      }, {
        path: 'djbw',
        name: '点检部位',
        code: '1033',
        component: () => import('@/views/gzgl/djbw'),
        meta: { title: '点检部位', icon: '' }
        meta: { code: '1033', title: '点检部位', icon: '' }
      }, {
        path: 'bybz',
        name: '保养标准',
        code: '1034',
        component: () => import('@/views/gzgl/bybz'),
        meta: { title: '保养标准', icon: '' }
        meta: { code: '1034', title: '保养标准', icon: '' }
      }, {
        path: 'bybw',
        name: '保养部位',
        code: '1035',
        component: () => import('@/views/gzgl/bybw'),
        meta: { title: '保养部位', icon: '' }
        meta: { code: '1035', title: '保养部位', icon: '' }
      }, {
        path: 'djjl',
        name: '点检记录',
        code: '1036',
        component: () => import('@/views/gzgl/djjl'),
        meta: { title: '点检记录', icon: '' }
        meta: { code: '1036', title: '点检记录', icon: '' }
      }, {
        path: 'byjl',
        name: '保养记录',
        code: '1037',
        component: () => import('@/views/gzgl/byjl'),
        meta: { title: '保养记录', icon: '' }
        meta: { code: '1037', title: '保养记录', icon: '' }
      }, {
        path: 'gzwx',
        name: '工装维修',
        code: '1038',
        component: () => import('@/views/gzgl/gzwx'),
        meta: { title: '工装维修', icon: '' }
        meta: { code: '1038', title: '工装维修', icon: '' }
      }
    ]
  },
@@ -272,7 +272,7 @@
    redirect: '/wlgl/ckdy',
    name: '物料管理',
    code: '1004',
    meta: { title: '物料管理', icon: 'table' },
    meta: { code: '1004', title: '物料管理', icon: 'table' },
    alwaysShow: true,
    children: [
      {
@@ -280,38 +280,38 @@
        name: '仓库定义',
        code: '1050',
        component: () => import('@/views/wlgl/ckdy'),
        meta: { title: '仓库定义', icon: '' }
        meta: { code: '1050', title: '仓库定义', icon: '' }
      },
      {
        path: 'kwdy',
        name: '库位定义',
        code: '1051',
        component: () => import('@/views/wlgl/kwdy'),
        meta: { title: '库位定义', icon: '' }
        meta: { code: '1051', title: '库位定义', icon: '' }
      }, {
        path: 'rqlx',
        name: '容器类型',
        code: '1052',
        component: () => import('@/views/wlgl/rqlx'),
        meta: { title: '容器类型', icon: '' }
        meta: { code: '1052', title: '容器类型', icon: '' }
      }, {
        path: 'rqqd',
        name: '容器清单',
        code: '1053',
        component: () => import('@/views/wlgl/rqqd'),
        meta: { title: '容器清单', icon: '' }
        meta: { code: '1053', title: '容器清单', icon: '' }
      }, {
        path: 'crkjl',
        name: '出入库记录',
        code: '1054',
        component: () => import('@/views/wlgl/crkjl'),
        meta: { title: '出入库记录', icon: '' }
        meta: { code: '1054', title: '出入库记录', icon: '' }
      }, {
        path: 'kccx',
        name: '库存查询',
        code: '1055',
        component: () => import('@/views/wlgl/kccx'),
        meta: { title: '库存查询', icon: '' }
        meta: { code: '1055', title: '库存查询', icon: '' }
      }
    ]
  },
@@ -321,7 +321,7 @@
    redirect: '/zzmx/gylx',
    name: '制造模型',
    code: '1005',
    meta: { title: '制造模型', icon: 'icu' },
    meta: { code: '1005', title: '制造模型', icon: 'icu' },
    alwaysShow: true,
    children: [
      {
@@ -329,40 +329,40 @@
        name: '物料类型',
        code: '1060',
        component: () => import('@/views/zzmx/wllx'),
        meta: { title: '物料类型', icon: '' }
        meta: { code: '1060', title: '物料类型', icon: '' }
      },
      {
        path: 'chda',
        name: '存货档案',
        code: '1061',
        component: () => import('@/views/zzmx/chda'),
        meta: { title: '存货档案', icon: '' }
        meta: { code: '1061', title: '存货档案', icon: '' }
      }, {
        path: 'wlqd',
        name: '物料清单',
        code: '1062',
        component: () => import('@/views/zzmx/wlqd'),
        meta: { title: '物料清单', icon: '' }
        meta: { code: '1062', title: '物料清单', icon: '' }
      },
      {
        path: 'gylx',
        name: '工艺路线',
        code: '1063',
        component: () => import('@/views/zzmx/gylx'),
        meta: { title: '工艺路线', icon: '' }
        meta: { code: '1063', title: '工艺路线', icon: '' }
      }, {
        path: 'gxdy',
        name: '工序定义',
        code: '1064',
        component: () => import('@/views/zzmx/gxdy'),
        meta: { title: '工序定义', icon: '' }
        meta: { code: '1064', title: '工序定义', icon: '' }
      },
      {
        path: 'jpgj',
        name: '节拍工价',
        code: '1065',
        component: () => import('@/views/zzmx/jpgj'),
        meta: { title: '节拍工价', icon: '' }
        meta: { code: '1065', title: '节拍工价', icon: '' }
      }
    ]
  },
@@ -372,7 +372,7 @@
    redirect: '/scgl/scdd',
    name: '生产管理',
    code: '1006',
    meta: { title: '生产管理', icon: 'production' },
    meta: { code: '1006', title: '生产管理', icon: 'production' },
    alwaysShow: true,
    children: [
      {
@@ -380,25 +380,25 @@
        name: 'ERP生产订单',
        code: '1070',
        component: () => import('@/views/scgl/scdd'),
        meta: { title: 'ERP生产订单', icon: '' }
        meta: { code: '1070', title: 'ERP生产订单', icon: '' }
      }, {
        path: 'gd',
        name: 'MES工单',
        code: '1071',
        component: () => import('@/views/scgl/gd'),
        meta: { title: 'MES工单', icon: '' }
        meta: { code: '1071', title: 'MES工单', icon: '' }
      }, {
        path: 'gdpg',
        name: '工单派工',
        code: '1072',
        component: () => import('@/views/scgl/gdpg'),
        meta: { title: '工单派工', icon: '' }
        meta: { code: '1072', title: '工单派工', icon: '' }
      }, {
        path: 'sckbg',
        name: '生产开报工',
        code: '1073',
        component: () => import('@/views/scgl/sckbg'),
        meta: { title: '生产开报工', icon: '' }
        meta: { code: '1073', title: '生产开报工', icon: '' }
      }
    ]
  },
@@ -408,7 +408,7 @@
    redirect: '/zlgl/zjbz',
    name: '质量管理',
    code: '1007',
    meta: { title: '质量管理', icon: 'quality' },
    meta: { code: '1007', title: '质量管理', icon: 'quality' },
    alwaysShow: true,
    children: [
      {
@@ -416,31 +416,31 @@
        name: '质检标准',
        code: '1080',
        component: () => import('@/views/zlgl/zjbz'),
        meta: { title: '质检标准', icon: '' }
        meta: { code: '1080', title: '质检标准', icon: '' }
      }, {
        path: 'qxdy',
        name: '缺陷定义',
        code: '1081',
        component: () => import('@/views/zlgl/qxdy'),
        meta: { title: '缺陷定义', icon: '' }
        meta: { code: '1081', title: '缺陷定义', icon: '' }
      }, {
        path: 'gxjy',
        name: '工序检验',
        code: '1082',
        component: () => import('@/views/zlgl/gxjy'),
        meta: { title: '工序检验', icon: '' }
        meta: { code: '1082', title: '工序检验', icon: '' }
      }, {
        path: 'wljy',
        name: '物流检验',
        code: '1083',
        component: () => import('@/views/zlgl/wljy'),
        meta: { title: '物流检验', icon: '' }
        meta: { code: '1083', title: '物流检验', icon: '' }
      }, {
        path: 'qxsj',
        name: '缺陷统计',
        code: '1084',
        component: () => import('@/views/zlgl/qxsj'),
        meta: { title: '缺陷统计', icon: '' }
        meta: { code: '1084', title: '缺陷统计', icon: '' }
      }
    ]
  },
@@ -450,7 +450,7 @@
    redirect: '/xtsz/bmgz',
    name: '系统设置',
    code: '1009',
    meta: { title: '系统设置', icon: 'xtsz' },
    meta: { code: '1009', title: '系统设置', icon: 'xtsz' },
    alwaysShow: true,
    children: [
      {
@@ -458,25 +458,25 @@
        name: '编码规则',
        code: '1101',
        component: () => import('@/views/xtsz/bmgz'),
        meta: { title: '编码规则', icon: '' }
        meta: { code: '1101', title: '编码规则', icon: '' }
      }, {
        path: 'mmxg',
        name: '密码修改',
        code: '1102',
        component: () => import('@/views/xtsz/mmxg'),
        meta: { title: '密码修改', icon: '' }
        meta: { code: '1102', title: '密码修改', icon: '' }
      }, {
        path: 'xtrz',
        name: '系统日志',
        code: '1103',
        component: () => import('@/views/xtsz/xtrz'),
        meta: { title: '系统日志', icon: '' }
        meta: { code: '1103', title: '系统日志', icon: '' }
      }, {
        path: 'sc',
        name: 'SOP上传',
        code: '1104',
        component: () => import('@/views/xtsz/sc'),
        meta: { title: 'SOP上传', icon: '' }
        meta: { code: '1104', title: 'SOP上传', icon: '' }
      }
    ]
  }
src/store/modules/permission.js
@@ -17,11 +17,14 @@
 */
export function getAsyncRoutes(routes, menu) {
  const menuCode = []// å°†åŽç«¯code取出存成数组形式
  const menuNameAndCode = []// å°†åŽç«¯code与name取出存成数组形式
  menu.forEach(item => {
    menuCode.push(item.code)
    menuNameAndCode.push({ code: item.code, name: item.name })
    if (item.children && item.children.length > 0) {
      item.children.forEach(it => {
        menuCode.push(it.code)
        menuNameAndCode.push({ code: it.code, name: it.name })
      })
    }
  })
@@ -30,10 +33,12 @@
  routes.forEach(item => {
    if (menuCode.includes(item.code) && item.children && item.children.length > 0) {
      item.meta.title = menuNameAndCode.find(item2 => item2.code === item.code).name
      const children = []
      let flag = false// åˆ¤æ–­æ˜¯å¦æœ‰children存进去
      item.children.forEach(it => {
        if (menuCode.includes(it.code)) {
          it.meta.title = menuNameAndCode.find(item2 => item2.code === it.code).name
          children.push(it)
          flag = true
        }
src/views/jcsz/jsqd.vue
@@ -154,6 +154,7 @@
      :visible.sync="dialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
@@ -197,6 +198,7 @@
      :visible.sync="settingDialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      class="settingDialogVisible"
      @close="handleCloseSetting"
    >
@@ -277,6 +279,7 @@
      title="角色关联用户"
      :visible.sync="userDialogVisible"
      width="80%"
      :close-on-click-modal="false"
      top="15vh"
      class="userDialogVisible"
      @closed="handleCloseUser"
@@ -421,6 +424,7 @@
      :visible.sync="dialogVisibleRight"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      class="dialogVisibleRight"
      @closed="handleCloseRight"
      @close="handleCloseRight"
src/views/jcsz/wldw.vue
@@ -166,6 +166,7 @@
      :visible.sync="dialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
src/views/jcsz/yhqd.vue
@@ -181,6 +181,7 @@
      :title="operation==='add'?'新增':'修改'"
      :visible.sync="dialogVisible"
      width="50%"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
@@ -261,6 +262,7 @@
      :visible.sync="dialogVisibleRoles"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      class="dialogVisibleRoles"
      @closed="handleCloseRoles"
      @close="handleCloseRoles"
src/views/jcsz/zzjg.vue
@@ -132,6 +132,7 @@
      :visible.sync="dialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
src/views/sbgl/sbqd.vue
@@ -197,6 +197,7 @@
    </div>
    <!--设备清单新增编辑-->
    <el-dialog
      :close-on-click-modal="false"
      :title="operation==='add'?'新增':'修改'"
      :visible.sync="dialogVisible"
      width="50%"
@@ -289,7 +290,7 @@
      :visible.sync="DeviceTypeDialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      class="DeviceTypeDialogVisible"
      @close="handleCloseDeviceType"
    >
@@ -375,6 +376,7 @@
      title="设备组"
      :visible.sync="DeviceGroupDialogVisible"
      width="70%"
      :close-on-click-modal="false"
      top="15vh"
      class="DeviceTypeDialogVisible"
      @close="handleCloseDeviceGroup"
src/views/wlgl/ckdy.vue
@@ -39,6 +39,7 @@
        <el-table
          :data="tableData"
          border
          stripe
          :height="tableHeight"
          :style="{width: 100+'%',height:tableHeight+'px',}"
          highlight-current-row
@@ -109,6 +110,7 @@
      :title="operation==='add'?'新增':'修改'"
      :visible.sync="dialogVisible"
      width="50%"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
src/views/wlgl/kwdy.vue
@@ -49,6 +49,7 @@
        <el-table
          :data="tableData"
          border
          stripe
          :height="tableHeight"
          :style="{width: 100+'%',height:tableHeight+'px',}"
          highlight-current-row
@@ -124,6 +125,7 @@
      :title="operation==='add'?'新增':'修改'"
      :visible.sync="dialogVisible"
      width="50%"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
src/views/xtsy/index.vue
@@ -118,6 +118,8 @@
    }
  },
  created() {
    console.log(document.documentElement.clientHeight, 1)
    console.log(document.documentElement.clientWidth, 2)
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
src/views/xtsz/bmgz.vue
@@ -1,11 +1,517 @@
<template />
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div style="padding: 10px 5px 0 0">
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="编码名称" style=" display: flex;">
              <el-input v-model="form.rightname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="固定字符" style=" display: flex;">
              <el-input v-model="form.prefix" placeholder="请输入" style="width: 200px" />
              <!--              <el-select v-model="form.prefix" :popper-append-to-body="false" style="width: 200px" placeholder="请选择">-->
              <!--                <el-option-->
              <!--                  v-for="item in OrgTypeArr"-->
              <!--                  :key="item.code"-->
              <!--                  :label="item.name"-->
              <!--                  :value="item.code"-->
              <!--                />-->
              <!--              </el-select>-->
            </el-form-item>
            <!--            <el-form-item label="创建人员" style=" display: flex;">-->
            <!--              <el-input v-model="form.UserName" style="width: 200px" placeholder="请输入" />-->
            <!--            </el-form-item>-->
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
      </div>
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <!--        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>-->
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <!--      <el-divider />-->
      <div class="elTableDiv">
        <el-table
          :data="tableData"
          :height="tableHeight"
          border
          stripe
          :style="{width: 100+'%',height:tableHeight+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <!--          <el-table-column-->
          <!--            type="selection"-->
          <!--            width="50"-->
          <!--          />-->
          <el-table-column
            prop="RowNum"
            width="50"
            label="序号"
          />
          <el-table-column
            prop="right_name"
            label="编码名称"
            sortable="custom"
          />
          <el-table-column
            prop="prefix"
            label="前缀"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.prefix">{{ row.prefix }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="filingdate"
            label="提交日期"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.filingdate">{{ row.filingdate }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="incbit"
            label="自增位数"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.incbit">{{ row.incbit }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">修改</el-button>
                <!--                <el-button type="text" @click="del(row)">删除</el-button>-->
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="form.page"
        :limit.sync="form.rows"
        align="right"
        layout="prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getEncodingRules"
      />
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'编码格式'"
      :visible.sync="dialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="固定字符" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 220px" />
        </el-form-item>
        <el-form-item prop="SupUnit" label="提交日期">
          <el-select
            v-model="dialogForm.SupUnit"
            style="width: 220px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in dateType"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="自增位数" prop="OrgName">
          <el-input v-model="dialogForm.OrgName" style="width: 220px" />
        </el-form-item>
        <el-form-item label="编码预览">
          <!--          <el-input v-model="dialogForm.OrgName" style="width: 220px" />-->
          xxxx
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { EncodingRules } from '@/api/xtsz'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Bmgz'
  name: 'Zzjg',
  components: {
    Pagination
  },
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请输入编码'))
      } else {
        if (SER_HZ.test(value)) {
          return callback(new Error('编码不能为中文'))
        } else {
          callback()
        }
      }
    }
    return {
      mainHeight: 0,
      tableHeight: 0,
      form: {
        rightname: '', // ç¼–码名称
        prefix: '', // å›ºå®šå­—符
        prop: 'right_code', // æŽ’序字段
        order: 'asc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      dateType: [
        { label: 'å¹´', value: 'Y' },
        { label: '月', value: 'M' },
        { label: '日', value: 'D' }
      ],
      total: 10,
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// ä¸Šçº§å•位
      },
      operation: '',
      dialogFormRules: {
        // OrgCode: [
        //   { required: true, validator: validateName, trigger: ['blur', 'change'] }
        // ],
        OrgName: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ]
      }
    }
  },
  created() {
    this.getEncodingRules()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getEncodingRules() {
      const res = await EncodingRules(this.form)
      this.tableData = res.data
      this.total = res.count
      // this.tableData = [
      //   { code: 123, name: 'xxx1' }
      // ]
      // this.total = 10
    },
    // æŽ’序改变时
    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.getEncodingRules()
    },
    // æŸ¥è¯¢
    search() {
      this.getEncodingRules()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
      this.form.OrgCode = ''
      this.form.OrgName = ''
      this.form.OrgType = ''
      this.form.UserName = ''
      this.getEncodingRules()
    },
    // æ–°å¢žæŒ‰é’®
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // ä¿®æ”¹æŒ‰é’®
    edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
      })
    },
    // åˆ é™¤æŒ‰é’®
    async del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getEncodingRules()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
          }
          AddUpdateOrganization(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.getEncodingRules()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight
      })
    }
  }
}
</script>
<style scoped>
<style lang="scss" scoped>
$main_color: #42b983;
::v-deep .el-button--primary {
  background-color: $main_color !important;
  height: 30px;
  display: flex;
  align-items: center;
  //border: 1px solid $main_color;
  border: none;
  padding: 0 20px;
}
::v-deep .el-button--primary:hover {
  border: none;
}
::v-deep .el-button--info {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: $main_color !important;
}
::v-deep .el-dialog__footer {
  display: flex;
  justify-content: flex-end;
}
.footerButton {
  display: flex;
  justify-content: end;
}
::v-deep .el-button--default {
  background-color: #ffffff !important;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
::v-deep .el-button--default:hover {
  color: #606266;
}
::v-deep .el-dialog__body {
  padding: 20px 100px !important;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  background-color: $main_color;
  border-color: $main_color;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
  color: $main_color !important;
}
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
  border-color: $main_color;
  background-color: $main_color;
}
::v-deep .el-input__inner {
  height: 30px;
  line-height: 30px;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-table .caret-wrapper {
  transform: scale(0.8);
}
::v-deep .cell {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
::v-deep .el-button--text {
  color: $main_color;
  font-size: 14px;
  cursor: pointer;
}
.operationClass {
  height: 23px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-icon-share {
  color: $main_color;
  cursor: pointer;
}
.el-checkbox.is-bordered.is-checked {
  border-color: $main_color;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  border-color: $main_color;
  background: $main_color;
}
::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  border-color: $main_color;
  background: $main_color;
}
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
  color: $main_color !important;
}
::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
  margin: 10px 30px 0px 0;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
  color: $main_color;
}
::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
  margin: 10px 30px 0px 0;
}
.body ::v-deep .el-divider {
  border: 1px solid #eee;
  width: 99%;
  margin: 10px auto;
}
.body ::v-deep .el-form-item {
  margin-bottom: 0;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-select .el-input__inner:focus{
  border-color: $main_color;
}
::v-deep .el-select-dropdown__item.selected{
  color: $main_color;
}
::v-deep .el-checkbox__inner:hover{
  border-color: $main_color;
}
::v-deep .el-textarea__inner:focus{
  border-color: $main_color;
}
</style>
src/views/zzmx/chda.vue
@@ -84,6 +84,7 @@
        <el-table
          :data="tableData"
          border
          stripe
          :height="tableHeight"
          width="100%"
          highlight-current-row
@@ -202,6 +203,7 @@
    <!--新增编辑对话框-->
    <el-dialog
      :close-on-click-modal="false"
      :title="operation==='add'?'新增':'修改'"
      :visible.sync="dialogVisible"
      width="50%"
@@ -298,6 +300,7 @@
    <!--    å•位按钮对话框-->
    <el-dialog
      :close-on-click-modal="false"
      title="单位设置"
      :visible.sync="officeDialogVisible"
      width="50%"
@@ -417,6 +420,7 @@
    <!--    å·¥è‰ºè·¯çº¿å¯¹è¯æ¡†-->
    <el-dialog
      :close-on-click-modal="false"
      title="关联工艺路线"
      :visible.sync="dialogVisibleRoute"
      width="50%"
src/views/zzmx/gxdy.vue
@@ -1,11 +1,596 @@
<template />
<template>
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div style="padding: 10px 5px 0 0">
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="工序编码" style=" display: flex;">
              <el-input v-model="form.stepcode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="工序名称" style=" display: flex;">
              <el-input v-model="form.stepname" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="启用状态" style=" display: flex;">
              <el-select v-model="form.enable" :popper-append-to-body="false" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in enableArr"
                  :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.steptypecode"
                :popper-append-to-body="false"
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in steptypeArr"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="创建人员" style=" display: flex;">
              <el-input v-model="form.createuser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
      </div>
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>
      </div>
      <el-divider />
      <div class="elTableDiv">
        <el-table
          :data="tableData"
          :height="tableHeight"
          border
          stripe
          :style="{width: 100+'%',height:tableHeight+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <!--          <el-table-column-->
          <!--            type="selection"-->
          <!--            width="50"-->
          <!--          />-->
          <el-table-column
            prop="RowNum"
            width="50"
            label="序号"
          />
          <el-table-column
            prop="stepcode"
            label="工序编码"
            sortable="custom"
          />
          <el-table-column
            prop="stepname"
            label="工序名称"
            sortable="custom"
          />
          <el-table-column
            prop="flwtype"
            label="工序类型"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.flwtype.indexOf(';')!==-1">自制;外协</div>
              <div v-if="row.flwtype==='W'">外协</div>
              <div v-if="row.flwtype==='Z'">自制</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="descr"
            label="工序描述"
            sortable="custom"
          />
          <el-table-column
            prop="lm_user"
            label="创建人员"
            sortable="custom"
          />
          <el-table-column
            prop="lm_date"
            label="创建时间"
            sortable="custom"
          />
          <el-table-column
            label="关联工作站"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <i class="el-icon-share" @click="workClick(row)" />
              </div>
            </template>
          </el-table-column>
          <el-table-column
            label="关联缺陷"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <i class="el-icon-share" @click="defectClick(row)" />
              </div>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">修改</el-button>
                <el-button type="text" @click="del(row)">删除</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!--分页-->
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="form.page"
        :limit.sync="form.rows"
        align="right"
        layout="prev, pager, next,sizes"
        popper-class="select_bottom"
        @pagination="getStepSearch"
      />
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'修改'"
      :visible.sync="dialogVisible"
      width="50%"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <el-form-item label="工序编码" prop="stepcode">
          <el-input v-model="dialogForm.stepcode" :disabled="operation!=='add'" style="width: 220px" />
        </el-form-item>
        <el-form-item label="工序名称" prop="stepname">
          <el-input v-model="dialogForm.stepname" style="width: 220px" />
        </el-form-item>
        <el-form-item prop="steptypecode" label="工序类型">
          <el-select
            v-model="dialogForm.steptypecode"
            style="width: 220px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in steptypeArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <el-form-item prop="enable" label="启用状态">
          <el-select
            v-model="dialogForm.enable"
            style="width: 220px"
            placeholder="请选择"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in enableArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="工序描述" prop="description">
          <el-input v-model="dialogForm.description" type="textarea" style="width: 220px" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>
        </div>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { AddUpdateStep, DeleteStep, StepSearch } from '@/api/zzmx'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Gxdy'
  name: 'Zzjg',
  components: {
    Pagination
  },
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请输入编码'))
      } else {
        if (SER_HZ.test(value)) {
          return callback(new Error('编码不能为中文'))
        } else {
          callback()
        }
      }
    }
    return {
      mainHeight: 0,
      tableHeight: 0,
      form: {
        stepcode: '', // å·¥åºç¼–码
        stepname: '', // å·¥åºåç§°
        enable: '', // å¯ç”¨çŠ¶æ€
        steptypecode: [], // å·¥åºç±»åž‹ç¼–码
        createuser: '', // åˆ›å»ºäººå‘˜
        prop: 'lm_date', // æŽ’序字段
        order: 'desc', // æŽ’序字段
        page: 1, // ç¬¬å‡ é¡µ
        rows: 20 // æ¯é¡µå¤šå°‘条
      },
      enableArr: [
        { code: 'Y', name: '是' },
        { code: 'N', name: '否' }
      ],
      steptypeArr: [
        { code: 'Z', name: '自制' },
        { code: 'W', name: '外协' },
        { code: 'Z;W', name: '自制;外协' }
      ],
      total: 10,
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        'idid': '',
        'stepcode': '',
        'stepname': '',
        'steptypecode': '',
        'enable': '',
        'description': '',
        'OperType': ''
      },
      operation: '',
      dialogFormRules: {
        stepcode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        stepname: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ],
        steptypecode: [
          { required: true, message: '请选择类型', trigger: ['blur', 'change'] }
        ],
        enable: [
          { required: true, message: '请选择状态', trigger: ['blur', 'change'] }
        ]
      }
    }
  },
  created() {
    this.getStepSearch()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    async getStepSearch() {
      const res = await StepSearch(this.form)
      this.tableData = res.data
      this.total = res.count
    },
    // æŽ’序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {
        order = 'desc'
      } else if (order === 'ascending') {
        order = 'asc'
      } else {
        order = 'desc'
      }
      this.form.order = order
      this.form.prop = prop
      this.getStepSearch()
    },
    // æŸ¥è¯¢
    search() {
      this.getStepSearch()
    },
    upload() {
    },
    // é‡ç½®
    reset() {
      this.form.stepcode = ''
      this.form.stepname = ''
      this.form.enable = ''
      this.form.steptypecode = ''
      this.form.createuser = ''
      this.getStepSearch()
    },
    // æ–°å¢žæŒ‰é’®
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
    },
    // ä¿®æ”¹æŒ‰é’®
    edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      this.$nextTick(() => {
        this.dialogForm.id = row.id
        this.dialogForm.stepcode = row.stepcode
        this.dialogForm.stepname = row.stepname
        this.dialogForm.steptypecode = row.flwtype
        this.dialogForm.description = row.descr
        this.dialogForm.enable = row.enable
      })
    },
    // åˆ é™¤æŒ‰é’®
    async del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteStep({ stepcode: row.stepcode }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getStepSearch()
          }
        })
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm.stepcode = ''
      this.dialogForm.stepname = ''
      this.dialogForm.steptypecode = ''
      this.dialogForm.enable = ''
      this.dialogForm.description = ''
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
    dialogVisibleCancel() {
      this.dialogVisible = false
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            id: this.dialogForm.id,
            stepcode: this.dialogForm.stepcode,
            stepname: this.dialogForm.stepname,
            steptypecode: this.dialogForm.steptypecode,
            enable: this.dialogForm.enable,
            description: this.dialogForm.description,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
          }
          AddUpdateStep(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.getStepSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
    // èŽ·å–é¡µé¢é«˜åº¦
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
      })
    },
    /* å…³è”工作站模块*/
    // å…³è”工作站点击
    workClick(row) {
    },
    /* å…³è”缺陷*/
    //  å…³è”缺陷点击
    defectClick(row) {
    }
  }
}
</script>
<style scoped>
<style lang="scss" scoped>
$main_color: #42b983;
::v-deep .el-button--primary {
  background-color: $main_color !important;
  height: 30px;
  display: flex;
  align-items: center;
  //border: 1px solid $main_color;
  border: none;
  padding: 0 20px;
}
::v-deep .el-button--primary:hover {
  border: none;
}
::v-deep .el-button--info {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: $main_color !important;
}
::v-deep .el-dialog__footer {
  display: flex;
  justify-content: flex-end;
}
.footerButton {
  display: flex;
  justify-content: end;
}
::v-deep .el-button--default {
  background-color: #ffffff !important;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
::v-deep .el-button--default:hover {
  color: #606266;
}
::v-deep .el-dialog__body {
  padding: 20px 100px !important;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  background-color: $main_color;
  border-color: $main_color;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
  color: $main_color !important;
}
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
  border-color: $main_color;
  background-color: $main_color;
}
::v-deep .el-input__inner {
  height: 30px;
  line-height: 30px;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-table .caret-wrapper {
  transform: scale(0.8);
}
::v-deep .cell {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
::v-deep .el-button--text {
  color: $main_color;
  font-size: 14px;
  cursor: pointer;
}
.operationClass {
  height: 23px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-icon-share {
  color: $main_color;
  cursor: pointer;
}
.el-checkbox.is-bordered.is-checked {
  border-color: $main_color;
}
::v-deep .el-radio__input.is-checked .el-radio__inner {
  border-color: $main_color;
  background: $main_color;
}
::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
  border-color: $main_color;
  background: $main_color;
}
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
  color: $main_color !important;
}
::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
  margin: 10px 30px 0px 0;
}
::v-deep .el-radio__input.is-checked + .el-radio__label {
  color: $main_color;
}
::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
  margin: 10px 30px 0px 0;
}
.body ::v-deep .el-divider {
  border: 1px solid #eee;
  width: 99%;
  margin: 10px auto;
}
.body ::v-deep .el-form-item {
  margin-bottom: 0;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-select .el-input__inner:focus{
  border-color: $main_color;
}
::v-deep .el-select-dropdown__item.selected{
  color: $main_color;
}
::v-deep .el-checkbox__inner:hover{
  border-color: $main_color;
}
::v-deep .el-textarea__inner:focus{
  border-color: $main_color;
}
</style>
src/views/zzmx/gylx.vue
@@ -40,6 +40,7 @@
          :data="tableData"
          :height="tableHeight"
          border
          stripe
          :style="{width: 100+'%',height:tableHeight+'px',}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
@@ -96,7 +97,8 @@
            <template slot-scope="{row}">
              <div class="operationClass">
                <!--                <el-button type="text" @click="edit('edit',row)">修改</el-button>-->
                <el-button type="text" @click="del(row.id)">删除</el-button>
                <el-button type="text" @click="edit('edit',row)">预览</el-button>
                <el-button type="text" @click="del(row)">删除</el-button>
              </div>
            </template>
          </el-table-column>
@@ -116,26 +118,28 @@
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'修改'"
      :title="operation==='add'?'新增':'预览'"
      :visible.sync="dialogVisible"
      width="70%"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
    >
      <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
      <el-form ref="dialogForm" style="height: 500px" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
        <div style="display: flex">
          <el-form-item label="工艺编码" prop="OrgCode" style="margin-right: 20px">
            <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 220px" />
          <el-form-item label="工艺编码" prop="code" style="margin-right: 20px">
            <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 220px" />
          </el-form-item>
          <el-form-item label="工艺名称" prop="OrgName">
            <el-input v-model="dialogForm.OrgName" style="width: 220px" />
          <el-form-item label="工艺名称" prop="name">
            <el-input v-model="dialogForm.name" :disabled="operation==='edit'" style="width: 220px" />
          </el-form-item>
        </div>
        <div style="display: flex">
          <el-form-item prop="SupUnit" label="使用状态" style="margin-right: 20px">
          <el-form-item prop="enable" label="使用状态" style="margin-right: 20px">
            <el-select
              v-model="dialogForm.isEnable"
              v-model="dialogForm.enable"
              :disabled="operation==='edit'"
              :popper-append-to-body="false"
              style="width: 220px"
              placeholder="请选择"
@@ -148,14 +152,14 @@
              />
            </el-select>
          </el-form-item>
          <el-form-item label="工艺描述" prop="OrgName">
            <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 220px" />
          <el-form-item label="工艺描述" prop="description">
            <el-input v-model="dialogForm.description" :disabled="operation==='edit'" type="textarea" style="width: 220px" />
          </el-form-item>
        </div>
        <el-form-item label="工艺设置" prop="OrgName" style="margin-top: 30px">
        <el-form-item label="工艺设置" prop="Data" style="margin-top: 30px">
          <div class="settingDiv">
            <!--   å®žçŽ°å·¥è‰ºè®¾ç½®åŠ¨æ€æ·»åŠ -->
            <div v-for="(tag,index) in dynamicTags" :key="tag.id" style="display: flex;align-items: center">
            <div v-for="(tag,index) in dynamicTags" :key="tag.seq" style="display: flex;align-items: center">
              <div style="display: flex;align-items: center;position: relative;">
                <div
                  class="orderNumber"
@@ -163,54 +167,73 @@
                    backgroundColor:index===0?'#f8f8fa':'#409EFF',
                    color:index===0?'#c6bbc4':'#FFFFFF',
                    border:index===0?'1px solid #c6bbc4':'1px solid #409EFF',
                    zIndex:!flag&&tag.label===flagSelected?0:2
                    zIndex:tag.label===selectedName?0:2
                  }"
                >
                  {{ index+1 }}</div>
                <el-tooltip class="item" effect="dark" :content="tag.label" placement="top">
                  <!--                  @close="handleTagClose(tag.label)"-->
                  {{ index+1 }}
                </div>
                <!--                <el-tooltip-->
                <!--                  class="item"-->
                <!--                  effect="dark"-->
                <!--                  :content="tag.stepname"-->
                <!--                  placement="top"-->
                <!--                >-->
                <!--                  @close="handleTagClose(tag.stepname)"-->
                  <!--                  :closable="index!==0"-->
                  <el-tag
                    v-if="flag||tag.label!==flagSelected"
                  v-if="tag.stepname!==selectedName"
                    :disable-transitions="false"
                    class="elTag"
                    :class="tagClass(tag.label)"
                    :effect="tag.effect"
                    @click="elTagClick(tag)"
                  >
                    <!--                <div class="orderNumber">{{ index }}</div>-->
                    {{ tag.label }}
                    <i class="el-icon-edit" @click="tagEdit(tag)" />
                  </el-tag>
                </el-tooltip>
                  {{ tag.stepname }}
                <i
                  v-if="index!==0"
                    v-if="tag.editDisabled&&operation!=='edit'"
                    class="el-icon-edit"
                    @click="tagEdit(tag)"
                  />
                </el-tag>
                <!--                </el-tooltip>-->
                <!--                left:tag.stepname===selectedName?'191px':'141px',-->
                <i
                  v-if="index!==0&&tag.editDisabled&&operation!=='edit'"
                  :style="{
                    left:!flag&&tag.label===flagSelected?'191px':'91px',
                    top:!flag&&tag.label===flagSelected?'-2px':'-8px',
                    top:tag.stepname===selectedName?'-2px':'-8px',
                  }"
                  class="el-icon-close"
                  @click="handleTagClose(tag.label)"
                  @click="handleTagClose(tag)"
                />
                <el-autocomplete
                  v-if="!flag&&tag.label===flagSelected"
                  :ref="'saveTagInput'+tag.id"
                  v-model="tagValue"
                  v-if="tag.stepname===selectedName"
                  :ref="'saveTagInput'+tag.seq"
                  v-model="autocompleteValue"
                  class="input-new-tag"
                  size="small"
                  :fetch-suggestions="querySearch"
                  style="margin-left: 0;width: 200px;transform: translate(1)"
                  style="margin-left: 0;width: 150px;transform: translate(1)"
                  autofocus
                  :debounce="300"
                  :popper-append-to-body="false"
                  popper-class="autocompleteClass"
                  @select="handleSelect"
                  @keyup.enter.native="handleInputConfirm2"
                  @keyup.enter.native="handleInputConfirm(tag)"
                />
                <!--        @blur="handleBlur2"-->
                <div v-if="index!==dynamicTags.length-1" style="width: 40px;height: 1px;border: 1px solid #42b983" />
                <div
                  v-if="index!==dynamicTags.length-1"
                  style="width: 40px;height: 1px;border: 1px solid #42b983"
                />
              </div>
            </div>
            <!--            :disabled="addDisabled"-->
            <el-button
              v-if="operation!=='edit'"
              type="success"
              :disabled="addDisabled"
              class="tagSuccess"
              size="small"
              icon="el-icon-plus"
@@ -222,8 +245,9 @@
      </el-form>
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>
          <el-button v-if="operation==='edit'" @click="dialogVisibleCancel">返 å›ž</el-button>
          <el-button v-if="operation!=='edit'" @click="dialogVisibleCancel">取 æ¶ˆ</el-button>
          <el-button v-if="operation!=='edit'" type="primary" @click="dialogVisibleConfirm">ç¡® å®š</el-button>
        </div>
      </span>
    </el-dialog>
@@ -232,9 +256,7 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import { RouteSearch } from '@/api/zzmx'
import { AddUpdateRoute, DeleteRoute, RouteSearch, RouteSelect, StepSelect, ViewRoute } from '@/api/zzmx'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -252,13 +274,6 @@
        } else {
          callback()
        }
      }
    }
    const validateTypeCode = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请选择上级'))
      } else {
        callback()
      }
    }
    return {
@@ -282,37 +297,39 @@
      tableData: [],
      dialogVisible: false,
      dialogForm: {
        OrgType: '',
        OrgCode: '',
        OrgName: '',
        SupUnit: ''// ä¸Šçº§å•位
        id: '',
        code: '',
        name: '',
        enable: '',
        description: '',
        Data: []
      },
      dynamicTags: [// å·¥è‰ºè®¾ç½®æ•°ç»„
        { id: 1, label: '标签一标签一标签一标签一标签一标签一', effect: 'light' },
        { id: 2, label: '标签二', effect: 'light' },
        { id: 3, label: '标签三', effect: 'light' }
        { editDisabled: true, stepcode: 'Step01', seq: 1, stepname: ' ', effect: 'light' }
        // { editDisabled: true, stepcode: 'Step02', seq: 2, stepname: '奶', effect: 'light' },
        // { editDisabled: true, stepcode: 'Step03', seq: 3, stepname: '大', effect: 'light' }
      ],
      tagSelectedId: '', // tag选择中id
      flag: true,
      flagSelected: '', // åˆ¤æ–­æ˜¯å¦é€‰ä¸­
      tagValue: '',
      restaurants: [],
      addDisabled: false,
      clickSelected: '', // é¼ æ ‡ç‚¹å‡»é€‰ä¸­çš„值
      selectedName: '', // é€‰ä¸­çš„名称
      autocompleteValue: '', // å¯æœç´¢è¾“入框中的值
      routeArr: [], // å·¥è‰ºè®¾ç½®ä¸‹æ‹‰æ‰€æœ‰å€¼
      addDisabled: false, // æ·»åŠ æŒ‰é’®æ˜¯å¦å¯ç‚¹å‡»
      editDisabled: true, // ä¿®æ”¹æŒ‰é’®æ˜¯å¦å¯ç‚¹å‡»
      mouseFocusPosition: 0, // é¼ æ ‡èšç„¦çš„位置
      operation: '',
      dialogFormRules: {
        OrgType: [
          { required: true, message: '请输入选择类型', trigger: ['blur', 'change'] }
        ],
        OrgCode: [
        code: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
        ],
        OrgName: [
        name: [
          { required: true, message: '请输入名称', trigger: ['blur', 'change'] }
        ],
        SupUnit: [
          { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
        enable: [
          { required: true, message: '请选择使用状态', trigger: ['blur', 'change'] }
        ]
        // Data: [
        //   { required: true, message: '请设置工艺', trigger: ['blur', 'change'] }
        // ]
      }
    }
@@ -323,68 +340,94 @@
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    this.restaurants = this.loadAll()
  },
  methods: {
    // è¿œç¨‹æœç´¢
    querySearch(queryString, cb) {
      var restaurants = this.restaurants
      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
      const routeArr = this.routeArr
      routeArr.forEach(item => {
        item.value = item.stepname
      })
      const results = queryString ? routeArr.filter(this.createFilter(queryString)) : routeArr
      // è°ƒç”¨ callback è¿”回建议列表的数据
      cb(results)
    },
    // è¿‡æ»¤
    createFilter(queryString) {
      return (restaurant) => {
        // return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
      return (res) => {
        return (res.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
      }
    },
    loadAll() {
      return [
        { 'value': '三全鲜食(北新泾店)', 'address': '长宁区新渔路144号' },
        { 'value': 'Hot honey é¦–尔炸鸡(仙霞路)', 'address': '上海市长宁区淞虹路661号' },
        { 'value': '新旺角茶餐厅', 'address': '上海市普陀区真北路988号创邑金沙谷6号楼113' },
        { 'value': '泷千家(天山西路店)', 'address': '天山西路438号' },
        { 'value': '胖仙女纸杯蛋糕(上海凌空店)', 'address': '上海市长宁区金钟路968号1å¹¢18号楼一层商铺18-101' },
        { 'value': '贡茶', 'address': '上海市长宁区金钟路633号' },
        { 'value': '豪大大香鸡排超级奶爸', 'address': '上海市嘉定区曹安公路曹安路1685号' },
        { 'value': '茶芝兰(奶茶,手抓饼)', 'address': '上海市普陀区同普路1435号' }
      ]
    // å·¥è‰ºè®¾ç½® ä¸‹æ‹‰èŽ·å–æ‰€æœ‰
    async  getStepSelectArr() {
      const { data: res } = await StepSelect()
      this.routeArr = res
    },
    // å¤„理下拉选择
    handleSelect(item) {
      console.log(item)
    },
    handleInputConfirm2() {
      console.log(this.flagSelect, 111)
      // this.dynamicTags.forEach((item,index) => {
      //   if (item === this.flagSelect) {
      //     console.log(item, 111)
      //     item = this.flagSelect
      //   }
      // })
      console.log(this.value)
      this.addDisabled = false
      this.flagSelect = ''
      this.tagValue = ''
      this.flag = !this.flag
    },
    tagEdit(tag) {
      console.log(tag, 2)
      this.addDisabled = true
      this.flagSelected = tag.label
      this.tagValue = tag.label
      this.flag = !this.flag
      this.autocompleteValue = item.value
      this.$nextTick(_ => {
        this.$refs['saveTagInput' + tag.id][0].focus()
        this.$refs['saveTagInput' + this.mouseFocusPosition][0].focus()
      })
    },
    // è¾“入框确认事件
    handleInputConfirm(tag) {
      console.log(tag, 111)
      console.log(this.autocompleteValue, 2)
      // 1.选择内容不能为空
      if (this.autocompleteValue.trim().length < 1) {
        return this.$message.info('选择内容不能为空!')
      }
      // 2.输入框内容与下拉选项内容不匹配
      let flag = false
      this.routeArr.forEach(item => {
        if (item.stepname === this.autocompleteValue) {
          flag = true
        }
      })
      if (!flag) {
        return this.$message.info('输入框内容与下拉选项内容不匹配!')
      }
      // å°†å€¼æ›¿æ¢åˆ°åŽŸtag位置上
      this.dynamicTags.forEach((item, index) => {
        if ((index + 1) === tag.seq) {
          console.log(tag)
          item.stepname = this.autocompleteValue
        }
        item.editDisabled = true
      })
      console.log(this.dynamicTags, 234)
      this.addDisabled = false
      this.editDisabled = true
      this.selectedName = ''
    },
    // tag点击修改按钮
    tagEdit(tag) {
      console.log(tag, 2)
      this.autocompleteValue = ''
      this.dynamicTags.forEach(item => {
        item.stepname = item.stepname.trim()
        if (item.seq !== tag.seq) {
          item.editDisabled = false
          // return this.$message.info('请先填写或选择工艺!')
        }
      })
      this.addDisabled = true
      this.selectedName = tag.stepname
      this.autocompleteValue = tag.stepname
      this.$nextTick(_ => {
        this.$refs['saveTagInput' + tag.seq][0].focus()
      })
      this.mouseFocusPosition = tag.seq
    },
    // tag点击事件
    elTagClick(tag) {
      console.log(tag, 1)
      this.tagSelectedId = tag.id
      this.clickSelected = tag.seq
      if (tag.effect === 'dark') {
        tag.effect = 'light'
        this.tagSelectedId = ''
        this.clickSelected = ''
      } else {
        this.dynamicTags.forEach(item => {
          item.effect = 'light'
@@ -395,46 +438,69 @@
          tag.effect = 'light'
        }
      }
      console.log(this.$el)
      // console.log(this.$el.style.color = 'red')
    },
    tagClass() {
      // this.tagSelect.style({ backgroundColor: 'red' })
      // return { backgroundColor: 'red' }
    },
    // å¤„理tag关闭事件
    handleTagClose(tag) {
      // this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
      console.log(tag)
      // å½“选中的步骤被删除时
      if (tag.seq === this.clickSelected) {
        this.clickSelected = ''
      }
      this.dynamicTags.forEach((item, index) => {
        if (item.label === tag) {
          console.log(item.label === tag)
        if (item.seq === tag.seq) {
          this.dynamicTags.splice(index, 1)
        }
      })
      // é‡æ–°æŽ’序
      this.dynamicTags.forEach((item, index) => {
        item.editDisabled = true
        item.seq = index + 1
        item.stepcode = 'Step' + ((index + 1).toString().length === 2 ? (index + 1) : '0' + (index + 1))
      })
      if (this.clickSelected === '') {
        this.selectedName = ''
      }
      this.addDisabled = false
    },
    // tag添加按钮
    showInput() {
      // this.inputVisible = true
      this.autocompleteValue = ''
      this.addDisabled = true
      if (this.tagSelectedId === '' || this.tagSelectedId === this.dynamicTags.length) {
      this.editDisabled = false
      let seq = 0
      // 1.第一种情况   å½“未选中情况下或者选中最后一个的情况下
      if (this.clickSelected === '' || this.clickSelected === this.dynamicTags.length) {
        seq = this.dynamicTags.length + 1
        this.dynamicTags.push(
          { id: (this.dynamicTags.length + 1), label: '', effeft: 'light' }
          { editDisabled: true, seq: seq, stepname: '', effect: 'light', stepcode: ('Step' + (seq.toString().length === 2 ? seq : '0' + seq)) }
        )
      } else {
        console.log(this.tagSelectedId, 31)
        this.dynamicTags.splice(this.tagSelectedId, 0, { id: this.dynamicTags.length + 1, label: '', effect: 'light' })
      }
      this.flag = !this.flag
      this.$nextTick(_ => {
        this.$refs['saveTagInput' + this.dynamicTags.length][0].focus()
        // 2.第二种情况   å½“选中某个tag   å°†åœ¨tag后面添加
        seq = this.clickSelected + 1
        this.dynamicTags.splice(this.clickSelected, 0, { editDisabled: true, seq: seq, stepname: '', effect: 'light' })
        this.dynamicTags.forEach((item, index) => {
          item.seq = index + 1
          item.stepcode = 'Step' + ((index + 1).toString().length === 2 ? (index + 1) : '0' + (index + 1))
      })
      // this.$nextTick(_ => {
      //   console.log(this.$refs['saveTagInput'], 321)
      //   this.$refs.saveTagInput.$refs.input.focus()
      // })
      }
      this.$nextTick(_ => {
        this.$refs['saveTagInput' + seq][0].focus()
      })
      this.mouseFocusPosition = seq
      this.dynamicTags.forEach((item, index) => {
        item.editDisabled = seq === index + 1
      })
      console.log(this.dynamicTags, 1)
    },
    // èŽ·å–å·¥è‰ºè·¯çº¿åˆ—è¡¨æ¸…å•
    async getRouteSearch() {
      const res = await RouteSearch(this.form)
      this.tableData = res.data
@@ -473,26 +539,37 @@
    add(operation) {
      this.operation = operation
      this.dialogVisible = true
      this.getStepSelectArr()
    },
    // ä¿®æ”¹æŒ‰é’®
    edit(operation, row) {
    // å·¥è‰ºè·¯çº¿é¢„览
    async  edit(operation, row) {
      this.operation = operation
      this.dialogVisible = true
      const { data: res } = await ViewRoute({ routecode: row.code })
      this.dynamicTags = []
      this.$nextTick(() => {
        this.dialogForm.OrgCode = row.org_code
        this.dialogForm.OrgName = row.org_name
        this.dialogForm.SupUnit = row.parent_id
        this.dialogForm.code = res[0].code
        this.dialogForm.name = res[0].name
        this.dialogForm.enable = res[0].enable
        this.dialogForm.description = res[0].description
        // this.dialogForm.Data = row.description
        res[0].Data.forEach(item => {
          this.dynamicTags.push(
            { seq: item.seq, stepname: item.stepname, stepcode: item.stepcode, editDisabled: true, effect: 'light' }
          )
        })
      })
    },
    // åˆ é™¤æŒ‰é’®
    async del(id) {
    async del(row) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        DeleteOrganization({ orgid: id }).then(res => {
        DeleteRoute({ routecode: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            this.getRouteSearch()
@@ -504,10 +581,14 @@
    },
    // å¯¹è¯æ¡†å…³é—­äº‹ä»¶
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.dialogForm.code = ''
      this.dialogForm.name = ''
      this.dialogForm.enable = ''
      this.dialogForm.description = ''
      this.dialogForm.Data = []
      this.dynamicTags = [
        { editDisabled: true, stepcode: 'Step01', seq: 1, stepname: ' ', effect: 'light' }
      ]
      this.$refs.dialogForm.clearValidate()
    },
    // å¯¹è¯æ¡†å–消
@@ -516,25 +597,33 @@
    },
    // å¯¹è¯æ¡†ç¡®è®¤
    dialogVisibleConfirm() {
      if (this.dynamicTags[0].stepname.trim() === '') {
        return this.$message.info('工艺设置第一项不能为空!')
      }
      console.log(this.dynamicTags, 3)
      const Data = []
      this.dynamicTags.forEach(item => {
        Data.push({ seq: item.seq, stepcode: item.stepcode, stepname: item.stepname })
      })
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          const data = {
            OrganType: this.dialogFormOrgTypeSelected,
            OrganCode: this.dialogForm.OrgCode,
            OrganName: this.dialogForm.OrgName,
            SupUnit: this.dialogFormOrgTypeSelected === 'F' ? '0' : this.dialogForm.SupUnit,
            OperType: this.operation === 'add' ? 'Add' : 'Update',
            Operator: getCookie('admin')
            code: this.dialogForm.code,
            name: this.dialogForm.name,
            enable: this.dialogForm.enable,
            description: this.dialogForm.description,
            Data: Data
          }
          // AddUpdateOrganization(data).then(res => {
          //   if (res.code === '200') {
          //     this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
          //     this.dialogVisible = false
          //     this.getRouteSearch()
          //   } else {
          //     this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
          //   }
          // })
          console.log(data, 2)
          AddUpdateRoute(this.dialogForm.id, this.operation === 'add' ? 'Add' : 'Update', data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.getRouteSearch()
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
        }
      })
    },
@@ -748,7 +837,7 @@
  position: absolute;
  top: -8px;
  z-index: 2;
  left: 91px;
  left: 141px;
  cursor: pointer;
  color: #FFFFFF;
  border-radius: 50%;
@@ -803,15 +892,21 @@
  overflow-x: scroll;
  overflow-y: hidden;
  align-items: center;
  background: aliceblue;
}
.elTag {
  margin-left: 0;
  width: 100px;
  width: 150px;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.autocompleteClass{
  .el-autocomplete-suggestion li{
    //color: red;
  }
}
</style>
src/views/zzmx/wllx.vue
@@ -43,6 +43,7 @@
        <el-table
          :data="tableData"
          border
          stripe
          :height="tableHeight"
          :style="{width: 100+'%',height:tableHeight+'px',}"
          highlight-current-row
@@ -114,6 +115,7 @@
      :visible.sync="dialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >