瀏覽代碼

Merge remote-tracking branch 'origin/dev' into goalManagementDev

002637 1 年之前
父節點
當前提交
793b5e58d5
共有 100 個文件被更改,包括 10390 次插入4389 次删除
  1. 52 0
      src/api/business/spd/starget/target.js
  2. 60 0
      src/api/business/spd/starget/targetTemplate.js
  3. 64 0
      src/api/business/spd/task_management/visitingPlan/visitingPlan.js
  4. 36 0
      src/api/changeApply/basic.js
  5. 25 25
      src/api/login.js
  6. 10 0
      src/api/monitor/service.js
  7. 7 0
      src/api/purchase/purchaseDemand.js
  8. 33 2
      src/api/requisition/basic.js
  9. 8 9
      src/assets/styles/element-ui.scss
  10. 10 0
      src/assets/styles/font.scss
  11. 33 20
      src/assets/styles/index.scss
  12. 23 0
      src/assets/styles/margin.scss
  13. 23 0
      src/assets/styles/padding.scss
  14. 4 1
      src/assets/styles/sidebar.scss
  15. 1 1
      src/components/Pagination/index.vue
  16. 13 5
      src/components/PopDialog/index.vue
  17. 9 2
      src/components/Refers/refers.vue
  18. 56 0
      src/components/popover-select-v2/fetch/index.js
  19. 3 3
      src/components/popover-select-v2/index.vue
  20. 4 3
      src/components/popover-select-v2/multiple.vue
  21. 15 0
      src/components/popover-select/components/CUSTOMER_PARAM_ZT.js
  22. 9 0
      src/components/popover-select/components/LINKMAN_PARAM.js
  23. 15 0
      src/components/popover-select/components/MANUFACTURER_PARAM.js
  24. 48 0
      src/components/popover-select/components/MATERIAL_PARAM.js
  25. 15 0
      src/components/popover-select/components/MK_SALESAREA_PARAM.js
  26. 9 0
      src/components/popover-select/components/MK_TARGET_CYCLE_PARAM.js
  27. 9 0
      src/components/popover-select/components/MK_TARGET_INDEX_PARAM.js
  28. 9 0
      src/components/popover-select/components/MK_TARGET_TEMPLATE_PARAM.js
  29. 4 3
      src/components/popover-select/index.vue
  30. 6 5
      src/components/popover-tree-select/index.vue
  31. 4 3
      src/components/popover-tree-select/multiple.vue
  32. 14 2
      src/components/super-form/index.vue
  33. 117 152
      src/components/super-search/index.vue
  34. 119 0
      src/components/super-table/freeze.vue
  35. 119 0
      src/components/super-table/hide.vue
  36. 314 162
      src/components/super-table/index.vue
  37. 142 0
      src/components/super-table/once/filters.vue
  38. 64 0
      src/components/super-table/once/freeze.vue
  39. 45 0
      src/components/super-table/once/hide.vue
  40. 64 0
      src/components/super-table/once/sort.vue
  41. 1 1
      src/layout/components/TagsView/index.vue
  42. 86 71
      src/layout/index.vue
  43. 28 1
      src/main.js
  44. 31 29
      src/store/modules/app.js
  45. 4 0
      src/utils/init.js
  46. 3 1
      src/utils/init/index.js
  47. 1 1
      src/utils/request.js
  48. 173 162
      src/views/WMS/historical-route/index.vue
  49. 51 45
      src/views/business/spd/bo/basic/index.vue
  50. 5 5
      src/views/business/spd/bo/basic/process.vue
  51. 19 108
      src/views/business/spd/bo/behavior/behaviorList.vue
  52. 255 79
      src/views/business/spd/bo/behavior/index.vue
  53. 18 51
      src/views/business/spd/bo/contact/contactList.vue
  54. 381 248
      src/views/business/spd/bo/contact/index.vue
  55. 24 6
      src/views/business/spd/bo/filetemplate/index.vue
  56. 3 3
      src/views/business/spd/bo/statement/index.vue
  57. 4 4
      src/views/business/spd/bo/statement/proportion/index.vue
  58. 33 7
      src/views/business/spd/bo/task/index.vue
  59. 264 0
      src/views/business/spd/target/targetMk/add.vue
  60. 287 0
      src/views/business/spd/target/targetMk/index.vue
  61. 210 0
      src/views/business/spd/target/targetMk/item.vue
  62. 131 0
      src/views/business/spd/target/targetTemplate/add/columns.js
  63. 453 0
      src/views/business/spd/target/targetTemplate/add/index.vue
  64. 38 0
      src/views/business/spd/target/targetTemplate/columns.js
  65. 74 0
      src/views/business/spd/target/targetTemplate/delete/index.vue
  66. 14 0
      src/views/business/spd/target/targetTemplate/dicts.js
  67. 159 0
      src/views/business/spd/target/targetTemplate/index.vue
  68. 110 0
      src/views/business/spd/target/targetTemplate/see/columns.js
  69. 170 0
      src/views/business/spd/target/targetTemplate/see/index.vue
  70. 604 0
      src/views/business/spd/task_management/visitingPlan/add.vue
  71. 658 0
      src/views/business/spd/task_management/visitingPlan/index.vue
  72. 490 213
      src/views/material/basicFile/details.vue
  73. 90 68
      src/views/material/basicFile/index.vue
  74. 1 1
      src/views/material/basicFile/style/index.scss
  75. 0 825
      src/views/material/changeApply/add.vue
  76. 399 0
      src/views/material/changeApply/add/column.js
  77. 432 0
      src/views/material/changeApply/add/index.vue
  78. 7 0
      src/views/material/changeApply/amendantRecord/column.js
  79. 102 0
      src/views/material/changeApply/amendantRecord/index.vue
  80. 134 0
      src/views/material/changeApply/batchImport/index.vue
  81. 77 0
      src/views/material/changeApply/columns.js
  82. 15 0
      src/views/material/changeApply/dicts.js
  83. 143 239
      src/views/material/changeApply/index.vue
  84. 289 0
      src/views/material/changeApply/see/index.vue
  85. 777 677
      src/views/material/requisition/add.vue
  86. 340 235
      src/views/material/requisition/index.vue
  87. 0 31
      src/views/monitor/job/index.vue
  88. 70 27
      src/views/monitor/job/log.vue
  89. 113 0
      src/views/monitor/service/index.vue
  90. 130 61
      src/views/purchase/DemandSummary/add.vue
  91. 69 51
      src/views/purchase/DemandSummary/index.vue
  92. 10 6
      src/views/purchase/MaterialClassDivision/add.vue
  93. 52 31
      src/views/purchase/MaterialClassDivision/index.vue
  94. 315 358
      src/views/purchase/PurchaseDemandList/add.vue
  95. 46 22
      src/views/purchase/PurchaseDemandList/index.vue
  96. 1 1
      src/views/purchase/PurchaseDemandList/reserved.vue
  97. 9 39
      src/views/purchase/apply/add/columns.js
  98. 72 277
      src/views/purchase/apply/add/index.vue
  99. 9 7
      src/views/purchase/apply/columns.js
  100. 291 0
      src/views/purchase/apply/copy/columns.js

+ 52 - 0
src/api/business/spd/starget/target.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询营销目标列表
+export function listTarget(query) {
+  return request({
+    url: '/mk/target/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询营销目标详细
+export function getTarget(id) {
+  return request({
+    url: '/mk/target/' + id,
+    method: 'get'
+  })
+}
+
+// 查询营销目标明细
+export function getTargetItem(id) {
+  return request({
+    url: '/mk/target/item/' + id,
+    method: 'get'
+  })
+}
+
+// 新增营销目标
+export function addTarget(data) {
+  return request({
+    url: '/mk/target',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改营销目标
+export function updateTarget(data) {
+  return request({
+    url: '/mk/target',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除营销目标
+export function delTarget(id) {
+  return request({
+    url: '/mk/target/' + id,
+    method: 'delete'
+  })
+}

+ 60 - 0
src/api/business/spd/starget/targetTemplate.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询目标模板列表
+export function listTargetTemplate(query) {
+  return request({
+    url: '/mk/target/targetTemplate/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询目标模板详细
+export function getTargetTemplate(id) {
+  return request({
+    url: '/mk/target/targetTemplate/' + id,
+    method: 'get'
+  })
+}
+
+// 新增目标模板
+export function addTargetTemplate(data) {
+  return request({
+    url: '/mk/target/targetTemplate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改目标模板
+export function updateTargetTemplate(data) {
+  return request({
+    url: '/mk/target/targetTemplate',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除目标模板
+export function delTargetTemplate(id) {
+  return request({
+    url: '/mk/target/targetTemplate/' + id,
+    method: 'delete'
+  })
+}
+
+// 获取动态表头数据
+export function getHeaderData(id) {
+  return request({
+    url: '/mk/target/targetTemplate/getHeaderData/' + id,
+    method: 'get'
+  })
+}
+
+//校验目标模板是否被引用
+export function checkQuote(id) {
+  return request({
+    url: '/mk/target/targetTemplate/checkQuote/' + id,
+    method: 'get'
+  })
+}

+ 64 - 0
src/api/business/spd/task_management/visitingPlan/visitingPlan.js

@@ -0,0 +1,64 @@
+import request from '@/utils/request'
+
+//拜访计划列表
+export function getPlanList(data) {
+    return request({
+        url: '/mk/bo/plan/list',
+        method: 'get',
+        params: data
+    })
+}
+//拜访计划新增
+export function addPlan(data) {
+    return request({
+        url: '/mk/bo/plan/',
+        method: 'post',
+        data: data
+    })
+}
+//拜访计划编辑
+export function editPlan(data) {
+    return request({
+        url: '/mk/bo/plan/',
+        method: 'put',
+        data: data
+    })
+}
+//拜访计划提交
+export function submitPlan(data) {
+    return request({
+      url: `/mk/bo/plan/submit`,
+      method: 'POST',
+      data: data
+    })
+}
+//拜访计划基本信息详情
+export function getPlanDetail(id) {
+    return request({
+      url: '/mk/bo/plan/' + id,
+      method: 'get',
+    })
+}
+//拜访计划基本子表详情
+export function getPlanSonDetail(planId) {
+    return request({
+      url: `/mk/bo/item/` + planId,
+      method: 'get',
+    })
+}
+//拜访计划删除
+export function delPlan(id) {
+    return request({
+        url: '/mk/bo/plan/' + id,
+        method: 'delete'
+    })
+}
+// 采购需求单导出
+export function exportPlan(data) {
+    return request({
+      url: `/mk/bo/plan/export`,
+      method: 'post',
+      data: data,
+      responseType: 'blob'
+    })
+  }

+ 36 - 0
src/api/changeApply/basic.js

@@ -62,3 +62,39 @@ export function getProductFactory(data) {
     data: data
   })
 }
+// 获取生产厂家列表信息
+export function getRecordList(params) {
+  return request({
+    url: `/material/record/list`,
+    method: 'get',
+    params: params
+  })
+}
+
+// 模板下载
+export function changeDownload(data) {
+  return request({
+    url: `/material/change/download`,
+    method: 'post',
+    data: data
+  })
+}
+
+// 导入
+export function changeImport(data) {
+  return request({
+    url: `/material/change/import`,
+    method: 'post',
+    data: data
+  })
+}
+
+// 下载失败导入文件数据
+export function downloadFailData(data) {
+  return request({
+    url: `/material/change/downloadFailData`,
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+  })
+}

+ 25 - 25
src/api/login.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 
 // 登录方法
 export function login(username, password, code, uuid) {
@@ -6,54 +6,54 @@ export function login(username, password, code, uuid) {
     username,
     password,
     code,
-    uuid
-  }
+    uuid,
+  };
   return request({
-    url: '/login',
+    url: "/login",
     headers: {
-      isToken: false
+      isToken: false,
     },
-    method: 'post',
-    data: data
-  })
+    method: "post",
+    data: data,
+  });
 }
 
 // 注册方法
 export function register(data) {
   return request({
-    url: '/register',
+    url: "/register",
     headers: {
-      isToken: false
+      isToken: false,
     },
-    method: 'post',
-    data: data
-  })
+    method: "post",
+    data: data,
+  });
 }
 
 // 获取用户详细信息
 export function getInfo() {
   return request({
-    url: '/getInfo',
-    method: 'get'
-  })
+    url: "/getInfo",
+    method: "get",
+  });
 }
 
 // 退出方法
 export function logout() {
   return request({
-    url: '/logout',
-    method: 'post'
-  })
+    url: "/logout",
+    method: "post",
+  });
 }
 
 // 获取验证码
 export function getCodeImg() {
   return request({
-    url: '/captchaImage',
+    url: "/captchaImage",
     headers: {
-      isToken: false
+      isToken: false,
     },
-    method: 'get',
-    timeout: 20000
-  })
-}
+    method: "get",
+    timeout: 20000,
+  });
+}

+ 10 - 0
src/api/monitor/service.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+//查询服务列表
+export function listService(query) {
+    return request({
+      url: 'serviceScan/list',
+      method: 'get',
+      params: query
+    })
+  }

+ 7 - 0
src/api/purchase/purchaseDemand.js

@@ -78,4 +78,11 @@ export function queryMan(id) {
     url: `/material/division/queryBuyer?materialId=${id}`,
     method: 'get',
   })
+}
+// 跳转OA
+export function toOA(userName, fdId) {
+  return request({
+    url: `/oaflow/redirectToOa/${userName}/${fdId}`,
+    method: 'get',
+  })
 }

+ 33 - 2
src/api/requisition/basic.js

@@ -8,14 +8,16 @@ export function getReqList(params) {
     params: params
   })
 }
+
 // 物料申请单-新增
 export function addReq(data) {
   return request({
     url: `/system/apply/material`,
     method: 'post',
-    data: data
+    data: data,
   })
 }
+
 // 获取物料申请单详情
 export function getReqDetail(id) {
   return request({
@@ -23,6 +25,7 @@ export function getReqDetail(id) {
     method: 'get',
   })
 }
+
 // 物料申请单-修改提交
 export function editReq(data) {
   return request({
@@ -31,6 +34,7 @@ export function editReq(data) {
     data: data
   })
 }
+
 // 物料申请单-删除
 export function delReq(id) {
   return request({
@@ -47,6 +51,7 @@ export function getUnit(data) {
     data: data
   })
 }
+
 // 参照-产地
 export function getPlace(data) {
   return request({
@@ -55,6 +60,7 @@ export function getPlace(data) {
     data: data
   })
 }
+
 // 参照-税类
 export function getTax(data) {
   return request({
@@ -63,6 +69,7 @@ export function getTax(data) {
     data: data
   })
 }
+
 // 参照-采购员
 export function getStaff(data) {
   return request({
@@ -71,6 +78,7 @@ export function getStaff(data) {
     data: data
   })
 }
+
 // 参照-业务线
 export function getLine(data) {
   return request({
@@ -79,6 +87,7 @@ export function getLine(data) {
     data: data
   })
 }
+
 // 参照-剂型-树形
 export function getDose(data) {
   return request({
@@ -87,6 +96,7 @@ export function getDose(data) {
     data: data
   })
 }
+
 // 参照-采购组织-树形
 // 查询部门下拉树结构
 export function getOrgs(data) {
@@ -96,6 +106,7 @@ export function getOrgs(data) {
     params: data
   })
 }
+
 // 参照-药品类别(子表)-树形
 export function getDrug(data) {
   return request({
@@ -104,6 +115,7 @@ export function getDrug(data) {
     data: data
   })
 }
+
 // 参照-中包装单位
 export function getMidPack(data) {
   return request({
@@ -111,4 +123,23 @@ export function getMidPack(data) {
     method: 'post',
     data: data
   })
-}
+}
+
+// 导入
+export function importData(data) {
+  return request({
+    url: `/system/apply/material/import`,
+    method: 'post',
+    data: data
+  })
+}
+
+// 下载失败导入文件数据
+export function fileImport(data) {
+  return request({
+    url: `/system/apply/material/downloadFailData`,
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+  })
+}

+ 8 - 9
src/assets/styles/element-ui.scss

@@ -69,7 +69,7 @@
 // dropdown
 .el-dropdown-menu {
   a {
-    display: block
+    display: block;
   }
 }
 
@@ -91,18 +91,17 @@
   display: none;
 }
 
-
-.el-autocomplete-suggestion .el-autocomplete-suggestion__wrap{
+.el-autocomplete-suggestion .el-autocomplete-suggestion__wrap {
   padding: 10px 0 0 0;
-}   
+}
 
- .el-super-table {
+.el-super-table {
   width: 100%;
-  margin: 20px 0 0 0;
 }
- .el-super-table .el-table__cell {
+.el-super-table .el-table__cell {
   height: 50px;
 }
- .el-super-table td.el-table__cell {
+
+.el-super-table td.el-table__cell {
   border-right: 0;
-}
+}

+ 10 - 0
src/assets/styles/font.scss

@@ -0,0 +1,10 @@
+.fe-1 {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+@for $i from 3 through 10 {
+  .fs-#{$i} {
+    font-size: 4px * $i;
+  }
+}

+ 33 - 20
src/assets/styles/index.scss

@@ -1,16 +1,20 @@
-@import './variables.scss';
-@import './mixin.scss';
-@import './transition.scss';
-@import './element-ui.scss';
-@import './sidebar.scss';
-@import './btn.scss';
+@import "./variables.scss";
+@import "./mixin.scss";
+@import "./transition.scss";
+@import "./element-ui.scss";
+@import "./sidebar.scss";
+@import "./btn.scss";
+@import "./margin.scss";
+@import "./padding.scss";
+@import "./font.scss";
 
 body {
   height: 100%;
   -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;
   text-rendering: optimizeLegibility;
-  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
+    Microsoft YaHei, Arial, sans-serif;
 }
 
 label {
@@ -64,7 +68,6 @@ div:focus {
 .fl {
   float: left;
 }
-
 .pr-5 {
   padding-right: 5px;
 }
@@ -104,7 +107,8 @@ aside {
   display: block;
   line-height: 32px;
   font-size: 16px;
-  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
+  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
+    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
   color: #2c3e50;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
@@ -134,7 +138,7 @@ aside {
 }
 
 .text-center {
-  text-align: center
+  text-align: center;
 }
 
 .sub-navbar {
@@ -145,7 +149,13 @@ aside {
   text-align: right;
   padding-right: 20px;
   transition: 600ms ease position;
-  background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
+  background: linear-gradient(
+    90deg,
+    rgba(32, 182, 249, 1) 0%,
+    rgba(32, 182, 249, 1) 0%,
+    rgba(33, 120, 241, 1) 100%,
+    rgba(33, 120, 241, 1) 100%
+  );
 
   .subtitle {
     font-size: 20px;
@@ -190,22 +200,25 @@ aside {
   z-index: 1000 !important;
 }
 
-
 /**修改全局的滚动条*/
 /**滚动条的宽度*/
 ::-webkit-scrollbar {
-	width: 8px;
+  width: 8px;
 }
 ::-webkit-scrollbar-thumb {
-	background-color: #eaecf1;
-	border-radius: 3px;
+  background-color: #eaecf1;
+  border-radius: 3px;
 }
 /*表格*/
 .el-table__body-wrapper::-webkit-scrollbar {
-	width: 10px;
-	height: 10px;
+  width: 8px;
+  height: 8px;
 }
 .el-table__body-wrapper::-webkit-scrollbar-thumb {
-	background-color: #a1a3a9;
-	border-radius: 3px;
-}
+  background-color: #a1a3a9;
+  border-radius: 3px;
+}
+.el-input__suffix {
+  display: flex;
+  align-items: center;
+}

+ 23 - 0
src/assets/styles/margin.scss

@@ -0,0 +1,23 @@
+@for $i from 0 through 10 {
+  .m-#{$i} {
+    margin: 4px * $i;
+  }
+  .mx-#{$i} {
+    margin: 0 4px * $i;
+  }
+  .my-#{$i} {
+    margin: 4px * $i 0;
+  }
+  .mt-#{$i} {
+    margin-top: 4px * $i;
+  }
+  .mr-#{$i} {
+    margin-right: 4px * $i;
+  }
+  .mb-#{$i} {
+    margin-bottom: 4px * $i;
+  }
+  .ml-#{$i} {
+    margin-left: 4px * $i;
+  }
+}

+ 23 - 0
src/assets/styles/padding.scss

@@ -0,0 +1,23 @@
+@for $i from 0 through 8 {
+  .p-#{$i} {
+    padding: 4px * $i;
+  }
+  .px-#{$i} {
+    padding: 0 4px * $i;
+  }
+  .py-#{$i} {
+    padding: 4px * $i 0;
+  }
+  .pt-#{$i} {
+    padding-top: 4px * $i;
+  }
+  .pr-#{$i} {
+    padding-right: 4px * $i;
+  }
+  .pb-#{$i} {
+    padding-bottom: 4px * $i;
+  }
+  .pl-#{$i} {
+    padding-left: 4px * $i;
+  }
+}

+ 4 - 1
src/assets/styles/sidebar.scss

@@ -4,6 +4,7 @@
     min-height: 100%;
     transition: margin-left .28s;
     margin-left: $base-sidebar-width;
+    // margin-left: 0;
     position: relative;
   }
 
@@ -51,7 +52,7 @@
     }
 
     .is-horizontal {
-      display: none;
+
     }
 
     a {
@@ -109,11 +110,13 @@
 
   .hideSidebar {
     .sidebar-container {
+      // display: none;
       width: 54px !important;
     }
 
     .main-container {
       margin-left: 54px;
+      // margin-left: 0;
     }
 
     .submenu-title-noDropdown {

+ 1 - 1
src/components/Pagination/index.vue

@@ -36,7 +36,7 @@ export default {
     pageSizes: {
       type: Array,
       default() {
-        return [1, 10, 20, 30, 50];
+        return [1, 10, 20, 50, 100];
       },
     },
     // 移动端页码按钮的数量端默认值5

+ 13 - 5
src/components/PopDialog/index.vue

@@ -21,7 +21,7 @@
           </el-header>
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable" @row-click="rowSelect"
-              @select="handleSelectionChange" height="calc(100% - 40px)" style="width: 100%">
+              @select="handleSelectionChange" :selection="selectedRows" @selection-change="watchSel"  height="calc(100% - 40px)" style="width: 100%">
               <el-table-column type="selection" header-align="center" align="center" width="50">
               </el-table-column>
               <el-table-column prop="code" header-align="center" align="center" sortable="custom" min-width="90"
@@ -67,6 +67,7 @@ export default {
       orders: [],
       loading: false,
       visible: false,
+      selectedRows:[]
     };
   },
   props: {
@@ -79,7 +80,7 @@ export default {
     // 是否启用单选
     single: {
       type: Boolean,
-      default: false
+      default: true
     }
   },
   methods: {
@@ -136,14 +137,21 @@ export default {
       this.searchForm.pageNo = 1;
       this.refreshList();
     },
+    watchSel(rows) {
+      console.log('监听得到选中吗', rows)
+      this.dataListAllSelections = rows
+    },
     // 表格选中数据
-    rowSelect(row, column, event) {
-      this.$refs.contractTable.clearSelection();
+    rowSelect(row) {
+      // this.$refs.contractTable.clearSelection();
+      // this.$refs.contractTable.toggleRowSelection(row);
+      // this.dataListAllSelections = this.single ? [row] : selection
       this.$refs.contractTable.toggleRowSelection(row);
-      this.dataListAllSelections = this.single ? [row] : selection
     },
     // 选中数据
     handleSelectionChange(selection, row) {
+      console.log('selection',selection)
+      console.log('row',[row])
       if (this.single && selection.length > 1) {
         this.$refs.contractTable.clearSelection();
         this.$refs.contractTable.toggleRowSelection(row);

+ 9 - 2
src/components/Refers/refers.vue

@@ -18,7 +18,7 @@
           </el-header>
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
-              @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)">
+              @select="handleSelectionChange" @row-dblclick="choose"  @row-click="rowSelect" height="calc(100% - 40px)">
               <el-table-column show-overflow-tooltip type="selection" header-align="center" align="center" width="50"/>
               <!-- <el-table-column show-overflow-tooltip prop="id" header-align="center" align="center" min-width="90" :label="reciveForm.title + 'id'"/> -->
               <el-table-column show-overflow-tooltip prop="code" header-align="center" align="center" min-width="90" label="编码"/>
@@ -134,9 +134,13 @@ export default {
         // 仓库里面加组织
         if(res.rows.length !== 0 && res.rows[0].orgName) {
           this.orgName = true
-          this.warehouseAttributes = true
         } else {
           this.orgName = false
+        }
+        // 仓库里面加仓库属性
+        if(res.rows.length !== 0 && res.rows[0].warehouseAttributes) {
+          this.warehouseAttributes = true
+        } else {
           this.warehouseAttributes = false
         }
         // 人员内加部门
@@ -231,6 +235,9 @@ export default {
       console.log('选择的数据?', this.dataListAllSelections)
       this.$emit("doSubmit", this.dataListAllSelections);
     },
+    choose() {
+      this.doSubmit()
+    }
   },
 };
 </script>

+ 56 - 0
src/components/popover-select-v2/fetch/index.js

@@ -0,0 +1,56 @@
+import { REFER } from "@/components/popover-select/api";
+
+// 币种
+export const currency = async (prop) => {
+  try {
+    // try
+    const { code, rows } = await REFER({
+      search: prop,
+      type: "CURRENCY_PARAM",
+    });
+    if (code === 200) {
+      return rows[0] || {};
+    }
+  } catch (err) {
+    // catch
+    console.error(err);
+  } finally {
+    // finally
+  }
+};
+// 税率
+export const tax = async (prop) => {
+  try {
+    // try
+    const { code, rows } = await REFER({
+      search: prop,
+      type: "TAX_RATE_PARAM",
+    });
+    if (code === 200) {
+      return rows[0] || {};
+    }
+  } catch (err) {
+    // catch
+    console.error(err);
+  } finally {
+    // finally
+  }
+};
+// 单位
+export const unit = async (prop) => {
+  try {
+    // try
+    const { code, rows } = await REFER({
+      search: prop,
+      type: "UNIT_PARAM",
+    });
+    if (code === 200) {
+      return rows[0] || {};
+    }
+  } catch (err) {
+    // catch
+    console.error(err);
+  } finally {
+    // finally
+  }
+};

+ 3 - 3
src/components/popover-select-v2/index.vue

@@ -213,9 +213,6 @@ export default {
       append-to-body
     >
       <div slot="footer">
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
         <el-button
           type="primary"
           :size="$attrs.size"
@@ -223,6 +220,9 @@ export default {
           @click="useConfirm(selectData)"
           >确 认</el-button
         >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
       </div>
       <el-form
         v-loading="loading"

+ 4 - 3
src/components/popover-select-v2/multiple.vue

@@ -179,9 +179,6 @@ export default {
       append-to-body
     >
       <div slot="footer">
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
         <el-button
           type="primary"
           :size="$attrs.size"
@@ -189,6 +186,10 @@ export default {
           @click="useConfirm(selectData)"
           >确 认</el-button
         >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+        
       </div>
       <el-form
         v-loading="loading"

+ 15 - 0
src/components/popover-select/components/CUSTOMER_PARAM_ZT.js

@@ -0,0 +1,15 @@
+// 收货客户
+export default [
+  {
+    key: "code",
+    title: "客户编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "客户名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 9 - 0
src/components/popover-select/components/LINKMAN_PARAM.js

@@ -0,0 +1,9 @@
+// 收货客户
+export default [
+  {
+    key: "name",
+    title: "名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 15 - 0
src/components/popover-select/components/MANUFACTURER_PARAM.js

@@ -0,0 +1,15 @@
+// 生产厂家
+export default [
+  {
+    key: "code",
+    title: "编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 48 - 0
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -45,4 +45,52 @@ export default [
       return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
     },
   },
+  {
+    key: "isDrugNumber",
+    title: "药品",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.isDrug;
+    },
+  },
+  {
+    key: "oriRegistrationNo",
+    title: "注册证号/备案凭证编号",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.oriRegistrationNo;
+    },
+  },
+  {
+    key: "dosageFrom",
+    title: "剂型",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.dosageFrom;
+    },
+  },
+  {
+    key: "dosageFromName",
+    title: "剂型名称",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.dosageFromName;
+    },
+  },
+  {
+    key: "curingType",
+    title: "养护类型",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.curingType;
+    },
+  },
+  {
+    key: "medicalInstruments",
+    title: "医疗器械",
+    type: "ComputedInput",
+    formatter: (prop) => {
+      return prop.materialMedcine.medicalInstruments;
+    },
+  },
 ];

+ 15 - 0
src/components/popover-select/components/MK_SALESAREA_PARAM.js

@@ -0,0 +1,15 @@
+// 销售区域
+export default [
+  {
+    key: "code",
+    title: "区域编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "区域名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 9 - 0
src/components/popover-select/components/MK_TARGET_CYCLE_PARAM.js

@@ -0,0 +1,9 @@
+// 目标周期
+export default [
+  {
+    key: "name",
+    title: "周期名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 9 - 0
src/components/popover-select/components/MK_TARGET_INDEX_PARAM.js

@@ -0,0 +1,9 @@
+// 目标指标
+export default [
+  {
+    key: "name",
+    title: "指标名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 9 - 0
src/components/popover-select/components/MK_TARGET_TEMPLATE_PARAM.js

@@ -0,0 +1,9 @@
+// 目标摸吧
+export default [
+  {
+    key: "name",
+    title: "模板名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 4 - 3
src/components/popover-select/index.vue

@@ -331,12 +331,13 @@ export default {
         />
       </el-form>
       <div style="margin-top: 20px; text-align: right">
-        <el-button :size="size" @click="useCancel(lastSelectData)">
-          取 消
-        </el-button>
         <el-button :size="size" @click="useConfirm(selectData)">
           确 定
         </el-button>
+        <el-button :size="size" @click="useCancel(lastSelectData)">
+          取 消
+        </el-button>
+        
       </div>
     </el-dialog>
     <div

+ 6 - 5
src/components/popover-tree-select/index.vue

@@ -154,9 +154,9 @@ export default {
         $props: { source, valueKey, dataMapping },
       } = this;
       for (let key in dataMapping) {
-        source[key] = prop[dataMapping[key]];
+        source[key] = prop[0][dataMapping[key]];
       }
-      this.innerValue = prop[valueKey];
+      this.innerValue = prop[0][valueKey];
       this.$emit("update:source", source);
       this.$emit("change", prop, this.$props);
     },
@@ -210,9 +210,6 @@ export default {
       append-to-body
     >
       <div slot="footer">
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
         <el-button
           type="primary"
           :size="$attrs.size"
@@ -220,6 +217,10 @@ export default {
           @click="useConfirm(selectData)"
           >确 认</el-button
         >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+        
       </div>
       <el-form
         v-loading="loading"

+ 4 - 3
src/components/popover-tree-select/multiple.vue

@@ -196,9 +196,6 @@ export default {
       append-to-body
     >
       <div slot="footer">
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
         <el-button
           type="primary"
           :size="$attrs.size"
@@ -206,6 +203,10 @@ export default {
           @click="useConfirm(selectData)"
           >确 认</el-button
         >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+        
       </div>
       <el-form
         v-loading="loading"

+ 14 - 2
src/components/super-form/index.vue

@@ -45,9 +45,21 @@ export default {
     },
   },
   watch: {},
-  methods: {},
+  methods: {
+    // 继承el-table的Method
+    extendMethod() {
+      const refMethod = Object.entries(this.$refs["superForm"]);
+      for (const [key, value] of refMethod) {
+        if (!(key.includes("$") || key.includes("_"))) {
+          this[key] = value;
+        }
+      }
+    },
+  },
   created() {},
-  mounted() {},
+  mounted() {
+    this.extendMethod();
+  },
   destroyed() {},
 };
 </script>

+ 117 - 152
src/components/super-search/index.vue

@@ -28,15 +28,13 @@ export default {
   },
   data() {
     const { columns } = this.$props;
-    const stroageKey = (
-      this.$parent.$parent.$options.name + "_search"
-    ).toUpperCase();
-    const loaclColumns = JSON.parse(localStorage.getItem(stroageKey));
-    const innerColumns = !!loaclColumns ? loaclColumns : columns;
+    const innerColumns = columns.map(({ item, attr }) => ({
+      attr,
+      item: { ...item, hidden: true, span: item.span || 6 },
+    }));
     return {
       drawer: false,
       visible: false,
-      stroageKey: stroageKey,
       innerColumns: innerColumns,
     };
   },
@@ -51,17 +49,29 @@ export default {
     },
     showColumns: {
       get() {
-        const columns = this.innerColumns.filter(({ item }) => item.hidden);
-        return this.visible ? columns : columns.slice(0, 4);
+        return this.innerColumns.filter(({ item }) => item.hidden);
+      },
+      set() {},
+    },
+    height: {
+      get() {
+        const maxMultiples = Math.ceil(
+          this.innerColumns
+            .map(({ item }) => item.span)
+            .reduce((prev, curr) => {
+              return prev + curr;
+            }) / 24
+        );
+        const multiples = this.visible ? maxMultiples : 1;
+        return multiples * 47 + "px";
       },
       set() {},
     },
   },
   watch: {},
   methods: {
-    changeColumns() {
-      const { stroageKey, innerColumns } = this;
-      localStorage.setItem(stroageKey, JSON.stringify(innerColumns));
+    onVisible() {
+      this.visible = !this.visible;
     },
   },
   created() {},
@@ -80,155 +90,110 @@ export default {
     label-position="right"
     @submit.native.prevent
   >
-    <el-row :gutter="20">
-      <el-col :span="20">
-        <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
-          <el-col
-            v-for="({ item, attr }, index) in showColumns"
-            :key="index"
-            :span="item.span"
-          >
-            <el-form-item :prop="item.key" :label="item.title">
-              <component
-                v-if="attr.is === 'el-input'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @keyup.enter.native="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-                <template>
-                  <el-option
-                    v-for="item in dict.type[attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </template>
-              </component>
-              <component
-                v-if="attr.is === 'el-date-picker'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-select-v2'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-multiple-select-v2'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-tree-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-              <component
-                v-if="attr.is === 'el-popover-multiple-tree-select'"
-                v-bind="attr"
-                v-model="innerValue[item.key]"
-                :source.sync="innerValue"
-                @change="$emit('submit')"
-                style="width: 100%"
-              >
-              </component>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-col>
-      <el-col :span="4" style="text-align: right">
-        <el-button
-          :size="$attrs.size"
-          type="primary"
-          icon="el-icon-search"
-          @click="$emit('submit')"
+    <el-row
+      :gutter="24"
+      :style="{ height }"
+      style="overflow: hidden; transition: 250ms; display: flex"
+      class="px-3"
+    >
+      <el-row :gutter="20" style="flex: 1; display: flex; flex-wrap: wrap">
+        <el-col
+          v-for="({ item, attr }, index) in showColumns"
+          :key="index"
+          :span="item.span"
         >
-          查 询
+          <el-form-item :prop="item.key" :label="item.title">
+            <component
+              v-if="attr.is === 'el-input'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @keyup.enter.native="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+              <template>
+                <el-option
+                  v-for="item in dict.type[attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </template>
+            </component>
+            <component
+              v-if="attr.is === 'el-date-picker'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-select-v2'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-multiple-select-v2'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-tree-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+            <component
+              v-if="attr.is === 'el-popover-multiple-tree-select'"
+              v-bind="attr"
+              v-model="innerValue[item.key]"
+              :source.sync="innerValue"
+              @change="$emit('submit')"
+              style="width: 100%"
+            >
+            </component>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row style="width: fit-content; text-align: right" class="ml-5">
+        <el-button :size="$attrs.size" type="primary" @click="$emit('submit')">
+          搜索
         </el-button>
-        <el-button
-          :size="$attrs.size"
-          icon="el-icon-refresh"
-          @click="$emit('reset')"
-        >
-          重 置
+        <el-button :size="$attrs.size" @click="$emit('reset')">
+          重置
         </el-button>
-        <!-- <el-button
-          :size="$attrs.size"
-          icon="el-icon-setting"
-          @click="drawer = true"
-        >
+        <!-- <el-button :size="$attrs.size" @click="visible = !visible">
+          {{ visible ? "展开" : "收起" }}
         </el-button> -->
-      </el-col>
+      </el-row>
     </el-row>
-    <el-divider>
+    <el-divider class="m-0" style="cursor: pointer" @click="visible = !visible">
       <i
-        v-if="innerColumns.length > 4"
-        :class="visible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
-        style="cursor: pointer"
-        @click="visible = !visible"
+        class="el-icon-d-arrow-left"
+        style="transition: 250ms"
+        :style="{ transform: `rotate(${visible ? 90 : -90}deg)` }"
       ></i>
     </el-divider>
-    <!-- <el-drawer size="25%" title="操作列" append-to-body :visible.sync="drawer">
-      <el-row :gutter="20" style="margin: 0">
-        <el-draggable
-          v-model="innerColumns"
-          :group="{ item: 'key' }"
-          @change="changeColumns"
-        >
-          <el-col
-            v-for="({ item }, index) in innerColumns"
-            :key="index"
-            :span="24"
-            style="
-              display: flex;
-              justify-content: space-between;
-              padding: 15px 20px;
-            "
-          >
-            <span style="cursor: move">
-              <i class="el-icon-rank"></i>
-              {{ item.title }}
-            </span>
-            <div>
-              <el-radio-group
-                v-model="item.hidden"
-                :size="$attrs.size"
-                @change="changeColumns"
-              >
-                <el-radio-button :label="true">显</el-radio-button>
-                <el-radio-button :label="false">隐</el-radio-button>
-              </el-radio-group>
-            </div>
-          </el-col>
-        </el-draggable>
-      </el-row>
-    </el-drawer> -->
   </el-form>
 </template>
 

+ 119 - 0
src/components/super-table/freeze.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-button size="mini" @click="drawer = true">
+    {{ number ? `冻结列 :${number}` : "冻结列" }}
+    <el-drawer
+      :modal="false"
+      :visible.sync="drawer"
+      size="20%"
+      title="冻结列"
+      append-to-body
+    >
+      <el-input
+        v-model="key"
+        size="mini"
+        placeholder="请输入列名称"
+        style="width: 100%; padding: 0 16px 16px"
+      >
+      </el-input>
+      <el-row :gutter="20" style="margin: 0">
+        <el-draggable
+          v-model="columns"
+          :group="{ item: 'key' }"
+          @end="$emit('freeze')"
+        >
+          <el-col
+            v-for="({ item }, index) in searchColumns"
+            :key="index"
+            :span="24"
+            style="
+              display: flex;
+              justify-content: space-between;
+              padding: 12px 16px;
+            "
+          >
+            <span
+              style="
+                font-size: 13px;
+                flex: 1;
+                cursor: move;
+                padding: 0 12px 0 0;
+                text-overflow: ellipsis;
+                overflow: hidden;
+                word-break: break-all;
+                white-space: nowrap;
+              "
+            >
+              <i
+                class="el-icon-mouse"
+                style="color: #72767b; margin: 0 6px 0 0"
+              ></i>
+              <i
+                class="el-icon-user"
+                style="color: #72767b; margin: 0 6px 0 0"
+              ></i>
+              {{ item.title }}
+            </span>
+            <div>
+              <el-switch
+                v-model="item.fixed"
+                size="mini"
+                @change="$emit('freeze')"
+              ></el-switch>
+            </div>
+          </el-col>
+        </el-draggable>
+      </el-row>
+    </el-drawer>
+  </el-button>
+</template>
+
+<script>
+export default {
+  name: "",
+  components: {
+    ElDraggable: () => import("@/components/draggable/index.vue"),
+  },
+  props: {
+    value: {
+      type: Array,
+      require: true,
+    },
+  },
+  data() {
+    return {
+      drawer: false,
+      key: "",
+    };
+  },
+  computed: {
+    columns: {
+      get() {
+        return this.$props.value;
+      },
+      set(value) {
+        this.$emit("input", value);
+      },
+    },
+    searchColumns: {
+      get() {
+        return this.columns.filter(
+          ({ item }) => item.title.indexOf(this.key) > -1
+        );
+      },
+      set(value) {},
+    },
+    number: {
+      get() {
+        return this.columns.filter(({ item }) => item.fixed).length;
+      },
+      set(value) {},
+    },
+  },
+  watch: {},
+  methods: {},
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 119 - 0
src/components/super-table/hide.vue

@@ -0,0 +1,119 @@
+<template>
+  <el-button size="mini" @click="drawer = true">
+    {{ number ? `隐藏列 :${number}` : "隐藏列" }}
+    <el-drawer
+      :modal="false"
+      :visible.sync="drawer"
+      size="20%"
+      title="隐藏列"
+      append-to-body
+    >
+      <el-input
+        v-model="key"
+        size="mini"
+        placeholder="请输入列名称"
+        style="width: 100%; padding: 0 16px 16px"
+      >
+      </el-input>
+      <el-row :gutter="20" style="margin: 0">
+        <el-draggable
+          v-model="columns"
+          :group="{ item: 'key' }"
+          @end="$emit('hide')"
+        >
+          <el-col
+            v-for="({ item }, index) in searchColumns"
+            :key="index"
+            :span="24"
+            style="
+              display: flex;
+              justify-content: space-between;
+              padding: 12px 16px;
+            "
+          >
+            <span
+              style="
+                font-size: 13px;
+                flex: 1;
+                cursor: move;
+                padding: 0 12px 0 0;
+                text-overflow: ellipsis;
+                overflow: hidden;
+                word-break: break-all;
+                white-space: nowrap;
+              "
+            >
+              <i
+                class="el-icon-mouse"
+                style="color: #72767b; margin: 0 6px 0 0"
+              ></i>
+              <i
+                class="el-icon-user"
+                style="color: #72767b; margin: 0 6px 0 0"
+              ></i>
+              {{ item.title }}
+            </span>
+            <div>
+              <el-switch
+                v-model="item.hidden"
+                size="mini"
+                @change="$emit('hide')"
+              ></el-switch>
+            </div>
+          </el-col>
+        </el-draggable>
+      </el-row>
+    </el-drawer>
+  </el-button>
+</template>
+
+<script>
+export default {
+  name: "",
+  components: {
+    ElDraggable: () => import("@/components/draggable/index.vue"),
+  },
+  props: {
+    value: {
+      type: Array,
+      require: true,
+    },
+  },
+  data() {
+    return {
+      drawer: false,
+      key: "",
+    };
+  },
+  computed: {
+    columns: {
+      get() {
+        return this.$props.value;
+      },
+      set(value) {
+        this.$emit("input", value);
+      },
+    },
+    searchColumns: {
+      get() {
+        return this.columns.filter(
+          ({ item }) => item.title.indexOf(this.key) > -1
+        );
+      },
+      set(value) {},
+    },
+    number: {
+      get() {
+        return this.columns.filter(({ item }) => !item.hidden).length;
+      },
+      set(value) {},
+    },
+  },
+  watch: {},
+  methods: {},
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 314 - 162
src/components/super-table/index.vue

@@ -2,26 +2,56 @@
 export default {
   name: "SuperTable",
   props: {
+    // 数据
     value: {
       type: [Array],
       require: true,
     },
+    // 字典
     dict: {
       type: [Object],
       require: true,
     },
+    // 分页
+    page: {
+      type: [Object],
+      require: false,
+    },
+    // 模板
     columns: {
       type: [Array],
       require: true,
     },
-    stroage: {
+    // 是否显示序号
+    index: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否显示单选
+    radio: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否显示多选
+    checkbox: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否显示分页
+    pagination: {
       type: Boolean,
       default: false,
     },
-    hideOperationColumns: {
+    // 是否列操作
+    convenitentOperation: {
       type: Boolean,
       default: false,
     },
+    // 是否禁止选择
+    selectable: {
+      type: Function,
+      default: () => {},
+    },
   },
   components: {
     ElDictTag: () => import("@/components/DictTag/index.vue"),
@@ -29,29 +59,45 @@ export default {
     ElFilePreview: () => import("@/components/file-preview/index.vue"),
     ElComputedInput: () => import("@/components/computed-input/index.vue"),
     ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverMultipleSelectV2: () =>
+      import("@/components/popover-select-v2/multiple.vue"),
     ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
+    ButtonHide: () => import("./hide.vue"),
+    ButtonFreeze: () => import("./freeze.vue"),
+    IconHide: () => import("./once/hide.vue"),
+    IconSort: () => import("./once/sort.vue"),
+    IconFreeze: () => import("./once/freeze.vue"),
+    IconFilter: () => import("./once/filters.vue"),
   },
   data() {
-    const { columns, stroage } = this.$props;
-    const stroageKey = (
-      this.$parent.$parent.$options.name + "_table"
-    ).toUpperCase();
-    const loaclColumns = JSON.parse(localStorage.getItem(stroageKey));
-    const innerColumns = stroage && !!loaclColumns ? loaclColumns : columns;
+    const { columns } = this.$props;
+    const innerColumns = columns.map(({ item, attr }) => ({
+      attr,
+      item: { ...item, hidden: true },
+    }));
     return {
-      drawer: false,
-      visible: false,
-      top: 0,
-      left: 0,
-      stroageKey: stroageKey,
       innerColumns: innerColumns,
-      currentData: {},
+      rowKey: "id",
+      // 选择
+      selectData: [],
+      selectState: false,
+      // 过滤
+      filterData: [],
+      filterState: false,
     };
   },
   computed: {
     innerValue: {
       get() {
-        return this.value;
+        if (this.filterState) {
+          return this.filterData;
+        } else if (this.selectState) {
+          return this.selectData;
+        } else {
+          return this.$props.value;
+        }
       },
       set(value) {
         this.$emit("input", value);
@@ -59,105 +105,211 @@ export default {
     },
     showColumns: {
       get() {
-        const { stroage, hideOperationColumns } = this.$props;
-        return stroage && hideOperationColumns
-          ? this.innerColumns.filter(({ item }) => item.hidden)
-          : this.innerColumns;
+        return this.innerColumns.filter(({ item }) => item.hidden);
+      },
+      set() {},
+    },
+    filterRules: {
+      get() {
+        return Object.fromEntries(
+          this.innerColumns
+            .filter(({ item }) => item.filter && !!item.filter.length)
+            .map(({ item }) => [item.key, item.filter])
+        );
       },
+      set() {},
     },
   },
   watch: {
-    visible(value) {
-      if (value) {
-        document.body.addEventListener("click", this.hideContextmenu);
-        document.body.addEventListener("keydown", this.hideContextmenu);
-      } else {
-        document.body.removeEventListener("click", this.hideContextmenu);
-        document.body.removeEventListener("keydown", this.hideContextmenu);
-      }
+    filterRules: {
+      handler: function (newValue) {
+        function multiFilter(array, filters) {
+          const filterKeys = Object.keys(filters);
+          // filters all elements passing the criteria
+          return array.filter((item) => {
+            // dynamically validate all filter criteria
+            return filterKeys.every((key) => {
+              //ignore when the filter is empty Anne
+              if (!filters[key].length) return true;
+              return !!~filters[key].indexOf(item[key]);
+            });
+          });
+        }
+        this.filterState = JSON.stringify(newValue) !== "{}";
+        this.filterData = multiFilter(this.$props.value, newValue);
+      },
     },
   },
   methods: {
-    setColumns() {
-      const { stroageKey, innerColumns } = this;
+    //
+    onSelectionChange(value) {
+      this.selectData = value;
+      this.$emit("row-select", this.selectData);
+    },
+    //
+    onRowClick(row, column, event) {
+      const { radio, checkbox } = this.$props;
+      // 单选
+      if (radio) {
+        this.$emit("row-select", [row]);
+      }
+      // 多选
+      if (checkbox) {
+        this.$refs.superTable.toggleRowSelection(
+          this.innerValue.find((item) => item.id === row.id)
+        );
+      }
+    },
+    // 冻结
+    onHide() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
-        localStorage.setItem(stroageKey, JSON.stringify(innerColumns));
       });
     },
-    resetColumns() {
-      const { stroageKey, innerColumns } = this;
-      this.innerColumns = innerColumns.map(({ item, attr }) => ({
-        attr,
-        item: { ...item, hidden: true, fixed: false },
-      }));
+    // 排序
+    onSort(prop) {
+      const { key, sort } = prop;
       this.$nextTick(() => {
+        this.$refs.superTable.sort(key, sort);
         this.$refs.superTable.doLayout();
-        localStorage.removeItem(stroageKey);
       });
     },
-    openContextmenu(row, column, event) {
-      this.visible = true;
-      this.currentData = { row, column };
+    // 冻结
+    onFreeze() {
       this.$nextTick(() => {
-        // 鼠标坐标
-        const { x, y } = event;
-        // 侧边栏宽度
-        const [{ clientWidth: sideWidth }] =
-          document.getElementsByClassName("sidebar-container");
-        // 导航栏宽度
-        const { clientHeight: navHeight } =
-          document.getElementsByClassName("main-container")[0].firstChild;
-        // 菜单宽度
-        const [{ clientWidth: contextmenuWidth }] =
-          document.getElementsByClassName("el-super-table_contextmenu");
-        // 最大Y轴偏差
-        const maxLeft = this.$el.offsetWidth - contextmenuWidth;
-        if (x > maxLeft) {
-          this.left = maxLeft + 10;
-        } else {
-          this.left = x - sideWidth;
-        }
-        this.top = y - navHeight;
+        this.$refs.superTable.doLayout();
       });
     },
-    hideContextmenu(event) {
-      const { type } = event;
-      if (type === "click") {
-        this.visible = false;
-      }
-      if (type === "keydown") {
-        const { keyCode } = event;
-        if (keyCode === 27) this.visible = false;
+    // 过滤
+    onFilter() {
+      this.$nextTick(() => {
+        this.$refs.superTable.doLayout();
+      });
+    },
+    onFilters(value) {
+      const {
+        item: { key },
+        attr: { dictName },
+      } = value;
+      let dataList = [];
+      const dict = this.dict.type[dictName];
+      dataList = Array.from(
+        new Set(this.innerValue.map((item) => item[key]).filter((item) => item))
+      ).map((item) => ({
+        text: dictName
+          ? (dict.find((dictItem) => dictItem.value == item) || {}).label
+          : item,
+        value: item,
+      }));
+      return dataList;
+    },
+    // 继承el-table的Method
+    extendMethod() {
+      const refMethod = Object.entries(this.$refs["superTable"]);
+      for (const [key, value] of refMethod) {
+        if (!(key.includes("$") || key.includes("_"))) {
+          this[key] = value;
+        }
       }
     },
   },
   created() {},
-  mounted() {},
+  mounted() {
+    this.extendMethod();
+  },
   destroyed() {},
 };
 </script>
 
 <template>
-  <div class="el-super-table" @contextmenu.prevent.stop>
+  <div class="el-super-table">
     <el-table
+      ref="superTable"
+      border
+      height="auto"
+      :row-key="rowKey"
+      :data="innerValue"
+      :highlight-current-row="radio"
+      @row-click="onRowClick"
+      @selection-change="onSelectionChange"
       v-bind="$attrs"
       v-on="$listeners"
-      :data="innerValue"
-      border
-      ref="superTable"
-      @row-contextmenu="openContextmenu"
+      style="flex: 1"
     >
-      <slot></slot>
+      <!-- 序号 -->
+      <el-table-column
+        v-if="index"
+        :resizable="false"
+        fixed
+        width="50"
+        label="序号"
+        align="center"
+        class="is-index"
+      >
+        <template slot-scope="scope">
+          {{ scope.$index + 1 }}
+        </template>
+      </el-table-column>
+      <!-- 多选 -->
+      <el-table-column
+        v-if="checkbox"
+        :column-key="rowKey"
+        fixed
+        width="50"
+        align="center"
+        type="selection"
+        reserve-selection
+      >
+      </el-table-column>
       <el-table-column
         v-for="({ item, attr }, index) in showColumns"
         :key="index"
         :prop="item.key"
         :label="item.title"
         :fixed="item.fixed"
-        :width="item.width || 250"
+        :width="item.width || 200"
         show-overflow-tooltip
       >
+        <template slot="header" slot-scope="scope">
+          <template>
+            <span v-if="item.require" style="color: #ff4949">*</span>
+            <span
+              :style="{
+                color:
+                  item.sort ||
+                  item.fixed ||
+                  (item.filter && !!item.filter.length)
+                    ? '#1890ff'
+                    : '',
+              }"
+            >
+              {{ item.title }}
+            </span>
+            <template>
+              <icon-sort
+                v-if="item.sortabled"
+                v-model="item.sort"
+                @sort="onSort(item)"
+              ></icon-sort>
+              <icon-freeze
+                v-if="item.fixedabled"
+                v-model="item.fixed"
+                @freeze="onFreeze"
+              ></icon-freeze>
+              <icon-filter
+                v-if="item.filterabled"
+                v-model="item.filter"
+                :filters="onFilters({ item, attr })"
+                @filter="onFilter"
+              ></icon-filter>
+              <icon-hide
+                v-if="item.hiddenabled"
+                v-model="item.hidden"
+                @hide="onHide"
+              ></icon-hide>
+            </template>
+          </template>
+        </template>
         <template slot-scope="scope">
           <slot :name="item.key" v-bind="scope" :item="item" :attr="attr">
             <template v-if="attr.is">
@@ -177,6 +329,14 @@ export default {
               >
               </component>
               <component
+                v-else-if="attr.is === 'el-popover-multiple-select-v2'"
+                v-bind="attr"
+                v-model="scope.row[item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+              >
+              </component>
+              <component
                 v-else-if="attr.is === 'el-select'"
                 v-bind="attr"
                 v-model="scope.row[item.key]"
@@ -197,6 +357,7 @@ export default {
                 v-bind="attr"
                 v-model="scope.row[item.key]"
                 :size="$attrs.size"
+                style="width: 100%"
               >
               </component
             ></template>
@@ -211,99 +372,90 @@ export default {
           </slot>
         </template>
       </el-table-column>
+      <slot></slot>
     </el-table>
-    <el-drawer :visible.sync="drawer" size="25%" title="操作列" append-to-body>
-      <el-row :gutter="20" style="margin: 0">
-        <el-draggable
-          v-model="innerColumns"
-          :group="{ item: 'key' }"
-          @change="setColumns"
-        >
-          <el-col
-            v-for="({ item }, index) in innerColumns"
-            :key="index"
-            :span="24"
-            style="
-              display: flex;
-              justify-content: space-between;
-              padding: 15px 20px;
-            "
+    <div
+      style="
+        height: 50px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+      "
+    >
+      <div class="mr-4">
+        <template v-if="checkbox">
+          <el-button
+            v-if="selectState"
+            size="mini"
+            @click="selectState = !selectState"
           >
-            <span style="cursor: move">
-              <i class="el-icon-rank"></i>
-              {{ item.title }}
-            </span>
-            <div>
-              <el-radio-group
-                v-model="item.hidden"
-                :size="$attrs.size"
-                style="margin: 0 15px 0 0"
-                @change="setColumns"
-              >
-                <el-radio-button :label="true">显</el-radio-button>
-                <el-radio-button :label="false">隐</el-radio-button>
-              </el-radio-group>
-              <el-radio-group
-                v-model="item.fixed"
-                :size="$attrs.size"
-                @change="setColumns"
-              >
-                <el-radio-button :label="false">不</el-radio-button>
-                <el-radio-button label="left">左</el-radio-button>
-                <el-radio-button label="right">右</el-radio-button>
-              </el-radio-group>
-            </div>
-          </el-col>
-        </el-draggable>
-      </el-row>
-    </el-drawer>
-    <transition name="el-fade-in-linear">
-      <ul
-        v-show="visible"
-        :style="{ left: left + 'px', top: top + 'px' }"
-        class="el-super-table_contextmenu"
-      >
-        <li v-if="hideOperationColumns" @click="drawer = true">
-          <i class="el-icon-setting"></i>
-          <span>设置布局</span>
-        </li>
-        <li v-if="hideOperationColumns" @click="resetColumns">
-          <i class="el-icon-refresh"></i>
-          <span>重置布局</span>
-        </li>
-        <slot name="contextmenu" v-bind="currentData"> </slot>
-      </ul>
-    </transition>
+            所有列
+          </el-button>
+          <el-button
+            v-else
+            :disabled="!selectData.length"
+            size="mini"
+            @click="selectState = !selectState"
+          >
+            选择列
+            {{ selectData.length ? ` :${selectData.length}` : "" }}
+          </el-button>
+        </template>
+        <template v-if="convenitentOperation">
+          <button-hide v-model="innerColumns" @hide="onHide"></button-hide>
+          <button-freeze
+            v-model="showColumns"
+            @freeze="onFreeze"
+          ></button-freeze>
+        </template>
+      </div>
+      <pagination
+        v-if="pagination"
+        v-show="!selectState"
+        :total="page.total"
+        :page.sync="page.pageNum"
+        :limit.sync="page.pageSize"
+        @pagination="$emit('pagination', { ...$event })"
+        style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
+      />
+    </div>
   </div>
 </template>
 
-<style lang="scss">
-.el-super-table .el-table {
-  overflow: hidden;
-  border-radius: 5px;
+<style lang="scss" scoped>
+.el-super-table {
+  position: relative;
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  overflow: auto;
 }
-.el-super-table_contextmenu {
-  margin: 0;
-  background: #fff;
-  z-index: 3000;
-  position: absolute;
-  list-style-type: none;
-  padding: 5px 0;
-  border-radius: 4px;
-  font-size: 12px;
-  font-weight: 400;
-  color: #333;
-  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-  li {
-    margin: 0;
-    padding: 7px 16px;
-    cursor: pointer;
-    &:hover {
-      background: #ddd;
-    }
-    span {
-      margin: 0 0 0 5px;
-    }
+::v-deep.el-super-table .el-table__header .cell {
+  word-break: keep-all;
+  white-space: nowrap;
+  .icon-sort {
+    display: none;
+  }
+  &:hover .icon-sort {
+    display: inline-block;
+  }
+  .icon-freeze {
+    display: none;
+  }
+  &:hover .icon-freeze {
+    display: inline-block;
+  }
+  .icon-filter {
+    display: none;
+  }
+  &:hover .icon-filter {
+    display: inline-block;
+  }
+  .icon-hide {
+    display: none;
+  }
+  &:hover .icon-hide {
+    display: inline-block;
   }
 }
 </style>

+ 142 - 0
src/components/super-table/once/filters.vue

@@ -0,0 +1,142 @@
+<template>
+  <el-popover
+    v-if="innerValue !== false || filterData.length"
+    :visible-arrow="false"
+    width="auto"
+    trigger="hover"
+    placement="bottom"
+    popper-class="p-0"
+    class="icon-filter"
+    :style="{
+      color: innerValue && innerValue.length ? '#1890ff' : '',
+      display: innerValue && innerValue.length ? 'inline-block' : '',
+    }"
+  >
+    <template>
+      <el-checkbox-group
+        v-model="selectData"
+        class="pt-3 px-3"
+        @change="onCheck"
+        style="max-height: 300px; overflow-y: auto"
+      >
+        <el-checkbox
+          v-for="item in filterData"
+          :key="item.value"
+          :label="item.value"
+          class="mr-0 mb-3"
+          style="display: block"
+        >
+          {{ item.text }}
+        </el-checkbox>
+      </el-checkbox-group>
+      <el-divider class="m-0"></el-divider>
+      <div
+        class="p-3"
+        style="min-width: 175px; display: flex; justify-content: space-between"
+      >
+        <el-checkbox
+          v-model="checkAll"
+          :indeterminate="indeterminate"
+          @change="onCheckAll"
+        >
+          全选
+        </el-checkbox>
+        <div>
+          <el-button type="text" class="p-0" @click="onReset">重置</el-button>
+          <el-button type="text" class="p-0" @click="onFilter">筛选</el-button>
+        </div>
+      </div>
+    </template>
+    <i
+      slot="reference"
+      class="el-icon-search pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onOpen"
+    ></i>
+  </el-popover>
+</template>
+
+<script>
+export default {
+  name: "IconFilter",
+  components: {},
+  data() {
+    return {
+      disabled: false,
+      selectData: [],
+    };
+  },
+  props: {
+    value: {
+      type: [Array, Boolean],
+      require: true,
+    },
+    filters: {
+      type: Array,
+      require: true,
+    },
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.value;
+      },
+      set(value) {
+        this.$emit("input", value);
+      },
+    },
+    filterData: {
+      get() {
+        return this.$props.filters;
+      },
+      set() {},
+    },
+    indeterminate: {
+      get() {
+        const count = this.filterData.length;
+        const selectCount = this.selectData.length;
+        return selectCount > 0 && selectCount < count;
+      },
+      set() {},
+    },
+    checkAll: {
+      get() {
+        const count = this.filterData.length;
+        const selectCount = this.selectData.length;
+        return count === selectCount;
+      },
+      set() {},
+    },
+  },
+  watch: {},
+  methods: {
+    // 打开
+    onOpen() {
+      this.disabled = !this.disabled;
+    },
+    // 选中
+    onCheck() {
+      // const count = this.filterData.length;
+      // const selectCount = this.selectData.length;
+      // this.checkAll = count === selectCount;
+    },
+    // 全选
+    onCheckAll(value) {
+      this.selectData = value ? this.filterData.map((item) => item.value) : [];
+    },
+    // 重置
+    onReset() {
+      this.selectData = [];
+      this.innerValue = this.selectData;
+    },
+    // 筛选
+    onFilter() {
+      this.innerValue = this.selectData;
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 64 - 0
src/components/super-table/once/freeze.vue

@@ -0,0 +1,64 @@
+<template>
+  <span
+    class="icon-freeze"
+    :style="{
+      color: innerValue ? '#1890ff' : '',
+      display: innerValue ? 'inline-block' : '',
+    }"
+  >
+    <i
+      v-if="innerValue"
+      class="el-icon-lock pl-1"
+      style="
+        color: #1890ff;
+        cursor: pointer;
+        font-weight: 600;
+        transition: 500ms;
+      "
+      @click="onFreeze"
+    ></i>
+    <i
+      v-else
+      class="el-icon-unlock pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onFreeze"
+    ></i>
+  </span>
+</template>
+
+<script>
+export default {
+  name: "IconFreeze",
+  components: {},
+  data() {
+    return {};
+  },
+  props: {
+    value: {
+      type: Boolean,
+      require: true,
+    },
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.value;
+      },
+      set(value) {
+        this.$emit("input", value);
+      },
+    },
+  },
+  watch: {},
+  methods: {
+    onFreeze() {
+      this.innerValue = !this.innerValue;
+      this.$emit("freeze");
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 45 - 0
src/components/super-table/once/hide.vue

@@ -0,0 +1,45 @@
+<template>
+  <i
+    v-if="innerValue"
+    class="el-icon-circle-close pl-1 icon-hide"
+    style="cursor: pointer; font-weight: 600; transition: 500ms"
+    @click="onHide"
+  ></i>
+</template>
+
+<script>
+export default {
+  name: "IconHide",
+  components: {},
+  props: {
+    value: {
+      type: Boolean,
+      require: true,
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.value;
+      },
+      set(value) {
+        this.$emit("input", value);
+      },
+    },
+  },
+  watch: {},
+  methods: {
+    onHide() {
+      this.innerValue = !this.innerValue;
+      this.$emit("hide");
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 64 - 0
src/components/super-table/once/sort.vue

@@ -0,0 +1,64 @@
+<template>
+  <span
+    class="icon-sort"
+    :style="{
+      color: innerValue ? '#1890ff' : '',
+      display: innerValue ? 'inline-block' : '',
+    }"
+  >
+    <i
+      v-if="innerValue === 'descending'"
+      class="el-icon-bottom pl-1"
+      style="
+        color: #1890ff;
+        cursor: pointer;
+        font-weight: 600;
+        transition: 500ms;
+      "
+      @click="onSort(null)"
+    ></i>
+    <i
+      v-else
+      class="el-icon-top pl-1"
+      style="cursor: pointer; font-weight: 600; transition: 500ms"
+      @click="onSort('descending')"
+    ></i>
+  </span>
+</template>
+
+<script>
+export default {
+  name: "IconSort",
+  components: {},
+  data() {
+    return {};
+  },
+  props: {
+    value: {
+      type: String,
+      require: true,
+    },
+  },
+  computed: {
+    innerValue: {
+      get() {
+        return this.$props.value;
+      },
+      set(value) {
+        this.$emit("input", value);
+      },
+    },
+  },
+  watch: {},
+  methods: {
+    onSort(value) {
+      this.innerValue = value;
+      this.$emit("sort");
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 1 - 1
src/layout/components/TagsView/index.vue

@@ -243,7 +243,7 @@ export default {
   width: 100%;
   background: #fff;
   border-bottom: 1px solid #d8dce5;
-  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
+  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);  
   .tags-view-wrapper {
     .tags-view-item {
       display: inline-block;

+ 86 - 71
src/layout/index.vue

@@ -1,16 +1,28 @@
 <template>
-  <div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}">
+  <div
+    :class="classObj"
+    class="app-wrapper"
+    :style="{ '--current-color': theme }"
+  >
     <el-scrollbar>
-      <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
-      <sidebar v-if="!sidebar.hide" class="sidebar-container"/>
-      <div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">
-        <div :class="{'fixed-header':fixedHeader}">
-          <navbar/>
-          <tags-view v-if="needTagsView"/>
+      <div
+        v-if="device === 'mobile' && sidebar.opened"
+        class="drawer-bg"
+        @click="handleClickOutside"
+      />
+      <sidebar v-if="dev" class="sidebar-container" />
+      <div
+        :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }"
+        class="main-container"
+        :style="`margin-left:${dev ? '54':'0'}px`"
+      >
+        <div :class="{ 'fixed-header': fixedHeader }">
+          <!-- <navbar /> -->
+          <!-- <tags-view v-if="needTagsView" /> -->
         </div>
-        <app-main/>
-        <right-panel>
-          <settings/>
+        <app-main />
+        <right-panel v-if="dev">
+          <settings />
         </right-panel>
       </div>
     </el-scrollbar>
@@ -18,104 +30,107 @@
 </template>
 
 <script>
-import RightPanel from '@/components/RightPanel'
-import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
-import ResizeMixin from './mixin/ResizeHandler'
-import { mapState } from 'vuex'
-import variables from '@/assets/styles/variables.scss'
+import RightPanel from "@/components/RightPanel";
+import { AppMain, Navbar, Settings, Sidebar, TagsView } from "./components";
+import ResizeMixin from "./mixin/ResizeHandler";
+import { mapState } from "vuex";
+import variables from "@/assets/styles/variables.scss";
 
 export default {
-  name: 'Layout',
+  name: "Layout",
   components: {
     AppMain,
     Navbar,
     RightPanel,
     Settings,
     Sidebar,
-    TagsView
+    TagsView,
   },
   mixins: [ResizeMixin],
   computed: {
     ...mapState({
-      theme: state => state.settings.theme,
-      sideTheme: state => state.settings.sideTheme,
-      sidebar: state => state.app.sidebar,
-      device: state => state.app.device,
-      needTagsView: state => state.settings.tagsView,
-      fixedHeader: state => state.settings.fixedHeader
+      theme: (state) => state.settings.theme,
+      sideTheme: (state) => state.settings.sideTheme,
+      sidebar: (state) => state.app.sidebar,
+      device: (state) => state.app.device,
+      needTagsView: (state) => state.settings.tagsView,
+      fixedHeader: (state) => state.settings.fixedHeader,
     }),
     classObj() {
       return {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened,
         withoutAnimation: this.sidebar.withoutAnimation,
-        mobile: this.device === 'mobile'
-      }
+        mobile: this.device === "mobile",
+      };
     },
     variables() {
       return variables;
-    }
+    },
+    dev() {
+      return process.env.NODE_ENV === "development";
+    },
   },
   methods: {
     handleClickOutside() {
-      this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
-    }
-  }
-}
+      this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  @import "~@/assets/styles/mixin.scss";
-  @import "~@/assets/styles/variables.scss";
+@import "~@/assets/styles/mixin.scss";
+@import "~@/assets/styles/variables.scss";
 
-  .app-wrapper {
-    @include clearfix;
-    position: relative;
-    height: 100%;
-    width: 100%;
-
-    .el-scrollbar{
-      height: 100%;
-    }
-
-    ::v-deep .el-scrollbar__wrap {
-      overflow-x: hidden;
-    }
+.app-wrapper {
+  @include clearfix;
+  position: relative;
+  height: 100%;
+  width: 100%;
 
-    &.mobile.openSidebar {
-      position: fixed;
-      top: 0;
-    }
+  .el-scrollbar {
+    height: 100%;
   }
 
-  .drawer-bg {
-    background: #000;
-    opacity: 0.3;
-    width: 100%;
-    top: 0;
-    height: 100%;
-    position: absolute;
-    z-index: 999;
+  ::v-deep .el-scrollbar__wrap {
+    overflow-x: hidden;
   }
 
-  .fixed-header {
+  &.mobile.openSidebar {
     position: fixed;
     top: 0;
-    right: 0;
-    z-index: 9;
-    width: calc(100% - #{$base-sidebar-width});
-    transition: width 0.28s;
   }
+}
 
-  .hideSidebar .fixed-header {
-    width: calc(100% - 54px);
-  }
+.drawer-bg {
+  background: #000;
+  opacity: 0.3;
+  width: 100%;
+  top: 0;
+  height: 100%;
+  position: absolute;
+  z-index: 999;
+}
 
-  .sidebarHide .fixed-header {
-    width: 100%;
-  }
+.fixed-header {
+  position: fixed;
+  top: 0;
+  right: 0;
+  z-index: 9;
+  width: calc(100% - #{$base-sidebar-width});
+  transition: width 0.28s;
+}
 
-  .mobile .fixed-header {
-    width: 100%;
-  }
+.hideSidebar .fixed-header {
+  width: calc(100% - 54px);
+}
+
+.sidebarHide .fixed-header {
+  width: 100%;
+}
+
+.mobile .fixed-header {
+  width: 100%;
+}
 </style>

+ 28 - 1
src/main.js

@@ -29,7 +29,7 @@ import {
   selectDictLabels,
   handleTree,
 } from "@/utils/ruoyi";
-import { initParams, initRules, initDicts } from "@/utils/init.js";
+import { initParams, initRules, initDicts, initPage } from "@/utils/init.js";
 // 分页组件
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件
@@ -73,6 +73,7 @@ Vue.prototype.$init = {
   params: initParams,
   dicts: initDicts,
   rules: initRules,
+  page: initPage,
 };
 
 // 全局组件挂载
@@ -94,6 +95,32 @@ Vue.use(VueMeta);
 Vue.use(Print); //注册
 DictData.install();
 
+// el-table无限滚动解决页面渲染卡死
+Vue.directive("myscroll", {
+  bind(el, bind, vnode) {
+    const self = vnode.context;
+    let target = el.querySelector('.el-table__body-wrapper');
+    target.addEventListener("scroll", () => {
+      // 检测触底
+      if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
+        if (self.over >= self.basicForm.puDemandItemList) {
+          return;
+        }
+        self.over +=15
+      }
+    })
+  }
+})
+Vue.mixin({
+  data() {
+    return {
+      // scrollTop: 0,
+      // tableHeight: 300
+      start: 0,
+      over: 15
+    }
+  }
+})
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 31 - 29
src/store/modules/app.js

@@ -1,66 +1,68 @@
-import Cookies from 'js-cookie'
+import Cookies from "js-cookie";
 
 const state = {
   sidebar: {
-    opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
+    opened: Cookies.get("sidebarStatus")
+      ? !!+Cookies.get("sidebarStatus")
+      : false,
     withoutAnimation: false,
-    hide: false
+    hide: false,
   },
-  device: 'desktop',
-  size: Cookies.get('size') || 'medium'
-}
+  device: "desktop",
+  size: Cookies.get("size") || "medium",
+};
 
 const mutations = {
-  TOGGLE_SIDEBAR: state => {
+  TOGGLE_SIDEBAR: (state) => {
     if (state.sidebar.hide) {
       return false;
     }
-    state.sidebar.opened = !state.sidebar.opened
-    state.sidebar.withoutAnimation = false
+    state.sidebar.opened = !state.sidebar.opened;
+    state.sidebar.withoutAnimation = false;
     if (state.sidebar.opened) {
-      Cookies.set('sidebarStatus', 1)
+      Cookies.set("sidebarStatus", 1);
     } else {
-      Cookies.set('sidebarStatus', 0)
+      Cookies.set("sidebarStatus", 0);
     }
   },
   CLOSE_SIDEBAR: (state, withoutAnimation) => {
-    Cookies.set('sidebarStatus', 0)
-    state.sidebar.opened = false
-    state.sidebar.withoutAnimation = withoutAnimation
+    Cookies.set("sidebarStatus", 0);
+    state.sidebar.opened = false;
+    state.sidebar.withoutAnimation = withoutAnimation;
   },
   TOGGLE_DEVICE: (state, device) => {
-    state.device = device
+    state.device = device;
   },
   SET_SIZE: (state, size) => {
-    state.size = size
-    Cookies.set('size', size)
+    state.size = size;
+    Cookies.set("size", size);
   },
   SET_SIDEBAR_HIDE: (state, status) => {
-    state.sidebar.hide = status
-  }
-}
+    state.sidebar.hide = status;
+  },
+};
 
 const actions = {
   toggleSideBar({ commit }) {
-    commit('TOGGLE_SIDEBAR')
+    commit("TOGGLE_SIDEBAR");
   },
   closeSideBar({ commit }, { withoutAnimation }) {
-    commit('CLOSE_SIDEBAR', withoutAnimation)
+    commit("CLOSE_SIDEBAR", withoutAnimation);
   },
   toggleDevice({ commit }, device) {
-    commit('TOGGLE_DEVICE', device)
+    commit("TOGGLE_DEVICE", device);
   },
   setSize({ commit }, size) {
-    commit('SET_SIZE', size)
+    commit("SET_SIZE", size);
   },
   toggleSideBarHide({ commit }, status) {
-    commit('SET_SIDEBAR_HIDE', status)
-  }
-}
+    commit("SET_SIDEBAR_HIDE", status);
+  },
+};
 
 export default {
   namespaced: true,
   state,
   mutations,
-  actions
-}
+  actions,
+};

+ 4 - 0
src/utils/init.js

@@ -48,3 +48,7 @@ export const initDicts = (prop) => {
     )
   );
 };
+
+export const initPage = () => {
+  return { pageNum: 1, pageSize: 20, total: 0 };
+};

+ 3 - 1
src/utils/init/index.js

@@ -33,4 +33,6 @@ export const initRules = (prop) => {
   return rules;
 };
 
-export const initPage = () => ({ pageNum: 1, pageSize: 10, total: 0, });
+export const initPage = () => {
+  return { pageNum: 1, pageSize: 20, total: 0 };
+};

+ 1 - 1
src/utils/request.js

@@ -17,7 +17,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 10000,
+  timeout: 300000,
 });
 
 // request拦截器

+ 173 - 162
src/views/WMS/historical-route/index.vue

@@ -1,140 +1,141 @@
 <template>
-  <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" stretch="true">
-    <el-tab-pane label="温湿度信息" name="first">
-      <div id="body" :style="{width: width - 300 + 'px'}">
-        <!-- 单据信息 -->
-        <el-timeline>
+  <div id="print">
+    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" stretch="true">
+      <el-tab-pane label="温湿度信息" name="first">
+        <div id="body" :style="{width: width - 300 + 'px'}">
+          <!-- 单据信息 -->
           <el-timeline>
-            <el-descriptions>
-              <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
-              <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
-            </el-descriptions>
-            <el-descriptions>
-              <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
-              <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
-            </el-descriptions>
+            <el-timeline>
+              <el-descriptions>
+                <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
+                <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
+              </el-descriptions>
+              <el-descriptions>
+                <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
+                <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
+              </el-descriptions>
+              <!--导出按钮-->
+              <el-button class="OutCss" v-print="'#print'" type="primary">导出</el-button>  
+            </el-timeline>
           </el-timeline>
-        </el-timeline>
-        <el-timeline>
-         	<!--导出按钮-->
-           <el-button class="OutCss" v-print="'#body'" type="primary">导出</el-button>  
-          <!-- 数据表 -->
-          <h2>订单温湿度列表</h2>
-          <el-table
-            :data="tableData2"
-            stripe
-            border
+          <el-timeline>
+            <!-- 数据表 -->
+            <h2>订单温湿度列表</h2>
+            <el-table
+              :data="tableData2"
+              stripe
+              border
+              style="width: 97%">
+              <el-table-column
+              prop="temperature"
+              label="温度"
+              align="center"
+              min-width="300">
+              </el-table-column>
+              <el-table-column
+              prop="hisDate"
+              label="时间点"
+              align="center"
+              min-width="400">
+              </el-table-column>
+              <el-table-column
+              prop="address"
+              label="地址"
+              min-width="500">
+              </el-table-column>
+            </el-table>
+          </el-timeline>
+        </div>
+        <br>
+        <div id="body" :style="{width: width - 300 + 'px'}">
+          <el-timeline>
+            <h2>订单温度折线图</h2>
+            <div class="echart" id="mychart" :style="myChartStyle"></div>
+          </el-timeline>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="运输信息" name="second">
+        <div id="body" :style="{width: width - 300 + 'px'}">
+          <!-- 单据信息 -->
+          <el-timeline>
+            <el-timeline>
+              <el-descriptions>
+                <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
+                <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
+              </el-descriptions>
+              <el-descriptions>
+                <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
+                <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
+              </el-descriptions>
+            </el-timeline>
+          </el-timeline>
+        
+          <!-- 地图 -->
+          <div id="container"></div>
+
+          <!-- 订单温湿度列表 -->
+          <el-timeline>
+            <br>
+            <h2>订单温湿度列表</h2>
+            <el-table
+            :data="tableData1"
+            height="200"
             style="width: 97%">
             <el-table-column
-            prop="temperature"
-            label="温度"
+            prop="maxTemperature"
+            label="温度最大值"
             align="center"
-            min-width="300">
+            min-width="100">
             </el-table-column>
             <el-table-column
-            prop="hisDate"
-            label="时间点"
+            prop="avgTemperature"
+            label="温度平均值"
             align="center"
-            min-width="400">
+            min-width="100">
             </el-table-column>
             <el-table-column
-            prop="address"
-            label="地址"
-            min-width="500">
+            prop="minTemperature"
+            label="温度最小值"
+            align="center"
+            min-width="100">
             </el-table-column>
-          </el-table>
-        </el-timeline>
-      </div>
-      <br>
-      <div id="body" :style="{width: width - 300 + 'px'}">
-        <el-timeline>
-          <h2>订单温度折线图</h2>
-          <div class="echart" id="mychart" :style="myChartStyle"></div>
-        </el-timeline>
-      </div>
-    </el-tab-pane>
-    <el-tab-pane label="运输信息" name="second">
-      <div id="body" :style="{width: width - 300 + 'px'}">
-        <!-- 单据信息 -->
-        <el-timeline>
-          <el-timeline>
-            <el-descriptions>
-              <el-descriptions-item label="订单编号">{{this.basicData.billCode}}</el-descriptions-item>
-              <el-descriptions-item label="车牌号">{{this.basicData.plateNumber}}</el-descriptions-item>
-            </el-descriptions>
-            <el-descriptions>
-              <el-descriptions-item label="开始时间">{{this.basicData.startTime}}</el-descriptions-item>
-              <el-descriptions-item label="结束时间">{{this.basicData.endTime}}</el-descriptions-item>
-            </el-descriptions>
+            <el-table-column
+            prop="maxHumidity"
+            label="湿度最大值"
+            align="center"
+            min-width="100">
+            </el-table-column>
+            <el-table-column
+            prop="avgHumidity"
+            label="湿度平均值"
+            align="center"
+            min-width="100">
+            </el-table-column>
+            <el-table-column
+            prop="minHumidity"
+            label="湿度最小值"
+            align="center"
+            min-width="100">
+            </el-table-column>
+            <el-table-column
+            prop="startTime"
+            label="开始时间"
+            align="center"
+            min-width="250">
+            </el-table-column>
+            <el-table-column
+            prop="endTime"
+            align="center"
+            label="结束时间"
+            min-width="250">
+            </el-table-column>
+            </el-table>
           </el-timeline>
-        </el-timeline>
-      
-        <!-- 地图 -->
-        <div id="container"></div>
-
-        <!-- 订单温湿度列表 -->
-        <el-timeline>
-          <br>
-          <h2>订单温湿度列表</h2>
-          <el-table
-          :data="tableData1"
-          height="200"
-          style="width: 97%">
-          <el-table-column
-          prop="maxTemperature"
-          label="温度最大值"
-          align="center"
-          min-width="100">
-          </el-table-column>
-          <el-table-column
-          prop="avgTemperature"
-          label="温度平均值"
-          align="center"
-          min-width="100">
-          </el-table-column>
-          <el-table-column
-          prop="minTemperature"
-          label="温度最小值"
-          align="center"
-          min-width="100">
-          </el-table-column>
-          <el-table-column
-          prop="maxHumidity"
-          label="湿度最大值"
-          align="center"
-          min-width="100">
-          </el-table-column>
-          <el-table-column
-          prop="avgHumidity"
-          label="湿度平均值"
-          align="center"
-          min-width="100">
-          </el-table-column>
-          <el-table-column
-          prop="minHumidity"
-          label="湿度最小值"
-          align="center"
-          min-width="100">
-          </el-table-column>
-          <el-table-column
-          prop="startTime"
-          label="开始时间"
-          align="center"
-          min-width="250">
-          </el-table-column>
-          <el-table-column
-          prop="endTime"
-          align="center"
-          label="结束时间"
-          min-width="250">
-          </el-table-column>
-          </el-table>
-        </el-timeline>
-     </div>
-    </el-tab-pane>
-
-  </el-tabs>
+      </div>
+      </el-tab-pane>
 
+    </el-tabs>
+  </div>
 </template>
 
 <script>
@@ -146,6 +147,11 @@ import historyApi from '@/api/WMS/historical-route'
 import * as echarts from "echarts";
 
 export default {
+  mounted() {
+    //DOM初始化完成进行地图初始化
+    this.initMap();
+    // this.initEcharts();
+  },
   data() {
     return {
       width: document.documentElement.clientWidth - 10,
@@ -194,11 +200,6 @@ export default {
       option:{}
     };
   },
-  mounted() {
-    //DOM初始化完成进行地图初始化
-    this.initMap();
-    // this.initEcharts();
-  },
   methods: {
     handleClick(tab, event) {
       console.log(tab, event);
@@ -235,11 +236,7 @@ export default {
           bottom: '5%',
           containLabel: true
         },
-        toolbox: {
-          feature: {
-            saveAsImage: {}
-          }
-        },
+        toolbox: {},
         xAxis: {
           data: this.xData
         },
@@ -285,7 +282,14 @@ export default {
         this.myChart.resize();
       });
     },
-
+    //
+    // maploading() {
+    //   var map;
+    //   //基本地图加载
+    //   map = new AMap.Map("container", {
+    //     resizeEnable: true
+    //   });
+    // },
     handleGeocodeRepo(data) {
       // let data = {
       //     billCode: "CS01",
@@ -313,11 +317,6 @@ export default {
               //定义经纬度不为0的数组[j]为终点
               for	(let j = data.length - 1; j > i; j--) {
                 if (data[j].gpsLatitude != 0 && data[j].gpsLongitude != 0) {
-                  var map, route;
-                  //基本地图加载
-                  map = new AMap.Map("container", {
-                    resizeEnable: true
-                  });
                   //绘制初始路径
                   var path = [];
                   path.push([data[i].gpsLongitude, data[i].gpsLatitude]);
@@ -326,18 +325,32 @@ export default {
                   this.resX[0] = res.data[i].hisDate;
                   this.resYTemperature[0] = res.data[i].temperature;
                   this.resYHumidity[0] = res.data[i].humidity / 100;
-                  //定义递增值
-                  let increment = Math.trunc((j - i) / 14);
-                  //途径点数据
-                  for (let z = i + increment; z < j; z = z + increment) {
-                  // for (let z = i; z < j; z++) {
-                    if(data[z].gpsLongitude != 0 && data[z].gpsLatitude != 0) {
-                      path.push([data[z].gpsLongitude, data[z].gpsLatitude]);
-                      this.resData[count + 1] = res.data[z];
-                      this.resX[count + 1] = res.data[z].hisDate;
-                      this.resYTemperature[count + 1] = res.data[z].temperature;
-                      this.resYHumidity[count + 1] = res.data[z].humidity / 100;
-                      count++;
+                  //判断差值
+                  if ((j - i) < 14) {
+                    //途径点数据
+                    for (let z = i + 1; z < j; z++) {
+                      if(data[z].gpsLongitude != 0 && data[z].gpsLatitude != 0) {
+                        path.push([data[z].gpsLongitude, data[z].gpsLatitude]);
+                        this.resData[count + 1] = res.data[z];
+                        this.resX[count + 1] = res.data[z].hisDate;
+                        this.resYTemperature[count + 1] = res.data[z].temperature;
+                        this.resYHumidity[count + 1] = res.data[z].humidity / 100;
+                        count++;
+                      }
+                    }
+                  } else {
+                    //定义递增值
+                    let increment = Math.trunc((j - i) / 14);
+                    //途径点数据
+                    for (let z = i + increment; z < j; z = z + increment) {
+                      if(data[z].gpsLongitude != 0 && data[z].gpsLatitude != 0) {
+                        path.push([data[z].gpsLongitude, data[z].gpsLatitude]);
+                        this.resData[count + 1] = res.data[z];
+                        this.resX[count + 1] = res.data[z].hisDate;
+                        this.resYTemperature[count + 1] = res.data[z].temperature;
+                        this.resYHumidity[count + 1] = res.data[z].humidity / 100;
+                        count++;
+                      }
                     }
                   }
                   path.push([data[j].gpsLongitude, data[j].gpsLatitude]);
@@ -346,10 +359,6 @@ export default {
                   this.resX[count] = res.data[j].hisDate;
                   this.resYTemperature[count] = res.data[j].temperature;
                   this.resYHumidity[count] = res.data[j].humidity / 100;
-                  map.plugin("AMap.DragRoute", function() {
-                    route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE); //构造拖拽导航类
-                    route.search(); //查询导航路径并开启拖拽导航
-                  });
                   this.xData = res.data.temperature;
                   this.tableData2 = this.resData;
                   this.xData = this.resX;
@@ -411,6 +420,15 @@ export default {
                   this.basicData.endTime = this.modelData1[0].endTime
                   //渲染图表
                   this.initEcharts();
+                  //基本地图加载
+                  var map, route;
+                  map = new AMap.Map("container", {
+                    resizeEnable: true
+                  });
+                  map.plugin("AMap.DragRoute", function() {
+                    route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE); //构造拖拽导航类
+                    route.search(); //查询导航路径并开启拖拽导航
+                  });
                   return;
                 }
               }
@@ -436,12 +454,6 @@ export default {
   width: 1000;
   height: 800px;
 }
-.Button {
-padding-top:3px; 
-padding-left:1000px;
-padding-right:3px;
-padding-bottom:100px;
-}
 .OutCss {
 float: right; 
 }
@@ -466,4 +478,3 @@ float: right;
   }
 }
 </style>
-

+ 51 - 45
src/views/business/spd/bo/basic/index.vue

@@ -4,13 +4,14 @@
     <el-form
       :model="queryParams"
       ref="queryForm"
-      size="small"
+      size="mini"
       :inline="true"
       v-show="showSearch"
       label-width="68px"
     >
       <el-form-item label="商机名称" prop="boName">
         <el-input
+          size="mini"
           v-model="queryParams.boName"
           clearable
           @keyup.enter.native="handleQuery"
@@ -18,6 +19,7 @@
       </el-form-item>
       <el-form-item label="客户名称" prop="customerName">
         <el-input
+          size="mini"
           v-model="queryParams.customerName"
           clearable
           @keyup.enter.native="handleQuery"
@@ -25,6 +27,7 @@
       </el-form-item>
       <el-form-item label="商机负责人" prop="principalName">
         <el-input
+          size="mini"
           v-model="queryParams.principalName"
           clearable
           @keyup.enter.native="handleQuery"
@@ -32,6 +35,7 @@
       </el-form-item>
       <el-form-item label="商机类型" prop="boType">
         <el-select
+          size="mini"
           v-model="queryParams.boType"
           @change="boTypeChange"
           clearable
@@ -45,7 +49,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="商机阶段" prop="boStage">
-        <el-select v-model="queryParams.boStage" clearable>
+        <el-select size="mini" v-model="queryParams.boStage" clearable>
           <el-option
             v-for="item in mk_bo_stage"
             :key="item.code"
@@ -55,7 +59,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="商机状态" prop="boState" clearable>
-        <el-select v-model="queryParams.boState" clearable>
+        <el-select size="mini" v-model="queryParams.boState" clearable>
           <el-option
             v-for="dict in dict.type.mk_bo_state"
             :key="dict.value"
@@ -64,7 +68,7 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="商机来源" prop="boSource">
+      <el-form-item size="mini" label="商机来源" prop="boSource">
         <el-select v-model="queryParams.boSource" clearable>
           <el-option
             v-for="dict in dict.type.mk_bo_source"
@@ -86,6 +90,7 @@
       </el-form-item> -->
       <el-form-item label="创建时间">
         <el-date-picker
+          size="mini"
           v-model="dateRange"
           style="width: 240px"
           value-format="yyyy-MM-dd"
@@ -109,9 +114,8 @@
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
+    <div class="btn_grooup">
+      <el-button
           type="primary"
           plain
           icon="el-icon-plus"
@@ -119,52 +123,29 @@
           @click="handleAdd"
           >新增</el-button
         >
-      </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-        >删除</el-button>
-      </el-col> -->
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
-    </el-row>
+    </div>
 
     <el-table
       v-loading="loading"
       :data="basicList"
       @selection-change="handleSelectionChange"
       @cell-dblclick="enterDetails"
+      height="700px"
     >
       <el-table-column type="selection" align="center" />
       <el-table-column
+        width="150"
         label="编号"
         align="center"
         prop="boCode"
       />
-      <el-table-column label="商机名称" align="center" prop="boName" />
-      <el-table-column label="商机类型" align="center" prop="boType">
+      <el-table-column label="商机名称" show-overflow-tooltip width="300" align="center" prop="boName" />
+      <el-table-column label="商机类型" width="150" align="center" prop="boType">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.mk_bo_type" :value="scope.row.boType" />
         </template>
       </el-table-column>
-      <el-table-column label="商机状态" align="center" prop="boState">
+      <el-table-column label="商机状态" width="150" align="center" prop="boState">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.mk_bo_state"
@@ -172,7 +153,7 @@
           />
         </template>
       </el-table-column>
-      <el-table-column label="商机来源" align="center" prop="boSource">
+      <el-table-column label="商机来源" width="150" align="center" prop="boSource">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.mk_bo_source"
@@ -180,15 +161,16 @@
           />
         </template>
       </el-table-column>
-      <el-table-column label="商机阶段" align="center" prop="boStageName" />
-      <el-table-column label="客户名称" align="center" prop="customerName" />
+      <el-table-column label="商机阶段" width="150" align="center" prop="boStageName" />
+      <el-table-column label="客户名称" show-overflow-tooltip width="150" align="center" prop="customerName" />
       <el-table-column
+        width="150"
         label="预估值(万元)"
         align="center"
         prop="hosDiscreetValue"
       />
-      <el-table-column label="赢单率" align="center" prop="winningRate" />
-      <el-table-column label="赢单率状态" align="center" prop="winningState">
+      <el-table-column label="赢单率" width="150" align="center" prop="winningRate" />
+      <el-table-column label="赢单率状态" width="150" align="center" prop="winningState">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.mk_bo_winstate"
@@ -197,19 +179,22 @@
         </template>
       </el-table-column>
       <el-table-column
+        width="150"
         label="销售区域"
         align="center"
         prop="marketingAreaName"
       />
       <el-table-column
+        width="150"
+        show-overflow-tooltip
         label="销售组织"
         align="center"
         prop="marketingOrganizingName"
       />
-      <el-table-column label="部门" align="center" prop="deptName" />
-      <el-table-column label="商机负责人" align="center" prop="principalName" />
-      <el-table-column label="创建人" align="center" prop="createBy" />
-      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="部门" width="150" align="center" prop="deptName" />
+      <el-table-column label="商机负责人" width="150" align="center" prop="principalName" />
+      <el-table-column label="创建人" width="150" align="center" prop="createBy" />
+      <el-table-column label="创建时间" width="150" align="center" prop="createTime" />
       <el-table-column
         label="操作"
         fixed="right"
@@ -918,3 +903,24 @@ export default {
   },
 };
 </script>
+
+<style lang="scss" scoped>
+#deliveryAddressList {
+  height: calc(100vh - 84px);
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.lines {
+  margin-top: 0;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 5 - 5
src/views/business/spd/bo/basic/process.vue

@@ -25,7 +25,7 @@
       <!-- 商机审核 -->
       <el-tab-pane label="阶段动作" name="t00101" style="height: 200px; overflow-y: scroll" v-if="tabsName.t00101" >
         <el-descriptions >
-          <el-descriptions-item label="医院收总额">
+          <el-descriptions-item label="医院收总额">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
               <div>{{dict.label}}</div>
             </div>
@@ -303,7 +303,7 @@
       <!-- 商机审核 -->
       <el-tab-pane label="阶段动作" name="t10101" style="height: 200px; overflow-y: scroll" v-if="tabsName.t10101">
         <el-descriptions >
-          <el-descriptions-item label="医院收总额">
+          <el-descriptions-item label="医院收总额">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
               <div>{{dict.label}}</div>
             </div>
@@ -518,7 +518,7 @@
       <!-- 商机审核 -->
       <el-tab-pane label="阶段动作" name="t20201" style="height: 200px; overflow-y: scroll" v-if="tabsName.t20201">
         <el-descriptions >
-          <el-descriptions-item label="医院收总额">
+          <el-descriptions-item label="医院收总额">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
               <div>{{dict.label}}</div>
             </div>
@@ -748,7 +748,7 @@
       <!-- 商机审核 -->
       <el-tab-pane label="阶段动作" name="t30201" style="height: 200px; overflow-y: scroll" v-if="tabsName.t30201">
         <el-descriptions >
-          <el-descriptions-item label="医院收总额">
+          <el-descriptions-item label="医院收总额">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
               <div>{{dict.label}}</div>
             </div>
@@ -978,7 +978,7 @@
       <!-- 商机审核 -->
       <el-tab-pane label="阶段动作" name="t40201" style="height: 200px; overflow-y: scroll" v-if="tabsName.t40201">
         <el-descriptions >
-          <el-descriptions-item label="医院收总额">
+          <el-descriptions-item label="医院收总额">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
               <div>{{dict.label}}</div>
             </div>

+ 19 - 108
src/views/business/spd/bo/behavior/behaviorList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-row :gutter="10" class="mb8" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
+    <el-row :gutter="10" class="mb8" v-if="this.bo.winningState == 0">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -11,31 +11,8 @@
           v-if="this.boAuthority.boAuthority.behaviorAdd"
         >新增</el-button>
       </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-        >删除</el-button>
-      </el-col> -->
-      <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
     </el-row>
-
-    <el-table v-loading="loading" :data="behaviorList" @selection-change="handleSelectionChange">
-      <el-table-column type="index" label="序号" width="55" align="center"/>
+    <el-table v-loading="loading" :data="behaviorList">
       <el-table-column label="负责人" align="center" prop="staffName" />
       <el-table-column label="行动日期" align="center" prop="time" />
       <el-form-item label="行动日期" prop="time">
@@ -59,46 +36,27 @@
       </el-table-column>
       <el-table-column label="协助内容" align="center" prop="assistContent" />
       <el-table-column label="洽谈内容" align="center" prop="content" />
-
-      <el-table-column label="任务编码" align="center" prop="taskCode" v-if="source == 'Behavior'"/>
-      <el-table-column label="行动类型" align="center" prop="type" v-if="source == 'Behavior'">
+      <el-table-column label="行动类型" align="center" prop="type">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.mk_bo_behavior_type" :value="scope.row.type"/>
         </template>
       </el-table-column>
-      <el-table-column label="客户" align="center" prop="customerName" v-if="source == 'Behavior'"/>
-      <el-table-column label="拜访目的" align="center" prop="purpose" v-if="source == 'Behavior'">
+      <el-table-column label="拜访目的" align="center" prop="purpose">
         <template slot-scope="scope">
             <dict-tag :options="dict.type.mk_bo_behavior_goal" :value="scope.row.purpose"/>
         </template>
       </el-table-column>
-      <el-table-column label="销售组织" align="center" prop="salesOrgName" v-if="source == 'Behavior'"/>
-      <el-table-column label="部门" align="center" prop="deptName" v-if="source == 'Behavior'"/>
-
+      <el-table-column label="销售组织" align="center" prop="salesOrgName"/>
+      <el-table-column label="部门" align="center" prop="deptName"/>
       <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
-      <!-- <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true"> -->
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            :disabled="!boAuthority.boAuthority.behaviorEdit"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
             icon="el-icon-view"
             @click="handleBrowse(scope.row)"
             :disabled="!boAuthority.boAuthority.behaviorView"
           >查看</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            :disabled="!boAuthority.boAuthority.behaviorDel"
-          >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -119,11 +77,6 @@
         </el-divider>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="任务" prop="taskId" v-if="!(this.source == 'BoDetails')">
-              <el-input v-model="form.taskCode" placeholder="请输入任务" :disabled="this.source == 'TaskList'"/>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
             <el-form-item label="行动类型" prop="type">
               <el-select v-model="form.type" placeholder="请输入行动类型">
                 <el-option
@@ -149,7 +102,7 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="客户" prop="customerName">
-              <el-input v-model="form.customerName" placeholder="请输入客户" disabled="this.source == 'BoDetails' || this.source == 'TaskList'"/>
+              <el-input v-model="form.customerName" placeholder="请输入客户" disabled/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -260,7 +213,7 @@
         <el-dialog :visible.sync="dialogVisible">
           <img width="100%" :src="dialogImageUrl" alt="">
         </el-dialog>
-        
+
         <div class="md-auditInfo">
           <el-divider content-position="left">
             <dev style="width: 50px; height: 40px; font-size: 18px">其它信息</dev>
@@ -319,7 +272,7 @@ import SaleaeaRef from '@/views/business/spd/bo/refer/saleaea/index.vue';
 
 export default {
   name: "BehaviorList",
-  props:["source","bo","boAuthority"],
+  props:["bo","boAuthority"],
   dicts: ['mk_bo_behavior_res','mk_bo_behavior_type','sys_yes_no','mk_bo_behavior_goal'],
   components: {ContactRef,SaleaeaRef},
   data() {
@@ -400,19 +353,10 @@ export default {
   },
   created() {
     console.log('this.boAuthority',this.boAuthority);
-    if(this.source == 'Behavior'){
-      this.queryParams = this.bo;
-    }
-    if(this.source == 'BoDetails'){
-      this.queryParams.bo = this.bo.id;
-      this.queryParams.boStage = this.bo.boStage;
-      let params = {"post":this.boAuthority.post};
-      this.queryParams.params = params;
-    }
-    if(this.source == 'TaskList'){
-      this.queryParams.taskCode = this.bo.code;
-      console.log("this.bo", this.bo);
-    }
+    this.queryParams.bo = this.bo.id;
+    this.queryParams.boStage = this.bo.boStage;
+    let params = {"post":this.boAuthority.post};
+    this.queryParams.params = params;
     this.getList();
   },
   methods: {
@@ -506,23 +450,12 @@ export default {
       this.reset();
       this.operatingState = "Insert";
       //新增行动设置默认值
-      if(this.source == 'BoDetails'){
-        this.queryParams.bo = this.bo.id;
-        this.form.bo = this.bo.id;
-        this.form.boName = this.bo.boName;
-        this.form.boStage = this.bo.boStage;
-        this.form.customer = this.bo.customer;
-        this.form.customerName = this.bo.customerName;
-      }
-      if(this.source == 'TaskList'){
-        this.form.bo = this.bo.bo;
-        this.form.boName = this.bo.boName;
-        this.form.boStage = this.bo.boStage;
-        this.form.customer = this.bo.customer;
-        this.form.customerName = this.bo.customerName;
-        this.form.task = this.bo.id;
-        this.form.taskCode = this.bo.code;
-      }
+      this.queryParams.bo = this.bo.id;
+      this.form.bo = this.bo.id;
+      this.form.boName = this.bo.boName;
+      this.form.boStage = this.bo.boStage;
+      this.form.customer = this.bo.customer;
+      this.form.customerName = this.bo.customerName;
       this.form.type = '0';
       this.form.staff = this.$store.state.user.id;
       this.form.staffName = this.$store.state.user.nickName;
@@ -534,18 +467,6 @@ export default {
       this.open = true;
       this.title = "添加行动";
     },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      this.operatingState = "Update";
-      const id = row.id || this.ids
-      getBehavior(id).then(response => {
-        this.form = response.data;
-        
-        this.open = true;
-        this.title = "修改行动";
-      });
-    },
     /** 查看按钮操作 */
     handleBrowse(row) {
       this.reset();
@@ -593,16 +514,6 @@ export default {
         }
       });
     },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除行动编号为"' + ids + '"的数据项?').then(function() {
-        return delBehavior(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
     // 触发联系人参照列表
     refereContact() {
       this.$refs.contactSelect.init()

+ 255 - 79
src/views/business/spd/bo/behavior/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="任务" prop="taskCode">
         <el-input
           v-model="queryParams.taskCode"
@@ -14,18 +14,255 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
+    <el-table v-loading="loading" :data="behaviorList" height="700px">
+      <el-table-column label="负责人" align="center" prop="staffName" />
+      <el-table-column label="行动日期" align="center" prop="time" />
+      <el-form-item label="行动日期" prop="time">
+        <el-date-picker clearable
+          v-model="form.time"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="请选择行动日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-table-column label="联系人" align="center" prop="linkmanName" />
+      <el-table-column label="拜访效果" align="center" prop="result" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.mk_bo_behavior_res" :value="scope.row.result"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否上级协助" align="center" prop="assist" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.assist"/>
+        </template>
+      </el-table-column>
+      <el-table-column show-overflow-tooltip label="协助内容" align="center" prop="assistContent" />
+      <el-table-column show-overflow-tooltip label="洽谈内容" align="center" prop="content" />
+      <el-table-column width="150" label="任务编码" align="center" prop="taskCode"/>
+      <el-table-column label="行动类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.mk_bo_behavior_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column show-overflow-tooltip label="客户" align="center" prop="customerName"/>
+      <el-table-column label="拜访目的" align="center" prop="purpose">
+        <template slot-scope="scope">
+            <dict-tag :options="dict.type.mk_bo_behavior_goal" :value="scope.row.purpose"/>
+        </template>
+      </el-table-column>
+      <el-table-column show-overflow-tooltip label="销售组织" align="center" prop="salesOrgName"/>
+      <el-table-column show-overflow-tooltip label="部门" align="center" prop="deptName"/>
+      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+       <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleBrowse(scope.row)"
+          >查看</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.operatingState == 'Browse'">
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="任务" prop="taskId" v-if="!(this.source == 'BoDetails')">
+              <el-input v-model="form.taskCode" placeholder="请输入任务" :disabled="this.source == 'TaskList'"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="行动类型" prop="type">
+              <el-select v-model="form.type" placeholder="请输入行动类型">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_behavior_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="行动日期" prop="time">
+              <el-date-picker clearable
+                v-model="form.time"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="请选择行动日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="客户" prop="customerName">
+              <el-input v-model="form.customerName" placeholder="请输入客户" disabled="this.source == 'BoDetails' || this.source == 'TaskList'"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="联系人" prop="linkmanName">
+              <el-input v-model="form.linkmanName" placeholder="请输入联系人" >
+                <el-button slot="append" icon="el-icon-more" @click="refereContact"></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="拜访目的" prop="purpose">
+              <el-select v-model="form.purpose" placeholder="请输入拜访目的">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_behavior_goal"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col  :span="8">
+            <el-form-item label="拜访效果" prop="result">
+              <el-select v-model="form.result" placeholder="请输入拜访效果">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_behavior_res"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="是否上级协助" prop="assist">
+              <el-select v-model="form.assist" placeholder="请输入是否上级协助">
+                <el-option
+                  v-for="dict in dict.type.sys_yes_no"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="协助内容" prop="assistContent" v-show="form.assist == 'Y'" :rules="form.assist == 'Y' ? rules.assistContent : [{require: false}]">
+              <el-input v-model="form.assistContent" placeholder="请输入协助内容" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="销售区域" prop="marketingAreaName">
+              <el-input v-model="form.marketingAreaName" placeholder="请输入销售区域">
+                <el-button slot="append" icon="el-icon-more" @click="refereSaleaea"></el-button>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col  :span="8">
+            <el-form-item label="销售组织" prop="salesOrgName">
+              <el-input v-model="form.salesOrgName" placeholder="请输入销售组织" :disabled="true"/>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+             <el-form-item label="部门" prop="deptName">
+              <el-input v-model="form.deptName" placeholder="请输入部门" :disabled="true"/>
+            </el-form-item>
+          </el-col>
+          <el-col  :span="8">
+            <el-form-item label="负责人" prop="staffName">
+              <el-input v-model="form.staffName" placeholder="请输入负责人" :disabled="true"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">跟进内容</dev>
+        </el-divider>
+        <el-form-item label="内容" prop="content" >
+          <el-input
+            type="textarea"
+            :rows="2"
+            maxlength=900
+            placeholder="填写提示:今天拜访了谁,收集了什么述求,达成了什么结果,下一步计划。"
+            autosize
+            v-model="form.content">
+          </el-input>
+        </el-form-item>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">照片信息</dev>
+        </el-divider>
+
+        <el-upload
+          action="actionUrl"
+          list-type="picture-card"
+          :on-change="uploadPic"
+          :on-preview="handlePictureCardPreview"
+          :on-remove="handleRemove"
+          :auto-upload="false"
+          :file-list="fileList"
+          >
+          <i class="el-icon-plus"></i>
+        </el-upload>
+        <el-dialog :visible.sync="dialogVisible">
+          <img width="100%" :src="dialogImageUrl" alt="">
+        </el-dialog>
 
-    <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" :boAuthority="boAuthority" />
+        <div class="md-auditInfo">
+          <el-divider content-position="left">
+            <dev style="width: 50px; height: 40px; font-size: 18px">其它信息</dev>
+          </el-divider>
+          <el-form :inline="true" label-position="right" :model="form">
+            <el-row>
+              <el-col :span="6">
+                <el-form-item label="创建人">
+                  <el-input v-model="form.createByName" size="small" readonly></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="创建时间">
+                  <el-input v-model="form.createTime" size="small" readonly></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="修改人">
+                  <el-input v-model="form.updateByName" size="small" readonly></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="6">
+                <el-form-item label="修改时间">
+                  <el-input v-model="form.updateTime" size="small" readonly></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </div>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'" :disabled="submitButtonEditStatus">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listBehavior, getBehavior, delBehavior, addBehavior, updateBehavior } from "@/api/business/spd/bo/behavior";
-import BehaviorList from '../behavior/behaviorList.vue'
+import { listBehavior, getBehavior} from "@/api/business/spd/bo/behavior";
 
 export default {
   name: "Behavior",
-  components: {BehaviorList},
+  dicts: ['mk_bo_behavior_res','mk_bo_behavior_type','sys_yes_no','mk_bo_behavior_goal'],
   data() {
     return {
       // 遮罩层
@@ -73,20 +310,6 @@ export default {
       },
       // 表单参数
       form: {},
-      // 表单校验
-      rules: {
-      },
-      //重新加载子组件参数
-      timer: '',
-      //行动权限写死
-      boAuthority:{
-        boAuthority:{
-          behaviorAdd:true,
-          behaviorEdit:true,
-          behaviorView:true,
-          behaviorDel:true,
-        }
-      },
     };
   },
   created() {
@@ -102,6 +325,18 @@ export default {
         this.loading = false;
       });
     },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getBehavior(id).then(response => {
+        this.form = response.data;
+        this.fileList = this.form.behaviorPs;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -142,72 +377,13 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
-      this.timer = new Date().getTime();
-      // this.getList();
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加行动";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getBehavior(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改行动";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateBehavior(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addBehavior(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除行动编号为"' + ids + '"的数据项?').then(function() {
-        return delBehavior(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('system/behavior/export', {
-        ...this.queryParams
-      }, `behavior_${new Date().getTime()}.xlsx`)
-    }
   }
 };
 </script>

+ 18 - 51
src/views/business/spd/bo/contact/contactList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-row :gutter="10" class="mb8" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
+    <el-row :gutter="10" class="mb8" v-if="this.bo.winningState == 0">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -13,7 +13,7 @@
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-    <el-table v-loading="loading" :data="contactList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="contactList">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="code" />
       <el-table-column label="姓名" align="center" prop="name" />
@@ -42,7 +42,6 @@
           <dict-tag :options="dict.type.mk_bo_contact_state" :value="scope.row.state"/>
         </template>
       </el-table-column>
-      <!-- v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true" -->
       <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" >
         <template slot-scope="scope">
           <el-button
@@ -116,8 +115,8 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="所属客户" prop="customerName">
-              <el-input v-model="form.customerName" placeholder="请输入所属客户" :disabled="this.source == 'BoDetails'">
-                <el-button slot="append" icon="el-icon-more" @click="refereCustomer" :disabled="this.source == 'BoDetails'"></el-button>
+              <el-input v-model="form.customerName" placeholder="请输入所属客户" disabled>
+                <el-button slot="append" icon="el-icon-more" @click="refereCustomer" disabled></el-button>
               </el-input>
             </el-form-item>
           </el-col>
@@ -280,8 +279,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="邮件" prop="mail">
-              <el-input v-model="form.mail" placeholder="请输入邮件" />
+            <el-form-item label="微信" prop="mail">
+              <el-input v-model="form.mail" placeholder="请输入微信" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -450,15 +449,9 @@ export default {
     };
   },
   created() {
-    if(this.source == 'BoDetails'){
-      this.queryParams.customer = this.bo.customer;
-      let params = {"post":this.boAuthority.post};
-      this.queryParams.params = params;
-    }
-    if(this.source == 'Contact'){
-      this.queryParams = this.bo;
-    }
-    console.log('this.boAuthority',this.boAuthority);
+    this.queryParams.customer = this.bo.customer;
+    let params = {"post":this.boAuthority.post};
+    this.queryParams.params = params;
     this.getList();
   },
   methods: {
@@ -467,14 +460,12 @@ export default {
       this.loading = true;
       listContact(this.queryParams).then(response => {
         this.contactList = response.rows;
-        if(this.source == 'BoDetails'){
-          console.log('this.contactList',this.contactList);
-          for (var i = 0; i < this.contactList.length; i++) {
-            this.contactList[i].telephone = this.contactList[i].telephone.substring(0,3) + '******' + this.contactList[i].telephone.substring(this.contactList[i].telephone.length - 4,this.contactList[i].telephone.length);
-            this.contactList[i].customerName = this.contactList[i].customerName.substring(0,2) + '******' + this.contactList[i].customerName.substring(this.contactList[i].customerName.length - 2,this.contactList[i].customerName.length);
-            const start = new Array(this.contactList[i].name.length).join('*');
-            this.contactList[i].name = start + this.contactList[i].name.slice(-1);
-          }
+        console.log('this.contactList',this.contactList);
+        for (var i = 0; i < this.contactList.length; i++) {
+          this.contactList[i].telephone = this.contactList[i].telephone.substring(0,3) + '******' + this.contactList[i].telephone.substring(this.contactList[i].telephone.length - 4,this.contactList[i].telephone.length);
+          this.contactList[i].customerName = this.contactList[i].customerName.substring(0,2) + '******' + this.contactList[i].customerName.substring(this.contactList[i].customerName.length - 2,this.contactList[i].customerName.length);
+          const start = new Array(this.contactList[i].name.length).join('*');
+          this.contactList[i].name = start + this.contactList[i].name.slice(-1);
         }
         this.total = response.total;
         this.loading = false;
@@ -526,31 +517,13 @@ export default {
       };
       this.resetForm("form");
     },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
     /** 新增按钮操作 */
     handleAdd() {
       this.operatingState = "Insert";
       this.reset();
-      if(this.source == 'BoDetails'){
-        this.form.boId = this.bo.id;
-        this.form.customer = this.bo.customer;
-        this.form.customerName = this.bo.customerName;
-      }
+      this.form.boId = this.bo.id;
+      this.form.customer = this.bo.customer;
+      this.form.customerName = this.bo.customerName;
       this.form.state = '1';
       this.open = true;
       this.title = "添加联系人";
@@ -613,12 +586,6 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('system/contact/export', {
-        ...this.queryParams
-      }, `contact_${new Date().getTime()}.xlsx`)
-    },
     // 触发客户参照列表
     refereCustomer() {
       this.$refs.customerSelect.init()

+ 381 - 248
src/views/business/spd/bo/contact/index.vue

@@ -1,198 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <!-- <el-form-item label="创建日期" prop="createDate">
-        <el-date-picker clearable
-          v-model="queryParams.createDate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="请选择创建日期">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="部门名称" prop="departmentName">
-        <el-input
-          v-model="queryParams.departmentName"
-          placeholder="请输入部门名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门编码" prop="departmentCode">
-        <el-input
-          v-model="queryParams.departmentCode"
-          placeholder="请输入部门编码"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="销售区域" prop="area">
-        <el-input
-          v-model="queryParams.area"
-          placeholder="请输入销售区域"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="销售组织" prop="organization">
-        <el-input
-          v-model="queryParams.organization"
-          placeholder="请输入销售组织"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="最佳拜访地点" prop="visitPlace">
-        <el-input
-          v-model="queryParams.visitPlace"
-          placeholder="请输入最佳拜访地点"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="最佳拜访时间" prop="visitTime">
-        <el-date-picker clearable
-          v-model="queryParams.visitTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="请选择最佳拜访时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="家庭地址" prop="address">
-        <el-input
-          v-model="queryParams.address"
-          placeholder="请输入家庭地址"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="邮件" prop="mail">
-        <el-input
-          v-model="queryParams.mail"
-          placeholder="请输入邮件"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="关键决策人" prop="decisionMaker">
-        <el-input
-          v-model="queryParams.decisionMaker"
-          placeholder="请输入关键决策人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="擅长领域" prop="fieldExpertise">
-        <el-input
-          v-model="queryParams.fieldExpertise"
-          placeholder="请输入擅长领域"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="支持度" prop="support">
-        <el-input
-          v-model="queryParams.support"
-          placeholder="请输入支持度"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="决策力" prop="power">
-        <el-input
-          v-model="queryParams.power"
-          placeholder="请输入决策力"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="职称" prop="jobTitle">
-        <el-input
-          v-model="queryParams.jobTitle"
-          placeholder="请输入职称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="职务" prop="position">
-        <el-input
-          v-model="queryParams.position"
-          placeholder="请输入职务"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="任职科室" prop="section">
-        <el-input
-          v-model="queryParams.section"
-          placeholder="请输入任职科室"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="上级联系人" prop="superiorContact">
-        <el-input
-          v-model="queryParams.superiorContact"
-          placeholder="请输入上级联系人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="state">
-        <el-input
-          v-model="queryParams.state"
-          placeholder="请输入状态"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="业务爱好" prop="hobby">
-        <el-input
-          v-model="queryParams.hobby"
-          placeholder="请输入业务爱好"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="籍贯" prop="birthplace">
-        <el-input
-          v-model="queryParams.birthplace"
-          placeholder="请输入籍贯"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="生日" prop="birthday">
-        <el-date-picker clearable
-          v-model="queryParams.birthday"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="请选择生日">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="联系人分类" prop="contactClassification">
-        <el-input
-          v-model="queryParams.contactClassification"
-          placeholder="请输入联系人分类"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="所属客户编码" prop="customerCode">
-        <el-input
-          v-model="queryParams.customerCode"
-          placeholder="请输入所属客户编码"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="性别" prop="gander">
-        <el-input
-          v-model="queryParams.gander"
-          placeholder="请输入性别"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item> -->
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="姓名" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -222,17 +30,357 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" :boAuthority="boAuthority" />
+    <!-- <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+        >新增</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row> -->
+    <div class="btn_grooup">
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="handleAdd"
+      >新增</el-button>
+    </div>
+    <el-table v-loading="loading" :data="contactList" height="700px">
+      <el-table-column width="200" label="编号" align="center" prop="code" />
+      <el-table-column show-overflow-tooltip label="姓名" align="center" prop="name" />
+      <el-table-column label="性别" align="center" prop="gander" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gander"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="联系电话" align="center" prop="telephone" />
+      <el-table-column width="200" show-overflow-tooltip label="所属客户" align="center" prop="customerName" />
+      <el-table-column show-overflow-tooltip label="部门名称" align="center" prop="departmentName" />
+      <el-table-column label="职务" align="center" prop="position" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.mk_bo_position" :value="scope.row.position"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="决策力" align="center" prop="power" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.mk_bo_power" :value="scope.row.power"/>
+        </template>
+      </el-table-column>
+      <el-table-column show-overflow-tooltip label="兴趣爱好" align="center" prop="hobby" />
+      <el-table-column show-overflow-tooltip label="家庭地址" align="center" prop="address" />
+      <el-table-column label="状态" align="center" prop="state" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.mk_bo_contact_state" :value="scope.row.state"/>
+        </template>
+      </el-table-column>
+      <el-table-column width="200" label="操作" fixed="right" align="center" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleBrowse(scope.row)"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改联系人管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="this.operatingState == 'Browse'">
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="编码" prop="code">
+              <el-input v-model="form.code" placeholder="系统自动生成编码" :disabled = "true"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="姓名" prop="name">
+              <el-input v-model="form.name" placeholder="请输入姓名" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="性别" prop="gander">
+              <el-select v-model="form.gander" placeholder="请输入性别">
+                <el-option
+                  v-for="dict in dict.type.sys_user_sex"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="所属客户" prop="customerName">
+              <dr-popover-select v-model="form.customerName" title="客户" type="CUSTOMER_PARAM_ZT" :dataMapping="{
+                  customer: 'id',
+                  customerName: 'name',
+                }" :source.sync="form">
+              </dr-popover-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="联系人分类" prop="contactClassification">
+              <el-select v-model="form.contactClassification" placeholder="请输入联系人分类">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_contact_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="生日" prop="birthday">
+              <el-date-picker clearable
+                v-model="form.birthday"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="请选择生日">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="籍贯" prop="birthplace">
+              <el-input v-model="form.birthplace" placeholder="请输入籍贯" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="兴趣爱好" prop="hobby">
+              <el-input v-model="form.hobby" placeholder="请输入业务爱好" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="状态" prop="state">
+              <el-select v-model="form.state" placeholder="请输入状态">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_contact_state"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">工作信息</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="上级联系人" prop="superiorContactName">
+              <dr-popover-select v-model="form.superiorContactName" title="上级联系人" type="LINKMAN_PARAM" :dataMapping="{
+                  superiorContact: 'id',
+                  superiorContactName: 'name',
+                }" :source.sync="form">
+              </dr-popover-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="任职科室" prop="section">
+              <el-select v-model="form.section" placeholder="请输入任职科室">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_section"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="职务" prop="position">
+              <el-select v-model="form.position" placeholder="请输入职务">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_position"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="职称" prop="jobTitle">
+              <el-select v-model="form.jobTitle" placeholder="请输入职称">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_job_title"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="决策力" prop="power">
+              <el-select v-model="form.power" placeholder="请输入决策力">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_power"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="支持度" prop="support">
+              <el-select v-model="form.support" placeholder="请输入支持度">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_support"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="擅长领域" prop="fieldExpertise">
+              <el-select v-model="form.fieldExpertise" placeholder="请输入擅长领域">
+                <el-option
+                  v-for="dict in dict.type.mk_bo_field_expertise"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="关键决策人" prop="decisionMaker">
+              <el-select v-model="form.decisionMaker" placeholder="请输入关键决策人">
+                <el-option
+                  v-for="dict in dict.type.sys_yes_no"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">联系信息</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="联系电话" prop="telephone">
+              <el-input v-model="form.telephone" placeholder="请输入联系电话" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="微信" prop="mail">
+              <el-input v-model="form.mail" placeholder="请输入微信" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="家庭地址" prop="address">
+              <el-input v-model="form.address" placeholder="请输入家庭地址" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="最佳拜访时间" prop="visitTime">
+              <el-input v-model="form.visitTime" placeholder="请选择最佳拜访时间" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="最佳拜访地点" prop="visitPlace">
+              <el-input v-model="form.visitPlace" placeholder="请输入最佳拜访地点" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
+        <el-tabs v-model="activeName" v-if="this.operatingState != 'Insert'">
+          <el-tab-pane label="学历信息" name="first">
+            <EducationList  :key="timer" :supForm="this.form" />
+          </el-tab-pane>
+          <el-tab-pane label="社会关系" name="second">
+            <RelationshipList :key="timer" :supForm="this.form" />
+          </el-tab-pane>
+        </el-tabs>
+        <div class="md-auditInfo">
+          <el-divider content-position="left">
+            <dev style="width: 50px; height: 40px; font-size: 18px">其它信息</dev>
+          </el-divider>
+          <el-form :inline="true" label-position="right" :model="form">
+            <el-form-item label="创建人">
+              <el-input v-model="form.createByName" size="small" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="创建时间">
+              <el-input v-model="form.createTime" size="small" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="修改人">
+              <el-input v-model="form.updateByName" size="small" readonly></el-input>
+            </el-form-item>
+            <el-form-item label="修改时间">
+              <el-input v-model="form.updateTime" size="small" readonly></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'" :disabled="submitButtonEditStatus">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { listContact, getContact, delContact, addContact, updateContact } from "@/api/business/spd/bo/contact";
-import ContactList from '../contact/contactList.vue'
+import EducationList from '../education/educationList.vue';
+import RelationshipList from '../relationship/relationshipList.vue';
 
 export default {
   name: "Contact",
-  components: {ContactList},
+  dicts: ['sys_user_sex','mk_bo_contact_state','mk_bo_section','mk_bo_position','mk_bo_job_title','mk_bo_power','mk_bo_support','mk_bo_field_expertise','sys_yes_no','mk_bo_contact_type'],
+  components: {EducationList,RelationshipList},
   data() {
     return {
       // 遮罩层
@@ -257,35 +405,9 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        boId: null,
-        createDate: null,
-        departmentName: null,
-        departmentCode: null,
-        area: null,
-        organization: null,
-        visitPlace: null,
-        visitTime: null,
-        address: null,
-        mail: null,
+        name: null,
         telephone: null,
-        decisionMaker: null,
-        fieldExpertise: null,
-        support: null,
-        power: null,
-        jobTitle: null,
-        position: null,
-        section: null,
-        superiorContact: null,
-        state: null,
-        hobby: null,
-        birthplace: null,
-        birthday: null,
-        contactClassification: null,
         customerName: null,
-        customerCode: null,
-        gander: null,
-        name: null,
-        code: null,
       },
       // 表单参数
       form: {},
@@ -333,15 +455,11 @@ export default {
       },
       //重新加载子组件参数
       timer: '',
-      //列表权限写死
-      boAuthority:{
-        boAuthority:{
-          contactAdd:true,
-          contactEdit:true,
-          contactView:true,
-          contactDel:true,
-        }
-      },
+      //当前操作状态
+      operatingState: '',
+      activeName: 'first',
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -404,40 +522,49 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      console.log('this.queryParams',this.queryParams);
       this.queryParams.pageNum = 1;
       this.timer = new Date().getTime();
-      // this.getList();
+      this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
     /** 新增按钮操作 */
     handleAdd() {
+      this.operatingState = "Insert";
       this.reset();
+      this.form.state = '1';
       this.open = true;
-      this.title = "添加联系人管理";
+      this.title = "添加联系人";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.operatingState = "Update";
       this.reset();
       const id = row.id || this.ids
       getContact(id).then(response => {
         this.form = response.data;
         this.open = true;
-        this.title = "修改联系人管理";
+        this.title = "修改联系人";
+        this.timer = new Date().getTime();
+      });
+    },
+    /** 查看按钮操作 */
+    handleBrowse(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getContact(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.operatingState = "Browse";
+        this.title = "基础信息";
       });
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -445,14 +572,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addContact(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },
@@ -466,12 +597,14 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('system/contact/export', {
-        ...this.queryParams
-      }, `contact_${new Date().getTime()}.xlsx`)
-    }
   }
 };
 </script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 24 - 6
src/views/business/spd/bo/filetemplate/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机类型" prop="boType">
         <el-select
           v-model="queryParams.boType"
@@ -23,12 +23,12 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8">
+    <!-- <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -39,9 +39,19 @@
         >上传</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+    </el-row> -->
 
-    <el-table v-loading="loading" :data="filetemplateList" @selection-change="handleSelectionChange">
+    <div class="btn_grooup">
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="uploadAccessory"
+      >上传</el-button>
+    </div>
+
+    <el-table v-loading="loading" :data="filetemplateList" @selection-change="handleSelectionChange"  height="700px">
       <el-table-column
         type="index"
         label="序号"
@@ -271,3 +281,11 @@ export default {
   }
 };
 </script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 3 - 3
src/views/business/spd/bo/statement/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机名称" prop="boName">
         <el-input
           v-model="queryParams.boName"
@@ -36,8 +36,8 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
     <el-tabs v-model="activeName" @tab-click="handleClick">

+ 4 - 4
src/views/business/spd/bo/statement/proportion/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="商机日期" prop="yearMonth">
         <el-date-picker
           type="month"
@@ -44,12 +44,12 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
-    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange" height="700px">
       <el-table-column label="中心部门" align="center" prop="deptName" />
       <el-table-column label="当月新增商机数(个)" align="center" prop="sumTotal" />
       <el-table-column label="当月审核通过数(个)" align="center" prop="passAudit" />

+ 33 - 7
src/views/business/spd/bo/task/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="任务编码" prop="code">
         <el-input
           v-model="queryParams.code"
@@ -47,8 +47,8 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
-      <!-- <el-col :span="1.5">
+    <!-- <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -77,28 +77,43 @@
           @click="handleDelete"
           >删除</el-button
         >
-      </el-col> -->
+      </el-col>
       <right-toolbar
         :showSearch.sync="showSearch"
         @queryTable="getList"
       ></right-toolbar>
-    </el-row>
+    </el-row> -->
+
+    <div class="btn_grooup">
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="handleAdd"
+        >新增</el-button
+      >
+    </div>
 
     <el-table
       v-loading="loading"
       :data="taskList"
       @selection-change="handleSelectionChange"
+      height="700px"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="任务编码" align="center" prop="code" />
-      <el-table-column label="任务名称" align="center" prop="name" />
+      <el-table-column width="150" label="任务编码" align="center" prop="code" />
+      <el-table-column width="200" show-overflow-tooltip label="任务名称" align="center" prop="name" />
       <el-table-column
+        width="200"
+        show-overflow-tooltip
         label="商机名称"
         align="center"
         prop="boName"
       />
       <el-table-column label="商机阶段" align="center" prop="boStageName"/>
       <el-table-column
+        show-overflow-tooltip
         label="客户名称"
         align="center"
         prop="customerName"
@@ -121,6 +136,7 @@
       </el-table-column>
       <el-table-column label="联系人" align="center" prop="linkmanName" />
       <el-table-column
+        show-overflow-tooltip
         label="销售组织名称"
         align="center"
         prop="salesOrgName"
@@ -139,6 +155,7 @@
       </el-table-column>
       <el-table-column label="任务内容" align="center" prop="content" />
       <el-table-column
+        show-overflow-tooltip
         label="操作"
         fixed="right"
         align="center"
@@ -607,6 +624,7 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加任务";
+      this.operatingState = "Insert";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -746,3 +764,11 @@ export default {
   }
 };
 </script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 264 - 0
src/views/business/spd/target/targetMk/add.vue

@@ -0,0 +1,264 @@
+<template>
+  <div>
+    <el-card>
+      <el-form :model="form" :rules="rules" ref="form" label-width="auto" :disabled="this.pageStu == 'see'">
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="单据编号" prop="code">
+              <el-input
+                v-model="form.code"
+                size="mini"
+                disabled
+                style="width: 200px"
+              />
+              <!-- <div>{{form.code}}</div> -->
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="单据日期" prop="date">
+              <el-date-picker
+                  v-model="form.date"
+                  clearable
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="mini"
+                  style="width: 200px"
+                >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="目标名称" prop="name">
+              <el-input
+                v-model="form.name"
+                size="mini"
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+          <!-- <el-col :span="1.5">
+            <el-form-item label="包含下级组织" >
+              <el-select v-model="form.includeOrg" size="mini" style="width: 200px">
+                <el-option
+                  v-for="dict in dict.type.sys_yes_no"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col> -->
+          <el-col :span="1.5">
+            <el-form-item label="模板" prop="template">
+              <dr-popover-select size="mini" v-model="form.templateName" title="模板" type="MK_TARGET_TEMPLATE_PARAM" :dataMapping="{
+                  template: 'id',
+                  templateName: 'name',
+                }" :source.sync="form"
+              >
+              </dr-popover-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-card shadow="never">
+          <el-descriptions title="模板信息">
+            <el-descriptions-item label="年度">{{template.year}}</el-descriptions-item>
+            <el-descriptions-item label="开始日期">{{template.startTime}}</el-descriptions-item>
+            <el-descriptions-item label="结束日期">{{template.deadlineTime}}</el-descriptions-item>
+            <el-descriptions-item label="周期">
+              <div v-for="dict in dict.type.mk_periodic_unit" v-if="template.cycle == dict.value">
+                  <el-tag size="small">{{dict.label}}</el-tag>
+                </div>
+            </el-descriptions-item>
+            <el-descriptions-item label="维度">
+              <div v-for="d in template.dimensionalitys">
+                <!-- <el-tag size="small">{{d.dimensionality}}</el-tag> -->
+                <div v-for="dict in dict.type.mk_dimensionality" v-if="d.dimensionality == dict.value">
+                  <el-tag size="small">{{dict.label}}</el-tag>
+                </div>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item label="指标">
+              <div v-for="d in template.indexs">
+                <!-- <el-tag size="small">{{d.target}}</el-tag> -->
+                <div v-for="dict in dict.type.mk_index_type" v-if="d.target == dict.value">
+                  <el-tag size="small">{{dict.label}}</el-tag>
+                </div>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item label="展开方式">
+              <div v-for="dict in dict.type.mk_expansion_mode" v-if="template.unfold == dict.value">
+                  <el-tag size="small">{{dict.label}}</el-tag>
+                </div>
+            </el-descriptions-item>
+          </el-descriptions>
+        </el-card>
+      </el-form>
+    </el-card>
+    <el-card  style="height:500px">
+      <Item ref="child" v-if="isItem" :pageStu="pageStu" :template="template" :form="form" :columns="headers" :latestTemplate="latestTemplate"></Item>
+    </el-card>
+    <el-card>
+      <div class="btn_group">
+        <el-col :span="1.5">
+          <el-button size="mini" plain @click="useBack">取消</el-button>
+        </el-col>
+        <el-col :span="1.5" style="margin: 0 10px;">
+          <el-button type="primary" size="mini" plain @click="useSave" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+        </el-col>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import Item from './item.vue'
+import { getTargetTemplate,getHeaderData } from "@/api/business/spd/starget/targetTemplate";
+import { getTarget,addTarget,updateTarget } from "@/api/business/spd/starget/target";
+export default {
+  name: 'add',
+  dicts: ['sys_yes_no','mk_periodic_unit','mk_dimensionality','mk_index_type','mk_expansion_mode'],
+  props: ['pageStu','row', 'disable'],
+  components: {Item},
+  model: {
+    prop: 'isList',
+    event: 'jugislist'
+  },
+  data() {
+    return {
+      template:{},
+      form:{},
+      //表单校验
+      rules: {
+        date: [
+          { required: true, message: "单据日期不能为空", trigger: "blur" },
+        ],
+        name: [
+          { required: true, message: "目标名称不能为空", trigger: "blur" },
+        ],
+        template: [
+          { required: true, message: "模板不能为空", trigger: "blur" },
+        ],
+      },
+      //子表表头数据
+      headers:[],
+      //遮罩
+      loading: false,
+      //是否展示Item组件
+      isItem:false,
+      //是否为最新模板
+      latestTemplate:false,
+    }
+  },
+  async created() {
+    if(this.pageStu == 'add'){
+      this.form.date = new Date();
+    }
+    if(this.pageStu == 'edit' || this.pageStu == 'see') {
+      await this.fetchTarget(this.row);
+      await this.fetchTemplate(this.row.template);
+      await this.fetchHeaderData(this.row.template);
+      this.latestTemplate = true;
+      this.isItem = true;
+    }
+  },
+  watch: {
+	  'form.template': {
+      async handler(newVal) {
+        console.log('111');
+        this.isItem = false;
+        await this.fetchTemplate(newVal);
+        await this.fetchHeaderData(newVal);
+        this.isItem = true;
+      },
+      immediate:false,
+    }
+  },
+  methods: {
+    //保存
+    async useSave(){
+      let passrule = false;
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+            passrule = true;
+          }
+      });
+      if(passrule){
+        try {
+          this.form.items = this.$refs.child.merge();
+          if(!this.form.items.length){
+            this.$modal.msgError("子表数据不能为空!");
+            return;
+          }
+          console.log('this.form',this.form);
+          this.loading = true;
+          let res = null;
+          if(this.pageStu == 'add'){
+            res = await addTarget(this.form);
+          }
+          if(this.pageStu == 'edit'){
+            res = await updateTarget(this.form);
+          }
+          if (res.code === 200) {
+            this.$modal.msgSuccess("保存成功");
+            this.useBack();
+          }
+        } catch (err) {
+          // catch
+          console.error(err);
+        } finally {
+          this.loading = false;
+        }
+      }
+    },
+    //返回
+    useBack(){
+      this.$emit('jugislist', true)
+      this.$emit('refresh')
+    },
+    //查询目标模板
+    async fetchTemplate(id) {
+      try {
+        this.loading = true;
+        const { code, data } = await getTargetTemplate(id);
+        if (code === 200) {
+          this.template = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //查询详情
+    async fetchTarget(row){
+      await getTarget(row.id).then(res => {
+        if (res.code === 200) {
+          this.form = res.data
+         }
+      })
+    },
+    //查询动态表头数据
+    async fetchHeaderData(id){
+      await getHeaderData(id).then(res => {
+        if (res.code === 200) {
+          this.headers = res.rows
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+} 
+</style>

+ 287 - 0
src/views/business/spd/target/targetMk/index.vue

@@ -0,0 +1,287 @@
+<template>
+  <div id="deliveryAddressList">
+    <div v-if="isList">
+      <el-card>
+        <el-form class="search_area" label-width="120px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="单据编号">
+                <el-input
+                  v-model="queryParams.code"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="目标名称">
+                <el-input
+                  v-model="queryParams.name"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="1.5">
+              <el-form-item label="模板">
+                <el-input
+                  v-model="queryParams.template"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="年度">
+                <el-input
+                  v-model="queryParams.year"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+                <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <CollapseTransition>
+            <div v-show="expanded">
+              
+            </div>
+          </CollapseTransition>
+        </el-form>
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+      
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
+          <el-button type="primary" size="mini" @click="useAdd">模板导出</el-button>
+          <el-button type="primary" size="mini" @click="useAdd">导入</el-button>
+        </div>
+
+        <el-table 
+          :data="tableList" 
+          fit
+          max-height="480"
+          style="font-size: 12px;"
+          @selection-change="useSelectionRow"
+          @row-dblclick="useDoubleClick"
+        >
+          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip label="单据编号" align="center" width="200" prop="code"/>
+          <el-table-column show-overflow-tooltip label="单据日期" align="center" width="200" prop="date"/>
+          <el-table-column show-overflow-tooltip label="目标名称" align="center" width="200" prop="name"/>
+          <el-table-column show-overflow-tooltip label="年度" align="center" width="200" prop="templateData.year"/>
+          <el-table-column show-overflow-tooltip label="模板" align="center" width="200" prop="templateData.name"/>
+          <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200" prop="templateData.startTime" />
+          <el-table-column show-overflow-tooltip label="结束日期" align="center" width="200" prop="templateData.deadlineTime" />
+          <el-table-column show-overflow-tooltip label="周期" align="center" width="200" prop="templateData.cycle">
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.mk_periodic_unit"
+                :value="scope.row.templateData.cycle"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="维度" align="center" min-width="200" prop="templateData.dimensionalitys">
+            <template slot-scope="scope">
+              <div style="display:flex;">
+                <span v-for="o in scope.row.templateData.dimensionalitys">
+                  <dict-tag
+                    :options="dict.type.mk_dimensionality"
+                    :value="o.dimensionality"
+                    />
+                  </span>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="指标" align="center" min-width="200" prop="templateData.indexs">
+            <template slot-scope="scope">
+              <div style="display:flex;">
+                <span v-for="o in scope.row.templateData.indexs">
+                  <dict-tag
+                    :options="dict.type.mk_index_type"
+                    :value="o.target"
+                  />
+                </span>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="200" prop="createByName" />
+          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
+          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
+          <el-table-column fixed="right" label="操作" align="center" width="200">
+            <template slot-scope="scope">
+              <!-- <el-button type="text" size="mini" @click="useSubmit(scope.row)">提交</el-button> -->
+              <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
+              <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+          background
+          @size-change="useChangePageSize"
+          @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
+          :page-size="100"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="useSearch"/>
+  </div>
+</template>
+
+<script>
+import Add from './add.vue'
+import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+import { listTarget,delTarget } from "@/api/business/spd/starget/target";
+export default {
+  name: 'target',
+  dicts: [
+    "mk_periodic_unit","mk_dimensionality","mk_index_type"
+  ],
+  components: { Add,CollapseTransition},
+  data() {
+    return {
+      expanded: false,
+      // 页面配置
+      isList: true,
+      // 页面状态
+      page: '',
+      // 搜索框参数
+      queryParams: {
+        code: '',
+        name: '',
+        template:'',
+        year:'',
+        pageNum: 1,
+        pageSize: 10
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableList:[],
+      disable: false,
+      rowDetail:{},
+    }
+  },
+  created() {
+    this.getList(this.queryParams)
+  },
+  methods: {
+    //新增
+    useAdd(){
+      this.isList = false
+      this.page = 'add'
+      this.disable = false
+    },
+    //提交
+    useSubmit(){
+      
+    },
+    //修改
+    useEdit(row){
+      this.isList = false
+      this.page = 'edit'
+      this.rowDetail = row
+      this.disable = false
+    },
+    //删除
+    useDel(row){
+      this.$modal.confirm('确认删除选择数据').then(() => {
+        delTarget(row.id).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }).catch(() => {})
+    },
+    //查看
+    useSee(){
+
+    },
+    //选择列
+    useSelectionRow(){
+
+    },
+    //双击
+    useDoubleClick(row){
+      this.isList = false
+      this.page = 'see'
+      this.rowDetail = row
+      this.disable = false
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    //翻页
+    useCurrentChange(val){
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+    //搜索
+    useSearch() {
+      this.getList(this.queryParams)
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        code: '',
+        name: '',
+        template:'',
+        year:'',
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams)
+    },
+    //查询列表
+    getList(params){
+      listTarget(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+        }
+      })
+    },
+    drop() {
+      this.expanded = !this.expanded
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+#deliveryAddressList {
+  height: calc(100vh - 84px);
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.lines {
+  margin-top: 0;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 210 - 0
src/views/business/spd/target/targetMk/item.vue

@@ -0,0 +1,210 @@
+<template>
+  <div>
+    <el-row>
+      <div class="btn_add">
+        <el-button type="primary" size="mini" @click="useAdd" v-if="this.pageStu != 'see'">增行</el-button>
+      </div>
+    </el-row>
+    <!-- 渲染表头 -->
+    <el-table :data="items" style="width: 100%" height="500px">
+      <el-table-column label="序号" type="index" width="50" align="center" fixed>
+      </el-table-column>
+      <el-table-column show-overflow-tooltip v-for="head in headers" :prop="head.prop" :label="head.modelName" width="150" align="center">
+        <template slot-scope="scope">
+          <div v-if="pageStu == 'add' || pageStu == 'edit'">
+            <div v-if="scope.row[head.prop].type == 'D'">
+              <dr-popover-select 
+                size="mini" 
+                v-if="scope.row[head.prop].model == 'MK_TARGET_CYCLE_PARAM' || scope.row[head.prop].model == 'MK_TARGET_INDEX_PARAM'" 
+                v-model="scope.row[head.prop].valueName" 
+                title="参照选择" 
+                :type="scope.row[head.prop].model" 
+                :dataMapping="{
+                  value: 'id',
+                  valueName: 'name',
+                }" 
+                :source.sync="scope.row[head.prop]"
+                :queryParams="additionalCondition"
+              />
+              <dr-popover-select size="mini" v-else v-model="scope.row[head.prop].valueName" title="参照选择" :type="scope.row[head.prop].model" :dataMapping="{
+                value: 'id',
+                valueName: 'name',
+              }" :source.sync="scope.row[head.prop]"></dr-popover-select>
+            </div>
+            <div v-if="scope.row[head.prop].type == 'C' || scope.row[head.prop].type == 'I'">
+              <el-input size="mini"  v-model="scope.row[head.prop].value"></el-input>
+            </div>
+          </div>
+          <div v-else-if="pageStu == 'see'">
+            <div v-if="scope.row[head.prop].type == 'D'">
+              {{scope.row[head.prop].valueName}}
+            </div>
+            <div v-else>
+              {{scope.row[head.prop].value}}
+            </div>
+          </div>
+        </template>
+        <el-table-column show-overflow-tooltip v-if="head.children" v-for="headChi in head.children" :prop="headChi.prop" :label="headChi.modelName" width="150" align="center">
+          <template slot-scope="scope">
+            <div v-if="pageStu == 'add' || pageStu == 'edit'">
+              <el-input size="mini" v-model="scope.row[headChi.prop].value"></el-input>
+            </div>
+            <div v-else-if="pageStu == 'see'">
+              {{scope.row[headChi.prop].value}}
+            </div>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" align="center" width="100" v-if="this.pageStu != 'see'">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" @click="useDel(scope.$index, scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import { getTargetItem } from "@/api/business/spd/starget/target";
+
+export default {
+  name: 'item',
+  props: ['pageStu','template','form','columns','latestTemplate'],  
+  dicts: ['sys_yes_no','mk_periodic_unit','mk_dimensionality','mk_index_type','mk_expansion_mode'],
+  data() {
+    return {
+      items:[],
+      delItems:[],
+      headers:[],
+      itemTemplate:{},
+    }
+  },
+  async created() {
+    this.processHeadersData(this.template.unfold,this.columns);
+    this.itemTemplate = this.formatItem(this.columns);
+    console.log('this.itemTemplate',this.itemTemplate);
+    if(this.pageStu == 'edit' || this.pageStu == 'see'){
+      if(!this.latestTemplate){
+        await this.fetchTargetItem(this.form.id);
+      }
+    }
+  },
+  methods: {
+    //增行
+    useAdd(){
+      this.items.push(this.itemTemplate);
+    },
+    //删行
+    useDel(index){
+      this.items[index].delFlag = '2';
+      if(this.items[index].id){
+        let delList = this.items.filter(item => {
+          return item.delFlag == '2'
+        })
+        this.delItems.push(...delList);
+      }
+      this.items.splice(index, 1);
+    },
+    //表头数据处理
+    processHeadersData(unfold,columns){
+      const array = [];
+      if("cycle/unfold" == unfold){
+        for(let i in columns){
+          if(columns[i].type == 'D'){
+            columns[i].prop = columns[i].model
+            array.push(columns[i]);
+          }else{
+            const arr = array.filter(element => element.model == columns[i].superiors);
+            if(arr.length > 0){
+              columns[i].prop = array[array.length - 1].model + '-' + columns[i].model;
+              array[array.length - 1].children.push(columns[i]);
+            }else{
+              columns[i].prop = columns[i].superiors + '-' + columns[i].model;
+              let c = {
+                type:'C',
+                model:columns[i].superiors,
+                modelName:columns[i].superiorsName,
+                children:[columns[i]]
+              }
+              array.push(c);
+            }
+          }
+        }
+        this.headers = array;
+      }else if("cycle" == unfold){
+        for(let i in columns){
+          columns[i].prop = columns[i].model
+          if(columns[i].model == 'MK_TARGET_CYCLE_PARAM' || columns[i].model == 'MK_TARGET_INDEX_PARAM'){
+            columns[i].templateId = this.template.id
+          }
+          array.push(columns[i]);
+        }
+        this.headers = array;
+      }else if("unfold" == unfold){
+        for(let i in columns){
+          columns[i].prop = columns[i].model
+          if(columns[i].model == 'MK_TARGET_CYCLE_PARAM' || columns[i].model == 'MK_TARGET_INDEX_PARAM'){
+            columns[i].templateId = this.template.id
+          }
+          array.push(columns[i]);
+        }
+        this.headers = array;
+      }else if("" == unfold){
+        for(let i in columns){
+          columns[i].prop = columns[i].model
+          if(columns[i].model == 'MK_TARGET_CYCLE_PARAM' || columns[i].model == 'MK_TARGET_INDEX_PARAM'){
+            columns[i].templateId = this.template.id
+          }
+          array.push(columns[i]);
+        }
+        this.headers = array;
+      }
+      console.log('this.headers',this.headers);
+    },
+    //获取明细数据
+    async fetchTargetItem(id){
+      await getTargetItem(id).then(res => {
+        if (res.code === 200) {
+          this.items = res.rows
+        }
+      })
+    },
+    //格式化数据
+    formatItem(item){
+      let obj = {};
+      for(let i in item){
+        obj[item[i].prop] = item[i];
+      }
+      return obj;
+    },
+    //合并已存在和删除的数据
+    merge(){
+      this.items.push(...this.delItems);
+      return this.items;
+    },
+    //附加查询条件
+    additionalCondition(prop){
+      console.log("prop",prop);
+      return {
+        parame:{
+          templateId: prop.templateId
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btn_add{
+    margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: center;
+} 
+</style>

+ 131 - 0
src/views/business/spd/target/targetTemplate/add/columns.js

@@ -0,0 +1,131 @@
+import CONFIG from "@/config";
+
+export default function useColumns() {
+  const TableColumns = [
+    {
+      item: { key: "year", title: "年度", require: true },
+      attr: {
+        is: "el-date-picker",
+        type: "year",
+        valueFormat: "yyyy-MM-dd",
+      },
+    },
+    {
+      item: { key: "name", title: "模板名称", require: true },
+      attr: { is: "el-input" },
+    },
+    {
+      item: { key: "startTime", title: "开始日期", require: true },
+      attr: {
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd",
+      },
+    },
+    {
+      item: { key: "deadlineTime", title: "结束日期", require: true },
+      attr: {
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd",
+      },
+    },
+    {
+      item: { key: "cycle", title: "周期", require: true },
+      attr: {
+        is: "el-select",
+        dictName: "mk_periodic_unit",
+      },
+    },
+    {
+      item: { key: "unfold", title: "按列展开"},
+      attr: {
+        is: "el-select",
+        dictName: "mk_expansion_mode",
+        clearable: true,
+      },
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  const TabColumns = [
+    {
+      item: {
+        title: "指标",
+        key: "indexs",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "target", title: "指标", width: 'auto' },
+          attr: {
+            is: "el-select",
+            dictName: "mk_index_type",
+          },
+        },
+      ],
+    },
+    {
+      item: {
+        title: "维度",
+        key: "dimensionalitys"
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "dimensionality", title: "维度", width: 'auto' },
+          attr: {
+            is: "el-select",
+            dictName: "mk_dimensionality",
+          },
+        },
+      ],
+    },
+    {
+      item: {
+        title: "周期",
+        key: "cycles",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "name", title: "周期名称", require: true },
+          attr: { is: "el-input" },
+        },
+        {
+          item: {
+            key: "startTime",
+            title: "周期开始日期",
+            require: true,
+          },
+          attr: {
+            is: "el-date-picker",
+            // valueFormat: "yyyy-MM-dd",
+            // value: new Date(),
+          },
+        },
+        {
+          item: {
+            key: "deadlineTime",
+            title: "周期结束日期",
+            require: true,
+            width: 'auto'
+          },
+          attr: {
+            is: "el-date-picker",
+            // valueFormat: "yyyy-MM-dd",
+            // value: new Date(),
+          },
+        },
+      ],
+    },
+  ];
+
+  return { TableColumns, TabColumns };
+}

+ 453 - 0
src/views/business/spd/target/targetTemplate/add/index.vue

@@ -0,0 +1,453 @@
+<script>
+import useColumns from "./columns";
+import {
+  addTargetTemplate,
+  updateTargetTemplate,
+  getTargetTemplate,
+  checkQuote,
+} from "@/api/business/spd/starget/targetTemplate";
+export default {
+  name: "AddDrawer",
+  props: {
+    dict: {
+      type: Object,
+    },
+    selectData: {
+      type: Object,
+      require: true,
+    },
+    addType: {
+      type: String,
+      default: "add",
+    },
+  },
+  components: {
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+  },
+  data() {
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    return {
+      width: "100%",
+      visible: false,
+      loading: false,
+      rules: rules,
+      params: params,
+      tabName: tabName,
+      TabColumns: TabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+    title: {
+      get() {
+        const { addType } = this;
+        if (addType === "add") {
+          return "新 增";
+        }
+        if (addType === "edit") {
+          return "编 辑";
+        }
+      },
+      set() {},
+    },
+  },
+  watch: {},
+  methods: {
+    changePuOrgName(prop) {
+      console.log("changePuOrgName", prop);
+    },
+    changeMaterialName(prop) {
+      console.log("changeMaterialName", prop);
+    },
+
+    //查询目标模板详情
+    async fetchTemplate(prop) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await getTargetTemplate(prop);
+        if (code === 200) {
+          this.params = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //打开组件
+    async open() {
+      const { addType, selectData } = this.$props;
+      if (addType === "add") {
+        this.visible = true;
+        var date = new Date();
+        this.params.year = date.getFullYear() + '-' + '01' + '-' + '01';
+        this.params.startTime = date.getFullYear() + '-' + '01' + '-' + '01';
+        this.params.deadlineTime = date.getFullYear() + '-' + '12' + '-' + '31';
+        this.params.cycle = 'month';
+      }
+      if (addType === "edit") {
+        //校验目标模板是否存在引用
+        const { code, data } = await checkQuote(selectData.id);
+        if (code == "200") {
+          if (data) {
+            this.$modal.msgError("该目标模板存在引用,无法修改!");
+            this.visible = false;
+            return;
+          }
+        } else {
+          this.$modal.msgError("校验该目标模板是否存在引用异常,无法修改!");
+          this.visible = false;
+          return;
+        }
+        this.visible = await this.fetchTemplate(selectData.id);
+        this.params.indexs = this.params.indexs.map((item) => ({ ...item}));
+        this.params.dimensionalitys = this.params.dimensionalitys.map(
+          (item) => ({ ...item})
+        );
+        this.params.cycles = this.params.cycles.map((item) => ({ ...item}));
+        console.log("this.params",this.params);
+      }
+    },
+    //关闭页面
+    async hide() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.tabName = tabName;
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+    //增行
+    async useRowAdd(prop) {
+      const { TabColumns } = this;
+      const { TableColumns } = TabColumns.find(
+        ({ item: { key } }) => key === prop
+      );
+      this.params[prop].push({
+        delFlag: "0",
+        $index: new Date().getTime(),
+        ...this.$init.params(TableColumns),
+      });
+    },
+    //删行
+    async useRowRemove(prop, scope) {
+      // const { addType } = this.$props;
+      if (scope.row.id) {
+        this.params[prop].forEach(e => {
+          if(e.id == scope.row.id){
+            e.delFlag = '2'
+          }
+        });
+      }else{
+        this.params[prop] = this.params[prop].filter(item => item.$index != scope.row.$index);
+      }
+      console.log("this.params[prop]",this.params[prop]);
+    },
+    //确认
+    async useSubmit(prop) {
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+            const { addType } = this.$props;
+            let res = null;
+            if (addType === "add") {
+              res = await addTargetTemplate(this.params);
+            }
+            if (addType === "edit") {
+              res = await updateTargetTemplate(this.params);
+            }
+            if (res.code === 200) {
+              this.hide();
+              this.$emit("success");
+              this.$notify.success(res.msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    //保存并新增
+    useSaveAndAdd(prop){
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+            const { addType } = this.$props;
+            let res = null;
+            if (addType === "add") {
+              res = await addTargetTemplate(this.params);
+            }
+            if (addType === "edit") {
+              res = await updateTargetTemplate(this.params);
+            }
+            if (res.code === 200) {
+              this.$notify.success(res.msg);
+              this.params={};
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    //重置周期
+    useResetCycle(){
+      if(!this.params.startTime || !this.params.deadlineTime || !this.params.cycle){
+        this.$modal.msgError("开始日期、结束日期、周期不能存在空值!");
+        return;
+      }
+      if(this.params.startTime > this.params.deadlineTime){
+        this.$modal.msgError("开始日期不能大于结束日期!");
+        return;
+      }
+      this.params.cycles = [];
+      var cycles = [];
+      var start = new Date(this.params.startTime);
+      var deadline = new Date(this.params.deadlineTime);
+      start.setHours( 0, 0, 0);
+      deadline.setHours( 0, 0, 0);
+      if(this.params.cycle == 'period'){
+        cycles.push({
+          name:'目标期间',
+          startTime:start,
+          deadlineTime:deadline,
+        });
+      }else{
+        while(deadline >= start){
+          console.log(start);
+          if(this.params.cycle == 'day'){
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:start,
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+1);
+            start = new Date(start);
+          }
+          if(this.params.cycle == 'week'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+7),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+7);
+            start = new Date(start);
+          }
+          if(this.params.cycle == 'month'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+30),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+30);
+            start = new Date(start);
+          }
+          if(this.params.cycle == 'season'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+90),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+90);
+            start = new Date(start);
+          }
+        }
+      }
+      this.params.cycles = cycles;
+      console.log('this.params.cycles',this.params.cycles);
+    },
+    //日期名称格式化
+    formatDateTime(date, format) {
+      const o = {
+        'M+': date.getMonth() + 1, // 月份
+        'd+': date.getDate(), // 日
+        'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时
+        'H+': date.getHours(), // 小时
+        'm+': date.getMinutes(), // 分
+        's+': date.getSeconds(), // 秒
+        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+        S: date.getMilliseconds(), // 毫秒
+        a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午
+        A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM
+      };
+      if (/(y+)/.test(format)) {
+        format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+      }
+      for (let k in o) {
+        if (new RegExp('(' + k + ')').test(format)) {
+          format = format.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+          );
+        }
+      }
+      return format;
+    }
+  },
+  created() {
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-button v-bind="$attrs" v-on="$listeners" @click="open">
+    {{ title }}
+    <el-drawer
+      :size="width"
+      :title="title"
+      :visible.sync="visible"
+      append-to-body
+      destroy-on-close
+      @close="hide"
+    >
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <!-- <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+            @change="changePuOrgName({ ...scope, select: $event })"
+          >
+          </component
+        ></template> -->
+      </el-super-form>
+      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+        <el-tab-pane
+          v-for="({ item, TableColumns: columns }, index) in TabColumns"
+          :key="index"
+          :label="item.title"
+          :name="item.key"
+          lazy
+        >
+          <el-super-table
+            v-model="params[item.key]"
+            :dict="dict"
+            :ref="tabName"
+            :columns="columns"
+            :size="$attrs.size"
+          >
+            <!-- <template slot="materialName" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                @change="changeMaterialName(scope)"
+              >
+              </component>
+            </template> -->
+            <el-table-column fixed="right" label="操作" width="100">
+              <template slot="header" slot-scope="scope">
+                <el-button v-if="tabName == 'cycles'" type="primary" size="mini" @click="useResetCycle">重算周期</el-button>
+                <el-button
+                  v-else
+                  circle
+                  icon="el-icon-plus"
+                  :size="$attrs.size"
+                  @click="useRowAdd(tabName)"
+                >
+                </el-button>
+              </template>
+              <template slot-scope="scope">
+                <el-button
+                  v-if="tabName == 'indexs' || tabName == 'dimensionalitys'"
+                  circle
+                  icon="el-icon-minus"
+                  :size="$attrs.size"
+                  @click.native.prevent="useRowRemove(tabName, scope)"
+                >
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-super-table>
+        </el-tab-pane>
+      </el-tabs>
+      <div style="padding: 20px; text-align: right">
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+        <!-- <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSaveAndAdd('superForm')"
+          >保存并新增</el-button
+        > -->
+        <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit('superForm')"
+          >确 认</el-button
+        >
+      </div>
+    </el-drawer>
+  </el-button>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>

+ 38 - 0
src/views/business/spd/target/targetTemplate/columns.js

@@ -0,0 +1,38 @@
+import CONFIG from "@/config";
+
+export default function useColumns() {
+  const TableColumns = [
+    { item: { key: "year", title: "年度" }, attr: {} },
+    { item: { key: "name", title: "模板名称" }, attr: {} },
+    { item: { key: "startTime", title: "开始日期" }, attr: {} },
+    { item: { key: "deadlineTime", title: "结束日期" }, attr: {} },
+    {
+      item: { key: "cycle", title: "周期" },
+      attr: { is: "el-dict-tag", dictName: "mk_periodic_unit" },
+    },
+    {
+      item: { key: "unfold", title: "按列展开" },
+      attr: { is: "el-dict-tag", dictName: "mk_expansion_mode" },
+    },
+    { item: { key: "createByName", title: "创建人" }, attr: {} },
+    { item: { key: "createTime", title: "创建时间" }, attr: {} },
+    { item: { key: "updateByName", title: "修改人" }, attr: {} },
+    { item: { key: "updateTime", title: "修改时间" }, attr: {} },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, fixed: false },
+  }));
+  const SearchColumns = [
+    { item: { key: "year", title: "年度",},attr: {
+      is: "el-date-picker",
+      type: "year",
+      valueFormat: "yyyy-MM-dd",
+    }, },
+    { item: { key: "name", title: "模板名称"},attr: { is: "el-input" }, },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  return { TableColumns, SearchColumns };
+}

+ 74 - 0
src/views/business/spd/target/targetTemplate/delete/index.vue

@@ -0,0 +1,74 @@
+<script>
+import { delTargetTemplate,checkQuote, } from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: "DeleteDialog",
+  props: ['selectData'],
+  data() {
+    return {
+      title: "删 除",
+    };
+  },
+  watch: {},
+  methods: {
+    async open() {
+      const { selectData } = this.$props;
+      const { code, data } = await checkQuote(selectData.id);
+      if(code == '200'){
+        if(data){
+          this.$modal.msgError("该目标模板存在引用,无法删除!");
+          this.visible = false;
+          return;
+        }
+      }else{
+        this.$modal.msgError("校验该目标模板是否存在引用异常,无法删除!");
+        this.visible = false;
+        return;
+      }
+      this.$confirm(`是否删除数据项?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+        beforeClose: async (action, instance, done) => {
+          if (action === "confirm") {
+            instance.confirmButtonLoading = true;
+            instance.confirmButtonText = "执行中...";
+            try {
+              // try
+              const { msg, code } = await delTargetTemplate(selectData.id);
+              if (code === 200) {
+                done();
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              console.error(err);
+              instance.confirmButtonText = "确认";
+            } finally {
+              // finally
+              instance.confirmButtonLoading = false;
+            }
+          } else {
+            done();
+          }
+        },
+      })
+        .then(() => {})
+        .catch(() => {});
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    @click="open"
+  >
+    {{ title }}
+  </el-button>
+</template>

+ 14 - 0
src/views/business/spd/target/targetTemplate/dicts.js

@@ -0,0 +1,14 @@
+import { initDicts } from "@/utils/init.js";
+const modules = require.context("./", true, /columns.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 159 - 0
src/views/business/spd/target/targetTemplate/index.vue

@@ -0,0 +1,159 @@
+<script>
+import { dicts } from "./dicts";
+import useColumns from "./columns";
+import { listTargetTemplate } from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: "targettemplate",
+  dicts: dicts,
+  components: {
+    SeeButton: () => import("./see/index.vue"),
+    AddButton: () => import("./add/index.vue"),
+    DeleButton: () => import("./delete/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+  },
+  data() {
+    const { TableColumns, SearchColumns } = useColumns();
+    const params = this.$init.params(SearchColumns);
+    return {
+      size: "mini",
+      loading: false,
+      params: params,
+      tableData: [],
+      selectData: [],
+      SearchColumns: SearchColumns,
+      TableColumns: TableColumns,
+      page: { pageNum: 1, pageSize: 10, total: 0 },
+    };
+  },
+  created() {
+    console.log('this.$refs',this.$refs);
+    this.useQuery(this.params, this.page);
+  },
+  methods: {
+    async fetchList(prop, page) {
+      try {
+        this.loading = true;
+        const { code, rows, total } = await listTargetTemplate(
+          {...prop,...page}
+        );
+        if (code === 200) {
+          this.tableData = rows;
+          this.page.total = total;
+          console.log('this.tableData',this.tableData);
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    // 查 询
+    useQuery(prop, page) {
+      this.selectData = [];
+      this.fetchList(prop, page);
+    },
+    // 重 置
+    useReset() {
+      this.page.pageNum = 1;
+      this.page.pageSize = 10;
+      this.params = this.$init.params(this.SearchColumns);
+      this.useQuery(this.params, this.page);
+    },
+    // 选 择
+    useSelect(prop) {
+      this.selectData = prop;
+    },
+    // 明 细
+    async useSee(prop) {
+      const { open } = this.$refs.SeeButton;
+      await open([prop]);
+    },
+  },
+};
+</script>
+
+<template>
+  <el-card v-loading="loading" :body-style="{ padding: 0 }">
+    <el-super-search
+      v-model="params"
+      :size="size"
+      :dict="dict"
+      :columns="SearchColumns"
+      @reset="useReset"
+      @submit="useQuery(params, page)"
+    ></el-super-search>
+    <div style="margin: 0 0 20px 0; text-align: right">
+      <el-button-group>
+        <add-button
+          :size="size"
+          :select-data="[]"
+          :dict="dict"
+          add-type="add"
+          @success="useQuery(params, page)"
+        ></add-button>
+      </el-button-group>
+      <el-button-group>
+        <see-button
+          v-show="false"
+          :size="size"
+          :dict="dict"
+          :model="params"
+          :select-data="selectData"
+          ref="SeeButton"
+          @success="useQuery(params, page)"
+        ></see-button>
+      </el-button-group>
+    </div>
+    <el-super-table
+      v-model="tableData"
+      :size="size"
+      :dict="dict"
+      :columns="TableColumns"
+      stroage
+      hideOperationColumns
+      @row-dblclick="useSee"
+      @selection-change="useSelect"
+    >
+      <el-table-column fixed="right" label="操作" align="center" width="150">
+        <template slot-scope="scope">
+          <add-button
+          :size="size"
+          :dict="dict"
+          :select-data="scope.row"
+          add-type="edit"
+          @success="useQuery(params, page)"
+        ></add-button>
+        <dele-button
+          :size="size"
+          :select-data="scope.row"
+          @success="useQuery(params, page)"
+        ></dele-button>
+        </template>
+      </el-table-column>
+      <!-- <el-table-column fixed width="55" align="center" type="selection">
+      </el-table-column> -->
+    </el-super-table>
+    <pagination
+      :total="page.total"
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="useQuery(params, page)"
+      style="height: 32px; margin: 20px 0 0 0; padding: 0 !important"
+    />
+  </el-card>
+</template>
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 20px);
+  height: 100%;
+  margin: 10px;
+  padding: 20px;
+}
+.el-button-group + .el-button-group {
+  margin: 0 0 0 10px;
+}
+</style>

+ 110 - 0
src/views/business/spd/target/targetTemplate/see/columns.js

@@ -0,0 +1,110 @@
+import CONFIG from "@/config";
+
+export default function useColumns() {
+  const TableColumns = [
+    {
+      item: { key: "year", title: "年度" },
+      attr: {},
+    },
+    {
+      item: { key: "name", title: "模板名称" },
+      attr: {},
+    },
+    {
+      item: { key: "startTime", title: "开始日期" },
+      attr: {},
+    },
+    {
+      item: { key: "deadlineTime", title: "结束日期" },
+      attr: {},
+    },
+    {
+      item: { key: "cycle", title: "周期" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "mk_periodic_unit",
+      },
+    },
+    {
+      item: { key: "unfold", title: "按列展开" },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "mk_expansion_mode",
+      },
+    },
+    
+   
+  ];
+
+  const TabColumns = [
+    {
+      item: {
+        title: "指标",
+        key: "indexs",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "target", title: "指标" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "mk_index_type",
+          },
+        },
+      ],
+    },
+    {
+      item: {
+        title: "维度",
+        key: "dimensionalitys",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "dimensionality", title: "维度" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "mk_dimensionality",
+          },
+        },
+      ],
+    },
+    {
+      item: {
+        title: "周期",
+        key: "cycles",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "name", title: "周期名称", require: true },
+          attr: {},
+        },
+        {
+          item: {
+            key: "startTime",
+            title: "周期开始日期",
+            require: true,
+          },
+          attr: {},
+        },
+        {
+          item: {
+            key: "deadlineTime",
+            title: "周期结束日期",
+            require: true,
+          },
+          attr: {},
+        },
+      ],
+    },
+  ];
+
+  return { TableColumns, TabColumns };
+}

+ 170 - 0
src/views/business/spd/target/targetTemplate/see/index.vue

@@ -0,0 +1,170 @@
+<script>
+import useColumns from "./columns";
+import { getTargetTemplate } from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: "SeeDrawer",
+  components: {
+    ElSuperDescriptions: () =>
+      import("@/components/super-descriptions/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+  },
+  data() {
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+    return {
+      width: "50%",
+      column: 2,
+      title: "明 细",
+      visible: false,
+      loading: false,
+      params: {},
+      tabName,
+      TabColumns: TabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  props: {
+    dict: {
+      type: Object,
+    },
+    model: {
+      type: Object,
+    },
+    selectData: {
+      type: [Array],
+      require: true,
+    },
+  },
+  computed: {
+    disabled: {
+      get() {
+        const { selectData } = this;
+        if (selectData.length !== 1) {
+          return true;
+        }
+      },
+      set() {},
+    },
+  },
+  watch: {},
+  methods: {
+    //
+    async fetchTemplate(id) {
+      try {
+        this.loading = true;
+        const { code, data } = await getTargetTemplate(id);
+        if (code === 200) {
+          this.params = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
+    async open(prop) {
+      this.visible = await this.fetchTemplate(prop[0].id);
+    },
+    //
+    async hide() {
+      const {
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.tabName = tabName;
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    :disabled="disabled"
+    @click="open"
+  >
+    {{ title }}
+    <el-drawer
+      :size="width"
+      :title="title"
+      :visible.sync="visible"
+      append-to-body
+      @close="hide(selectData)"
+    >
+      <div
+        style="
+          z-index: 6666;
+          position: fixed;
+          right: 20px;
+          top: 50%;
+          transform: translateY(-50%);
+          display: flex;
+          flex-direction: column;
+        "
+      >
+        <el-button
+          :size="$attrs.size"
+          :disabled="params.$index === 1"
+          circle
+          icon="el-icon-top"
+          @click="fetchItem(params.$index - 1)"
+          style="margin: 0 0 10px 0"
+        ></el-button>
+        <el-button
+          :size="$attrs.size"
+          :disabled="params.$index === params.$total"
+          circle
+          icon="el-icon-bottom"
+          @click="fetchItem(params.$index + 1)"
+          style="margin: 0"
+        ></el-button>
+      </div>
+      <el-super-descriptions
+        v-model="params"
+        :dict="dict"
+        :column="column"
+        :size="$attrs.size"
+        :columns="TableColumns"
+      >
+      </el-super-descriptions>
+      <el-tabs v-model="tabName" :size="$attrs.size" style="margin: 10px">
+        <el-tab-pane
+          v-for="({ item, TableColumns: columns }, index) in TabColumns"
+          :key="index"
+          :name="item.key"
+          :label="item.title"
+          lazy
+        >
+          <el-super-table
+            v-model="params[item.key]"
+            :size="$attrs.size"
+            :dict="dict"
+            :columns="columns"
+          >
+          </el-super-table>
+        </el-tab-pane>
+      </el-tabs>
+    </el-drawer>
+  </el-button>
+</template>

+ 604 - 0
src/views/business/spd/task_management/visitingPlan/add.vue

@@ -0,0 +1,604 @@
+<template>
+  <div id="addPlanList">
+    <el-card>
+      <span>基本信息</span>
+      <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+              <el-form-item label="计划编码">
+                <el-input
+                  v-model="basicForm.planCode"
+                  size="mini"
+                  disabled
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="计划名称" prop="planName" :rules="{ required: true, message: '请填写名称', trigger: 'blur' }">
+              <el-input
+                v-model.trim="basicForm.planName"
+                size="mini"
+                :disabled="sonDisable"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+         </el-col>
+
+         <el-col :span="1.5">
+            <el-form-item label="执行人" prop="chargerName">
+                <el-select clearable size="mini" v-model="basicForm.chargerName" :disabled="sonDisable" @focus="choose('CONTACTS_PARAM', true, '执行人')" style="width: 200px">
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="开始时间" prop="startDate" :rules="{ required: true, message: '请选择开始时间', trigger: 'blur' }">
+              <el-date-picker
+                v-model="basicForm.startDate"
+                :disabled="sonDisable"
+                clearable
+                type="date"
+                value-format="yyyy-MM-dd"
+                @change="changePlanDate"
+                size="mini"
+                style="width: 200px"
+              >
+              </el-date-picker>
+            </el-form-item>
+         </el-col>
+
+         <el-col :span="1.5">
+            <el-form-item label="截止时间" prop="deadlineTime" :rules="{ required: true, message: '请选择截止时间', trigger: 'blur' }">
+              <el-date-picker
+                v-model="basicForm.deadlineTime"
+                :disabled="sonDisable"
+                clearable
+                type="date"
+                value-format="yyyy-MM-dd"
+                @change="changePlanDate"
+                size="mini"
+                style="width: 200px"
+              >
+              </el-date-picker>
+            </el-form-item>
+         </el-col>
+
+         <el-col :span="1.5">
+            <el-form-item label="销售区域" prop="marketingAreaName">
+              <el-select clearable v-model="basicForm.marketingAreaName" size="mini" :disabled="sonDisable" @focus="choose('MK_SALESAREA_PARAM', true, '销售区域')" style="width: 200px">
+                <el-option
+                  v-for="item in deptOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.code">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="部门" prop="deptName">
+              <el-select clearable v-model="basicForm.deptName" size="mini" :disabled="sonDisable" @focus="choose('DEPT_PARAM', true, '部门')" style="width: 200px">
+                <el-option
+                  v-for="item in deptOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.code">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="确认状态" prop="state">
+              <el-select disabled v-model="basicForm.state" size="mini" style="width: 200px">
+                <el-option v-for="dict in dict.type.mk_plan_state" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <span>明细信息</span>
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
+        </div>
+
+        <el-table 
+          :data="basicForm.mkBoPlanItemList" 
+          fit
+          max-height="300"
+          style="font-size: 12px;"
+          @selection-change="handleSelectionChange"
+          :cell-class-name="cellClassName"
+        >
+        <el-table-column show-overflow-tooltip type="selection"/>
+        <el-table-column show-overflow-tooltip label="序号" type="index" align="center"/>
+        <el-table-column show-overflow-tooltip label="计划编号" prop="planCode" width="150"/>
+        <el-table-column show-overflow-tooltip label="日期"  prop="date" width="230px">
+          <template slot-scope="scope">
+            <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'date'" :rules="{ required: true, message: '请填写日期', trigger: 'blur' }">
+              <el-date-picker
+                v-model="scope.row.date"
+                :readonly="sonDisable"
+                clearable
+                type="date"
+                size="mini"
+                value-format="yyyy-MM-dd"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column show-overflow-tooltip label="客户名称" prop="customerName" min-width="230">
+          <template slot-scope="scope">
+            <el-form-item class="hang">
+              <el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户')" style="width: 200px">
+                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230">
+          <template slot-scope="scope">
+            <el-form-item class="hang">
+              <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {})" style="width: 200px">
+                <el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column show-overflow-tooltip label="详细地址" prop="address" min-width="200">
+          <template slot-scope="scope">
+            <el-form-item class="hang">
+              <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.address"/>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200">
+          <template slot-scope="scope">
+            <el-form-item class="hang">
+              <el-select clearable v-model="scope.row.purpose" size="mini">
+                <el-option v-for=" dict in dict.type.mk_bo_behavior_goal" :key="dict.value" :label="dict.label" :value="dict.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column show-overflow-tooltip label="商机" prop="boName" min-width="200"/>
+        <el-table-column show-overflow-tooltip label="营销活动" prop="marketingCampaign" min-width="200">
+          <template slot-scope="scope">
+            <el-form-item class="hang">
+              <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.marketingCampaign"/>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+            fixed="right"
+            label="操作"
+            align="center"
+            >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+        </el-table>
+      </el-form>
+    </el-card>
+
+    <div class="btn_group">
+      <el-col :span="1.5">
+        <el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
+      </el-col>
+      <el-col :span="1.5" style="margin: 0 10px;">
+        <el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button size="mini" plain @click="back">返回</el-button>
+      </el-col>
+
+      <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+      <!-- <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" /> -->
+
+    </div>
+  </div>
+</template>
+
+<script>
+import {addPlan, getPlanDetail, editPlan} from '@/api/business/spd/task_management/visitingPlan/visitingPlan.js'
+import Refers from '@/components/Refers/refers.vue'
+// 用于回显参照框数据
+import {getRefer} from '@/api/purchase/basic.js'
+// 明细行选择物料参照
+import popDialog from '@/components/PopDialog/index.vue'
+export default {
+  name: 'addPlanList',
+  props: ['pageStu','row', 'disable'],
+  dicts: ['mk_plan_state', 'mk_bo_behavior_goal'],
+  components: {
+    Refers,
+    popDialog
+  },
+  model: {
+    prop: 'isList',
+    event: 'jugislist'
+  },
+  data() {
+    return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
+      dialog: {
+        config: false
+      },
+      basicForm: {
+        id: '',
+        planId: '',
+        planCode: '',
+        planName :'',
+        charger: '',
+        chargerName: '',
+        dept: '',
+        deptName: '',
+        startDate: '',
+        deadlineTime: '',
+        date: '',
+        marketingArea: '',
+        marketingAreaName: '',
+        state: '0',
+        customer: '',
+        customerName: '',
+        contact: '',
+        contactName: '',
+        address: '',
+        purpose: '',
+        bo: '',
+        boName: '',
+        marketingCampaign: '',
+        mkBoPlanItemList: []
+      },
+      delDemandItemList: [],
+      options: [{
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
+      }],
+      basicRules: {},
+      tableList: [],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: '',
+      },
+      // referCondition: {
+      //   type: '',
+      //   isPage: true,
+      //   title: '',
+      // },
+      tableIndex: null,
+      ids: [],
+      linkOptions: [],
+      manOptions: [],
+      personOptions: [],
+      deptOptions: [],
+      customerOptions: [],
+      pickerOptionsEnd: {
+        disabledDate: (time) => {
+          return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000
+        }
+      },
+      isBDXQ: false,
+      isYl: false,
+    }
+  },
+  updated() {},
+  mounted() {},
+  created() {
+    if(this.pageStu == 'check') {
+      console.log('数据', this.row)
+      this.getDetails(this.row)
+    } else if(this.pageStu == 'edit') {
+      this.getDetails(this.row)
+    }
+  },
+  methods:{
+    // 改变单据日期时清空子表的日期
+    changePlanDate() {
+      this.basicForm.mkBoPlanItemList.forEach(item => {
+        item.deliveryDate = null
+      })
+    },
+    // 清空
+    cleanYLSL(scope) {
+      scope.row.reservedQty = ''
+      scope.row.reservedPeriod = ''
+    },
+    handleData() {
+      console.log('222')
+      // 复制新增把id,编码,创建人置为空,子表去掉id
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+      this.basicForm.createBy = ''
+      this.basicForm.source = '4'
+      if (this.basicForm.mkBoPlanItemList.length !== 0) {
+        this.basicForm.mkBoPlanItemList.forEach(item => {
+          if (item.id) {
+            delete item.id
+          }
+          if (item.demandId) {
+            delete item.demandId
+          }
+          if (item.allotCode) {
+            delete item.allotCode
+          }
+        })
+      }
+    },
+    // 如果需要回显则调用详情接口
+    getDetails(row) {
+      getPlanDetail(row.id).then(res => {
+        if (res.code === 200) {
+          // console.log('res', res)
+          this.basicForm = res.data
+          for (let i = 0; i < this.basicForm.mkBoPlanItemList.length; i++) {
+            this.basicForm.mkBoPlanItemList[i].planCode = res.data.planCode
+          }
+          // console.log('this.basicForm.mkBoPlanItemList.planCode', this.basicForm.mkBoPlanItemList.planCode)
+        }
+      })
+    },
+    // getDetails(row) {
+    //   getPlanDetail(row.id).then(res => {
+    //     if (res.code === 200) {
+    //       // this.basicForm = res.data
+    //       console.log('res', res)
+    //       let reciveForm = res.data
+    //       let params = {...{id: row.id}, ...{pageNum:1, pageSize: 10}}
+    //       getPlanSonDetail(params.id).then(res => {
+    //         if (res.code === 200) {
+    //         reciveForm.mkBoPlanItemList = res.data
+    //         console.log('reciveForm',reciveForm)
+    //         this.basicForm = reciveForm
+    //         }
+    //       })
+    //     }
+    //   })
+    // },
+
+    async save() {
+      if(this.basicForm.mkBoPlanItemList.length !== 0) {
+        this.$refs['basic'].validate((valid) => {
+          if(valid) {
+            this.$modal.loading("保存中...");
+            if(this.sonPageStu == 'add') {
+              this.handleData()
+              addPlan(this.basicForm).then(res => {
+                console.log(333)
+                if (res.code === 200) {
+                  this.$modal.msgSuccess("保存成功");
+                  this.$modal.closeLoading();
+                  this.back()
+                }
+              }).catch(err => {
+                this.$modal.closeLoading();
+              })
+            } else if (this.sonPageStu == 'edit') {
+              let list = []
+              list.push(...this.basicForm.mkBoPlanItemList, ...this.delDemandItemList)
+              // 深拷贝一下参数对象
+              let param = JSON.parse(JSON.stringify(this.basicForm))
+              console.log('深拷贝对象',param);
+              param.mkBoPlanItemList = list
+              // this.basicForm.mkBoPlanItemList.push(...this.delDemandItemList)
+              editPlan(param).then(res => {
+                if (res.code === 200) {
+                  this.$modal.msgSuccess("编辑成功");
+                  this.$modal.closeLoading();
+                  this.back()
+                }
+              }).catch(err => {
+                this.$modal.closeLoading();
+              })
+            }
+          }
+        })
+      } else {
+        this.$modal.msgWarning("明细信息不能为空!");
+      }
+    },
+    submit() {
+      this.$modal.loading("提交中...");
+      submitDemand(this.basicForm).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("提交成功");
+          this.$modal.closeLoading();
+          this.back()
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 增行
+    addLine() {
+      const newLine = {
+        contacts: null,
+        id: null,
+        planId: null,
+        planCode: null,
+        date: null,
+        customer: null,
+        customerName: null,
+        contact: null,
+        contactName: null,
+        address: null,
+        purpose: null,
+        bo: null,
+        boName: null,
+        marketingCampaign: null,
+        tenantId: null,
+        revision: null,
+        createBy: null,
+        createByName: null,
+        createTime: null,
+        updateBy: null,
+        updateByName: null,
+        updateTime: null,
+        delFlag: 0,
+        // 新增字段
+        model: null,
+        storageCondition: null,
+        transportationCondition: null,
+      }
+      this.basicForm.mkBoPlanItemList.push(newLine)
+    },
+    delLine(index, row) {
+      console.log('删除行:', index)
+      console.log('改变行:', row)
+      // this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
+      //   return item.id !== row.id
+      // })
+      row.delFlag = '2'
+      // this.basicForm.mkBoPlanItemList.splice(index,1)
+      let delList = []
+      delList = this.basicForm.mkBoPlanItemList.filter(item => {
+        return item.delFlag == '2'
+      })
+      this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
+        return item.delFlag == '0'
+      })
+      this.delDemandItemList.push(...delList)
+      console.log('删除的数组',this.delDemandItemList)
+    },
+
+    back() {
+      this.$emit('jugislist', true)
+      // let queryParams = {
+      //   pageNum: 1,
+      //   pageSize: 10
+      // }
+      this.$emit('refresh')
+    },
+    // 单元格标红
+    cellClassName({row, column, rowIndex, columnIndex}) {
+      if(this.basicForm.isSpeical == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
+        return 'success-row';
+      }
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item =>{
+        return item.id
+      })
+      console.log('选中数组', this.ids)
+    },
+    // 回显参照框
+    reBackRefer(type, id, title) {
+      getRefer({type: type, id: id}).then(res => {
+        if(type == 'LINKMAN_PARAM') {
+          this.linkOptions = res.rows
+        }
+        if (type == 'CUSTOMER_PARAM_ZT') {
+          this.customerOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM') {
+          this.personOptions = res.rows
+        }
+        if (type == 'DEPT_PARAM') {
+          this.deptOptions = res.rows
+        }
+        if (type == 'MK_SALESAREA_PARAM') {
+          this.deptOptions = res.rows
+        }
+      })
+    },
+    // 基本信息选择参照带出数据
+    choose(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    // 明细行选择参照带出数据
+    chooseSon(index, type, isPage, title, parame) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.parame = parame
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if(this.referCondition.type == 'CUSTOMER_PARAM_ZT') {
+        this.customerOptions = selection
+        this.basicForm.mkBoPlanItemList[this.tableIndex].customer = selection[0].id
+        this.basicForm.mkBoPlanItemList[this.tableIndex].customerName = selection[0].name
+      }
+      if(this.referCondition.type == 'CONTACTS_PARAM') {
+        this.personOptions = selection
+        this.basicForm.charger = selection[0].id
+        this.basicForm.chargerName = selection[0].name
+      }
+      if(this.referCondition.type == 'MK_SALESAREA_PARAM') {
+        this.personOptions = selection
+        this.basicForm.marketingArea = selection[0].id
+        this.basicForm.marketingAreaName = selection[0].name
+      }
+      if(this.referCondition.type == 'DEPT_PARAM') {
+        this.deptOptions = selection
+        this.basicForm.dept = selection[0].id
+        this.basicForm.deptName = selection[0].name
+      }
+      if(this.referCondition.type == 'LINKMAN_PARAM') {
+        this.linkOptions = selection
+        this.basicForm.mkBoPlanItemList[this.tableIndex].contact = selection[0].id
+        this.basicForm.mkBoPlanItemList[this.tableIndex].contactName = selection[0].name
+      }
+    },
+    // tableRowClassName({ row, rowIndex }) {
+    //   row.index = rowIndex;
+    // },
+    // rowClick(row){
+    //   this.tableIndex = row.index;
+    //   console.log("row.index",row.index);
+    // }
+  }
+}
+
+</script>
+
+<style lang="scss" scoped>
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: center;
+} 
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
+.el-table ::v-deep .el-form-item__error{
+  padding-top: 0;
+  top: 70%
+}
+.el-table ::v-deep .success-row {
+  background: #f11616;
+}
+</style>

+ 658 - 0
src/views/business/spd/task_management/visitingPlan/index.vue

@@ -0,0 +1,658 @@
+<template>
+  <div id="PlanList">
+    <div v-if="isList">
+      <el-card>
+        <el-form class="search_area" label-width="100px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="计划编码">
+                <el-input
+                  v-model.trim="queryParams.planCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="计划名称">
+                <el-input
+                  v-model.trim="queryParams.planName"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="1.5">
+              <el-form-item label="线路类型">
+                <el-select clearable size="mini" v-model="queryParams.type" @focus="chooseOrg('CONTACTS_PARAM', true, '线路类型')" style="width: 200px">
+                  <el-option v-for="item in typeOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+            </el-col> -->
+            <el-col :span="1.5">
+              <el-form-item label="执行人">
+              <el-select clearable size="mini" v-model="queryParams.chargerName" @focus="chooseOrg('CONTACTS_PARAM', true, '执行人')" style="width: 200px">
+                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+              </el-select>
+              </el-form-item>
+            </el-col>
+                            
+            <el-col :span="1.5">
+              <el-form-item label="确认状态">
+                <el-select clearable v-model="queryParams.state" size="mini" style="width: 200px">
+                  <el-option v-for=" dict in dict.type.mk_plan_state" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+              <el-button type="primary" size="mini" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <CollapseTransition>
+            <div v-show="expanded">
+              <el-row :gutter="10">
+                <el-col :span="1.5">
+                  <el-form-item label="开始时间">
+                    <el-date-picker
+                    v-model="queryParams.startDate"
+                    type="date"
+                    clearable
+                    value-format="yyyy-MM-dd"
+                    size="mini"
+                    style="width: 200px"
+                    >
+                    </el-date-picker>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="1.5">
+                  <el-form-item label="截止时间">
+                    <el-date-picker
+                    v-model="queryParams.deadlineTime"
+                    type="date"
+                    clearable
+                    value-format="yyyy-MM-dd"
+                    size="mini"
+                    style="width: 200px"
+                    >
+                    </el-date-picker>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="1.5">
+                  <el-form-item label="销售区域">
+                    <el-select clearable v-model="queryParams.marketingAreaName" size="mini" @focus="chooseOrg('DEPT_PARAM', true, '销售区域')" style="width: 200px">
+                      <el-option
+                        v-for="item in deptOptions"
+                        :key="item.id"
+                        :label="item.name"
+                        :value="item.id">
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="1.5">
+                  <el-form-item label="部门">
+                    <el-select clearable v-model="queryParams.deptName" size="mini" @focus="chooseOrg('DEPT_PARAM', true, '部门')" style="width: 200px">
+                      <el-option
+                        v-for="item in deptOptions"
+                        :key="item.id"
+                        :label="item.name"
+                        :value="item.id">
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+          </CollapseTransition>
+        </el-form>
+
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+  
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
+
+          <!-- <el-dropdown size="mini" @command="handleCommand">
+            <el-button size="mini" type="primary" style="margin-left: 10px;">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="数据导入">数据导入</el-dropdown-item>
+            <el-dropdown-item command="模板下载">模板下载</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown> -->
+
+          <el-dropdown size="mini" @command="handleExport">
+            <el-button size="mini" type="primary" style="margin: 0 10px;">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="选中导出">选中导出</el-dropdown-item>
+            <el-dropdown-item command="全部导出">全部导出</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+
+          <el-button type="primary" size="mini" @click="delItems">删除</el-button>
+          <!-- <el-button type="primary" size="mini">打印</el-button> -->
+        </div>
+
+        <el-table 
+        :data="tableList" 
+        fit
+        max-height="550"
+        style="font-size: 12px;"
+        @selection-change="handleSelectionChange"
+        >
+          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip label="计划编码" align="center" min-width="200" prop="planCode"/>
+          <el-table-column show-overflow-tooltip label="计划名称" align="center" min-width="150" prop="planName"/>
+          <el-table-column show-overflow-tooltip label="执行人" align="center" min-width="150" prop="chargerName"/>
+          <el-table-column show-overflow-tooltip label="部门" align="center" min-width="150" prop="deptName"/>
+          <el-table-column show-overflow-tooltip label="开始时间" align="center" min-width="120" prop="startDate" />
+          <el-table-column show-overflow-tooltip label="截止时间" align="center" min-width="120" prop="deadlineTime" />
+          <el-table-column show-overflow-tooltip label="单据状态" align="center" min-width="120" prop="state" :formatter="formatterStatus"/>
+          <el-table-column
+          fixed="right"
+          label="操作"
+          align="center"
+          width="180"
+          >
+            <template slot-scope="scope">
+              <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
+              <el-button type="text" size="mini" v-if="scope.row.state == '0'" @click="edit(scope.row)">编辑</el-button>
+              <el-button type="text" size="mini" v-if="scope.row.state == '0'" @click="commit(scope.row)">提交</el-button>
+              <el-button type="text" size="mini" @click="deleteids(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+        background
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="queryParams.pageNum"
+        :page-sizes="[10, 15, 20]"
+        :page-size="100"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+
+    <!-- 用户导入对话框 -->
+    <el-dialog title="数据导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :on-error="errorFile"
+      :auto-upload="false"
+      drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <!-- <div class="el-upload__tip" slot="tip">
+          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+        </div> -->
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 模板下载新增参数 -->
+    <el-dialog title="需求模板下载" :visible.sync="download.open" @close="clearDownload" width="400px">
+
+    <el-row style="margin-bottom: 20px;">
+      <span style="margin-right: 10px;">需求客户</span>
+      <el-select clearable size="mini" v-model="download.customer" @clear="download.customer = ''" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')">
+       <el-option v-for="item in mBcustomer" :key="item.id" :label="item.name" :value="item.code" />
+      </el-select>
+    </el-row>
+
+    <!-- <el-row style="margin-bottom: 20px;">
+      <span style="margin-right: 10px;">供应仓库</span>
+      <el-select clearable size="mini" v-model="download.warehouse" @clear="cleanMb" @focus="chooseOrg('WAREHOUSE_PARAM', true, '选择仓库')">
+        <el-option v-for="item in mBwarehouse" :key="item.id" :label="item.name" :value="item.code" />
+      </el-select>
+    </el-row> -->
+
+    <el-row style="margin-bottom: 20px;">
+      <span style="margin-right: 10px;">供应货位</span>
+      <el-select clearable size="mini" v-model="download.cargoSpace" @clear="download.cargoSpace = ''" @focus="mbHuowei('ALLOCATION_PARAM', true, '选择货位', download.warehouseId)">
+        <el-option v-for="item in mBcargoSpace" :key="item.id" :label="item.name" :value="item.code" />
+      </el-select>
+    </el-row>
+
+    <el-row style="margin-bottom: 20px;">
+      <span style="margin-right: 10px;">品类选择</span>
+      <el-select
+      v-model="download.category"
+      size="mini"
+      clearable
+      @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
+      >
+       <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.code" />
+      </el-select>
+    </el-row>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button size="mini" type="primary" @click="mbDownload">模板下载</el-button>
+      <el-button size="mini" @click="download.open = false">取 消</el-button>
+    </div>
+    </el-dialog>
+
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
+  </div>
+</template>
+
+<script>
+// 导入的token
+import { getToken } from "@/utils/auth";
+import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
+import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+import {getPlanList, delPlan, downLoadDemand, exportPlan, submitPlan } from '@/api/business/spd/task_management/visitingPlan/visitingPlan.js'
+export default {
+  name: 'PlanLise',
+  components: {
+    Add,
+    CollapseTransition,
+    Refers,
+    TreeRefers
+  },
+  dicts: ['mk_plan_state'],
+  data() {
+    return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/pu/demand/import"
+      },
+      // 模板下载参数
+      download: {
+        open: false,
+        customer: '',
+        warehouse: '',
+        warehouseId: '',
+        cargoSpace: '',
+        category: ''
+      },
+      mBcustomer: [],
+      mBwarehouse: [],
+      mBcargoSpace: [],
+      classOptions: [],
+      // 下拉收起配置
+      expanded: false,
+      // 页面配置
+      isList: true,
+      // 页面状态
+      page: '',
+      queryParams: {
+        planCode: '',
+        planName: '',
+        charger: '',
+        chargerName: '',
+        dept: '',
+        deptName: '',
+        startDate: '',
+        deadlineTime: '',
+        type: '',
+        state: '',
+        marketingArea: '',
+        marketingAreaName: '',
+        pageNum: 1,
+        pageSize: 10
+      },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
+      options: [{
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
+      }],
+      customerOptions: [],
+      personOptions: [],
+      deptOptions: [],
+      tableList: [],
+      total: 0,
+      rowDetail: {},
+      disable: false,
+      ids: []
+    }
+  },
+  created() {
+    this.getList(this.queryParams)
+  },
+  methods: {
+    // 格式化表格内容
+    formatterStatus(row) {
+      switch(row.state){
+        case '0':
+          return '未确认'
+        case '1':
+          return '已确认'
+        case '2':
+          return '作废'
+      }
+    },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        planCode: '',
+        planName: '',
+        charger: '',
+        chargerName: '',
+        dept: '',
+        deptName: '',
+        startDate: '',
+        deadlineTime: '',
+        type: '',
+        state: '',
+        marketingArea: '',
+        marketingAreaName: '',
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams)
+    },
+    getList(params){
+      getPlanList(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+          console.log(res, 'res-------')
+        }
+      })
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.ids = selection.map(item => item.id)
+      console.log('选中数组', this.ids.join())
+    },
+    mbDownload() {
+      downLoadDemand(this.download).then(res => {
+        console.log('下载的文件流', res)
+        const blob = new Blob([res], {
+          type: "application/vnd.ms-excel;charset=UTF-8",
+        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+        const downloadElement = document.createElement("a"); //创建a标签
+        const href = window.URL.createObjectURL(blob); // 创建下载的链接
+        // var temp = res.headers["content-disposition"]; 
+        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+        // var name = fileName.split(";")[0]; //切割成文件名
+        downloadElement.href = href;  //下载地址
+        downloadElement.download = '模板'; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
+        this.download.open = false
+      })
+    },
+    // 关闭模板下载弹窗清空参数
+    clearDownload() {
+      // 模板下载参数
+      this.download =  {
+        open: false,
+        customer: '',
+        warehouse: '',
+        warehouseId: '',
+        cargoSpace: '',
+        category: ''
+      }
+    },
+    handleCommand(command) {
+      // alert(command)
+      if(command == '模板下载') {
+        this.download.open = true
+      }
+      if (command == '数据导入') {
+        this.upload.title = "用户导入"
+        this.upload.open = true
+      }
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList(this.queryParams);
+    },
+    errorFile(err) {
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    handleExport(command) {
+      if(command == '选中导出') {
+        if (this.ids.length == 0) {
+          this.$modal.msgWarning("请选中至少一条数据");
+        } else {
+          let param = {all: false, ids: this.ids}
+          exportPlan(param).then(res => {
+            const blob = new Blob([res], {
+              type: "application/vnd.ms-excel;charset=UTF-8",
+            });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+            const downloadElement = document.createElement("a"); //创建a标签
+            const href = window.URL.createObjectURL(blob); // 创建下载的链接
+            // var temp = res.headers["content-disposition"]; 
+            // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+            // var name = fileName.split(";")[0]; //切割成文件名
+            downloadElement.href = href;  //下载地址
+            downloadElement.download = '选中导出'; // 下载后文件名
+            document.body.appendChild(downloadElement);
+            downloadElement.click(); // 点击下载
+            document.body.removeChild(downloadElement); // 下载完成移除元素
+            window.URL.revokeObjectURL(href); // 释放blob对象
+          })
+        }
+      } else {
+        let param2 = {all: true}
+        exportPlan(param2).then(res => {
+          const blob = new Blob([res], {
+            type: "application/vnd.ms-excel;charset=UTF-8",
+          });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+          const downloadElement = document.createElement("a"); //创建a标签
+          const href = window.URL.createObjectURL(blob); // 创建下载的链接
+          // var temp = res.headers["content-disposition"]; 
+          // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+          // var name = fileName.split(";")[0]; //切割成文件名
+          downloadElement.href = href;  //下载地址
+          downloadElement.download = '全部导出'; // 下载后文件名
+          document.body.appendChild(downloadElement);
+          downloadElement.click(); // 点击下载
+          document.body.removeChild(downloadElement); // 下载完成移除元素
+          window.URL.revokeObjectURL(href); // 释放blob对象
+        })
+      }
+    },
+    addDivision() {
+      this.isList = false
+      this.page = 'add'
+      this.disable = false
+    },
+    check(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    edit(row) {
+      this.isList = false
+      this.page = 'edit'
+      this.rowDetail = row
+      this.disable = false
+    },
+    commit(row) {
+      console.log('row', row)
+      this.$modal.loading("提交中...");
+      submitPlan(row).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("提交成功");
+          this.$modal.closeLoading();
+          this.getList(this.queryParams)
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 行内删除
+    deleteids(row) {
+      console.log('row', row)
+      this.$modal.confirm('确定删除选择数据?').then(() => {
+        delPlan(row.id).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }).catch(() => {})
+    },
+    // 批量删除按钮
+    delItems() {
+      if(this.ids.length == 0) {
+        this.$modal.msgWarning("请选中至少一条数据");
+      } else {
+        let param = this.ids.join()
+        this.$modal.confirm('确认信息').then(() => {
+        delPlan(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+        }).catch(() => {})
+      }
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+    drop() {
+      this.expanded = !this.expanded
+    },
+    // 搜索区参照选择
+    chooseOrg(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      // 搜索区选择客户
+      if (this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '需求客户') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      // 模板内选择客户
+      if (this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '选择客户') {
+        this.mBcustomer = selection
+        this.download.customer = selection[0].code
+      }
+      // 模板内选择仓库
+      if (this.referCondition.type == 'WAREHOUSE_PARAM' && this.referCondition.title == '选择仓库') {
+        this.mBwarehouse = selection
+        this.download.warehouse = selection[0].code
+        this.download.warehouseId = selection[0].id
+      }
+      // 模板内选择货位
+      if (this.referCondition.type == 'ALLOCATION_PARAM' && this.referCondition.title == '选择货位') {
+        this.mBcargoSpace = selection
+        this.download.cargoSpace = selection[0].code
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.personOptions = selection
+        this.queryParams.charger = selection[0].name
+        this.queryParams.chargerName = selection[0].name
+      }
+      if (this.referCondition.type == 'DEPT_PARAM') {
+        this.deptOptions = selection
+        this.queryParams.demandDept = selection[0].id
+      }
+    },
+    // 搜索区树形选择
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.download.category = selection.code
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+#PlanLise {
+  height: calc(100vh - 84px);
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.lines {
+  margin-top: 0;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 490 - 213
src/views/material/basicFile/details.vue

@@ -2,85 +2,105 @@
 <template>
   <div class="material-details" v-loading="loading">
     <!-- 操作栏 -->
-    <!-- 基本信息栏 -->
-    <div v-if="activeMainTab == 'material'">
-
-      <!-- 基本信息修改状态下—— 保存、保存新增、更新导入、取消 -->
-      <el-row :gutter="10" class="mb10" v-if="updateButtonGroup || maintainNewVersion">
-        <el-col :span="1.5">
-          <el-button-group>
-            <el-button size="small" @click="handleSave"
-                       v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
-              保存
-            </el-button>
-          </el-button-group>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-button-group>
-            <el-button size="small" @click="handleCancel">取消</el-button>
-          </el-button-group>
-        </el-col>
-      </el-row>
-
-      <el-row :gutter="10" class="mb10" v-else>
-        <!-- 新增、修改、删除、复制 -->
-        <el-col :span="1.5">
-          <el-button-group>
-            <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
-            <el-button size="small" @click="handleBasicEdit">修改</el-button>
-            <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
-            <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
-          </el-button-group>
-        </el-col>
-
-        <!-- 查询、刷新、过滤 -->
-        <el-col :span="1.5">
-          <el-button-group>
-
-            <el-button size="small" @click="handleRefresh">刷新</el-button>
-
-          </el-button-group>
-        </el-col>
-
-        <!-- 启用 -->
+  
+    <el-card>
+      <!-- 基本信息栏 -->
+      <div style="display: flex;justify-content: end;">
+      <div v-if="activeMainTab == 'material'">
+  
+        <!-- 基本信息修改状态下—— 保存、保存新增、更新导入、取消 -->
+        <el-row 
+          v-if="updateButtonGroup || maintainNewVersion"
+          :gutter="10" 
+          class="mb10" 
+          type="flex"
+          justify="end"
+        >
+          <el-col :span="1.5">
+            <el-button-group>
+              <el-button size="small" @click="handleSave"
+                         v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
+                保存
+              </el-button>
+            </el-button-group>
+          </el-col>
+  
+          <el-col :span="1.5">
+            <el-button-group>
+              <el-button size="small" @click="handleCancel">取消</el-button>
+            </el-button-group>
+          </el-col>
+        </el-row>
+  
+        <el-row 
+          v-else
+          :gutter="10" 
+          class="mb10" 
+          type="flex"
+          justify="end" 
+        >
+          <!-- 新增、修改、删除、复制 -->
+          <el-col :span="1.5">
+            <el-button-group>
+              <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
+              <el-button size="small" @click="handleBasicEdit">修改</el-button>
+              <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
+              <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
+            </el-button-group>
+          </el-col>
+  
+          <!-- 查询、刷新、过滤 -->
+          <el-col :span="1.5">
+            <el-button-group>
+  
+              <el-button size="small" @click="handleRefresh">刷新</el-button>
+  
+            </el-button-group>
+          </el-col>
+  
+          <!-- 启用 -->
+          <el-col :span="1.5">
+            <el-button-group>
+              <el-button size="small" @click="handleMaterialType">维护物料类别</el-button>
+              <el-button size="small" @click="handleIsInvoke" :key="count" v-hasPermi="['system:material:add']">
+                <!-- 0:启用  2:停用 -->
+                {{ basicData.value.isEnable == '已启用' ? '停用' : '启用' }}
+              </el-button>
+            </el-button-group>
+          </el-col>
+  
+          <!-- 维护新版本 -->
+          <el-col :span="1.5">
+            <el-button-group>
+              <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本
+              </el-button>
+            </el-button-group>
+          </el-col>
+  
+        </el-row>
+  
+  
+      </div>
+  
+      <!-- 其他标签页操作  修改、删除 -->
+      <el-row 
+        :gutter="10" 
+        class="mb10" 
+        v-show="activeMainTab != 'material'"
+        type="flex"
+        justify="end"
+      >
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" @click="handleMaterialType">维护物料类别</el-button>
-            <el-button size="small" @click="handleIsInvoke" :key="count" v-hasPermi="['system:material:add']">
-              <!-- 0:启用  2:停用 -->
-              {{ basicData.value.isEnable == '已启用' ? '停用' : '启用' }}
-            </el-button>
+            <el-button size="small" @click="handleOtherEdit('table')">修改</el-button>
+            <el-button size="small" v-show="activeMainTab != 'material_finance'" @click="handleOtherDel">删除</el-button>
           </el-button-group>
-        </el-col>
-
-        <!-- 维护新版本 -->
-        <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本
-            </el-button>
+            <el-button size="small" @click="handleOtherListRefresh">刷新</el-button>
           </el-button-group>
         </el-col>
-
       </el-row>
 
-
-    </div>
-
-    <!-- 其他标签页操作  修改、删除 -->
-    <el-row :gutter="10" class="mb10" v-show="activeMainTab != 'material'">
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" @click="handleOtherEdit('table')">修改</el-button>
-          <el-button size="small" v-show="activeMainTab != 'material_finance'" @click="handleOtherDel">删除</el-button>
-        </el-button-group>
-        <el-button-group>
-          <el-button size="small" @click="handleOtherListRefresh">刷新</el-button>
-        </el-button-group>
-      </el-col>
-    </el-row>
-
-    <el-card>
       <!-- 返回   切换   附件管理 -->
       <el-row type="flex" justify="space-between">
         <el-col :span="6">
@@ -88,22 +108,12 @@
           <el-button size="small" @click="handleBack" :disabled="updateButtonGroup">返回</el-button>
         </el-col>
         <el-col :span="6" style="text-align: right;">
-          <!-- 附件管理 -->
-          <!-- <el-button-group> <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button></el-button-group> -->
-
-          <!-- 切换 -->
-          <!-- <el-button-group>
-            <el-button size="small" icon="el-icon-d-arrow-left" :disabled="!handleBasicEdit"
-              @click="handleChangePage('first')" />
-            <el-button size="small" icon="el-icon-arrow-left" :disabled="!handleBasicEdit"
-              @click="handleChangePage('pre')" />
-            <el-button size="small" icon="el-icon-arrow-right" :disabled="!handleBasicEdit"
-              @click="handleChangePage('next')" />
-            <el-button size="small" icon="el-icon-d-arrow-right" :disabled="!handleBasicEdit"
-            @click="handleChangePage('end')" /></el-button-group> -->
+          
         </el-col>
       </el-row>
 
+    </div>
+    
       <div class="md-content">
         <el-form :inline="true" label-position="right" :model="basicData.value">
           <!-- <el-form-item label="所属组织"></el-form-item> -->
@@ -138,7 +148,7 @@
                 >
 
                   <el-row :gutter="10">
-                    <el-col :span="8" v-for="f in basicData.form" style="text-align: right;">
+                    <el-col :span="6" v-for="f in basicData.form" style="text-align: right;">
                       <template v-if="f.show">
 
                         <!-- 多选框 -->
@@ -241,14 +251,21 @@
 
                 <!-- 其他展示为列表 -->
                 <el-table v-else 
+                  border
                   :data="mainMsg.value" 
                   @cell-dblclick="handleMaindbClick"
                   @selection-change="handleMainChange"
                   >
                   <el-table-column type="selection" width="55"/>
                   <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center"/>
-                  <el-table-column v-for="m in  mainMsg.form" v-if="m.show" :label="m.name" align="center"
-                                   :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" show-overflow-tooltip>
+                  <el-table-column 
+                    v-for="m in  mainMsg.form" 
+                    v-if="m.show" 
+                    :label="m.name" 
+                    align="center"
+                    :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" 
+                    show-overflow-tooltip
+                  >
                     <template slot-scope="scope">
                       {{ m.attribute == 'select' ? scope.row[`${m.prop}Name`] :
                       (m.attribute == 'checkbox' ?
@@ -279,7 +296,7 @@
                     >
 
                       <el-row :gutter="10">
-                        <el-col :span="8" v-for="m in medcineData.form" style="text-align: right;">
+                        <el-col :span="6" v-for="m in medcineData.form" style="text-align: right;">
 
                           <!-- 需要根据基本信息中的是否医药物料字段判断是否可以填写 -->
                           <template v-if="m.show">
@@ -350,7 +367,7 @@
                     <!-- 其他展示为列表 -->
 
                     <!-- 辅计量 -->
-                    <el-table v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
+                    <el-table border v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
                               class="material-table">
                       <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55"
                                        align="center"/>
@@ -367,7 +384,7 @@
                     </el-table>
 
                     <!-- 辅助属性 -->
-                    <el-table v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
+                    <el-table border v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
                               class="material-table">
                       <el-table-column type="index" v-if="propertyDetail.form.length" label="序号" width="55"
                                        align="center"/>
@@ -418,11 +435,24 @@
     </el-card>
 
     <!-- 维护物料类别弹窗 -->
-    <el-dialog title="物料类别维护" :visible.sync="materialType.show" :before-close="handleCloseTypeDetails"
-               :close-on-press-escape="false" :close-on-click-modal="false" width="80%" center class="materialType">
+    <el-dialog 
+      title="物料类别维护" 
+      :visible.sync="materialType.show" 
+      :before-close="handleCloseTypeDetails"
+      :close-on-press-escape="false" 
+      :close-on-click-modal="false" 
+      width="80%" 
+      center 
+      class="materialType"
+    >
 
       <!-- 操作按钮 -->
-      <el-row :gutter="10" class="mb10">
+      <el-row 
+        :gutter="10" 
+        class="mb10" 
+        type="flex"
+        justify="end"
+      >
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('add')">增行
@@ -441,8 +471,16 @@
         </el-col>
       </el-row>
       <!-- 表格数据 -->
-      <el-table :data="materialType.value" stripe style="width: 100%" max-height="350" v-loading="materialType.loading"
-                :key="refer" @selection-change="handleSelectionType">
+      <el-table 
+        border
+        :data="materialType.value" 
+        stripe 
+        style="width: 100%" 
+        max-height="350" 
+        v-loading="materialType.loading"
+        :key="refer" 
+        @selection-change="handleSelectionType"
+      >
         <el-table-column type="selection" width="30"/>
         <el-table-column type="index" width="50" label="序号"/>
         <el-table-column v-for="mt in materialType.form" v-if="mt.show" :label="mt.name" width="180">
@@ -494,10 +532,16 @@
       :close-on-press-escape="false"
       :close-on-click-modal="false"
       class="otherDialog"
+     
     >
-      <div v-loading="otherDeatils.loading">
+      <div  v-loading="otherDeatils.loading">
         <!-- 其他标签页操作  修改、删除 -->
-        <el-row :gutter="10" class="mb10">
+        <el-row 
+          :gutter="10" 
+          class="mb10" 
+          type="flex"
+          justify="end"
+        >
           <el-col :span="1.5" v-if="!otherDeatils.isEdit">
             <el-button-group>
               <el-button size="small" @click="handleOtherEdit('form')">修改</el-button>
@@ -616,8 +660,15 @@
     </el-dialog>
 
     <!-- 参照弹窗 -->
-    <el-dialog :title="MoreDataDialog.msg.name" :visible.sync="MoreDataDialog.show" width="70%" class="MoreDataDialog"
-               :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
+    <el-dialog 
+      :title="MoreDataDialog.msg.name" 
+      :visible.sync="MoreDataDialog.show" 
+      width="70%" 
+      class="MoreDataDialog"
+      :close-on-press-escape="false" 
+      :close-on-click-modal="false" 
+      :before-close="handleCloseRefer"
+    >
       <div>
         <el-row>
           <el-col :span="1.5">
@@ -625,22 +676,40 @@
           </el-col>
         </el-row>
         <!-- 树形 -->
-        <el-tree class="referTree" v-loading="MoreDataDialog.loading" v-if="MoreDataDialog.type == 'tree'"
-                 :data="MoreDataDialog.list" @node-click="handleNodeClick" :key="refer"
-                 :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" node-key="id">
+        <el-tree 
+          class="referTree" 
+          v-loading="MoreDataDialog.loading" 
+          v-if="MoreDataDialog.type == 'tree'"
+          :data="MoreDataDialog.list" 
+          @node-click="handleNodeClick" 
+          :key="refer"
+          :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" 
+          node-key="id"
+        >
         </el-tree>
         <!-- queryMedcineItemDrug -->
         <!-- 列表 -->
         <div v-else>
-          <el-table :data="MoreDataDialog.list" v-loading="MoreDataDialog.loading" style="width: 100%"
-                    @row-click="handleCurentRow" highlight-current-row>
+          <el-table  
+            border 
+            :data="MoreDataDialog.list"
+            v-loading="MoreDataDialog.loading" 
+            style="width: 100%"
+            @row-click="handleCurentRow" 
+            highlight-current-row
+          >
             <el-table-column type="index" label="序号" width="55" align="center"/>
             <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name"/>
           </el-table>
 
-          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                         :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
-                         layout="total, sizes, prev, pager, next, jumper" :total="queryParams.total">
+          <el-pagination 
+            @size-change="handleSizeChange" 
+            @current-change="handleCurrentChange"
+            :current-page="queryParams.pageNum" 
+            :page-sizes="[10, 20, 50, 100]"
+            layout="total, sizes, prev, pager, next, jumper" 
+            :total="queryParams.total"
+          >
           </el-pagination>
         </div>
 
@@ -1190,7 +1259,6 @@
         console.log(type, id, '查询其他标签页列表详情');
         this.otherDeatils.form = this.mainMsg.form;
         console.log(this.otherDeatils.form, 'this.otherDeatils.form');
-        this.otherDeatils.loading = true;
         switch (type) {
           // 财物信息
           case 'material_finance':
@@ -1221,82 +1289,146 @@
         }
       },
       // 查询财务信息详情
-      getFinanceDetails(id) {
-        materialApi.financeDetails(id).then(res => {
-          this.otherDeatils.loading = false;
-          let _this = this;
-          console.log('查询财务信息详情', res);
-          if (res.code == 200) {
-            this.otherDeatils.value = res.data.data;
-            // _this.handleAddReferLabel('otherDeatils');
+      async getFinanceDetails(id) {
+        
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,data} = await materialApi.financeDetails(id);
+
+            if (code == 200) {
+
+            this.otherDeatils.value = data.data;
+
           }
-        })
+
+        } catch (error) {}
+        finally{
+          setTimeout(()=>{
+
+            this.otherDeatils.loading = false;
+          },200)
+        }
       },
       // 获取利润中心详情
-      getCenterDetails(id) {
-        let _this = this;
-        materialApi.centerDetails(id).then(res => {
-          this.otherDeatils.loading = false;
-          console.log(res, '获取利润中心详情');
-          if (res.code == 200) {
-            this.otherDeatils.value = res.data.data;
-            // _this.handleAddReferLabel('otherDeatils');
+      async getCenterDetails(id) {
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,data} = await materialApi.centerDetails(id);
+
+            if (code == 200) {
+
+            this.otherDeatils.value = data.data;
+
           }
-        })
+
+        } catch (error) {}
+        finally{
+          setTimeout(()=>{
+
+            this.otherDeatils.loading = false;
+          },200)
+        }
       },
       // 获取采购详细信息详情
-      getPurchaseDetails(id) {
-        let _this = this;
-        materialApi.purchaseDetails(id).then(res => {
-          this.otherDeatils.loading = false;
-          console.log(res, '获取采购详细信息详情');
-          if (res.code == 200) {
-            this.otherDeatils.value = res.data.data;
-            // _this.handleAddReferLabel('otherDeatils');
+      async getPurchaseDetails(id) {
+       
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,data} = await materialApi.purchaseDetails(id);
+
+            if (code == 200) {
+
+            this.otherDeatils.value = data.data;
+
           }
-        })
+
+        } catch (error) {}
+        finally{
+          setTimeout(()=>{
+
+            this.otherDeatils.loading = false;
+          },200)
+        }
       },
       // 获取成本信息详情
-      getCostDetails(id) {
-        let _this = this;
-        materialApi.costDetails(id).then(res => {
-          this.otherDeatils.loading = false;
-          console.log(res, '获取成本信息详情');
-          if (res.code == 200) {
-            this.otherDeatils.value = res.data.data;
-            // _this.handleAddReferLabel('otherDeatils');
+      async getCostDetails(id) {
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,data} = await materialApi.costDetails(id);
+
+            if (code == 200) {
+
+            this.otherDeatils.value = data.data;
+
           }
-        })
+
+        } catch (error) {}
+        finally{
+        setTimeout(()=>{
+
+          this.otherDeatils.loading = false;
+        },200)
+        }
       },
       // 获取计划信息详情
-      getPlanDetails(id) {
-        let _this = this;
-        materialApi.planDetails(id).then(res => {
-          this.otherDeatils.loading = false;
-          console.log(res, '获取计划信息详情');
-          if (res.code == 200) {
-            this.otherDeatils.value = res.data.data;
-            // _this.handleAddReferLabel('otherDeatils');
+      async getPlanDetails(id) {
+
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,data} = await materialApi.planDetails(id);
+
+            if (code == 200) {
+
+            this.otherDeatils.value = data.data;
+
           }
-        })
-      },
-      // 获取库存详细信息详情
-      getInventoryDetails(id) {
-        let _this = this;
-        materialApi.inventoryDetails(id).then(res => {
+
+        } catch (error) {}
+        finally{
+          setTimeout(()=>{
+
           this.otherDeatils.loading = false;
-          console.log(res, '获取库存详细信息详情');
-          if (res.code == 200) {
-            this.otherDeatils.value = res.data.data;
-            // _this.handleAddReferLabel('otherDeatils');
+        },200)
+        }
+
+      },
+      //  
+      async getInventoryDetails(id) {
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,data} = await materialApi.inventoryDetails(id);
+
+            if (code == 200) {
+
+            this.otherDeatils.value = data.data;
+
           }
-        })
+
+        } catch (error) {}
+        finally{
+          setTimeout(()=>{
+
+          this.otherDeatils.loading = false;
+          },200)
+        }
       },
 
 
       /* 二级标签页 */
       // 根据物料id获取医药行业信息详细信息
-      getMedcineDetails(id) {
+      async getMedcineDetails(id) {
         let _this = this;
         console.log(id);
         materialApi.medcineDetailsInfo(id).then((res) => {
@@ -1402,14 +1534,15 @@
 
       // 新增
       handleInster() {
-        this.$message({
+        this.$notify({
+          title: '警告',
           message: '物料只能通过申请审批增加,不能在节点直接录入!',
           type: 'warning'
         });
       },
       // 除基本信息之后的修改
       handleOtherEdit(type) {
-        debugger
+        // debugger
         console.log('除基本信息之后的修改', type);
         if ('table' === type) {
           if (this.mainMsg.checkedList.length == 1) {
@@ -1422,7 +1555,8 @@
             // 查询其他标签页列表详情
             this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
           } else {
-            this.$message({
+            this.$notify({
+              title: '警告',
               message: '修改请选择单个数据!',
               type: 'warning'
             });
@@ -1476,10 +1610,11 @@
               break;
           }
         } else {
-          this.$message({
-            message: '请选择需要删除的数据!',
-            type: 'warning'
-          });
+          this.$notify({
+              title: '警告',
+              message: '请选择需要删除的数据!',
+              type: 'warning'
+            });
         }
       },
       // 其他标签页刷新
@@ -1621,7 +1756,8 @@
             _this.maintainNewVersion = res.data.result;
             // 维护版本消息展示 by shiy 2023/05/31
             if (!res.data.result) {
-              this.$message({
+              this.$notify({
+                title: '警告',
                 message: res.data.msg,
                 type: 'warning'
               });
@@ -1675,7 +1811,11 @@
               this.handleRefresh();
             })
           } else {
-            this.$message.error('存在必填项未填写');
+            this.$notify.error({
+              title: '错误',
+              message: '存在必填项未填写!'
+            });
+            
             console.log('error submit!!');
             return false;
           }
@@ -1721,10 +1861,12 @@
                 })
               })
             } else {
-              this.$message({
+              this.$notify({
+                title: '警告',
                 message: '请选择需要删除的信息!',
                 type: 'warning'
               });
+              
             }
             break;
           // 取消
@@ -1754,10 +1896,12 @@
                 })
                 // 保存
               } else {
-                this.$message({
-                  message: '不能保存空数据或存在数据为空!',
-                  type: 'warning'
-                });
+                this.$notify({
+                title: '警告',
+                message: '不能保存空数据或存在数据为空!',
+                type: 'warning'
+              });
+                
               }
             } else {
               // 非编辑状态
@@ -1769,10 +1913,11 @@
           default:
             console.log('物料类别刷新');
             if (this.materialType.isEdit) {
-              this.$message({
+              this.$notify({
+                title: '警告',
                 message: '请先保存数据!',
                 type: 'warning'
-              })
+              });
             } else {
               this.materialType.loading = true;
               this.getTagList('material_medcine_item', (form) => {
@@ -1788,10 +1933,11 @@
       handleCloseTypeDetails(done) {
 
         console.log('物料类别弹窗关闭前');
-        this.materialType.isEdit ? this.$message({
-          message: '请先保存数据!',
-          type: 'warning'
-        }) : done();
+        this.materialType.isEdit ? this.$notify({
+                title: '警告',
+                message: '请先保存数据!',
+                type: 'warning'
+              }): done();
 
       },
       // 保存修改并新增
@@ -1844,11 +1990,13 @@
         console.log('其他页签详情弹窗关闭事件');
         // 处于编辑状态
         if (this.otherDeatils.isEdit) {
-          this.$message({
+          this.$notify({
+            title: '警告',
             message: '请先退出编辑操作',
             type: 'warning'
           });
         } else {
+          this.handleOtherListRefresh();
           done();
         }
       },
@@ -1974,7 +2122,8 @@
               let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
               console.log(drug, 'drug------------------------------------');
               if (drug.length) {
-                _this.$message({
+                _this.$notify({
+                  title: '警告',
                   message: '不能维护相同的物料类别!',
                   type: 'warning'
                 });
@@ -2088,64 +2237,189 @@
         })
       },
       // 保存财务信息——单个数据
-      handleSaveFinance(data) {
+      async handleSaveFinance(data) {
+
         console.log(data, '保存财务信息——单个数据');
-        materialApi.financeEdit(data).then(res => {
-          if (res.code == 200) {
+        try {
+
+          this.otherDeatils.loading = true;
+
+          let {code,msg} = await materialApi.financeEdit(data);
+
+          if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
+            this.$notify({
+              title: '成功',
+              message: msg,
+              type: 'success'
+            });
           }
-        })
+        } catch (error) {
+        }finally{
+          this.otherDeatils.loading = false;
+        }
+
+
+        // this.otherDeatils.loading = true;
+        // materialApi.financeEdit(data).then(res => {
+        //   if (res.code == 200) {
+        //     this.otherDeatils.isEdit = false;
+        //     this.handleOtherRefresh();
+        //   }
+        //   this.otherDeatils.loading = false;
+        // })
       },
       // 保存利润中心信息
-      handleSaveCenter(data) {
+      async handleSaveCenter(data) {
         console.log(data, '保存利润中心信息');
-        materialApi.centerEdit(data).then(res => {
-          if (res.code == 200) {
+        try {
+          
+          this.otherDeatils.loading = true;
+          
+          let {code,msg} = await materialApi.centerEdit(data);
+
+          if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
+            this.$notify({
+              title: '成功',
+              message: msg,
+              type: 'success'
+            });
           }
-        })
+
+        } catch (error) {}
+        finally{
+          this.otherDeatils.loading = false;
+        }
+        // materialApi.centerEdit(data).then(res => {
+        //   if (res.code == 200) {
+        //     this.otherDeatils.isEdit = false;
+        //     this.handleOtherRefresh();
+        //   }
+        // })
       },
       // 保存采购信息
-      handleSavePurchase(data) {
+      async handleSavePurchase(data) {
         console.log(data, '保存采购信息');
-        materialApi.purchaseEdit(data).then(res => {
-          if (res.code == 200) {
+        try {
+          
+          this.otherDeatils.loading = true;
+          
+          let {code,msg} = await materialApi.purchaseEdit(data);
+
+          if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
+            this.$notify({
+              title: '成功',
+              message: msg,
+              type: 'success'
+            });
           }
-        })
+
+        } catch (error) {}
+        finally{
+          this.otherDeatils.loading = false;
+        }
+        // materialApi.purchaseEdit(data).then(res => {
+        //   if (res.code == 200) {
+        //     this.otherDeatils.isEdit = false;
+        //     this.handleOtherRefresh();
+        //   }
+        // })
       },
       // 保存库存信息
-      handleSaveInventoryEdit(data) {
+      async handleSaveInventoryEdit(data) {
         console.log(data, '保存库存信息');
-        materialApi.inventoryEdit(data).then(res => {
-          if (res.code == 200) {
+        try {
+          
+          this.otherDeatils.loading = true;
+          
+          let {code,msg} = await materialApi.inventoryEdit(data);
+
+          if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
+            this.$notify({
+              title: '成功',
+              message: msg,
+              type: 'success'
+            });
           }
-        })
+
+        } catch (error) {}
+        finally{
+          this.otherDeatils.loading = false;
+        }
+       
+        // materialApi.inventoryEdit(data).then(res => {
+        //   if (res.code == 200) {
+        //     this.otherDeatils.isEdit = false;
+        //     this.handleOtherRefresh();
+        //   }
+        // })
       },
       // 保存计划信息
-      handleSavePlan(data) {
+      async handleSavePlan(data) {
         console.log(data, '保存计划信息');
-        materialApi.planEdit(data).then(res => {
-          if (res.code == 200) {
+        try {
+          
+          this.otherDeatils.loading = true;
+          
+          let {code,msg} = await materialApi.planEdit(data);
+
+          if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
+            this.$notify({
+              title: '成功',
+              message: msg,
+              type: 'success'
+            });
           }
-        })
+
+        } catch (error) {}
+        finally{
+          this.otherDeatils.loading = false;
+        }
+        // materialApi.planEdit(data).then(res => {
+        //   if (res.code == 200) {
+        //     this.otherDeatils.isEdit = false;
+        //     this.handleOtherRefresh();
+        //   }
+        // })
       },
       // 保存成本信息
-      handleSaveCost(data) {
+      async handleSaveCost(data) {
         console.log(data, '保存成本信息');
-        materialApi.costEdit(data).then(res => {
-          if (res.code == 200) {
+        try {
+          
+          this.otherDeatils.loading = true;
+          
+          let {code,msg} = await materialApi.costEdit(data);
+
+          if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
+            this.$notify({
+              title: '成功',
+              message: msg,
+              type: 'success'
+            });
           }
-        })
+
+        } catch (error) {}
+        finally{
+          this.otherDeatils.loading = false;
+        }
+        // materialApi.costEdit(data).then(res => {
+        //   if (res.code == 200) {
+        //     this.otherDeatils.isEdit = false;
+        //     this.handleOtherRefresh();
+        //   }
+        // })
       },
 
       judgeIsRequriedByProps(message){
@@ -2311,11 +2585,13 @@
 <style lang="scss">
   .material-details {
     padding: 12px;
-    height: calc(100vh - 158px);
+    height: 100%;
+    // height: calc(100vh - 158px);
     box-sizing: border-box;
 
     .el-card__body {
-      height: calc(100vh - 160px);
+      height: calc(100vh - 40px);
+      // height: 100%;
       box-sizing: border-box;
       padding: 12px;
       overflow-y: auto;
@@ -2345,7 +2621,7 @@
           }
 
           .el-form {
-            max-height: 200px;
+            max-height: 350px;
             overflow-y: auto;
             overflow-x: hidden;
 
@@ -2517,6 +2793,7 @@
   .od-msg >>> .el-checkbox__label {
     width: 85%;
     box-sizing: border-box;
+    
   }
 
 

+ 90 - 68
src/views/material/basicFile/index.vue

@@ -3,9 +3,51 @@
 <template>
   <div class="material-basic" v-loading="failLoad">
 
-    <!-- 操作栏 -->
-    <div>
-      <el-row :gutter="10" class="mb10">
+    <!-- 主体列表 -->
+    <el-card class="material-list" v-loading="loading">
+
+      <!-- 操作栏 -->
+    <div style="margin: 0 0 10px 0;">
+      <!-- 查询条件 -->
+      <el-row :gutter="10">
+        <el-col :span="1.5">
+          <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
+            <el-form-item label="物料编码">
+              <el-input size="small" v-model="queryForm.code" placeholder="物料编码" clearable></el-input>
+            </el-form-item>
+            <el-form-item label="物料名称">
+              <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
+            </el-form-item>
+            <el-form-item label="启用状态">
+              <!-- 0=已启用,2=已停用 -->
+              <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
+                <el-option key="0" label="已启用" value="0"></el-option>
+                <el-option key="2" label="已停用" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="是否同步NC">
+              <!-- 是否同步;2=否,0=是 -->
+              <el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
+                <el-option key="0" label="是" value="0"></el-option>
+                <el-option key="2" label="否" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item>
+              <el-button size="small" type="primary" @click="handleQuery">搜 索</el-button>
+              <el-button size="small" @click="handleResetQuery">重 置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+
+      </el-row>
+    </div>
+      <el-row 
+        :gutter="10" 
+        class="mb10"
+        type="flex"
+        justify="end"
+      >
         <!-- 新增、修改、删除、复制 -->
         <el-col :span="1.5">
           <el-button-group>
@@ -58,50 +100,26 @@
 
       </el-row>
 
-      <!-- 查询条件 -->
-      <el-row :gutter="10">
-        <el-col :span="1.5">
-          <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
-            <el-form-item label="物料编码">
-              <el-input size="small" v-model="queryForm.code" placeholder="物料编码" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="物料名称">
-              <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
-            </el-form-item>
-            <el-form-item label="启用状态">
-              <!-- 0=已启用,2=已停用 -->
-              <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
-                <el-option key="0" label="已启用" value="0"></el-option>
-                <el-option key="2" label="已停用" value="2"></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="是否同步NC">
-              <!-- 是否同步;2=否,0=是 -->
-              <el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
-                <el-option key="0" label="是" value="0"></el-option>
-                <el-option key="2" label="否" value="2"></el-option>
-              </el-select>
-            </el-form-item>
-
-            <el-form-item>
-              <el-button size="small" type="primary" @click="handleQuery">查询</el-button>
-              <el-button size="small" @click="handleResetQuery">重置</el-button>
-            </el-form-item>
-          </el-form>
-        </el-col>
-
-      </el-row>
-    </div>
-
-    <!-- 主体列表 -->
-    <el-card class="material-list" v-loading="loading">
-      <el-table :data="taskList" ref="materialTable" @cell-dblclick="handledbClick" :row-key="getRowKey"
-                @selection-change="handleSelectionChange" @select="handleSelect" @select-all="handleSelectAll">
+      <el-table 
+        border 
+        :data="taskList" 
+        ref="materialTable" 
+        @cell-dblclick="handledbClick" 
+        :row-key="getRowKey"
+        @selection-change="handleSelectionChange" 
+        @select="handleSelect" 
+        @select-all="handleSelectAll"
+      >
         <!--  -->
-        <el-table-column type="selection" width="30" :reserve-selection="true"/>
+        <el-table-column type="selection" width="45" :reserve-selection="true"/>
         <el-table-column type="index" label="序号" width="55" align="center"/>
-        <el-table-column width="150" v-for="h in  tableHeader" v-if="h.show" :label="h.name" align="center"
-                         show-overflow-tooltip>
+        <el-table-column 
+          width="150" 
+          v-for="h in  tableHeader" v-if="h.show" 
+          :label="h.name" 
+          align="center"
+          show-overflow-tooltip
+        >
           <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
           <template slot-scope="scope">
             {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
@@ -113,9 +131,14 @@
         </el-table-column>
       </el-table>
 
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                     :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
-                     layout="total, sizes, prev, pager, next, jumper" :total="total">
+      <el-pagination 
+        @size-change="handleSizeChange" 
+        @current-change="handleCurrentChange"
+        :current-page="queryParams.pageNum" 
+        :page-sizes="[10, 20, 50, 100]"
+        layout="total, sizes, prev, pager, next, jumper" 
+        :total="total"
+      >
       </el-pagination>
     </el-card>
 
@@ -210,7 +233,8 @@
       },
       // 新增
       handleInster() {
-        this.$message({
+        this.$notify({
+          title: '警告',
           message: '物料只能通过申请审批增加,不能在节点直接录入!',
           type: 'warning'
         });
@@ -225,7 +249,8 @@
             }
           });
         } else {
-          this.$message({
+          this.$notify({
+            title: '警告',
             message: `${this.checkedList.length > 1 ? '修改只能选择单个数据!' : '请选择需要修改的信息!'}`,
             type: 'warning'
           });
@@ -246,8 +271,9 @@
             }
           })
         } else {
-          this.$message({
-            message: '请选择需要删除的数据!',
+          this.$notify({
+            title: '警告',
+            message: `请选择需要删除的数据!`,
             type: 'warning'
           });
         }
@@ -358,21 +384,23 @@
                       })
                     }
                   }
-                  this.$message({
+                  this.$notify({
                     message: res.data.msg,
                     type: res.data.flag ? 'warning' : 'success'
                   });
+                  
                 } else {
-                  this.$message({
+                  this.$notify({
                     message: res.msg,
                     type: res.code == 200 ? 'success' : 'warning'
                   });
                 }
               })
             } else {
-              this.$message({
+              this.$notify({
+                title:'警告',
                 message: '请上传文件之后在确认!',
-                type: 'warning'
+                type: 'warning',
               });
             }
             break;
@@ -401,10 +429,11 @@
           }
           this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
         } else {
-          this.$message({
-            message: '请选择需要导出的数据!',
-            type: 'warning'
-          });
+          this.$notify({
+                title:'警告',
+                message: '请选择需要导出的数据!',
+                type: 'warning'
+              });
         }
 
       },
@@ -536,8 +565,7 @@
 
 <style lang="scss">
   .material-list {
-    // height: calc(100% - 100px);
-    height: calc(100% - 70px);
+    height: calc(100vh - 70px);
 
 
     .el-card__body {
@@ -545,17 +573,11 @@
       box-sizing: border-box;
 
       .el-table {
-        height: calc(100% - 35px);
         overflow: auto;
 
         .el-table__body-wrapper {
-          // height: calc(100% - 150px);
-          height: calc(100% - 70px);
           overflow-y: auto !important;
           overflow-x: auto !important;
-          // .el-table__body {
-          //   height: 100%;
-          // }
         }
       }
     }

+ 1 - 1
src/views/material/basicFile/style/index.scss

@@ -1,6 +1,6 @@
 // 物料信息基础档案
 .material-basic {
-  height: calc(100vh - 84px);
+  // height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
 

+ 0 - 825
src/views/material/changeApply/add.vue

@@ -1,825 +0,0 @@
-<template>
-  <div class="apply_add">
-    <el-tabs type="border-card" v-model="tabValue" @tab-click="handleClick">
-      <el-tab-pane label="基本信息" name="first">
-        <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="170px">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="单据编码" prop="code">
-                <el-input disabled v-model="basicForm.code"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="所属组织" prop="orgId">
-                <el-input disabled v-model="basicForm.orgId"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="物料编码" prop="materialCode">
-                <el-input readonly :disabled="disable" v-model="basicForm.materialCode">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="物料名称" prop="materialName">
-                <el-input :disabled="disable" v-model="basicForm.materialName"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="医药物料" prop="medicineMaterial">
-                <el-select v-model="basicForm.medicineMaterial" placeholder="医药物料" clearable :disabled="disable"
-                           @change="controlMedic">
-                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="生产许可证" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="规格" prop="specification">
-                <el-input :disabled="disable" v-model="basicForm.specification"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="型号" prop="model">
-                <el-input :disabled="disable" v-model="basicForm.model"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="生产厂家/代理人" prop="factory">
-                <el-select ref="factoryOrman" v-model="basicForm.factory" placeholder="生产厂家/代理人" clearable
-                           :disabled="disable" @focus="chooseFactory">
-                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id"/>
-                </el-select>
-                <!-- <el-input :disabled="disable" v-model="basicForm.factory">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
-                </el-input> -->
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="注册人/上市许可持有人" prop="registrant">
-                <el-input :disabled="disable" v-model="basicForm.registrant"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="存储条件" prop="storageConditions">
-                <el-select v-model="basicForm.storageConditions" placeholder="存储条件" clearable :disabled="disable">
-                  <el-option v-for="dict in dict.type.sys_storage_condition" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="运输条件" prop="transportCondition">
-                <el-select v-model="basicForm.transportCondition" placeholder="运输条件" clearable :disabled="disable">
-                  <el-option v-for="dict in dict.type.sys_conditions_carriage" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <!--            <el-col :span="8">-->
-            <!--              <el-form-item label="交货周期" prop="leadTime">-->
-            <!--                <el-input type="number" min="0" :disabled="disable" v-model="basicForm.leadTime"></el-input>-->
-            <!--              </el-form-item>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="8">-->
-            <!--              <el-form-item label="业务线" prop="businessLine"-->
-            <!--                            :rules="{ required: isOneClass, message: '骨科、介入、检验、普耗、设备类物料产线必须输入对应的业务线', trigger: 'blur' }">-->
-            <!--                <el-select ref="lines" v-model="basicForm.businessLine" placeholder="请选择" clearable :disabled="disable"-->
-            <!--                           @focus="chooseLine">-->
-            <!--                  <el-option v-for="item in lineOptions" :key="item.id" :label="item.name" :value="item.id"/>-->
-            <!--                </el-select>-->
-            <!--              </el-form-item>-->
-            <!--            </el-col>-->
-            <!--            <el-col :span="8">-->
-            <!--              <el-form-item label="物料分类" prop="materialClassifyId">-->
-            <!--                <el-input readonly :disabled="disable" v-model="basicForm.fourClass">-->
-            <!--                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>-->
-            <!--                </el-input>-->
-            <!--                <el-input v-show="false" readonly :disabled="disable" v-model="basicForm.materialClassifyId"></el-input>-->
-            <!--              </el-form-item>-->
-            <!--            </el-col>-->
-            <el-col :span="8">
-              <el-form-item label="DI码" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.diCode"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="备注" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.remark"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="一级分类" prop="oneClass">
-                <el-input readonly disabled v-model="basicForm.oneClass"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="二级分类" prop="twoClass">
-                <el-input readonly disabled v-model="basicForm.twoClass"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="三级分类" prop="threeClass">
-                <el-input readonly disabled v-model="basicForm.threeClass"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="四级分类" prop="fourClass">
-                <el-input readonly disabled v-model="basicForm.fourClass">
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </el-tab-pane>
-
-      <el-tab-pane label="医药属性" name="second">
-        <el-form :model="basicForm2" ref="basic2" label-width="160px">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="药品" prop="drug"
-                            :rules="{ required: !isControl, message: '请选择是否药品', trigger: 'blur' }">
-                <el-select v-model="basicForm2.drug" placeholder="请选择" clearable :disabled="disable || isControl">
-                  <el-option v-for="dict in dict.type.sys_medicine" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="注册证号/备案凭证编号" prop="registrationNo">
-                <el-input :disabled="disable || isControl" v-model="basicForm2.registrationNo"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="医疗器械" prop="medicalDevices">
-                <el-select v-model="basicForm2.medicalDevices" placeholder="请选择" clearable
-                           :disabled="disable || isControl">
-                  <el-option v-for="dict in dict.type.medical_instruments" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="养护类型" prop="maintenanceType">
-                <el-select v-model="basicForm2.maintenanceType" placeholder="请选择" clearable
-                           :disabled="disable || isControl">
-                  <el-option v-for="dict in dict.type.curing_type" :key="dict.value" :label="dict.label"
-                             :value="dict.value"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="剂型" prop="dosageFrom"
-                            :rules="{ required: !isControl, message: '请选择剂型', trigger: 'blur' }">
-                <el-select ref="doses" v-model="basicForm2.dosageFrom" placeholder="请选择" clearable
-                           :disabled="disable || isControl" @focus="chooseDose">
-                  <el-option v-for="item in doseOptions" :key="item.id" :label="item.name" :value="item.id"/>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <!-- <el-row style="margin-bottom: 12px;">
-          <span>物料类别</span>
-        </el-row>
-        <el-row style="margin-bottom: 12px;">
-          <el-button type="primary" size="small" plain @click="addLine">新增</el-button>
-          <el-button type="primary" size="small" plain @click="handleDelete">删除</el-button>
-          <el-button type="primary" size="small" plain @click="testsave">暂存</el-button>
-        </el-row> -->
-        <!-- <el-row>
-          <el-col :span="12">
-            <el-table
-            :data="basicForm2.medicineTypeChanges"
-            class="request-table"
-            @selection-change="handleSelectionChange"
-            >
-              <el-table-column type="selection" width="55" />
-              <el-table-column label="序号" align="center" prop="sort">
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.sort"></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column label="物料类别" align="center" prop="medicineCode">
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.medicineCode"></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column label="类别名称" align="center" prop="medicineName">
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.medicineName"></el-input>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-col>
-        </el-row> -->
-      </el-tab-pane>
-
-      <el-tab-pane label="修改记录" name="third">
-        <el-table :data="basicForm.changeRecords" class="request-table">
-          <el-table-column label="字段名称" align="center" prop="pageCondtion"/>
-          <el-table-column label="变更前" align="center" prop="beforeChangeValue"/>
-          <el-table-column label="变更后" align="center" prop="afterChangeValue"/>
-        </el-table>
-      </el-tab-pane>
-
-      <el-tab-pane label="单据信息" name="fourth">
-        <el-form :model="basicForm" ref="info" label-width="160px">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="申请人" prop="createByName">
-                <el-input disabled v-model="basicForm.createByName"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="申请时间" prop="createTime">
-                <el-input disabled v-model="basicForm.createTime"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="创建人" prop="createByName">
-                <el-input disabled v-model="basicForm.createByName"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="创建时间" prop="createTime">
-                <el-input disabled v-model="basicForm.createTime"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="最后修改人" prop="updateByName">
-                <el-input disabled v-model="basicForm.updateByName"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="最后修改时间" prop="updateTime">
-                <el-input disabled v-model="basicForm.updateTime"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <!-- <el-col :span="8">
-              <el-form-item label="最后审核人" prop="approver">
-                <el-input disabled v-model="basicForm.approver"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="最后审核时间" prop="approvalTime">
-                <el-input disabled v-model="basicForm.approvalTime"></el-input>
-              </el-form-item>
-            </el-col> -->
-            <el-col :span="8">
-              <el-form-item label="单据状态" prop="status">
-                <el-select v-model="basicForm.status" size="small" disabled>
-                  <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
-                  </el-option>
-                </el-select>
-                <!-- <el-input disabled v-model="basicForm.status"></el-input> -->
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </el-tab-pane>
-    </el-tabs>
-
-    <div class="btn_group">
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="save"
-                   v-if="pageStu == 'add' || pageStu == 'edit'">保存
-        </el-button>
-      </el-col>
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="back">返回</el-button>
-      </el-col>
-    </div>
-
-    <popDialog ref="contractSelect" @doSubmit="selectionsToInput" :selectData="selectData" :single="true"/>
-
-    <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true"/>
-
-    <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true"/>
-
-    <dose ref="dose" @doSubmit="acceptDose" :selectData="selectData9" :single="true"/>
-    <serviceline ref="line" @doSubmit="acceptLine" :selectData="selectData8" :single="true"/>
-  </div>
-</template>
-
-<script>
-  import popDialog from '@/components/PopDialog/index.vue'
-  import factory from '@/components/PopDialog/productFactory.vue'
-  import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic'
-  import {getDose, getLine} from '@/api/requisition/basic'
-  // 生产厂商/代理人调用用于回显
-  import {getProductFactory} from '@/api/changeApply/basic'
-  // 四级分类
-  import fourClass from '@/components/PopDialog/fourClass.vue'
-  import dose from '@/components/PopDialog/dose.vue'
-  import serviceline from '@/components/PopDialog/serviceline.vue'
-  // 调用物料分类详情接口用于数据回显
-  import {getDetail} from '@/api/classify/basic';
-
-  export default {
-    name: 'applyAdd',
-    dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
-    components: {
-      popDialog,
-      factory,
-      dose,
-      serviceline,
-      fourClass
-    },
-    props: ['pageStu', 'row', 'disable'],
-    model: {
-      prop: 'isList',
-      event: 'jugislist'
-    },
-    data() {
-      return {
-        factoryOptions: [],
-        // 剂型
-        doseOptions: [],
-        selectData9: [],
-        selectData8: [],
-        tabValue: 'first',
-        isControl: true,
-        // 业务线
-        lineOptions: [],
-        isOneClass: false,
-        basicForm: {
-          code: '',
-          orgId: '德荣集团',
-          // 物料id
-          materialId: '',
-          materialCode: '',
-          materialName: '',
-          materialClassifyId: '',
-          medicineMaterial: '2',
-          oneClass: '',
-          twoClass: '',
-          threeClass: '',
-          fourClass: '',
-          specification: '',
-          model: '',
-          factory: '',
-          registrant: '',
-          storageConditions: '',
-          transportCondition: '',
-          leadTime: '',
-          remark: '',
-          // 修改记录
-          changeRecords: [],
-          // 单据信息字段
-          createBy: '',
-          applicationTime: '',
-          createTime: '',
-          updateBy: '',
-          updateTime: '',
-          approver: '',
-          approvalTime: '',
-          status: '',
-          // 业务线
-          businessLine: '',
-          // 生产许可证/经营许可证/备案号
-          productionPermit: '',
-          // di码
-          diCode: ''
-        },
-        options: [{
-          value: '0',
-          label: '是'
-        }, {
-          value: '2',
-          label: '否'
-        }],
-        statusOptions: [{
-          value: '0', label: '未提交'
-        }, {
-          value: '1', label: '审批中'
-        }, {
-          value: '2', label: '已完成'
-        }, {
-          value: '3', label: '已驳回'
-        },],
-        basicRules: {
-          materialCode: [{required: true, message: '请选择物料编码', trigger: 'blur'}],
-          materialName: [{required: true, message: '请填写物料名称', trigger: 'blur'}],
-          specification: [{required: true, message: '请填写规格', trigger: 'blur'}],
-          // materialClassifyId: [{required: true, message: '请选择物料分类', trigger: 'blur'}],
-          // model: [{required: true, message: '请填写型号', trigger: 'blur'}],
-          factory: [{required: true, message: '请选择生产厂家/代理人', trigger: 'blur'}],
-          registrant: [{required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur'}],
-          storageConditions: [{required: true, message: '请选择存储条件', trigger: 'blur'}],
-          // transportCondition: [{required: true, message: '请选择运输条件', trigger: 'blur'}],
-          // leadTime: [{required: true, message: '请填写交货周期', trigger: 'blur'}],
-        },
-        basicForm2: {
-          drug: '',
-          registrationNo: '',
-          medicalDevices: '',
-          maintenanceType: '',
-          // 剂型
-          dosageFrom: ''
-          // 医药属性子表
-          // medicineTypeChanges:[
-          // ],
-        },
-        // tableList: [],
-        // 子表选中
-        ids: [],
-        // 弹窗
-        name: '',
-        selectData: [],
-        selectData2: [],
-        selectData3: []
-      }
-    },
-    // watch: {
-    //   value: {
-    //     handler (newVal) {
-    //       this.selectData = []
-    //       if (newVal) {
-    //         newVal.split(',').forEach((id) => { // 回显拿数据
-    //           this.contractService.queryById(id).then(({data}) => {
-    //             if (data && data.id !== '') {
-    //               this.selectData.push(data)
-    //             }
-    //           })
-    //         })
-    //       }
-    //     },
-    //     immediate: true,
-    //     deep: false
-    //   },
-    //   selectData: {
-    //     handler (newVal) {
-    //       this.name = newVal.map(contract => contract.contractName).join(',')
-    //     },
-    //     immediate: false,
-    //     deep: false
-    //   }
-    // },
-    mounted() {
-      this.$nextTick(() => {
-        // console.log('页面状态',this.pageStu)
-        if (this.pageStu == 'check') {
-          // alert('详情页面:')
-          console.log('页面状态', this.pageStu)
-          console.log('数据', this.row)
-          this.getDetails(this.row)
-          // 生产厂家代理人用于回显
-          if (this.row.factory) {
-            this.getFactoryDetails(this.row.factory)
-          }
-        } else if (this.pageStu == 'edit') {
-          // alert('修改页面')
-          console.log('页面状态', this.pageStu)
-          console.log('数据', this.row)
-          this.getDetails(this.row)
-          // 控制医药属性是否能够填写
-          if (this.row.medicineMaterial == '0') {
-            this.isControl = false
-          } else {
-            this.isControl = true
-          }
-          // 生产厂家代理人用于回显
-          if (this.row.factory) {
-            this.getFactoryDetails(this.row.factory)
-          }
-        } else if (this.pageStu == 'add') {
-          // alert('新增页面')
-          console.log('页面状态', this.pageStu)
-        }
-      })
-    },
-    methods: {
-      // 剂型显示列表
-      chooseDose() {
-        this.$refs.doses.blur()
-        this.$refs.dose.init()
-      },
-      // 选择剂型-树形
-      acceptDose(selections) {
-        this.doseOptions.push(selections)
-        this.basicForm2.dosageFrom = selections.id
-        this.getDoseDetails(selections.id)
-      },
-      // 剂型回显
-      getDoseDetails(id) {
-        getDose({id: id}).then(res => {
-          console.log('剂型', res)
-          if (res.code === 200) {
-            this.doseOptions = res.data.tableBody
-          }
-        })
-      },
-      // 生产厂家/代理人用于回显
-      getFactoryDetails(id) {
-        getProductFactory({id: id}).then(res => {
-          if (res.code === 200) {
-            this.factoryOptions = res.data.tableBody
-          }
-        })
-      },
-      // 选择是否医药物料时控制医药属性
-      controlMedic(val) {
-        console.log('val', val)
-        if (val == '0') {
-          this.isControl = false
-          // 初始化剂型为其他
-          this.basicForm2.dosageFrom = '0001A11000000000BX7Z'
-          this.getDoseDetails(this.basicForm2.dosageFrom)
-        } else {
-          this.basicForm2.drug = ''
-          this.basicForm2.registrationNo = ''
-          this.basicForm2.medicalDevices = ''
-          this.basicForm2.maintenanceType = ''
-          this.isControl = true
-        }
-      },
-      handleClick(tab, event) {
-        console.log(tab, event);
-        console.log('页面状态', this.pageStu)
-      },
-      // 如果是详情进入,则调用详情接口
-      getDetails(row) {
-        getChangeDetails(row.id).then(res => {
-          if (res.code === 200) {
-            this.basicForm = res.data
-            if (res.data.medicineChange) {
-              this.basicForm2 = res.data.medicineChange
-            }
-            // 剂型回显
-            if (res.data.medicineChange && res.data.medicineChange.dosageFrom) {
-              this.getDoseDetails(res.data.medicineChange.dosageFrom)
-            }
-            // 业务线回显
-            if (res.data.businessLine) {
-              this.getLineDetails(res.data.businessLine)
-            }
-          }
-        })
-      },
-      save() {
-        // alert('保存传status:0')
-        let sparams = {...this.basicForm, ...{status: 0}}
-        sparams.medicineChange = this.basicForm2
-        console.log('保存参数', sparams)
-        this.$refs['basic'].validate((valid) => {
-          if (valid) {
-            this.$refs['basic2'].validate(valid => {
-              if (valid) {
-                this.$modal.loading("保存中...");
-                addChangeList(sparams).then(res => {
-                  if (res.code === 200) {
-                    this.$message({
-                      message: res.msg,
-                      type: 'success'
-                    });
-                    this.$modal.closeLoading();
-                    this.back()
-                  }
-                }).catch(err => {
-                this.$modal.closeLoading();
-                })
-              }
-            })
-          }
-        })
-      },
-      submit() {
-        // alert('提交传status:1')
-        let sparams = {...this.basicForm, ...{status: 1}}
-        sparams.medicineChange = this.basicForm2
-        console.log('提交参数', sparams)
-        this.$refs['basic'].validate((valid) => {
-          if (valid) {
-            this.$refs['basic2'].validate(valid => {
-              if (valid) {
-                this.$modal.loading("提交中...");
-                editChangeList(sparams).then(res => {
-                  if (res.code === 200) {
-                    this.$message({
-                      message: res.msg,
-                      type: 'success'
-                    });
-                    this.$modal.closeLoading();
-                    this.back()
-                  }
-                }).catch(err => {
-                this.$modal.closeLoading();
-                })
-              }
-            })
-          }
-        })
-      },
-      back() {
-        this.$emit('jugislist', true)
-        // let queryParams = {
-        //   pageNum: 1,
-        //   pageSize: 10
-        // }
-        this.$emit('refresh')
-      },
-      // 子表增删行
-      // handleSelectionChange(val) {
-      //   this.ids = val
-      //   console.log('this.ids',this.ids)
-      // },
-      // addLine() {
-      //   //添加行数
-      //   let newValue = {
-      //     sort:'',
-      //     medicineCode: '',
-      //     medicineName: '',
-      //   };
-      //   this.basicForm2.medicineTypeChanges.push(newValue);
-      // },
-      // handleDelete(index) {
-      //   if(this.ids.length == 0) {
-      //     this.$message({
-      //       message: '请选择删除条目',
-      //       type: 'warning'
-      //     });
-      //   } else {
-      //     // console.log('index',index)
-      //     // this.basicForm2.medicineTypeChanges.splice(index, 1);
-      //     this.basicForm2.medicineTypeChanges = this.basicForm2.medicineTypeChanges.filter(item =>
-      //      !this.ids.some(ele =>
-      //      ele.sort == item.sort))
-      //   }
-      // },
-      // testsave() {
-      //   console.log('暂存表格:', this.basicForm2.medicineTypeChanges)
-      //   console.log('暂存表单1', this.basicForm)
-      //   let params = {...this.basicForm, ...this.basicForm2}
-      //   console.log('暂存总表单', params)
-      // },
-      // 设置选中
-      selectionsToInput(selections) {
-        console.log('父组件拿到的:', selections)
-        this.selectData = selections
-        this.$emit('getInfo', this.selectData)
-        getMaterialDetails(selections[0].id).then(res => {
-          console.log('res', res)
-          if (res.code === 200) {
-            let data = res.data.data
-            // 物料id
-            this.basicForm.materialId = data.id
-            // 物料分类Id
-            // this.basicForm.materialClassifyId = data.classifyId
-            this.basicForm.materialCode = data.code
-            this.basicForm.materialName = data.name
-            this.basicForm.medicineMaterial = data.isMedicine
-            this.basicForm.oneClass = data.oneClass
-            this.basicForm.twoClass = data.twoClass
-            this.basicForm.threeClass = data.threeClass
-            this.basicForm.fourClass = data.fourClass
-            this.basicForm.specification = data.specification
-            this.basicForm.model = data.model
-            this.basicForm.factory = data.manufacturerId
-            this.basicForm.registrant = data.registrant
-            this.basicForm.storageConditions = data.storageCondition
-            this.basicForm.transportCondition = data.transportationCondition
-            this.basicForm.leadTime = data.deliveryPeriod
-            this.basicForm.diCode = data.diCode
-            this.basicForm.businessLine = data.businessLine
-            this.basicForm.productionPermit = data.productionPermit
-            if (data.manufacturerId) {
-              this.getFactoryDetails(data.manufacturerId)
-            }
-            if (data.businessLine) {
-              this.getLineDetails(data.businessLine)
-            }
-            if (data.medcines.length !== 0) {
-              this.basicForm2.drug = data.medcines[0].isDrug
-              this.basicForm2.registrationNo = data.medcines[0].registrationNo
-              this.basicForm2.medicalDevices = data.medcines[0].medicalInstruments
-              this.basicForm2.maintenanceType = data.medcines[0].curingType
-              this.basicForm2.dosageFrom = data.medcines[0].dosageFrom
-              if (data.medcines[0].dosageFrom) {
-                this.getDoseDetails(data.medcines[0].dosageFrom)
-              }
-            }
-            // 控制医药属性是否能够填写
-            if (this.basicForm.medicineMaterial == '0') {
-              this.isControl = false
-            } else {
-              this.isControl = true
-            }
-          }
-        })
-      },
-      // selectionsToInput2 (selections) {
-      //   console.log('选择的数据',selections)
-      //   this.basicForm.factory = selections[0].manufactureName
-      // },
-      // 显示列表
-      test01() {
-        console.log('测试点击')
-        this.$refs.contractSelect.init()
-      },
-      // test02() {
-      //   console.log('测试弹窗2');
-      //   this.$refs.contractSelect2.init()
-      // },
-      // 选择生产厂家/代理人
-      acceptFactory(selections) {
-        console.log('选择的数据', selections)
-        this.factoryOptions = selections
-        this.basicForm.factory = selections[0].id
-        this.getFactoryDetails(selections[0].id)
-      },
-      // 生产厂家/代理人显示列表
-      chooseFactory() {
-        this.$refs.factoryOrman.blur()
-        this.$refs.factory.init()
-      },
-      // 选择四级分类
-      acceptFourClass(selections) {
-        console.log('收到的四级分类', selections)
-        this.basicForm.materialClassifyId = selections.id
-        this.getTreeDetails(selections.id)
-      },
-      // 四级分类显示列表
-      chooseFourClass() {
-        this.$refs.fourClass.init(basicForm.materialClassifyId)
-      },
-      // 选择四级分类后需要根据id再次查询一下123级分类
-      getTreeDetails(id) {
-        getDetail(id).then(res => {
-          if (res.code === 200) {
-            this.basicForm.oneClass = res.data.oneClass
-            this.basicForm.twoClass = res.data.twoClass
-            this.basicForm.threeClass = res.data.threeClass
-            this.basicForm.fourClass = res.data.fourClass
-            const classjudge = res.data.oneClass
-            if (classjudge.includes('介入耗材&5') || classjudge.includes('骨科耗材&2') || classjudge.includes('普通耗材&3') || classjudge.includes('医用设备&1') || classjudge.includes('体外诊断&4')) {
-              this.isOneClass = true
-            } else {
-              this.isOneClass = false
-            }
-          }
-        })
-      },
-      // 选择业务线
-      acceptLine(selections) {
-        this.lineOptions = selections
-        this.basicForm.businessLine = selections[0].id
-        this.getLineDetails(selections[0].id)
-      },
-      // 业务线显示列表
-      chooseLine() {
-        this.$refs.lines.blur()
-        this.$refs.line.init()
-      },
-      // 业务线回显
-      getLineDetails(id) {
-        getLine({id: id}).then(res => {
-          console.log('业务线', res)
-          if (res.code === 200) {
-            this.lineOptions = res.data.tableBody
-          }
-        })
-      },
-    }
-  }
-</script>
-
-<style lang="scss" scoped>
-  .apply_add {
-    height: calc(100vh - 84px);
-    padding: 12px;
-    box-sizing: border-box;
-    overflow-y: auto;
-  }
-
-  .btn_group {
-    width: 100%;
-    margin: 20px 0;
-    display: flex;
-    justify-content: center;
-  }
-</style>

+ 399 - 0
src/views/material/changeApply/add/column.js

@@ -0,0 +1,399 @@
+export default function useColumns(){
+
+  const TableColumns = [
+    {
+      item:{
+        key:'code',
+        title:'单据编码',
+      },
+      attr:{
+        is: "el-input",
+        disabled:true,
+      },
+    },
+    {
+      item:{
+        key:'orgName',
+        title:'所属组织',
+      },
+      attr:{
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          orgId:'id'
+        },
+        disabled:true,
+      },
+    },
+    {
+      item:{
+        key:'status',
+        title:'单据状态',
+      },
+      attr:{
+        is: "el-select",
+        dictName: "documents_status", // 字典名
+        disabled:true,
+      },
+    },
+    // {
+    //   item:{
+    //     key:'approver',
+    //     title:'申请人',
+    //   },
+    //   attr:{
+    //     is: "el-input",
+    //     disabled:true,
+    //   },
+      
+    // },
+    {
+      item:{
+        key:'applicationTime',
+        title:'申请时间',
+      },
+      attr:{
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd HH:mm:ss",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'createByName',
+        title:'创建人',
+      },
+      attr:{
+        is: "el-input",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'createTime',
+        title:'创建时间',
+      },
+      attr:{
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd HH:mm:ss",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'updateByName',
+        title:'最后修改人',
+      },
+      attr:{
+        is: "el-input",
+        disabled:true,
+      },
+  
+    },
+    {
+      item:{
+        key:'updateTime',
+        title:'最后修改时间',
+      },
+      attr:{
+        is: "el-date-picker",
+        valueFormat: "yyyy-MM-dd HH:mm:ss",
+        disabled:true,
+      },
+  
+    },
+    
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+  
+  const TabColumns = [
+    {
+      item:{
+        key:'materialBasic',
+        title:'物料信息',
+      },
+      attr:{
+        value:[]
+      },
+      TableColumns:[
+        {
+          item:{
+            key:'materialCode',
+            title:'物料编码',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'materialName',
+            title:'物料名称',
+            require: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MATERIAL_PARAM",
+            dataMapping: {
+              materialId: "id",
+              materialCode: "code",
+              materialName: "name",
+              diCode:'diCode',
+              remark:'remark',
+              model: "model",
+              materialClassifyId:'classifyId',
+              productionPermit:'productionPermit',
+              specification: "specification",
+              storageConditions:'storageCondition',
+              transportCondition:'transportationCondition',
+              medicineMaterial:'isMedicine',
+              factory:'manufacturerId',
+              factoryName:'manufacturerIdName',
+              registrant:'registrant',
+              oneClass:'oneClass',
+              twoClass:'twoClass',
+              threeClass:'threeClass',
+              fourClass:'fourClass',
+              drug:'isDrugNumber',
+              registrationNo:'oriRegistrationNo',
+              dosageFrom:'dosageFrom',
+              dosageFromName:'dosageFromName',
+              maintenanceType:'curingType',
+              medicalDevices:'medicalInstruments',
+            },
+
+          },
+         
+        },
+        {
+          item:{
+            key:'medicineMaterial',
+            title:'医药物料',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_number_yes_no", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'productionPermit',
+            title:'生产许可证',
+          },
+          attr:{
+            is: "el-input",
+          },
+          
+        },
+        {
+          item:{
+            key:'specification',
+            title:'规格',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'model',
+            title:'型号',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'factoryName',
+            title:'生产厂家/代理人',
+            require: true,
+          },
+          attr:{
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MANUFACTURER_PARAM",
+            dataMapping: {
+              factory:'id'
+            }
+          },
+          
+        },
+        {
+          item:{
+            key:'registrant',
+            title:'注册人/上市许可持有人',
+            require: true,
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'storageConditions',
+            title:'存储条件',
+            require: true,
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_storage_condition", // 字典名
+          },
+          
+        },
+        {
+          item:{
+            key:'transportCondition',
+            title:'运输条件',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_conditions_carriage", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'diCode',
+            title:'DI码',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'remark',
+            title:'备注',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'oneClass',
+            title:'一级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+          
+        },
+        {
+          item:{
+            key:'twoClass',
+            title:'二级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'threeClass',
+            title:'三级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+          
+        },
+        {
+          item:{
+            key:'fourClass',
+            title:'四级分类',
+          },
+          attr:{
+            is: "el-input",
+            disabled:true,
+          },
+         
+        },
+        {
+          item:{
+            key:'drug',
+            title:'药品',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "sys_medicine", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'registrationNo',
+            title:'注册证号/备案凭证编号',
+          },
+          attr:{
+            is: "el-input",
+          },
+         
+        },
+        {
+          item:{
+            key:'medicalDevices',
+            title:'医疗器械',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "medical_instruments", // 字典名
+          },
+          
+        },
+        {
+          item:{
+            key:'maintenanceType',
+            title:'养护类型',
+          },
+          attr:{
+            is: "el-select",
+            dictName: "curing_type", // 字典名
+          },
+         
+        },
+        {
+          item:{
+            key:'dosageFromName',
+            title:'剂型',
+          },
+          attr:{
+            is: "el-popover-tree-select",
+            referName: "DOSAGEFORM_PARAM",
+            valueKey: "name",
+            dataMapping: {
+              dosageFrom:'id'
+            }
+          },
+          
+        },
+  
+      ]
+    }, 
+  ]
+
+  return {TableColumns,TabColumns}
+}
+

+ 432 - 0
src/views/material/changeApply/add/index.vue

@@ -0,0 +1,432 @@
+<!-- 批量新增 -->
+<script>
+import useColumns from "./column";
+import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic';
+
+
+export default {
+  name: "AddChangeOrders",
+  props: {
+    dict: {
+      type: Object,
+    },
+    addType: {
+      type: String,
+      default: "add",
+    },
+  },
+  components: {
+    AmendantRecord: () => import("../amendantRecord/index.vue"),
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
+  },
+
+  data() {
+
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    return {
+      width: "100%",
+      visible: false,
+      loading:false,
+      rules,
+      params,
+      tabName: tabName,
+      TabColumns: TabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+    title: {
+      get() {
+        const { addType } = this;
+        if (addType === "add") {
+          return "新 增";
+        }
+        if (addType === "edit") {
+          return "编 辑";
+        }
+      },
+      set() {},
+    },
+    materialInfo:{
+      get(){
+        const { materialBasic } = this.params;
+        this.params.materialBasic = materialBasic.map((item, index) => ({
+          ...item,
+          $index: index,
+        }));
+
+        return {
+          materialBasic: this.params.materialBasic.filter(
+            ({ delFlag }) => delFlag !== "2"
+          ),
+        }
+      },
+      set(){},
+    }
+  
+  },
+  watch: {
+    
+  },
+  methods: {
+    setVisible(prop){
+      this.visible = prop;
+    },
+    beforeOpen(){
+      if(this.addType === 'add'){
+        let {name,nickName} = this.$store.state.user;
+        this.params.createBy = name;
+        this.params.createByName = nickName;
+        this.params.createTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        this.params.updateBy = name;
+        this.params.updateByName = nickName;
+        this.params.updateTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        // this.params.approver = name;
+        this.params.applicationTime =  new Date().Format('yyyy-MM-dd HH:mm:ss');
+        this.params.status = '0';
+        console.log(this.$store.state.user,'user');
+        this.params.orgName = '德荣集团';
+        this.useRowAdd(this.tabName);
+      }
+    },
+
+    //
+    async fetchItem(prop) {
+      console.log(prop,'prop----------------');
+      try {
+        // try
+        this.loading = true;
+
+        let { code, data } = await getChangeDetails(prop.id);
+
+        if(code == 200){
+          this.params = data;
+        }
+        
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    
+    //
+    async hide() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.$emit('success');
+      this.tabName = tabName;
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+    //
+    async useRowAdd(prop) {
+      
+      const { TableColumns } = this.TabColumns.find(
+        ({ item: { key } }) => key === prop
+      );
+      this.params[prop].push({
+        delFlag: "0",
+        materialClassifyId:null,
+        ...this.$init.params(TableColumns),
+      });
+    },
+    //
+    async useRowRemove(prop, scope) {
+      const { addType } = this.$props;
+      const {
+        row: { $index },
+      } = scope;
+      if (addType === "add") {
+        this.params[prop].splice($index, 1);
+      }
+      if (addType === "edit") {
+        this.params[prop] = this.params[prop].map((item, index) => ({
+          ...item,
+          delFlag: index === $index ? "2" : item.delFlag,
+        })).filter(item =>( item.id  || (!item.id && item.delFlag === '0')) )
+        ;
+      }
+    },
+    handleSubmitValidate(prop,cb){
+
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+
+            let validList = this.params['materialBasic'].filter(item => item.delFlag === '0');
+
+            if(validList.length){
+              await cb();
+            }else{
+              this.$notify.error({
+                message:'物料信息不能不为空!'
+              })
+            }
+            
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    //
+    async useSubmit(prop) {
+      console.log(this.params,'this.params');
+      this.handleSubmitValidate(prop,async()=>{
+
+        try {
+          this.loading = true;
+          const {code,msg} = await addChangeList(this.params);
+
+          if(code == 200){
+
+            this.hide();
+            this.$notify.success({
+              title: msg,
+            });
+          }
+          
+        } catch (error) {}
+        finally{
+          this.loading = false;
+        }
+
+        
+        // await;
+      })
+    },
+  },
+  created() {
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+    <el-drawer
+      v-bind="$attrs"
+      v-on="$listeners"
+      :size="width"
+      :visible.sync="visible"
+      destroy-on-close
+      :show-close="false"
+      @close="hide"
+      @open="beforeOpen"
+      v-loading="loading"
+    >
+      <div 
+        slot="title" 
+        style="display: flex;
+            justify-content: space-between;
+            align-items: center;"
+      >
+        <h3>{{title}}</h3>
+        <div>
+          <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit('superForm')"
+          >确 认</el-button
+        >
+        <el-button :size="$attrs.size" :loading="loading" @click="hide"
+          >取 消</el-button
+        >
+        </div>
+      </div>
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+          >
+          </component
+        ></template>
+      </el-super-form>
+      
+  
+      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+        <el-tab-pane
+          v-for="({ item, TableColumns: columns }, index) in TabColumns"
+          :key="index"
+          :label="item.title"
+          :name="item.key"
+          lazy
+        >
+          <el-super-table
+            v-model="materialInfo[item.key]"
+            :dict="dict"
+            :ref="tabName"
+            :columns="columns"
+            :size="$attrs.size"
+          >
+            <template slot="materialName" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+              >
+              </component>
+            </template>
+            <!-- 判断是否禁用 -->
+            <template slot="drug" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial ==='0') "
+              >
+              <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+
+            <template slot="registrationNo" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial ==='0') "
+              >
+              </component>
+            </template>
+
+            <template slot="medicalDevices" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial ==='0') "
+              >
+              <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <template slot="maintenanceType" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial ==='0') "
+              >
+              <el-option
+                  v-for="item in dict.type[scope.attr.dictName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </component>
+            </template>
+            <template slot="dosageFromName" slot-scope="scope">
+              <component
+                v-bind="scope.attr"
+                v-model="scope.row[scope.item.key]"
+                :size="$attrs.size"
+                :source.sync="scope.row"
+                :disabled="!(scope.row.medicineMaterial ==='0') "
+              >
+              </component>
+            </template>
+            
+
+            <el-table-column fixed="right" label="操作" width="120" align="center">
+              <template slot="header" slot-scope="scope">
+                <el-button
+                  type="text"
+                  :size="$attrs.size"
+                  @click="useRowAdd(tabName)"
+                >
+                  增行
+                </el-button>
+              </template>
+              <template slot-scope="scope">
+                <el-button
+                  type="text"
+                  :size="$attrs.size"
+                  @click.native.prevent="useRowRemove(tabName, scope)"
+                >
+                删除
+                </el-button>
+                <AmendantRecord
+                  v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
+                  v-model="scope.row"
+                ></AmendantRecord>
+              </template>
+            </el-table-column>
+          </el-super-table>
+        </el-tab-pane>
+      </el-tabs>
+
+      
+     
+    </el-drawer>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>
+
+

+ 7 - 0
src/views/material/changeApply/amendantRecord/column.js

@@ -0,0 +1,7 @@
+export const recordColumns = [
+  { item: { key: "pageCondtion", title: "字段名称" }, attr: {} },
+  { item: { key: "afterChangeValue", title: "变更前" }, attr: {} },
+  {
+    item: { key: "beforeChangeValue", title: "变更后" },attr: {},
+  },
+];

+ 102 - 0
src/views/material/changeApply/amendantRecord/index.vue

@@ -0,0 +1,102 @@
+<!-- 修改记录 -->
+<script>
+import {recordColumns} from './column';
+import {getRecordList} from '@/api/changeApply/basic';
+
+export default {
+  name:'AmendantRecord',
+  components:{
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+  },
+  dicts:[],
+  props:{
+    type:{
+      type:String,
+      default:'text',
+    },
+    value:{
+      type:Object,
+      require:true,
+    },
+    size:{
+      type:String,
+      default:'mini'
+    }
+  },
+  data(){
+
+    return {
+      title:'修改记录',
+      visible:false,
+      loading:false,
+      tableData:[],
+      TableColumns:recordColumns,
+      
+
+    }
+  },
+  methods:{
+    async beforeOpen(){
+      try {
+        let {id} = this.value;
+
+        this.loading = true;
+
+        let {code,rows} = await getRecordList({changeId:id});
+
+        if(code == 200){
+          this.tableData = rows;
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.loading = false;
+      }
+    },
+    // 
+    handleClose(){},
+    handleClick(){
+      this.visible = true;
+    },
+  },
+  created(){},
+}
+</script>
+
+<template>
+
+  <el-button 
+    v-bind="$attrs"
+    v-on="$listeners"
+    :type="type"
+    @click="handleClick"
+    :size="size"
+  >
+    {{ title }}
+    <el-drawer
+      :title="title"
+      v-loading="loading"
+      width="50%"
+      @open="beforeOpen"
+      :visible.sync="visible"
+      append-to-body
+      direction="rtl"
+      :size="size"
+    >
+
+      <div style="padding: 10px;">
+
+        <el-super-table
+          v-model="tableData"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          >
+        </el-super-table>
+      </div>
+
+    </el-drawer>
+  </el-button>
+
+</template>

+ 134 - 0
src/views/material/changeApply/batchImport/index.vue

@@ -0,0 +1,134 @@
+<script>
+import { importData, fileImport} from '@/api/requisition/basic';
+import { changeImport, downloadFailData} from '@/api/changeApply/basic';
+export default {
+  name:'BatchImport',
+  props:{},
+  data(){
+    return {
+      title:'批量导入',
+      visible:false,
+      fileData:[],
+      size:'mini',
+    }
+  },
+  methods:{
+    beforeColse(done){
+      this.cancal();
+      done();
+
+    },
+    handleClick(){
+      this.visible = true;
+    },
+    confirmUpdate(){
+      if (this.fileData.length) {
+
+        let formData = new FormData();
+
+        formData.append('file', this.fileData[0].raw);
+        importData(formData).then(res => {
+          if (res.code == 200) {
+            this.visible = false;
+            this.fileData = [];
+            if (res.data.flag) {
+              this.failLoad = true;
+              console.log(res.data.datas)
+              let param = {failDatas: res.data.datas}
+              if (null != param) {
+
+                fileImport(param).then(res => {
+                  console.log('res',res)
+                  const isBlob = blobValidate(res);
+                  if (isBlob) {
+                    const blob = new Blob([res]);
+                    saveAs(blob, '导入失败的物料申请单数据.xlsx');
+                  }
+                  this.failLoad = false;
+                })
+              }
+            }
+            this.$notify({
+              message: res.data.msg,
+              type: res.data.flag ? 'warning' : 'success'
+            });
+          } else {
+            this.$notify({
+              message: res.msg,
+              type: res.code == 200 ? 'success' : 'warning'
+            });
+          }
+        })
+      } else {
+      this.$notify({
+        title:'警告',
+        message: '请上传文件之后在确认!',
+        type: 'warning'
+      });
+      }
+    },
+  
+    handleDownTemplate(){},
+    handleFileRemove(file, fileList) {
+        console.log('删除文件', file, 'file', fileList, 'fileList');
+        this.fileData = fileList;
+      },
+    handleChangeFile(file, fileList){
+      this.fileData = fileList;
+    },
+    cancal(){
+      this.fileData = [];
+      this.visible = false;
+    },
+  },
+  created(){},
+}
+</script>
+
+<template>
+  <el-button
+    v-bind="$attrs"
+    v-on="$listeners"
+    type="primary"
+    @click="handleClick"
+    :size="size"
+  >
+    {{ title }}
+    <el-dialog 
+      :title="title" 
+      :visible.sync="visible"
+      width="35%" 
+      center
+      append-to-body
+      :before-close="beforeColse"
+    >
+      <div style="display: flex;justify-content: center;">
+        <el-upload 
+          accept=".xls, .xlsx" 
+          ref="upload" 
+          action="#" 
+          :on-remove="handleFileRemove"
+          :file-list="fileData" 
+          :auto-upload="false" 
+          :on-change="handleChangeFile" 
+          :limit="1"
+        >
+          <el-button slot="trigger" :size="size" type="primary">选取文件</el-button>
+          <el-button 
+            style="margin-left: 10px;" 
+            :size="size"
+            type="success"
+            @click="handleDownTemplate"
+          >下载模板
+          </el-button>
+          <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
+        </el-upload>
+
+      </div>
+      <span slot="footer">
+        <el-button :size="size" @click="cancal">取 消</el-button>
+        <el-button type="primary" :size="size" @click="confirmUpdate">确 定</el-button>
+      </span>
+    </el-dialog>
+  </el-button>
+</template>

+ 77 - 0
src/views/material/changeApply/columns.js

@@ -0,0 +1,77 @@
+export default function useColumns() {
+
+  const TableColumns = [
+    { item: { key: "orgName", title: "所属组织" }, attr: {} },
+    { item: { key: "code", title: "单据编码" }, attr: {} },
+    {
+      item: { key: "applicationTime", title: "申请时间" },
+      attr: { },
+    },
+    { item: { key: "status", title: "单据状态",width:120, }, 
+      attr: {
+        
+        is: "el-dict-tag",
+        dictName: "documents_status", // 字典名
+      } 
+    },
+    // { item: { key: "materialCode", title: "物料编码" }, attr: {} },
+    // {
+    //   item: { key: "materialName", title: "物料名称" },
+    //   attr: {},
+    // },
+    { item: { key: "approver", title: "最后审批人" }, attr: {} },
+    { item: { key: "approvalTime", title: "最后审核时间" }, attr: {} },
+    { item: { key: "createByName", title: "创建人" ,width:150, }, attr: {} },
+    { item: { key: "createTime", title: "创建时间" }, attr: {} },
+    {
+      item: { key: "updateByName", title: "最后修改人" ,width:150, },
+      attr: {  },
+    },
+    { item: { key: "updateTime", title: "最后修改时间" }, attr: {} },
+   
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, fixed: false },
+  }));
+
+  const SearchColumns = [
+    {
+      item: { key: "materialCode", title: "物料编码" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MATERIAL_PARAM",
+        valueKey: "code",
+        clearable:true,
+        dataMapping: { 
+          materialName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "materialName", title: "物料名称" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MATERIAL_PARAM",
+        valueKey: "name",
+        clearable:true,
+        dataMapping: { 
+          materialCode: "code",
+        },
+      },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "documents_status",
+        clearable: true,
+      },
+    },
+  
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  return { TableColumns, SearchColumns };
+}

+ 15 - 0
src/views/material/changeApply/dicts.js

@@ -0,0 +1,15 @@
+import { initDicts } from "@/utils/init.js";
+
+const modules = require.context("./add/", true, /column.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 143 - 239
src/views/material/changeApply/index.vue

@@ -1,278 +1,182 @@
 <template>
-  <div class="changeApply">
-    <div class="applyList" v-if="isList">
-      <el-row :gutter="10" class="mb10">
-          <!-- <el-select size="small" v-model="textValue" placeholder="请选择">
-          <el-option
-            v-for="item in text"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select>
 
-        <el-select size="small" v-model="ruleValue" placeholder="请选择">
-          <el-option
-            v-for="item in rule"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select> -->
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料编码</span>
-          <el-input
-            v-model="queryParams.materialCode"
-            size="small"
-            placeholder="请输入物料编码查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
+  <el-card 
+    v-loading="loading" 
+    style="width: calc(100% - 24px); height: 100%; margin: 10px;padding: 10px;" 
+    :body-style="{ padding: 0 }"
+  >
 
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
-          <el-input
-            v-model="queryParams.materialName"
-            size="small"
-            placeholder="请输入物料名称查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
+    <AddChangeOrders
+      ref="addChangeOrders"
+      :size="size"
+      :dict="dict"
+      :add-type="optionType"
+      @success="useReset"
+    ></AddChangeOrders>
+    <SeeChangeOrders
+      ref="seeChangeOrders"
+      :size="size"
+      :dict="dict"
+      @success="useReset"
+    ></SeeChangeOrders>
 
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
-          <el-select 
-            v-model="queryParams.status"
-            size="small"
-            placeholder="请选择单据状态"
-            clearable
-            style="width: 240px">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-        </el-col>
+    <div>
 
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="useReset"
+        @row-dblclick="useSee"
+        @submit="useQuery(params, page)"
+      ></el-super-search>
+
+      <el-row 
+        :gutter="10" 
+        class="mb10" 
+        type="flex" 
+        justify="end"
+        style="margin-top: 20px;"
+      >
         <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
-        </el-col>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>高级查询</el-button>
-        </el-col> -->
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
+          <el-button type="primary" size="mini" @click="newAdd">新增</el-button>
+          <!-- <BatchImport></BatchImport> -->
         </el-col>
-
       </el-row>
 
-    <el-row :gutter="10" class="mb10">
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
-      </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>导入</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>导出</el-button>
-      </el-col> -->
-      <!-- <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>批量提交</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>批量删除</el-button>
-      </el-col> -->
-    </el-row>
 
-    <el-card>
-      <el-table 
-        :data="tableList" 
-        class="request-table"
-        fit
-        max-height="680"
-        @selection-change="handleSelectionChange"
+      <el-super-table
+        v-model="tableList"
+        :dict="dict"
+        :columns="TableColumns"
+        :size="size"
+        pagination
+        :page="page"
+        @pagination="useQuery(params, page)"
+        @row-dblclick="useSee"
       >
-        <!-- <el-table-column type="selection" width="55" /> -->
-        <el-table-column label="序号" align="center" type="index" width="50" />
-        <el-table-column label="所属组织" align="center" width="200" prop="orgId" />
-        <el-table-column label="单据编码" align="center" width="200" prop="code" />
-        <el-table-column label="申请时间" align="center" width="150" prop="createTime" />
-        <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug" />
-        <el-table-column label="物料编码" align="center" width="150" prop="materialCode" />
-        <el-table-column label="物料名称" align="center" width="150" prop="materialName" />
-        <!-- <el-table-column label="最后审批人" align="center" width="120" prop="approver" />
-        <el-table-column label="最后审核时间" align="center" width="150" prop="approvalTime" /> -->
-        <el-table-column label="创建人" align="center" prop="createByName" />
-        <el-table-column label="创建时间" align="center" width="150" prop="createTime" />
-        <el-table-column label="最后修改人" align="center" width="120" prop="updateByName" />
-        <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime" />
-        <el-table-column
-          fixed="right"
-          label="操作"
-          align="center"
-          width="150"
-          >
+        <el-table-column fixed="right" label="操作" width="150" align="center">
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
-            <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
+            <el-button type="text" size="small" @click="useSee(scope.row)">查看</el-button>
+            <el-button @click="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
             <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
           </template>
         </el-table-column>
-      </el-table>
-
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :page-sizes="[5, 10, 15, 20]"
-        :page-size=queryParams.pageSize
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-        style="text-align: center;">
-      </el-pagination>
-    </el-card>
+      </el-super-table>
     </div>
+</el-card>
 
-    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList" v-if="!isList"/>
-  </div>
 </template>
 
 <script>
-import addApply from './add.vue';
-import { getChangeList , deleteChangeList} from '@/api/changeApply/basic'
+import { dicts } from "./dicts";
+import { getChangeList , deleteChangeList} from '@/api/changeApply/basic';
+import useColumns from './columns';
 export default {
   name: 'changeApply',
+  dicts:dicts,
   components: {
-    addApply
+    AddChangeOrders:() => import('./add/index.vue'),
+    SeeChangeOrders:() => import('./see/index.vue'),
+    BatchImport:() => import('./batchImport/index.vue'),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
   },
-  data() {
-    return{
+
+  data(){
+    const {TableColumns,SearchColumns} = useColumns();
+    const params = this.$init.params(SearchColumns);
+    return {
+      loading:false,
+      size:'mini',
       tableList: [],
-      queryParams: {
-        materialCode: '',
-        materialName: '',
-        status: '',
-        pageNum: 1,
-        pageSize: 10
-      },
-      options: [{
-        value: 0, label: '未提交'
-      },{
-        value: 1, label: '审批中'
-      },{
-        value: 2, label: '已完成'
-      },{
-        value: 3, label: '已驳回'
-      },],
-      total:0,
-      // isComponent
-      isComponent:'addApply',
-      isList: true,
-      // 页面状态
-      page: '',
-      rowDetail: {},
-      disable: false
+      TableColumns:TableColumns,
+      page: { pageNum: 1, pageSize: 10, total: 0 },
+      params:params,
+      SearchColumns:SearchColumns,
+      optionType:'add',
+
+
     }
   },
-  created() {
+  methods:{
     
-  },
-  mounted() {
-    this.getList(this.queryParams)
-  },
-  methods: {
-    reset() {
-      this.queryParams.materialCode = ''
-      this.queryParams.materialName = ''
-      this.queryParams.pageNum = 1
-      this.queryParams.status = ''
-      this.getList(this.queryParams)
-    },
-    newAdd() {
-      this.isList = false
-      this.isComponent = 'addApply'
-      this.page = 'add'
-      this.disable = false
+    useReset(){
+      this.page.pageNum = 1;
+      this.page.pageSize = 10;
+      this.params = this.$init.params(this.SearchColumns);
+      this.useQuery(this.params, this.page);
     },
-    getList(val) {
-      console.log('val',val)
-      getChangeList(val).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows
-          this.total = res.total
-        }
-      })
+    
+    // 
+    openAddChangeOrders(row) {
+    
+      const {setVisible,fetchItem} = this.$refs.addChangeOrders;
+
+      setVisible(true);
+
+      row && fetchItem(row);
     },
-    // 表格内状态栏判断值
-    statusJug(row) {
-      if (row.status == 0) {
-        return '未提交'
-      } else if (row.status == 1) {
-        return '审批中'
-      } else if (row.status == 2) {
-        return '已完成'
-      } else if (row.status == 3) {
-        return '已驳回'
-      }
+
+    async newAdd(){
+      this.optionType = 'add';
+      await this.openAddChangeOrders();
     },
-    // 
-    handleSelectionChange () {
+
+    async handleEdit(row){  
+      this.optionType = 'edit';
+      await this.openAddChangeOrders(row);
 
     },
-    check(row) {
-      console.log('查看详情', row)
-      this.isList = false
-      this.isComponent = 'addApply'
-      this.page = 'check'
-      this.rowDetail = row
-      this.disable = true
+
+    async useQuery(params,page) {
+      try {
+        this.loading = true;
+        let {code,rows,total} = await getChangeList({...params,...page});
+        if (code === 200) {
+          this.tableList = rows
+          this.page.total = total;
+        }
+      } catch (error) {
+        
+      }finally{
+        this.loading = false;
+      }
     },
-    edit(row) {
-      console.log('修改先加载详情', row)
-      this.isList = false
-      this.isComponent = 'addApply'
-      this.page = 'edit'
-      this.rowDetail = row
-      this.disable = false
+   
+
+    async useSee(row){
+      const {setVisible,fetchItem} = this.$refs.seeChangeOrders;
+      await setVisible(true);
+      await fetchItem(row);
+
     },
-    deleteRow(row) {
+    deleteRow(row){
       this.$confirm('是否删除此条数据?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          deleteChangeList({id: row.id}).then(res => {
-            if(res.code === 200) {
-              this.$message({
-                message: res.msg,
-                type: 'success'
-              });
-              this.getList(this.queryParams)
-            }
-          })
-        }).catch(() => {})
-    },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-      this.queryParams.pageSize = val
-      this.getList(this.queryParams)
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async() => {
+
+        try {
+          let {code,msg} = await deleteChangeList({id: row.id});
+
+          if(code == 200){
+            this.$notify.success({
+              // title: '成功',
+              message: msg,
+            });
+            await this.useQuery(this.params, this.page);
+          }
+        } catch (error) {}
+      })
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
-    }
-  }
+ 
+  },
+  created(){
+    this.useQuery(this.params, this.page);
+  },
 }
-</script>
 
-<style scoped lang="scss">
-.changeApply {
-  height: calc(100vh - 84px);
-  padding: 12px;
-  box-sizing: border-box;
-}
-</style>
+</script>

+ 289 - 0
src/views/material/changeApply/see/index.vue

@@ -0,0 +1,289 @@
+<!-- 批量新增 -->
+<script>
+import useColumns from "../add/column";
+import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic';
+
+
+export default {
+  name: "SeeChangeOrders",
+  props: {
+    dict: {
+      type: Object,
+    },
+  },
+  components: {
+    AmendantRecord: () => import("../amendantRecord/index.vue"),
+    ElSuperForm: () => import("@/components/super-form/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    ElPopoverTreeSelect: () =>
+      import("@/components/popover-tree-select/index.vue"),
+  },
+
+  data() {
+
+    const {
+      TabColumns,
+      TableColumns,
+      TabColumns: [
+        {
+          item: { key: tabName },
+        },
+      ],
+    } = useColumns();
+
+    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+    const params = this.$init.params([...TabColumns, ...TableColumns]);
+    let tabColumns = _.cloneDeep(TabColumns);
+    tabColumns =  tabColumns.map(item =>( 
+
+      {...item,
+        TableColumns: [...item.TableColumns.map(column =>({
+          item:{...column.item,disabled:true},
+          attr:{
+            ...column.attr,
+            disabled:true
+          }
+        }))]
+      }
+      )
+
+    )
+
+    console.log(tabColumns,'tabColumns');
+    
+    return {
+      width: "100%",
+      visible: false,
+      loading:false,
+      title:'查看',
+      rules,
+      params,
+      tabName: tabName,
+      TabColumns: tabColumns,
+      TableColumns: TableColumns,
+    };
+  },
+  computed: {
+   
+    materialInfo:{
+      get(){
+        const { materialBasic } = this.params;
+        this.params.materialBasic = materialBasic.map((item, index) => ({
+          ...item,
+          $index: index,
+        }));
+
+        return {
+          materialBasic: this.params.materialBasic.filter(
+            ({ delFlag }) => delFlag !== "2"
+          ),
+        }
+      },
+      set(){},
+    }
+  
+  },
+  watch: {
+    
+  },
+  methods: {
+    setVisible(prop){
+      this.visible = prop;
+    },
+    beforeOpen(){
+    },
+    //
+    async fetchItem(prop) {
+      try {
+        // try
+        this.loading = true;
+
+        let { code, data } = await getChangeDetails(prop.id);
+
+        if(code == 200){
+          this.params = data;
+        }
+        
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    
+    //
+    async hide() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: { key: tabName },
+          },
+        ],
+      } = useColumns();
+      this.visible = false;
+      this.tabName = tabName;
+      this.$emit('success');
+      this.params = this.$init.params([...TabColumns, ...TableColumns]);
+    },
+   
+    async handleSubmit(){
+      this.params = {...this.params,status:'1'};
+      console.log(this.params,'this.params');
+      try {
+          this.loading = true;
+          
+          const {code,msg} = await addChangeList(this.params);
+
+          if(code == 200){
+
+            this.hide();
+            this.$notify.success({
+              message: msg,
+            });
+          }
+          
+        } catch (error) {}
+        finally{
+          this.loading = false;
+        }
+    },
+    handleSubmitValidate(prop,cb){
+
+      this.$refs[prop].$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            this.loading = true;
+
+            await cb();
+            
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+  created() {
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<template>
+    <el-drawer
+      v-bind="$attrs"
+      v-on="$listeners"
+      :size="width"
+      :visible.sync="visible"
+      destroy-on-close
+      :show-close="false"
+      @close="hide"
+      @open="beforeOpen"
+      v-loading="loading"
+    >
+      <div 
+        slot="title" 
+        style="display: flex;
+            justify-content: space-between;
+            align-items: center;"
+      >
+        <h3>{{title}}</h3>
+        <div>
+          <el-button 
+            v-if="params.status === '0' || params.status === '3'"
+            type="primary"
+            :size="$attrs.size" 
+            :loading="loading" 
+            @click="handleSubmit"
+          >
+            提 交
+          </el-button>
+          <el-button :size="$attrs.size" :loading="loading" @click="hide"
+            >取 消</el-button>
+        </div>
+      </div>
+      <el-super-form
+        v-model="params"
+        :dict="dict"
+        :rules="rules"
+        :size="$attrs.size"
+        :columns="TableColumns"
+        ref="superForm"
+        label-width="auto"
+        label-position="right"
+        style="padding: 20px"
+      >
+        <template slot="puOrgName" slot-scope="scope">
+          <component
+            v-bind="scope.attr"
+            v-model="scope.row[scope.item.key]"
+            :size="$attrs.size"
+            :source.sync="scope.row"
+            @change="changePuOrgName({ ...scope, select: $event })"
+          >
+          </component
+        ></template>
+      </el-super-form>
+      
+    
+        <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+          <el-tab-pane
+            v-for="({ item, TableColumns: columns }, index) in TabColumns"
+            :key="index"
+            :label="item.title"
+            :name="item.key"
+            lazy
+          >
+            <el-super-table
+              v-model="materialInfo[item.key]"
+              :dict="dict"
+              :ref="tabName"
+              :columns="columns"
+              :size="$attrs.size"
+            >
+              <template slot="materialName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  @change="changeMaterialName(scope)"
+                >
+                </component>
+              </template>
+              <el-table-column fixed="right" label="操作" width="120" align="center">
+                
+                <template slot-scope="scope">
+                  <AmendantRecord
+                    v-if=" tabName ==='materialBasic' "
+                    v-model="scope.row"
+                  ></AmendantRecord>
+                  
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </el-tab-pane>
+        </el-tabs>
+     
+    </el-drawer>
+</template>
+
+<style scoped>
+::v-deep .el-table__row.is-hidden {
+  display: none;
+}
+</style>
+
+

文件差異過大導致無法顯示
+ 777 - 677
src/views/material/requisition/add.vue


+ 340 - 235
src/views/material/requisition/index.vue

@@ -1,32 +1,32 @@
 <template>
-  <div class="requisition">
+  <div class="requisition" v-loading="failLoad">
     <div class="applyList" v-if="isList">
-    <el-row :gutter="10" class="mb10">
-      <el-col :span="1.5">
-        <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
-        <el-input
-          v-model="queryParams.billCode"
-          size="small"
-          placeholder="请输入单据编码查询"
-          clearable
-          style="width: 240px"
-        />
-      </el-col>
+      <el-row :gutter="10" class="mb10">
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
+          <el-input
+            v-model="queryParams.billCode"
+            size="small"
+            placeholder="请输入单据编码查询"
+            clearable
+            style="width: 240px"
+          />
+        </el-col>
 
-      <el-col :span="1.5">
-        <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
-        <el-input
-          v-model="queryParams.name"
-          size="small"
-          placeholder="请输入物料名称查询"
-          clearable
-          style="width: 240px"
-        />
-      </el-col>
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
+          <el-input
+            v-model="queryParams.name"
+            size="small"
+            placeholder="请输入物料名称查询"
+            clearable
+            style="width: 240px"
+          />
+        </el-col>
 
-      <el-col :span="1.5">
+        <el-col :span="1.5">
           <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
-          <el-select 
+          <el-select
             v-model="queryParams.status"
             size="small"
             placeholder="请选择单据状态"
@@ -41,223 +41,327 @@
           </el-select>
         </el-col>
 
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
-      </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>高级查询</el-button>
-      </el-col> -->
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="reset">重置</el-button>
-      </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
+        </el-col>
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>高级查询</el-button>
+        </el-col> -->
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
+        </el-col>
 
-    </el-row>
+      </el-row>
 
-    <el-row :gutter="10" class="mb10">
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载</el-button>
-      </el-col>
-      <!-- <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>导入</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>导出</el-button>
-      </el-col> -->
-      <!-- <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>批量提交</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain>批量删除</el-button>
-      </el-col> -->
-    </el-row>
+      <el-row :gutter="10" class="mb10">
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain
+                     @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
+          </el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="small" @click="handleImport">批量导入</el-button>
+        </el-col>
+        <!-- 导入弹窗 -->
+        <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center
+                   :before-close="handlefileDialogColse">
+          <div class="mb-import">
+            <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
+                       :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
+              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+              <el-button style="margin-left: 10px;" size="small" type="success" @click="handleDownTemplate">下载模板
+              </el-button>
+              <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
+            </el-upload>
+
+          </div>
+          <span slot="footer">
+        <el-button @click="handleImportData('cancal')">取 消</el-button>
+        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
+      </span>
+        </el-dialog>
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>导入</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>导出</el-button>
+        </el-col> -->
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>批量提交</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>批量删除</el-button>
+        </el-col> -->
+      </el-row>
 
-    <el-card>
-      <el-table 
-        :data="tableList" 
-        class="request-table"
-        fit
-        max-height="680"
-        @selection-change="handleSelectionChange"
-        @select="handleSelect"
-      >
-      <el-table-column type="selection" width="45" ></el-table-column>
-        <el-table-column label="序号" align="center" type="index" width="50"/>
-        <el-table-column label="所属组织" align="center" width="200" prop="orgName" />
-        <el-table-column label="单据编码" align="center" width="200" prop="billCode" />
-        <el-table-column label="申请人" align="center" prop="createName" />
-        <el-table-column label="申请时间" align="center" width="150" prop="createTime" />
-        <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug" />
-        <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
-        <el-table-column label="物料名称" align="center" width="150" prop="name" />
-        <el-table-column label="创建人" align="center" prop="createName"/>
-        <el-table-column label="创建时间" align="center" width="150" prop="createTime" />
-        <el-table-column label="最后修改人" align="center" width="120" prop="updateName" />
-        <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime" />
-        <el-table-column
-          fixed="right"
-          label="操作"
-          align="center"
-          width="180"
+      <el-card>
+        <el-table
+          :data="tableList"
+          class="request-table"
+          fit
+          max-height="680"
+          @selection-change="handleSelectionChange"
+          @select="handleSelect"
+        >
+          <el-table-column type="selection" width="45"></el-table-column>
+          <el-table-column label="序号" align="center" type="index" width="50"/>
+          <el-table-column label="所属组织" align="center" width="200" prop="orgName"/>
+          <el-table-column label="单据编码" align="center" width="200" prop="billCode"/>
+          <el-table-column label="申请人" align="center" prop="createName"/>
+          <el-table-column label="申请时间" align="center" width="150" prop="createTime"/>
+          <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug"/>
+          <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
+          <el-table-column label="物料名称" align="center" width="150" prop="name"/>
+          <el-table-column label="创建人" align="center" prop="createName"/>
+          <el-table-column label="创建时间" align="center" width="150" prop="createTime"/>
+          <el-table-column label="最后修改人" align="center" width="120" prop="updateName"/>
+          <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime"/>
+          <el-table-column
+            fixed="right"
+            label="操作"
+            align="center"
+            width="180"
           >
-          <template slot-scope="scope">
-            <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
-            <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
-            <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
-            <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
+            <template slot-scope="scope">
+              <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
+              <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
+                         size="small">编辑
+              </el-button>
+              <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
+              <el-button type="text" size="small" @click="deleteRow(scope.row)"
+                         v-if="scope.row.status == 0 || scope.row.status == 3">删除
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
 
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :page-sizes="[5, 10, 15, 20]"
-        :page-size=queryParams.pageSize
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-        style="text-align: center;">
-      </el-pagination>
-    </el-card>
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :page-sizes="[5, 10, 15, 20]"
+          :page-size=queryParams.pageSize
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          style="text-align: center;">
+        </el-pagination>
+      </el-card>
     </div>
 
-    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList" v-if="!isList"/>
+    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"
+               v-if="!isList"/>
   </div>
 </template>
 
 <script>
-import addReq from './add.vue';
-import { getReqList, delReq } from '@/api/requisition/basic'
-export default {
-  name: 'requisition',
-  components: {
-    addReq
-  },
-  data() {
-    return{
-      // 
-      tableList: [],
-      queryParams: {
-        billCode: '',
-        name: '',
-        status: '',
-        pageNum: 1,
-        pageSize: 10
-      },
-      options: [{
-        value: 0, label: '未提交'
-      },{
-        value: 1, label: '审批中'
-      },{
-        value: 2, label: '已完成'
-      },{
-        value: 3, label: '已驳回'
-      },],
-      total:0,
-      // isComponent
-      isComponent:'addReq',
-      isList: true,
-      // 页面状态
-      page: '',
-      rowDetail: {},
-      disable: false,
-      checkedList:[],
-    }
-  },
-  created() {
-    
-  },
-  mounted() {
-    this.getList(this.queryParams)
-  },
-  methods: {
-    reset() {
-      this.queryParams.billCode = ''
-      this.queryParams.name = ''
-      this.queryParams.status = ''
-      this.queryParams.pageNum = 1
-      this.getList(this.queryParams)
+  import addReq from './add.vue';
+  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
+  import {saveAs} from "file-saver";
+  import { blobValidate } from "@/utils/ruoyi";
+
+  export default {
+    name: 'requisition',
+    components: {
+      addReq
     },
-    newAdd() {
-      this.isList = false
-      this.isComponent = 'addReq'
-      this.page = 'add'
-      this.disable = false
+    data() {
+      return {
+        failLoad: false,
+        tableList: [],
+        queryParams: {
+          billCode: '',
+          name: '',
+          status: '',
+          pageNum: 1,
+          pageSize: 10
+        },
+        options: [{
+          value: 0, label: '未提交'
+        }, {
+          value: 1, label: '审批中'
+        }, {
+          value: 2, label: '已完成'
+        }, {
+          value: 3, label: '已驳回'
+        },],
+        total: 0,
+        // isComponent
+        isComponent: 'addReq',
+        isList: true,
+        // 页面状态
+        page: '',
+        rowDetail: {},
+        disable: false,
+        checkedList: [],
+        importData: {
+          show: false,
+          list: []
+        },
+      }
+    },
+    created() {
+
     },
-    // 复制
-    handleCopy(){
-      this.isList = false;
-      this.isComponent = 'addReq';
-      this.page = 'copy';
-      this.rowDetail =  this.checkedList[0];
-      this.disable = false;
+    mounted() {
+      this.getList(this.queryParams)
     },
-    // Select框
-    handleSelect(selection, row) {
+    methods: {
+      reset() {
+        this.queryParams.billCode = ''
+        this.queryParams.name = ''
+        this.queryParams.status = ''
+        this.queryParams.pageNum = 1
+        this.getList(this.queryParams)
+      },
+      newAdd() {
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'add'
+        this.disable = false
+      },
+      // 复制
+      handleCopy() {
+        this.isList = false;
+        this.isComponent = 'addReq';
+        this.page = 'copy';
+        this.rowDetail = this.checkedList[0];
+        this.disable = false;
+      },
+      // 导入
+      handleImport() {
+        this.importData.show = true
+      },
+      // 删除文件
+      handleFileRemove(file, fileList) {
+        console.log('删除文件', file, 'file', fileList, 'fileList');
+        this.importData.list = fileList;
+      },
+      // 文件发生改变
+      handleChangeFile(file, fileList) {
+        this.importData.list = fileList;
+      },
+      // 导入弹窗操作
+      handleImportData(type) {
+        switch (type) {
+          // 取消
+          case 'cancal':
+            this.importData.list = [];
+            this.importData.show = false;
+            break;
+          // 确认
+          case 'confirm':
+            if (this.importData.list.length) {
 
-      this.checkedList = selection;
+              let formData = new FormData();
 
-      console.log(this.checkedList, 'this.checkedList');
+              formData.append('file', this.importData.list[0].raw);
+              importData(formData).then(res => {
+                if (res.code == 200) {
+                  this.importData.show = false;
+                  this.importData.list = [];
+                  if (res.data.flag) {
+                    this.failLoad = true;
+                    console.log(res.data.datas)
+                    let param = {failDatas: res.data.datas}
+                    if (null != param) {
 
-    },
-    getList(val) {
-      console.log('val',val)
-      getReqList(val).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows
-          this.total = res.total
+                      fileImport(param).then(res => {
+                        console.log('res',res)
+                        const isBlob = blobValidate(res);
+                        if (isBlob) {
+                          const blob = new Blob([res]);
+                          saveAs(blob, '导入失败的物料申请单数据.xlsx');
+                        }
+                        this.failLoad = false;
+                      })
+                    }
+                  }
+                  this.$message({
+                    message: res.data.msg,
+                    type: res.data.flag ? 'warning' : 'success'
+                  });
+                } else {
+                  this.$message({
+                    message: res.msg,
+                    type: res.code == 200 ? 'success' : 'warning'
+                  });
+                }
+              })
+            } else {
+              this.$message({
+                message: '请上传文件之后在确认!',
+                type: 'warning'
+              });
+            }
+            break;
         }
-      })
-      this.checkedList = [];
-    },
-    // 表格内状态栏判断值
-    statusJug(row) {
-      if (row.status == 0) {
-        return '未提交'
-      } else if (row.status == 1) {
-        return '审批中'
-      } else if (row.status == 2) {
-        return '已完成'
-      } else if (row.status == 3) {
-        return '已驳回'
-      }
-    },
-    // 
-    handleSelectionChange () {
+      },
+      // Select框
+      handleSelect(selection, row) {
 
-    },
-    check(row) {
-      console.log('查看详情', row)
-      this.isList = false
-      this.isComponent = 'addReq'
-      this.page = 'check'
-      this.rowDetail = row
-      this.disable = true
-    },
-    edit(row) {
-      console.log('修改先加载详情', row)
-      this.isList = false
-      this.isComponent = 'addReq'
-      this.page = 'edit'
-      this.rowDetail = row
-      this.disable = false
-    },
-    commit(row) {
-      console.log('row', row)
-    },
-    deleteRow(row) {
-      this.$confirm('是否删除此条数据?', '提示', {
+        this.checkedList = selection;
+
+        console.log(this.checkedList, 'this.checkedList');
+
+      },
+      getList(val) {
+        console.log('val', val)
+        getReqList(val).then(res => {
+          if (res.code === 200) {
+            this.tableList = res.rows
+            this.total = res.total
+          }
+        })
+        this.checkedList = [];
+      },
+      // 表格内状态栏判断值
+      statusJug(row) {
+        if (row.status == 0) {
+          return '未提交'
+        } else if (row.status == 1) {
+          return '审批中'
+        } else if (row.status == 2) {
+          return '已完成'
+        } else if (row.status == 3) {
+          return '已驳回'
+        }
+      },
+      //
+      handleSelectionChange() {
+
+      },
+      check(row) {
+        console.log('查看详情', row)
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'check'
+        this.rowDetail = row
+        this.disable = true
+      },
+      edit(row) {
+        console.log('修改先加载详情', row)
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'edit'
+        this.rowDetail = row
+        this.disable = false
+      },
+      commit(row) {
+        console.log('row', row)
+      },
+      deleteRow(row) {
+        this.$confirm('是否删除此条数据?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
           delReq(row.id).then(res => {
-            if(res.code === 200) {
+            if (res.code === 200) {
               this.$message({
                 message: res.msg,
                 type: 'success'
@@ -265,26 +369,27 @@ export default {
               this.getList(this.queryParams)
             }
           })
-        }).catch(() => {})
-    },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-      this.queryParams.pageSize = val
-      this.getList(this.queryParams)
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
+        }).catch(() => {
+        })
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+        this.queryParams.pageSize = val
+        this.getList(this.queryParams)
+      },
+      handleCurrentChange(val) {
+        console.log(`当前页: ${val}`);
+        this.queryParams.pageNum = val
+        this.getList(this.queryParams)
+      }
     }
   }
-}
 </script>
 
 <style scoped lang="scss">
-.requisition {
-  height: calc(100vh - 84px);
-  padding: 12px;
-  box-sizing: border-box;
-}
-</style>
+  .requisition {
+    height: calc(100vh - 84px);
+    padding: 12px;
+    box-sizing: border-box;
+  }
+</style>

+ 0 - 31
src/views/monitor/job/index.vue

@@ -29,34 +29,6 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="任务员工" prop="empno">
-        <el-input
-          v-model="queryParams.empno"
-          placeholder="请输入员工工号"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="任务大类" prop="jobType">
-        <el-select v-model="queryParams.status" placeholder="请选择任务大类" clearable>
-          <el-option
-            v-for="dict in dict.type.sys_job_type"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="任务小类" prop="jobTypeS">
-        <el-select v-model="queryParams.status" placeholder="请选择任务小类" clearable>
-          <el-option
-            v-for="dict in dict.type.sys_job_types"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -134,7 +106,6 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="任务编号" width="100" align="center" prop="jobId" />
       <el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
-      <el-table-column label="员工工号" align="center" prop="empno" :show-overflow-tooltip="true" />
       <el-table-column label="任务组名" align="center" prop="jobGroup">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
@@ -536,7 +507,6 @@ export default {
         this.total = response.total;
         this.loading = false;
       });
-      console.log(this.queryParams,'this.queryParams')
     },
     // 任务组名字典翻译
     jobGroupFormat(row, column) {
@@ -552,7 +522,6 @@ export default {
       this.form = {
         jobId: undefined,
         jobName: undefined,
-        empno:undefined,
         jobGroup: undefined,
         invokeTarget: undefined,
         cronExpression: undefined,

+ 70 - 27
src/views/monitor/job/log.vue

@@ -58,6 +58,43 @@
           end-placeholder="结束日期"
         ></el-date-picker>
       </el-form-item>
+      <el-form-item label="是否完成" prop="whetherComplete">
+        <el-select v-model="queryParams.whetherComplete" placeholder="请选择任务是否完成" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_job_complete"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="任务员工" prop="empno">
+        <el-input
+          v-model="queryParams.empno"
+          placeholder="请输入员工工号"
+          clearable
+        />
+      </el-form-item>
+      <el-form-item label="任务大类" prop="jobType">
+        <el-select v-model="queryParams.jobType" placeholder="请选择任务大类" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_oa"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="任务小类" prop="jobTypeS">
+        <el-select v-model="queryParams.jobTypeS" placeholder="请选择任务小类" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_oa_s"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button
           type="primary"
@@ -131,6 +168,31 @@
     >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" width="80" align="center" prop="jobLogId" />
+      <el-table-column label="任务执行状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.sys_common_status"
+            :value="scope.row.status"
+          />
+        </template>
+      </el-table-column>
+      <!--      <el-table-column label="执行时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>-->
+      <el-table-column
+        label="完成时长"
+        width="180"
+        align="center"
+        prop="tqaaaa"
+      />
+      <el-table-column
+        label="超时时长"
+        width="180"
+        align="center"
+        prop="tqbbbb"
+      />
       <el-table-column
         label="任务名称"
         width="180"
@@ -180,28 +242,17 @@
         align="center"
         prop="executionTime"
       />
-      <el-table-column
-        label="完成时长"
-        width="180"
-        align="center"
-        prop="tqaaaa"
-      />
+
       <el-table-column
         label="预计时长"
         width="80"
         align="center"
         prop="durations"
       />
-      <el-table-column
-        label="超时时长"
-        width="180"
-        align="center"
-        prop="tqbbbb"
-      />
 
       <el-table-column
         label="oa执行状态"
-        width="80"
+        width="90"
         align="center"
         prop="completionStatus"
       >
@@ -233,19 +284,6 @@
         prop="jobMessage"
         :show-overflow-tooltip="true"
       />
-      <el-table-column label="任务执行状态" align="center" prop="status">
-        <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.sys_common_status"
-            :value="scope.row.status"
-          />
-        </template>
-      </el-table-column>
-      <!--      <el-table-column label="执行时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
-        </template>
-      </el-table-column>-->
 
       <el-table-column
         label="操作"
@@ -329,7 +367,7 @@ import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog";
 
 export default {
   name: "JobLog",
-  dicts: ["sys_common_status", "sys_job_group","sys_oa_back_state"],
+  dicts: ["sys_job_complete", "sys_oa", "sys_oa_s", "sys_common_status", "sys_job_group","sys_oa_back_state"],
   data() {
     return {
       // 遮罩层
@@ -357,6 +395,10 @@ export default {
         jobName: undefined,
         jobGroup: undefined,
         status: undefined,
+        jobType: undefined,
+        jobTypeS: undefined,
+        empno:undefined,
+        whetherComplete:undefined
       },
     };
   },
@@ -385,6 +427,7 @@ export default {
       this.loading = true;
       listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(
         (response) => {
+          // console.log(response, 'response')
           this.jobLogList = response.rows.map((item) => {
             const { executionTime, createTime, duration } = item;
 

+ 113 - 0
src/views/monitor/service/index.vue

@@ -0,0 +1,113 @@
+<template>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item label="任务名称" prop="taskName">
+                <el-input 
+                    v-model="queryParams.taskName"
+                    placeholder="请输入任务名称"
+                    clearable
+                    @keyup.enter.native="handleQuery"
+                />
+            </el-form-item>
+
+            <el-form-item label="来源系统" prop="baseId">
+                <el-input 
+                    v-model="queryParams.baseId"
+                    placeholder="请输入来源系统名称"
+                    clearable
+                    @keyup.enter.native="handleQuery"
+                />
+            </el-form-item>
+
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+            
+        </el-form>
+
+        <el-table v-loading="loading" :data="serviceList">
+            <el-table-column label="任务名称" min-width="120" align="center" prop="taskName" />
+            <el-table-column label="任务路径" min-width="120" align="center" prop="taskUrl" :show-overflow-tooltip="true"/>
+            <el-table-column label="来源系统" min-width="80" align="center" prop="baseId" />
+            <el-table-column label="任务信息" min-width="120" align="center" prop="taskMessage" :show-overflow-tooltip="true"/>
+            <el-table-column label="任务时间" min-width="60" align="center" prop="taskTime" :show-overflow-tooltip="true" :formatter="rounding"/>
+            <el-table-column label="任务返回信息" min-width="150" align="center" prop="taskResult" :show-overflow-tooltip="true"/>
+            <el-table-column label="异常信息" min-width="120" align="center" prop="taskAlarmSend" :show-overflow-tooltip="true"/>
+            <el-table-column label="请求超时时间" align="center" prop="timeOutSecs" :show-overflow-tooltip="true"/>
+            <el-table-column label="创建时间" min-width="120" align="center" prop="insertDate" :show-overflow-tooltip="true"/>
+            <el-table-column label="修改时间" min-width="120" align="center" prop="modifyDate" :show-overflow-tooltip="true"/>
+        </el-table>
+
+        <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+        />
+    </div>
+</template>
+
+<script>
+import { listService } from "@/api/monitor/service";
+
+export default {
+    data() {
+        return {
+            //遮罩层
+            loading: true,
+            //服务数据表
+            serviceList: [],
+            //显示搜索条件
+            showSearch: true,
+            //总条数
+            total: 0,
+            //查询参数
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                taskName: undefined,
+                baseId: undefined
+            }
+        }
+    },
+    updated() {},
+    mounted() {
+
+    },
+    created() {
+        this.getList()
+    },
+    methods: {
+        //保留两位小数点
+        rounding(row,column) {
+            return parseFloat(row[column.property]).toFixed(2);
+        },
+        //获取数据列表
+        getList(){
+            this.loading = true;
+            listService(this.queryParams).then(response => {
+                // console.log(response,'response')
+                this.serviceList = response.rows;
+                this.total = response.total;
+                this.loading = false;
+            });
+        },
+        //查询
+        handleQuery(){
+            this.queryParams.pageNum = 1;
+            this.getList();
+        },
+        //重置
+        resetQuery(){
+            this.resetForm("queryForm");
+            this.handleQuery();
+        }
+    }
+}
+</script>
+
+<style>
+
+</style>

+ 130 - 61
src/views/purchase/DemandSummary/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="checkDemandSummary">
-    <el-card>
+    <el-card style="position: relative;">
       <span>采购需求处理详情</span>
       <div class="btn_grooup">
         <el-button type="primary" size="mini" @click="editLine">编辑</el-button>
@@ -13,37 +13,41 @@
       <el-table 
           :data="tableList" 
           fit
-          max-height="680"
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          border
+          max-height="580"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-        <el-table-column show-overflow-tooltip type="selection" width="55" />
-        <el-table-column show-overflow-tooltip label="序号" align="center" type="index"/>
+        <el-table-column show-overflow-tooltip type="selection" fixed="left"/>
+        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55" fixed="left"/>
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
           <template slot-scope="scope">
             {{ scope.$index + 1 + '0' }}
           </template>
         </el-table-column>
-        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
-        <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="150px"/>
+        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
+        <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="120px"/>
         <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180"/>
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
         <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
-        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="150"/>
+        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="230"/>
         <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/>
         <el-table-column show-overflow-tooltip label="月销量" align="center" prop="totalMonthlySales"/>
         <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod"/>
-        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="150"/>
-        <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="150"/>
-        <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName"/>
-        <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="150"/>
-        <el-table-column show-overflow-tooltip label="最小包装量" align="center" prop="minPackage" width="150"/>
-        <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="150"/>
-        <el-table-column show-overflow-tooltip label="修改人" align="center" prop="updateByName" width="150"/>
+        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="120"/>
+        <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="120"/>
+        <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
+        <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="100"/>
+        <el-table-column show-overflow-tooltip label="最小包装量" align="center" prop="minPackage" width="100"/>
+        <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="100"/>
+        <el-table-column show-overflow-tooltip label="修改人" align="center" prop="updateByName" width="100"/>
         <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="updateCause" width="150"/>
         <el-table-column show-overflow-tooltip label="业务备注" align="center" prop="remark" width="150"/>
         <el-table-column show-overflow-tooltip label="有效期" align="center" prop="expiry" width="150"/>
-        <el-table-column show-overflow-tooltip label="要求交货日期" align="center" prop="deliveryDate" width="150"/>
+        <el-table-column show-overflow-tooltip label="要求交货日期" align="center" prop="deliveryDate" width="120"/>
         <el-table-column show-overflow-tooltip label="紧急标识" align="center" prop="isUrgency">
           <template slot-scope="scope">
             <el-switch
@@ -77,10 +81,23 @@
           </template>
         </el-table-column>
         <el-table-column show-overflow-tooltip label="需求单单号" align="center" prop="code" width="150"/>
-        <el-table-column show-overflow-tooltip label="供应仓库" align="center" prop="lastWarehouseName" width="150"/>
-        <el-table-column show-overflow-tooltip label="供应货位" align="center" prop="lastAllocationName" width="150"/>
-        <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" width="150" :formatter="formatterBillType"/>
-        <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="150"/>
+        <el-table-column show-overflow-tooltip label="供应仓库" align="center" prop="lastWarehouseName" width="100"/>
+        <el-table-column show-overflow-tooltip label="供应货位" align="center" prop="lastAllocationName" width="120"/>
+        <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="orgName" width="250px">
+          <template slot-scope="scope">
+              <el-input :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.orgName" @clear="clean(scope.row, '默认采购组织')" @focus="chooseMxHW(scope.$index, 'ORG_PARAM', true, '默认采购组织')">
+                <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
+              </el-input>
+          </template>
+        </el-table-column>
+        <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" width="120" :formatter="formatterBillType"/>
+        <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="200">
+            <template slot-scope="scope">
+              <el-input clearable :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.deliveryWarehouseName" @clear="clean(scope.row, '收货仓库')" @focus="chooseMxCK(scope.$index, 'WAREHOUSE_PARAM', true, '收货仓库', scope.row.org)">
+                <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseMxCK(scope.$index, 'WAREHOUSE_PARAM', true, '收货仓库', scope.row.org)"></el-button>
+              </el-input>
+            </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="收货货位" align="center" prop="deliveryAllocationName" width="200">
           <template slot-scope="scope">
             <el-input clearable :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.deliveryAllocationName" @clear="clean(scope.row, '收货货位')" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '收货货位', scope.row.deliveryWarehouse)">
@@ -88,20 +105,20 @@
             </el-input>
           </template>
         </el-table-column>
-        <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150"/>
-        <el-table-column show-overflow-tooltip label="制单人" align="center" prop="billMaker" width="150"/>
-        <el-table-column show-overflow-tooltip label="审核人员" align="center" prop="approver" width="150"/>
+        <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="100"/>
+        <el-table-column show-overflow-tooltip label="制单人" align="center" prop="billMaker" width="100"/>
+        <el-table-column show-overflow-tooltip label="审核人员" align="center" prop="approver" width="100"/>
         <!-- <el-table-column show-overflow-tooltip label="请购单号" align="center" prop="code"/> -->
-        <el-table-column show-overflow-tooltip label="品类" align="center" prop="materialCategory" width="150"/>
-        <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="150"/>
-        <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassify" width="150"/>
-        <el-table-column show-overflow-tooltip label="修改时间" align="center" prop="updateTime" width="150"/>
-        <el-table-column show-overflow-tooltip label="采购员编码" align="center" prop="buyer" width="150"/>
-        <el-table-column show-overflow-tooltip label="采购组织" align="center" prop="orgName" width="150"/>
-        <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="expiryUnit" width="150"/>
+        <el-table-column show-overflow-tooltip label="品类" align="center" prop="materialCategory" width="100"/>
+        <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="100"/>
+        <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassify" width="120"/>
+        <el-table-column show-overflow-tooltip label="修改时间" align="center" prop="updateTime" width="140"/>
+        <el-table-column show-overflow-tooltip label="采购员编码" align="center" prop="buyer" width="100"/>
+        <!-- <el-table-column show-overflow-tooltip label="采购组织" align="center" prop="orgName" width="150"/> -->
+        <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="expiryUnit" width="100"/>
         <!-- <el-table-column show-overflow-tooltip label="业务部门" align="center" prop="businessDeptName"/> -->
         <el-table-column show-overflow-tooltip label="需求部门" align="center" prop="demandDeptName" width="150"/>
-        <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="150">
+        <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="120">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.isBatchLock"
@@ -113,25 +130,25 @@
             </el-switch>
           </template>
         </el-table-column>
-        <el-table-column show-overflow-tooltip label="采购需求单审批人" align="center" prop="approveName" width="150"/>
-        <el-table-column show-overflow-tooltip label="需求单审批时间" align="center" prop="approverFinishTime" width="150"/>
-        <el-table-column show-overflow-tooltip label="需求单提交时间" align="center" prop="createTime" width="150"/>
-        <el-table-column show-overflow-tooltip label="需求单提交人" align="center" prop="createByName" width="150"/>
+        <el-table-column show-overflow-tooltip label="采购需求单审批人" align="center" prop="approveName" width="140"/>
+        <el-table-column show-overflow-tooltip label="需求单审批时间" align="center" prop="approverFinishTime" width="120"/>
+        <el-table-column show-overflow-tooltip label="需求单提交时间" align="center" prop="createTime" width="120"/>
+        <el-table-column show-overflow-tooltip label="需求单提交人" align="center" prop="createByName" width="120"/>
         <!-- <el-table-column show-overflow-tooltip label="处理需求时间" align="center" prop="processTime"/> -->
         <!-- <el-table-column show-overflow-tooltip label="处理需求人员" align="center" prop="processPersonal"/> -->
-        <el-table-column show-overflow-tooltip label="处理确认人" align="center" prop="affirmer" width="150"/>
-        <el-table-column show-overflow-tooltip label="处理确认时间" align="center" prop="affirmerTime" width="150"/>
+        <el-table-column show-overflow-tooltip label="处理确认人" align="center" prop="affirmerName" width="100"/>
+        <el-table-column show-overflow-tooltip label="处理确认时间" align="center" prop="affirmerTime" width="120"/>
         <!-- <el-table-column show-overflow-tooltip label="转请购时间" align="center" prop="code"/>
         <el-table-column show-overflow-tooltip label="转请购人员" align="center" prop="code"/> -->
-        <el-table-column show-overflow-tooltip label="价格类型" align="center" prop="priceType" width="150" :formatter="priceClass"/>
+        <el-table-column show-overflow-tooltip label="价格类型" align="center" prop="priceType" width="100" :formatter="priceClass"/>
       </el-table>
-    </el-card>
 
-    <div class="btn_group">
-      <el-col :span="1.5">
-        <el-button size="mini" plain @click="back">返回</el-button>
-      </el-col>
-    </div>
+      <div class="btn_group">
+        <el-col :span="1.5">
+          <el-button size="mini" plain @click="back" v-if="lineDisable">返回</el-button>
+        </el-col>
+      </div>
+    </el-card>
 
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
@@ -194,6 +211,10 @@ export default {
             return '新品需求'
           case 'HZBM':
             return '合作部门需求'
+          case 'DZBH':
+            return '大宗备货'
+          case 'XZCG':
+            return '行政类采购'
         }
       },
       // 不能直接改变props传来的值
@@ -234,6 +255,7 @@ export default {
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {
+      row.demandItemId = this.row.demandItemId
       getSummaryDetail(row).then(res => {
         if (res.code === 200) {
           this.tableList = res.data
@@ -253,7 +275,7 @@ export default {
     saveLine() {
       editSummaryMx(this.tableList).then(res => {
         if (res.code === 200) {
-          this.$modal.msgSuccess("保存成功");
+          this.$modal.notifySuccess("保存成功");
           this.lineDisable = true
           let param = JSON.parse(JSON.stringify(this.query))
           param.sumFlag = this.row.sumFlag
@@ -264,17 +286,20 @@ export default {
     // 行关闭
     closeLine() {
       if (this.ids.length == 0) {
-        this.$modal.msgWarning("请选中至少一条数据");
+        this.$modal.notifyWarning("请选中至少一条数据");
       } else {
-        let param = this.ids.join()
-        shutDownSummary(param).then(res => {
-          if (res.code === 200) {
-            this.$modal.msgSuccess("操作成功");
-            let param = JSON.parse(JSON.stringify(this.query))
-            param.sumFlag = this.row.sumFlag
-            this.getDetails(param)
-          }
-        })
+        this.$modal.confirm('是否确定关闭?').then(function () {
+        }).then(() => {
+          let param = this.ids.join()
+          shutDownSummary(param).then(res => {
+            if (res.code === 200) {
+              this.$modal.notifySuccess("操作成功");
+              let param = JSON.parse(JSON.stringify(this.query))
+              param.sumFlag = this.row.sumFlag
+              this.getDetails(param)
+            }
+          })
+        }).catch(() => {})
       }
     },
     // 重取批量
@@ -283,10 +308,11 @@ export default {
         let param = this.tableList.map(item => { return item.demandItemId })
         reloadBatch(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("操作成功");
-            let param = JSON.parse(JSON.stringify(this.query))
-            param.sumFlag = this.row.sumFlag
-            this.getDetails(param)
+            this.$modal.notifySuccess("操作成功");
+            let params = JSON.parse(JSON.stringify(this.query))
+            params.sumFlag = this.row.sumFlag
+            params.demandItemId = this.row.demandItemId
+            this.getDetails(params)
           }
         })
       }).catch(() =>{})
@@ -301,18 +327,47 @@ export default {
       this.referCondition.stordocId = stordocId
       this.$refs.refer.init(this.referCondition)
     },
+    // 明细行选择仓库
+    chooseMxCK(index, type, isPage, title, orgId) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.pkOrg = orgId
+      this.$refs.refer.init(this.referCondition)
+    },
     selectionsToInput(selection) {
       if (this.referCondition.title == '收货货位') {
         this.tableList[this.tableIndex].deliveryAllocationName = selection[0].name
         this.tableList[this.tableIndex].deliveryAllocation = selection[0].id
       }
+      if (this.referCondition.title == '收货仓库') {
+        this.tableList[this.tableIndex].deliveryWarehouseName = selection[0].name
+        this.tableList[this.tableIndex].deliveryWarehouse = selection[0].id
+        this.tableList[this.tableIndex].deliveryAllocation = ''
+        this.tableList[this.tableIndex].deliveryAllocationName = ''
+      }
       if (this.referCondition.title == '选择补单供应商') {
         this.tableList[this.tableIndex].additionalSupplierName = selection[0].name
         this.tableList[this.tableIndex].additionalSupplier = selection[0].id
       }
+      if (this.referCondition.title == '默认采购组织') {
+        this.tableList[this.tableIndex].org = selection[0].id
+        this.tableList[this.tableIndex].orgName = selection[0].name
+        this.tableList[this.tableIndex].deliveryWarehouse = ''
+        this.tableList[this.tableIndex].deliveryWarehouseName = ''
+        this.tableList[this.tableIndex].deliveryAllocation = ''
+        this.tableList[this.tableIndex].deliveryAllocationName = ''
+      }
     },
     // 清空选中的货位
     clean(row, title) {
+      if (title == '收货仓库') {
+        row.deliveryWarehouse = ''
+        row.deliveryWarehouseName = ''
+        row.deliveryAllocation = ''
+        row.deliveryAllocationName = ''
+      }
       if (title == '收货货位') {
         row.deliveryAllocation = ''
         row.deliveryAllocationName = ''
@@ -321,6 +376,14 @@ export default {
         row.additionalSupplier = ''
         row.additionalSupplierName = ''
       }
+      if (title == '默认采购组织') {
+        row.org = ''
+        row.orgName = ''
+        row.deliveryWarehouse = ''
+        row.deliveryWarehouseName = ''
+        row.deliveryAllocation = ''
+        row.deliveryAllocationName = ''
+      }
     }
   }
 }
@@ -328,14 +391,20 @@ export default {
 
 <style lang="scss" scoped>
  .btn_group {
-  width: 100%;
-  margin: 20px 0;
+  // width: 100%;
+  // margin: 20px 0;
   display: flex;
-  justify-content: center;
+  // justify-content: center;
+  position: absolute;
+  top: 10px;right: 20px;
 } 
 .btn_grooup {
+  margin-top: 10px;
   margin-bottom: 10px;
   display: flex;
   justify-content: flex-end;
 } 
+::v-deep .el-table__row > td {
+  border: none;
+}
 </style>

+ 69 - 51
src/views/purchase/DemandSummary/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="demandSummary">
     <div v-if="isList">
-      <el-card>
+      <el-card style="position: relative;">
         <el-form class="search_area" label-width="100px">
           <el-row :gutter="10">
             <el-col :span="1.5">
@@ -42,12 +42,14 @@
                 />
               </el-form-item>
             </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="" label-width="20px">
-                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="search">搜索</el-button>
-                <el-button size="mini" icon="el-icon-refresh" plain @click="reset">重置</el-button>
-              </el-form-item>
-            </el-col>
+            <!-- <el-col :span="1.5"> -->
+              <!-- <el-form-item label="" label-width="20px"> -->
+                <div style="position: absolute;top: 3px;right: 10px;">
+                  <el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
+                  <el-button size="mini" icon="el-icon-refresh" plain @click="reset">重置</el-button>
+                </div>
+              <!-- </el-form-item> -->
+            <!-- </el-col> -->
           </el-row>
 
           <CollapseTransition>
@@ -220,33 +222,39 @@
         <el-table 
           :data="tableList" 
           fit
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          border
           show-summary
           :summary-method="getSummaries"
-          max-height="550"
+          height="355"
+          max-height="355"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
-          <el-table-column type="selection" width="60" />
+          <el-table-column type="selection" width="60" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
           <!-- <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/> -->
-          <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
-          <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="180px"/>
-          <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180px"/>
-          <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification" width="200px"/>
+          <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
+          <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="100px"/>
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification" width="150px"/>
           <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
-          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
-          <el-table-column show-overflow-tooltip label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
+          <el-table-column show-overflow-tooltip label="需求单位数" align="center" prop="demandNum" width="100px"/>
           <el-table-column show-overflow-tooltip label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
           <el-table-column show-overflow-tooltip label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
           <el-table-column show-overflow-tooltip label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
           <el-table-column show-overflow-tooltip label="总月销量" align="center" prop="totalMonthlySales"/>
-          <el-table-column show-overflow-tooltip label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
+          <el-table-column show-overflow-tooltip label="需求可用周期" align="center" prop="demandCycle" width="120px"/>
           <el-table-column show-overflow-tooltip label="呆滞量" align="center" prop="dullQut"/>
           <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="buyPeriod"/>
           <el-table-column show-overflow-tooltip label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
           <el-table-column show-overflow-tooltip label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
-          <el-table-column show-overflow-tooltip label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
+          <el-table-column show-overflow-tooltip label="区域分仓公共库存" align="center" prop="regionPublicStock" width="150px"/>
           <el-table-column show-overflow-tooltip label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
           <el-table-column show-overflow-tooltip label="电商仓库" align="center" prop="commerceWarehouse"/>
           <el-table-column show-overflow-tooltip label="采购在途" align="center" prop="buyTransit"/>
@@ -264,14 +272,14 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
           <!-- <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
-          <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="150">
+          <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="100">
             <template slot-scope="scope">
                 <el-input :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
+          <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="120px"/>
+          <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="120px"/>
           <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
@@ -279,24 +287,24 @@
                 </el-input>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
-            <template slot-scope="scope">
+          <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="230px">
+            <!-- <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
                   <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
                 </el-input>
-            </template>
+            </template> -->
           </el-table-column>
           <el-table-column show-overflow-tooltip label="有效期" align="center" prop="validityPeriod"/>
           <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
           <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
           <el-table-column show-overflow-tooltip label="安全库存量" align="center" prop="safetyStock" width="100px"/>
           <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="billSource" :formatter="formatterSource"/>
-          <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant"/>
+          <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="120px"/>
           <!-- <el-table-column label="可用量" align="center" prop="qty"/> -->
           <el-table-column show-overflow-tooltip label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
-          <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
-          <el-table-column show-overflow-tooltip label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
-          <el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
+          <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassification" width="120px"/>
+          <el-table-column show-overflow-tooltip label="中心仓占有量" align="center" prop="centerBinPossession" width="120px"/>
+          <el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="120px"/>
           <!-- <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/> -->
           <!-- <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="需求单位" align="center" prop="demandUnit"/> -->
@@ -318,8 +326,8 @@
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="queryParams.pageNum"
-          :page-sizes="[10, 15, 20]"
-          :page-size="100"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
         </el-pagination>
@@ -337,7 +345,7 @@
 </template>
 
 <script>
-import Add from './add.vue'
+import Add from './add'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
@@ -408,7 +416,7 @@ export default {
       // 页面状态
       page: '',
       queryParams: {
-        rowStatus: [],
+        rowStatus: ['1'],
         buyer: '',
         buyerName: '',
         materialClassifyFourName: '',
@@ -502,7 +510,7 @@ export default {
     },
     reset() {
       this.queryParams = {
-        rowStatus: [],
+        rowStatus: ['1'],
         buyer: '',
         buyerName: '',
         materialClassifyFourName: '',
@@ -546,7 +554,7 @@ export default {
     handleCommand(command) {
       if(command == 'Excel导出') {
         if(this.allSelection.length == 0) {
-          this.$modal.msgWarning("请选中至少一条数据");
+          this.$modal.notifyWarning("请选中至少一条数据");
         } else {
           exportList(this.allSelection).then(res => {
             const blob = new Blob([res], {
@@ -569,7 +577,7 @@ export default {
 
       if (command == '导出明细') {
         if (this.allSelection.length == 0 || this.allSelection.length > 1) {
-          this.$modal.msgWarning("明细只能进行单条导出!");
+          this.$modal.notifyWarning("明细只能进行单条导出!");
         } else {
           let param = this.queryParams
           param.sumFlag = this.allSelection[0].sumFlag
@@ -622,7 +630,7 @@ export default {
     saveList() {
       editSummaryList(this.tableList).then(res => {
         if (res.code === 200) {
-          this.$modal.msgSuccess("保存成功");
+          this.$modal.notifySuccess("保存成功");
           this.lineDisable = true
           this.getList(this.queryParams)
         }
@@ -630,11 +638,11 @@ export default {
     },
     confirms() {
       if (this.ids.length == 0) {
-        this.$modal.msgWarning("请选中至少一条数据");
+        this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         confirmSummary(this.allSelection).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("确认成功");
+            this.$modal.notifySuccess("确认成功");
             this.getList(this.queryParams)
           }
         })
@@ -642,12 +650,12 @@ export default {
     },
     cancels() {
       if (this.ids.length == 0) {
-        this.$modal.msgWarning("请选中至少一条数据");
+        this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         let param = this.ids.join()
         cancelSummary(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("取消成功");
+            this.$modal.notifySuccess("取消成功");
             this.getList(this.queryParams)
           }
         })
@@ -655,12 +663,12 @@ export default {
     },
     audits() {
       if(this.ids.length == 0) {
-        this.$modal.msgWarning("请选中至少一条数据");
+        this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         let param = this.ids.join()
         auditSummary(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("审核成功");
+            this.$modal.notifySuccess("审核成功");
             this.getList(this.queryParams)
           }
         })
@@ -671,14 +679,14 @@ export default {
       let param = this.ids.join()
       shutDownSummary(param).then(res => {
         if (res.code === 200) {
-          this.$modal.msgSuccess("操作成功");
+          this.$modal.notifySuccess("操作成功");
           this.getList(this.queryParams)
         }
       })
     },
     closeLine() {
       if (this.ids.length == 0) {
-        this.$modal.msgWarning("请选中至少一条数据");
+        this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         console.log('选中数组', this.allSelection)
         let item = this.allSelection.some(item => {
@@ -737,11 +745,11 @@ export default {
         this.tableList[this.tableIndex].buyer = selection[0].code
         this.tableList[this.tableIndex].buyerName = selection[0].name
       }
-      if (this.referCondition.title == '明细默认采购组织') {
-        console.log('选择进了吗',this.tableList)
-        this.tableList[this.tableIndex].purchaseOrg = selection[0].id
-        this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
-      }
+      // if (this.referCondition.title == '明细默认采购组织') {
+      //   console.log('选择进了吗',this.tableList)
+      //   this.tableList[this.tableIndex].purchaseOrg = selection[0].id
+      //   this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
+      // }
     },
     // 搜索区树形选择
     chooseTreeRefer(type, isPage, title) {
@@ -776,7 +784,6 @@ export default {
 
 <style lang="scss" scoped>
 #demandSummary {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -799,4 +806,15 @@ export default {
   margin-top: 10px;
   text-align: right;
 }
+::v-deep .el-table__row > td {
+  border: none;
+}
+ ::v-deep .el-card .el-form-item {
+  margin-bottom: 3px;
+}
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+ }
 </style>

+ 10 - 6
src/views/purchase/MaterialClassDivision/add.vue

@@ -1,5 +1,7 @@
 <template>
   <div id="addDivision">
+    <el-card style="height: calc(100vh - 15vh);position: relative;overflow: scroll;">
+    <span>基本信息</span>
     <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
       <el-row :gutter="10">
         <el-col :span="1.5">
@@ -240,7 +242,7 @@
         <el-button size="mini" plain @click="back">返回</el-button>
       </el-col>
     </div>
-
+    </el-card>
     <fourClass
       ref="fourClass"
       @doSubmit="acceptFourClass"
@@ -340,7 +342,7 @@ export default {
         this.$modal.loading("保存中...");
         addDivision(this.basicForm).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("保存成功");
+            this.$modal.notifySuccess("保存成功");
             this.$modal.closeLoading();
             this.back()
           }
@@ -350,7 +352,7 @@ export default {
       } else if(this.pageStu == 'edit') {
         this.$modal.loading("保存中...");
         editDivision(this.basicForm).then(res => {
-          this.$modal.msgSuccess("编辑成功");
+          this.$modal.notifySuccess("编辑成功");
           this.$modal.closeLoading();
           this.back()
         }).catch(err => {
@@ -470,9 +472,11 @@ export default {
 
 <style lang="scss" scoped>
 .btn_group {
-  width: 100%;
-  margin: 20px 0;
+  // width: 100%;
+  // margin: 20px 0;
   display: flex;
-  justify-content: center;
+  // justify-content: center;
+  position: absolute;
+  top: 10px;right: 20px;
 } 
 </style>

+ 52 - 31
src/views/purchase/MaterialClassDivision/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="MaterialClassDivision">
     <div v-if="isList">
+      <el-card style="position: relative;">
       <el-form class="search_area" label-width="130px">
         <el-row :gutter="10">
           <el-col :span="1.5">
@@ -43,12 +44,14 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="mini" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+          <!-- <el-col :span="1.5"> -->
+            <!-- <el-form-item label="" label-width="20px"> -->
+            <div style="position: absolute;top: 3px;right: 10px;">
+              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
               <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
-            </el-form-item>
-          </el-col>
+            </div>
+            <!-- </el-form-item> -->
+          <!-- </el-col> -->
         </el-row>
 
         <CollapseTransition>
@@ -76,7 +79,7 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类编码">
-              <el-input size="mini" style="width: 200px" readonly v-model="queryParams.materialClassifyFour">
+              <el-input size="mini" style="width: 200px" readonly v-model="queryParams.materialClassify">
                 <el-button slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
               </el-input>
             </el-form-item>
@@ -180,7 +183,6 @@
       </el-form>
       <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
 
-      <el-card>
         <div class="btn_grooup">
           <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
 
@@ -209,28 +211,34 @@
         <el-table 
           :data="tableList" 
           fit
-          max-height="480"
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          border
+          height="390"
+          max-height="390"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
-          <el-table-column show-overflow-tooltip label="物料分类编码" align="center" width="150" prop="materialClassify"/>
-          <el-table-column show-overflow-tooltip label="物料分类名称" align="center" width="200" prop="materialClassifyName" />
-          <el-table-column show-overflow-tooltip label="一级分类名称" align="center" width="150" prop="materialClassifyOneName" />
-          <el-table-column show-overflow-tooltip label="二级分类名称" align="center" width="150" prop="materialClassifyTwoName" />
-          <el-table-column show-overflow-tooltip label="三级分类名称" align="center" width="150" prop="materialClassifyThreeName"/>
-          <el-table-column show-overflow-tooltip label="四级分类名称" align="center" width="150" prop="materialClassifyFourName" />
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" width="150" prop="materialCode" />
-          <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="物料分类编码" align="center" width="120" prop="materialClassify"/>
+          <!-- <el-table-column show-overflow-tooltip label="物料分类名称" align="center" width="200" prop="materialClassifyName" /> -->
+          <el-table-column show-overflow-tooltip label="一级分类名称" align="center" width="120" prop="materialClassifyOneName" />
+          <el-table-column show-overflow-tooltip label="二级分类名称" align="center" width="120" prop="materialClassifyTwoName" />
+          <el-table-column show-overflow-tooltip label="三级分类名称" align="center" width="120" prop="materialClassifyThreeName"/>
+          <el-table-column show-overflow-tooltip label="四级分类名称" align="center" width="120" prop="materialClassifyFourName" />
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" width="120" prop="materialCode" />
+          <el-table-column show-overflow-tooltip label="物料名称" align="center" width="150" prop="materialName" />
           <el-table-column show-overflow-tooltip label="生产厂商" align="center" width="150" prop="manufacturer" />
-          <el-table-column show-overflow-tooltip label="所属组织" align="center" width="120" prop="orgName"/>
-          <el-table-column show-overflow-tooltip label="订单员" align="center" width="150" prop="orderPersonalName" />
-          <el-table-column show-overflow-tooltip label="采购员" align="center" width="150" prop="buyerName" />
+          <el-table-column show-overflow-tooltip label="所属组织" align="center" width="200" prop="orgName"/>
+          <el-table-column show-overflow-tooltip label="订单员" align="center" width="100" prop="orderPersonalName" />
+          <el-table-column show-overflow-tooltip label="采购员" align="center" width="100" prop="buyerName" />
           <el-table-column show-overflow-tooltip label="订单部门" align="center" width="150" prop="orderDeptName" />
           <el-table-column show-overflow-tooltip label="部门" align="center" width="150" prop="puDeptName" />
-          <el-table-column show-overflow-tooltip label="创建人" align="center" width="150" prop="createByName" />
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="100" prop="createByName" />
           <el-table-column show-overflow-tooltip label="创建时间" align="center" width="150" prop="createTime" />
-          <el-table-column show-overflow-tooltip label="修改人" align="center" width="150" prop="updateByName" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="100" prop="updateByName" />
           <el-table-column show-overflow-tooltip label="修改时间" align="center" width="150" prop="updateTime" />
           <el-table-column
           fixed="right"
@@ -251,8 +259,8 @@
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="queryParams.pageNum"
-          :page-sizes="[10, 15, 20]"
-          :page-size="100"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
         </el-pagination>
@@ -309,7 +317,7 @@ export default {
         materialClassifyTwoName: '',
         materialClassifyThree: '',
         materialClassifyThreeName: '',
-        materialClassifyFour: '',
+        materialClassify: '',
         materialClassifyFourName: '',
         materialCode: '',
         materialName: '',
@@ -362,7 +370,7 @@ export default {
         materialClassifyTwoName: '',
         materialClassifyThree: '',
         materialClassifyThreeName: '',
-        materialClassifyFour: '',
+        materialClassify: '',
         materialClassifyFourName: '',
         materialCode: '',
         materialName: '',
@@ -377,14 +385,14 @@ export default {
     },
     deletes() {
       if (this.allSelection.length == 0) {
-        this.$modal.msgWarning("请至少选择一条数据!");
+        this.$modal.notifyWarning("请至少选择一条数据!");
       } else {
         let param = this.allSelection.map(item => item.id)
         let rows = param.join()
         this.$modal.confirm('确认删除选择数据?').then(() => {
           delDivision(rows).then(res => {
             if (res.code === 200) {
-              this.$modal.msgSuccess("删除成功");
+              this.$modal.notifySuccess("删除成功");
               this.getList(this.queryParams)
             }
           })
@@ -420,7 +428,7 @@ export default {
       this.$modal.confirm('确认信息').then(() => {
         delDivision(row.id).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("删除成功");
+            this.$modal.notifySuccess("删除成功");
             this.getList(this.queryParams)
           }
         })
@@ -446,7 +454,7 @@ export default {
     // 选择物料分类
     acceptFourClass(selections) {
       console.log('收到的四级分类', selections)
-      this.queryParams.materialClassifyFour = selections.code
+      this.queryParams.materialClassify = selections.code
     },
     // 显示物料编码列表
     test01() {
@@ -478,7 +486,6 @@ export default {
 
 <style lang="scss" scoped>
 #MaterialClassDivision {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -491,8 +498,22 @@ export default {
 .lines {
   margin-top: 0;
 }
+::v-deep .el-table__row > td {
+  border: none;
+}
+ ::v-deep .el-card .el-form-item {
+  margin-bottom: 3px;
+}
 .el-pagination {
   margin-top: 10px;
   text-align: right;
 }
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+}
+.el-table .el-table__header-wrapper th {
+  font-size: 14px;
+}
 </style>

文件差異過大導致無法顯示
+ 315 - 358
src/views/purchase/PurchaseDemandList/add.vue


+ 46 - 22
src/views/purchase/PurchaseDemandList/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="PurchaseDemandList">
     <div v-if="isList">
-      <el-card>
+      <el-card style="position: relative;">
         <el-form class="search_area" label-width="100px">
           <el-row :gutter="10">
             <el-col :span="1.5">
@@ -40,12 +40,14 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="" label-width="20px">
-                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="searchList">搜索</el-button>
-                <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
-              </el-form-item>
-            </el-col>
+            <!-- <el-col :span="1.5"> -->
+              <!-- <el-form-item label="" label-width="20px"> -->
+                <div style="position: absolute;top: 3px;right: 10px;">
+                  <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
+                  <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+                </div>
+              <!-- </el-form-item> -->
+            <!-- </el-col> -->
           </el-row>
         <CollapseTransition>
           <div v-show="expanded">
@@ -156,20 +158,25 @@
           <el-button type="primary" size="mini" @click="delItems">删除</el-button>
           <!-- <el-button type="primary" size="mini">打印</el-button> -->
         </div>
+        
         <el-table 
           :data="tableList" 
           fit
-          max-height="550"
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          max-height="410"
+          border
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
-          <el-table-column show-overflow-tooltip label="编码" align="center" width="200" prop="code"/>
+          <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
+          <el-table-column show-overflow-tooltip label="编码" align="center" width="170" prop="code"/>
           <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
-          <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="150" prop="approverFinishTime"/>
+          <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
-          <!-- <el-table-column show-overflow-tooltip label="是否已处理需求" align="center" width="150" prop="isProcess" /> -->
-          <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" :formatter="formatterBillType"/>
+          <el-table-column show-overflow-tooltip label="业务类型" align="center" width="120" prop="billType" :formatter="formatterBillType"/>
           <!-- <el-table-column show-overflow-tooltip label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
           <el-table-column show-overflow-tooltip label="需求人员" align="center" prop="demandPersonalName" />
           <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
@@ -199,8 +206,8 @@
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="queryParams.pageNum"
-          :page-sizes="[10, 15, 20]"
-          :page-size="100"
+          :page-sizes="[10, 20 ,50 ,100]"
+          :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
         </el-pagination>
@@ -404,6 +411,10 @@ export default {
           return '新品需求'
         case 'HZBM':
           return '合作部门需求'
+        case 'DZBH':
+          return '大宗备货'
+        case 'XZCG':
+          return '行政类采购'
       }
     },
     formatterSource(row) {
@@ -516,7 +527,7 @@ export default {
     handleExport(command) {
       if(command == '选中导出') {
         if (this.ids.length == 0) {
-          this.$modal.msgWarning("请选中至少一条数据");
+          this.$modal.notifyWarning("请选中至少一条数据");
         } else {
           let param = {all: false, ids: this.ids}
           exportDemand(param).then(res => {
@@ -578,7 +589,7 @@ export default {
       this.$modal.loading("提交中...");
       submitDemand(row).then(res => {
         if (res.code === 200) {
-          this.$modal.msgSuccess("提交成功");
+          this.$modal.notifySuccess("提交成功");
           this.$modal.closeLoading();
           this.getList(this.queryParams)
         }
@@ -592,7 +603,7 @@ export default {
       this.$modal.confirm('确定删除选择数据?').then(() => {
         delDemand(row.id).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("删除成功");
+            this.$modal.notifySuccess("删除成功");
             this.getList(this.queryParams)
           }
         })
@@ -601,13 +612,13 @@ export default {
     // 批量删除按钮
     delItems() {
       if(this.ids.length == 0) {
-        this.$modal.msgWarning("请选中至少一条数据");
+        this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         let param = this.ids.join()
         this.$modal.confirm('确认信息').then(() => {
         delDemand(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("删除成功");
+            this.$modal.notifySuccess("删除成功");
             this.getList(this.queryParams)
           }
         })
@@ -674,7 +685,7 @@ export default {
         this.referCondition.stordocId = stordocId
         this.$refs.refer.init(this.referCondition)
       } else {
-        this.$modal.msgWarning("请先选择仓库")
+        this.$modal.notifyWarning("请先选择仓库")
       }
     },
     cleanMb() {
@@ -698,7 +709,6 @@ export default {
 
 <style lang="scss" scoped>
 #PurchaseDemandList {
-  height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
   overflow-y: scroll;
@@ -715,4 +725,18 @@ export default {
   margin-top: 10px;
   text-align: right;
 }
+::v-deep .el-table__row > td {
+  border: none;
+}
+ ::v-deep .el-card .el-form-item {
+  margin-bottom: 10px;
+}
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+}
+.el-table .el-table__header-wrapper th {
+  font-size: 14px;
+}
 </style>

+ 1 - 1
src/views/purchase/PurchaseDemandList/reserved.vue

@@ -151,4 +151,4 @@ export default {
     }
   }
 }
-</script>
+</script>

+ 9 - 39
src/views/purchase/apply/add/columns.js

@@ -3,10 +3,6 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "priceName", title: "价格名称" },
-      attr: { is: "el-input", value: "价格申报单" },
-    },
-    {
       item: { key: "priceCode", title: "价格编码" },
       attr: { is: "el-input", disabled: true, readonly: true },
     },
@@ -80,6 +76,7 @@ export default function useColumns() {
       attr: {
         is: "el-select",
         dictName: "is_effective",
+        value: "N",
       },
     },
     {
@@ -135,10 +132,14 @@ export default function useColumns() {
               specification: "specification",
               manufacturer: "manufacturerId",
               manufacturerName: "manufacturerIdName",
+              tax: "materialRateName",
             },
           },
         },
-        { item: { key: "materialCode", title: "物料编码" }, attr: {} },
+        {
+          item: { key: "materialCode", title: "物料编码", require: true },
+          attr: {},
+        },
         { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
@@ -234,7 +235,6 @@ export default function useColumns() {
                 return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
               },
             },
-
             value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
           },
         },
@@ -267,10 +267,11 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "priceType", title: "价格类型" },
+          item: { key: "priceType", title: "价格类型", require: true },
           attr: {
             is: "el-select",
             dictName: "sys_price_type",
+            value: "order",
           },
         },
         {
@@ -278,44 +279,13 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            value: "N",
           },
         },
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],
     },
-    {
-      item: {
-        title: "合同执行组织范围",
-        key: "priceApplyOrgs",
-      },
-      attr: {
-        value: [],
-      },
-      TableColumns: [
-        {
-          item: { key: "orgName", title: "组织", require: true, width: "auto" },
-          attr: {
-            is: "el-popover-select-v2",
-            valueKey: "name",
-            referName: "ORG_PARAM",
-            dataMapping: {
-              org: "id",
-              orgCode: "code",
-              orgName: "name",
-            },
-          },
-        },
-        {
-          item: { key: "createByName", title: "创建人名称", width: "auto" },
-          attr: {},
-        },
-        {
-          item: { key: "updateByName", title: "更新人名称", width: "auto" },
-          attr: {},
-        },
-      ],
-    },
   ];
 
   return { TableColumns, TabColumns };

+ 72 - 277
src/views/purchase/apply/add/index.vue

@@ -1,44 +1,8 @@
 <script>
 import useColumns from "./columns";
-import { REFER } from "@/components/popover-select/api";
 import { EXIST } from "@/api/business/purchase/catalogue";
-import { ITEM, SAVE } from "@/api/business/purchase/apply";
-
-const fetchTax = async (prop) => {
-  try {
-    // try
-    const { code, rows } = await REFER({
-      search: prop,
-      type: "TAX_RATE_PARAM",
-    });
-    if (code === 200) {
-      return rows[0] || {};
-    }
-  } catch (err) {
-    // catch
-    console.error(err);
-  } finally {
-    // finally
-  }
-};
-
-const fetchUnit = async (prop) => {
-  try {
-    // try
-    const { code, rows } = await REFER({
-      search: prop,
-      type: "UNIT_PARAM",
-    });
-    if (code === 200) {
-      return rows[0] || {};
-    }
-  } catch (err) {
-    // catch
-    console.error(err);
-  } finally {
-    // finally
-  }
-};
+import { SAVE } from "@/api/business/purchase/apply";
+import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
 
 const fetchExist = async (prop) => {
   try {
@@ -59,14 +23,6 @@ export default {
     dict: {
       type: Object,
     },
-    selectData: {
-      type: [Array],
-      require: true,
-    },
-    addType: {
-      type: String,
-      default: "add",
-    },
   },
   components: {
     ElSuperForm: () => import("@/components/super-form/index.vue"),
@@ -86,6 +42,7 @@ export default {
     const rules = this.$init.rules([...TabColumns, ...TableColumns]);
     const params = this.$init.params([...TabColumns, ...TableColumns]);
     return {
+      title: "新 增",
       width: "100%",
       visible: false,
       loading: false,
@@ -96,108 +53,21 @@ export default {
       TableColumns: TableColumns,
     };
   },
-  computed: {
-    title: {
-      get() {
-        const { addType } = this;
-        if (addType === "add") {
-          return "新 增";
-        }
-        if (addType === "copy") {
-          return "复 制";
-        }
-        if (addType === "edit") {
-          return "编 辑";
-        }
-      },
-      set() {},
-    },
-    disabled: {
-      get() {
-        const {
-          addType,
-          selectData,
-          selectData: [{ status } = {}],
-        } = this.$props;
-        if (addType === "add") {
-          return false;
-        }
-        if (addType === "copy") {
-          if (selectData.length !== 1) {
-            return true;
-          }
-        }
-        if (addType === "edit") {
-          if (selectData.length !== 1) {
-            return true;
-          }
-          if (selectData.length === 1 && status === "1") {
-            return true;
-          }
-          if (selectData.length === 1 && status === "2") {
-            return true;
-          }
-        }
-      },
-      set() {},
-    },
-    priceApply: {
-      get() {
-        const {
-          params: { priceApplyOrgs, priceApplyItems },
-        } = this;
-        this.params.priceApplyOrgs = priceApplyOrgs.map((item, index) => ({
-          ...item,
-          $index: index,
-        }));
-        this.params.priceApplyItems = priceApplyItems.map((item, index) => ({
-          ...item,
-          $index: index,
-        }));
-        return {
-          priceApplyOrgs: this.params.priceApplyOrgs.filter(
-            ({ delFlag }) => delFlag !== "2"
-          ),
-          priceApplyItems: this.params.priceApplyItems.filter(
-            ({ delFlag }) => delFlag !== "2"
-          ),
-        };
-      },
-      set() {},
-    },
-  },
+  computed: {},
   watch: {},
   methods: {
     //
-    changePuOrgName(prop) {
-      const {
-        select: { id: org, code: orgCode, name: orgName },
-      } = prop;
-      const index = this.params.priceApplyOrgs.findIndex(
-        (item) => item.org === org
-      );
-      if (index === -1) {
-        this.params.priceApplyOrgs.push({
-          org,
-          orgCode,
-          orgName,
-          createByName: undefined,
-          updateByName: undefined,
-        });
-      }
-    },
-    //
     changeMaterialName(prop) {
       const { row } = prop;
       const { puOrg, customer, supplier } = this.params;
-      const { rateCode, unitIdName, code: materialCode } = row;
+      const { tax: taxName, unitName, code: materialCode } = row;
       // task 1
-      fetchTax(rateCode).then((res) => {
+      tax(taxName).then((res) => {
         const { ntaxrate } = res;
         row.tax = ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
       });
       // task 2
-      fetchUnit(unitIdName).then((res) => {
+      unit(unitName).then((res) => {
         const { id, code, name } = res;
         row.unit = id;
         row.unitCode = code;
@@ -207,95 +77,54 @@ export default {
         row.puUnitName = name;
       });
       // task 3
+      currency("人民币").then((res) => {
+        const { id, code, name } = res;
+        row.currency = id;
+        row.currencyCode = code;
+        row.currencyName = name;
+      });
+      // task 4
       fetchExist({ puOrg, customer, supplier, materialCode }).then((res) => {
         const { recentlyPrice, isApprovalFirst, isPriceAdjustment } = res;
         row.recentlyPrice = recentlyPrice;
-        row.isApprovalFirst = isApprovalFirst;
-        row.isPriceAdjustment = isPriceAdjustment;
-      });
-    },
-
-    //
-    async fetchItem(prop) {
-      try {
-        // try
-        this.loading = true;
-        const { code, data } = await ITEM(prop);
-        if (code === 200) {
-          this.params = data;
-          return true;
-        } else {
-          return false;
+        if (isApprovalFirst) {
+          row.isApprovalFirst = isApprovalFirst == 0 ? "Y" : "N";
         }
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
+        if (isPriceAdjustment) {
+          row.isPriceAdjustment = isPriceAdjustment == 0 ? "Y" : "N";
+        }
+      });
     },
     //
-    async open() {
-      const { addType, selectData } = this.$props;
-      if (addType === "add") {
-        this.visible = true;
-      }
-      if (addType === "copy") {
-        const [{ id }] = selectData;
-        this.visible = await this.fetchItem(id);
-        this.params.id = null;
-        this.params.createBy = null;
-        this.params.priceCode = null;
-        this.params.createByName = null;
-        this.params.effectiveDate = null;
-        this.params.priceApplyItems = this.params.priceApplyItems.map(
-          (item) => ({
-            ...item,
-            id: null,
-            applyId: null,
-            createByName: null,
-            updateByName: null,
-          })
-        );
-        this.params.priceApplyOrgs = this.params.priceApplyOrgs.map((item) => ({
-          ...item,
-          id: null,
-          applyId: null,
-          createByName: null,
-          updateByName: null,
-        }));
-      }
-      if (addType === "edit") {
-        const [{ id }] = selectData;
-        this.visible = await this.fetchItem(id);
-        this.params.priceApplyItems = this.params.priceApplyItems.map(
-          (item) => ({
-            ...item,
-          })
-        );
-        this.params.priceApplyOrgs = this.params.priceApplyOrgs.map((item) => ({
-          ...item,
-        }));
-      }
+    async onOpen() {
+      this.visible = true;
+      const {
+        deptId: puDept,
+        deptName: puDeptName,
+        name: buyer,
+        nickName: buyerName,
+        orgId: puOrg,
+        orgName: puOrgName,
+      } = this.$store.state.user;
+      const { id, code, name } = await currency("人民币");
+      this.params.currency = id;
+      this.params.currencyCode = code;
+      this.params.currencyName = name;
+      this.params.puOrg = puOrg;
+      this.params.puOrgName = puOrgName;
+      this.params.buyer = buyer;
+      this.params.buyerName = buyerName;
+      this.params.puDept = puDept;
+      this.params.puDeptName = puDeptName;
     },
     //
-    async hide() {
-      const {
-        TabColumns,
-        TableColumns,
-        TabColumns: [
-          {
-            item: { key: tabName },
-          },
-        ],
-      } = useColumns();
+    async onHide() {
+      const { TabColumns, TableColumns } = useColumns();
       this.visible = false;
-      this.tabName = tabName;
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async useRowAdd(prop) {
+    async onRowAdd(prop) {
       const {
         $notify,
         TabColumns,
@@ -316,46 +145,19 @@ export default {
       });
     },
     //
-    async useRowRemove(prop, scope) {
-      const { addType } = this.$props;
-      const {
-        row: { $index },
-      } = scope;
-      if (addType === "add") {
-        this.params[prop].splice($index, 1);
-      }
-      if (addType === "copy") {
-        this.params[prop].splice($index, 1);
-      }
-      if (addType === "edit") {
-        this.params[prop] = this.params[prop].map((item, index) => ({
-          ...item,
-          delFlag: index === $index ? "2" : item.delFlag,
-        }));
-        console.log(this.params[prop]);
-      }
+    async onRowRemove(prop, scope) {
+      const { $index } = scope;
+      this.params[prop].splice($index, 1);
     },
     //
     async useSubmit(prop) {
-      this.$refs[prop].$refs[prop].validate(async (valid) => {
+      this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
             this.loading = true;
-            const {
-              params,
-              params: { priceApplyOrgs, priceApplyItems },
-            } = this;
-            if (this.addType === "edit") {
-              params.priceApplyOrgs = priceApplyOrgs.filter(
-                (item) => item.orgName
-              );
-              params.priceApplyItems = priceApplyItems.filter(
-                (item) => item.materialName
-              );
-            }
-            const { msg, code } = await SAVE(params);
+            const { msg, code } = await SAVE(this.params);
             if (code === 200) {
-              this.hide();
+              this.onHide();
               this.$emit("success");
               this.$notify.success(msg);
             }
@@ -378,21 +180,31 @@ export default {
 };
 </script>
 <template>
-  <el-button
-    v-bind="$attrs"
-    v-on="$listeners"
-    :disabled="disabled"
-    @click="open"
-  >
+  <el-button v-bind="$attrs" v-on="$listeners" @click="onOpen">
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
       destroy-on-close
-      @close="hide"
+      @close="onHide"
     >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button
+          type="primary"
+          :size="$attrs.size"
+          :loading="loading"
+          @click="useSubmit('superForm')"
+        >
+          确 认
+        </el-button>
+        <el-button :size="$attrs.size" :loading="loading" @click="onHide">
+          取 消
+        </el-button>
+      </template>
       <el-super-form
         v-model="params"
         :dict="dict"
@@ -424,7 +236,7 @@ export default {
           lazy
         >
           <el-super-table
-            v-model="priceApply[item.key]"
+            v-model="params[item.key]"
             :dict="dict"
             :ref="tabName"
             :columns="columns"
@@ -440,41 +252,24 @@ export default {
               >
               </component>
             </template>
-            <el-table-column fixed="right" label="操作" width="75">
+            <el-table-column fixed="right" label="操作" width="100">
               <template slot="header" slot-scope="scope">
-                <el-button
-                  circle
-                  icon="el-icon-plus"
-                  :size="$attrs.size"
-                  @click="useRowAdd(tabName)"
-                >
+                <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
+                  新增
                 </el-button>
               </template>
               <template slot-scope="scope">
                 <el-button
-                  circle
-                  icon="el-icon-minus"
                   :size="$attrs.size"
-                  @click.native.prevent="useRowRemove(tabName, scope)"
+                  @click.native.prevent="onRowRemove(tabName, scope)"
                 >
+                  删除
                 </el-button>
               </template>
             </el-table-column>
           </el-super-table>
         </el-tab-pane>
       </el-tabs>
-      <div style="padding: 20px; text-align: right">
-        <el-button :size="$attrs.size" :loading="loading" @click="hide"
-          >取 消</el-button
-        >
-        <el-button
-          type="primary"
-          :size="$attrs.size"
-          :loading="loading"
-          @click="useSubmit('superForm')"
-          >确 认</el-button
-        >
-      </div>
     </el-drawer>
   </el-button>
 </template>

+ 9 - 7
src/views/purchase/apply/columns.js

@@ -2,7 +2,6 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "priceName", title: "价格名称" }, attr: {} },
     { item: { key: "priceCode", title: "价格编码" }, attr: {} },
     {
       item: { key: "status", title: "状态" },
@@ -17,7 +16,7 @@ export default function useColumns() {
     { item: { key: "buyerName", title: "采购员" }, attr: {} },
     { item: { key: "puDeptName", title: "采购部门" }, attr: {} },
     {
-      item: { key: "file", title: "附件" },
+      item: { key: "file", title: "附件", filter: false },
       attr: { is: "el-file-preview" },
     },
     { item: { key: "createByName", title: "创建人" }, attr: {} },
@@ -36,7 +35,13 @@ export default function useColumns() {
     },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
   }));
   const SearchColumns = [
     {
@@ -100,10 +105,7 @@ export default function useColumns() {
         clearable: true,
       },
     },
-  ].map(({ item, attr }) => ({
-    attr,
-    item: { ...item, hidden: true, span: item.span || 6 },
-  }));
+  ];
 
   return { TableColumns, SearchColumns };
 }

+ 291 - 0
src/views/purchase/apply/copy/columns.js

@@ -0,0 +1,291 @@
+import CONFIG from "@/config";
+
+export default function useColumns() {
+  const TableColumns = [
+    {
+      item: { key: "priceCode", title: "价格编码" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "supplierName", title: "供应商", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "SUPPLIER_PARAM",
+        dataMapping: {
+          supplier: "id",
+          supplierCode: "code",
+          supplierName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "puOrgName", title: "采购组织", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "ORG_PARAM",
+        dataMapping: { puOrg: "id", puOrgCode: "code", puOrgName: "name" },
+      },
+    },
+    {
+      item: { key: "currencyName", title: "币种", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "CURRENCY_PARAM",
+        dataMapping: {
+          currency: "id",
+          currencyCode: "code",
+          currencyName: "name",
+        },
+      },
+    },
+    {
+      item: { key: "explainStr", title: "价格合理性说明", require: true },
+      attr: { is: "el-input" },
+    },
+    {
+      item: { key: "buyerName", title: "采购员", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "CONTACTS_PARAM",
+        dataMapping: { buyer: "code", buyerName: "name" },
+      },
+    },
+    {
+      item: { key: "puDeptName", title: "采购部门", require: true },
+      attr: {
+        is: "el-popover-select-v2",
+        valueKey: "name",
+        referName: "DEPT_PARAM",
+        dataMapping: { puDept: "id", puDeptCode: "code", puDeptName: "name" },
+      },
+    },
+    {
+      item: { key: "createByName", title: "创建人" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "source", title: "来源单据号" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "isEffective", title: "是否已推价格" },
+      attr: {
+        is: "el-select",
+        dictName: "is_effective",
+        value: "N",
+      },
+    },
+    {
+      item: { key: "effectiveDate", title: "生效日期" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "file", title: "附件", require: true, span: 24 },
+      attr: { is: "el-file-upload" },
+    },
+    {
+      item: { key: "sourceType", title: "来源单据类型" },
+      attr: { is: "el-input", disabled: true, readonly: true },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "sys_status",
+        disabled: true,
+        readonly: true,
+        value: "0",
+      },
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+
+  const TabColumns = [
+    {
+      item: {
+        title: "物料信息表",
+        key: "priceApplyItems",
+      },
+      attr: {
+        value: [],
+      },
+      TableColumns: [
+        {
+          item: { key: "materialName", title: "物料名称", require: true },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "MATERIAL_PARAM",
+            dataMapping: {
+              model: "model",
+              material: "id",
+              materialCode: "code",
+              materialName: "name",
+              unitName: "unitIdName",
+              puUnitName: "unitIdName",
+              specification: "specification",
+              manufacturer: "manufacturerId",
+              manufacturerName: "manufacturerIdName",
+            },
+          },
+        },
+        {
+          item: { key: "materialCode", title: "物料编码", require: true },
+          attr: {},
+        },
+        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
+        { item: { key: "specification", title: "规格" }, attr: {} },
+        { item: { key: "model", title: "型号" }, attr: {} },
+        {
+          item: { key: "unitName", title: "单位" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: { unit: "id", unitCode: "code", unitName: "name" },
+          },
+        },
+        {
+          item: { key: "puUnitName", title: "采购单位" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "UNIT_PARAM",
+            dataMapping: {
+              puUnit: "id",
+              puUnitCode: "code",
+              puUnitName: "name",
+            },
+          },
+        },
+        {
+          item: { key: "conversionRate", title: "采购换算率", require: true },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: { key: "tax", title: "税率%", require: true },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "ntaxrate",
+            referName: "TAX_RATE_PARAM",
+            dataMapping: { tax: "ntaxrate" },
+          },
+        },
+        {
+          item: { key: "taxPrice", title: "含税单价", require: true },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+        {
+          item: { key: "price", title: "无税单价", require: true },
+          attr: {
+            formatter: (prop) => {
+              const { tax = 0, taxPrice = 0 } = prop;
+              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
+                CONFIG.precision
+              );
+              return prop.price;
+            },
+          },
+        },
+        {
+          item: { key: "currencyName", title: "币种" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "CURRENCY_PARAM",
+            dataMapping: {
+              currency: "id",
+              currencyCode: "code",
+              currencyName: "name",
+            },
+          },
+        },
+        {
+          item: {
+            key: "periodBegin",
+            title: "价格有效期(起)",
+            require: true,
+          },
+          attr: {
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd",
+            value: new Date(),
+          },
+        },
+        {
+          item: { key: "periodEnd", title: "价格有效期(止)", require: true },
+          attr: {
+            is: "el-date-picker",
+            valueFormat: "yyyy-MM-dd",
+            pickerOptions: {
+              disabledDate(time) {
+                return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
+              },
+            },
+            value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
+          },
+        },
+        {
+          item: { key: "customerName", title: "客户" },
+          attr: {
+            is: "el-popover-select-v2",
+            valueKey: "name",
+            referName: "CUSTOMER_PARAM",
+            dataMapping: {
+              customer: "id",
+              customerCode: "code",
+              customerName: "name",
+            },
+          },
+        },
+        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        {
+          item: { key: "isApprovalFirst", title: "首次报批" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { key: "isPriceAdjustment", title: "价格调整" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { key: "priceType", title: "价格类型", require: true },
+          attr: {
+            is: "el-select",
+            dictName: "sys_price_type",
+            value: "order",
+          },
+        },
+        {
+          item: { key: "isDistributionPrice", title: "配送价", require: true },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
+        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+      ],
+    },
+  ];
+
+  return { TableColumns, TabColumns };
+}

部分文件因文件數量過多而無法顯示