Browse Source

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!265
黄梓星 1 năm trước cách đây
mục cha
commit
519464239a
38 tập tin đã thay đổi với 715 bổ sung631 xóa
  1. 6 2
      src/assets/styles/index.scss
  2. 4 6
      src/assets/styles/sidebar.scss
  3. 1 1
      src/components/Pagination/index.vue
  4. 56 0
      src/components/popover-select-v2/fetch/index.js
  5. 9 54
      src/components/super-search/index.vue
  6. 39 64
      src/components/super-table/index.vue
  7. 0 1
      src/layout/components/Navbar.vue
  8. 1 2
      src/layout/components/TagsView/index.vue
  9. 85 71
      src/layout/index.vue
  10. 2 1
      src/main.js
  11. 31 29
      src/store/modules/app.js
  12. 4 0
      src/utils/init.js
  13. 3 1
      src/utils/init/index.js
  14. 88 39
      src/views/material/basicFile/details.vue
  15. 51 28
      src/views/material/basicFile/index.vue
  16. 1 1
      src/views/material/basicFile/style/index.scss
  17. 52 31
      src/views/purchase/PurchaseDemandList/add.vue
  18. 8 38
      src/views/purchase/apply/add/columns.js
  19. 57 119
      src/views/purchase/apply/add/index.vue
  20. 1 5
      src/views/purchase/apply/columns.js
  21. 20 24
      src/views/purchase/apply/index.vue
  22. 0 27
      src/views/purchase/apply/see/columns.js
  23. 10 2
      src/views/purchase/apply/see/index.vue
  24. 0 1
      src/views/purchase/catalogue/columns.js
  25. 10 15
      src/views/purchase/catalogue/index.vue
  26. 0 1
      src/views/purchase/catalogue/see/columns.js
  27. 9 2
      src/views/purchase/catalogue/see/index.vue
  28. 23 10
      src/views/purchase/contract/add/columns.js
  29. 27 9
      src/views/purchase/contract/add/index.vue
  30. 15 5
      src/views/purchase/contract/edit/columns.js
  31. 32 21
      src/views/purchase/contract/edit/index.vue
  32. 3 1
      src/views/purchase/contract/index.vue
  33. 15 5
      src/views/purchase/contract/see/columns.js
  34. 2 1
      src/views/purchase/contract/see/index.vue
  35. 2 2
      src/views/purchase/purchase-order/index.vue
  36. 19 12
      src/views/purchase/task/index.vue
  37. 4 0
      src/views/purchase/transferOrder/add.vue
  38. 25 0
      src/views/purchase/transferOrder/index.vue

+ 6 - 2
src/assets/styles/index.scss

@@ -211,10 +211,14 @@ aside {
 }
 /*表格*/
 .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;
 }
+.el-input__suffix {
+  display: flex;
+  align-items: center;
+}

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

@@ -3,7 +3,7 @@
   .main-container {
     min-height: 100%;
     transition: margin-left .28s;
-    // margin-left: $base-sidebar-width;
+    margin-left: $base-sidebar-width;
     margin-left: 0;
     position: relative;
   }
@@ -46,14 +46,13 @@
     }
 
     &.has-logo {
-      display: none;
       .el-scrollbar {
         height: calc(100% - 50px);
       }
     }
 
     .is-horizontal {
-      display: none;
+
     }
 
     a {
@@ -111,13 +110,12 @@
 
   .hideSidebar {
     .sidebar-container {
-      display: none;
       width: 54px !important;
     }
 
     .main-container {
-      // margin-left: 54px;
-      margin-left: 0;
+      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

+ 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
+  }
+};

+ 9 - 54
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,15 @@ 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() {},
     },
   },
   watch: {},
   methods: {
-    changeColumns() {
-      const { stroageKey, innerColumns } = this;
-      localStorage.setItem(stroageKey, JSON.stringify(innerColumns));
+    onVisible() {
+      this.visible = !this.visible;
     },
   },
   created() {},
@@ -178,57 +174,16 @@ export default {
         >
           重 置
         </el-button>
-        <!-- <el-button
-          :size="$attrs.size"
-          icon="el-icon-setting"
-          @click="drawer = true"
-        >
-        </el-button> -->
       </el-col>
     </el-row>
-    <el-divider>
+    <el-divider class="m-0">
       <i
         v-if="innerColumns.length > 4"
         :class="visible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
         style="cursor: pointer"
-        @click="visible = !visible"
+        @click="onVisible"
       ></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>
 

+ 39 - 64
src/components/super-table/index.vue

@@ -15,7 +15,7 @@ export default {
     // 分页
     page: {
       type: [Object],
-      require: true,
+      require: false,
     },
     // 模板
     columns: {
@@ -25,7 +25,7 @@ export default {
     // 是否显示序号
     index: {
       type: Boolean,
-      default: true,
+      default: false,
     },
     // 是否显示单选
     radio: {
@@ -40,32 +40,23 @@ export default {
     // 是否显示分页
     pagination: {
       type: Boolean,
-      default: true,
+      default: false,
     },
-    // 是否显示操作图标
-    iconOperation: {
+    // 是否显示
+    hiddenColumns: {
       type: Boolean,
-      default: true,
+      default: false,
     },
-    // 是否显示操作按钮
-    buttonOperation: {
+    // 是否列过滤
+    filterColumns: {
       type: Boolean,
-      default: true,
+      default: false,
     },
     // 是否禁止选择
     selectable: {
       type: Function,
       default: () => {},
     },
-
-    // stroage: {
-    //   type: Boolean,
-    //   default: false,
-    // },
-    // hideOperationColumns: {
-    //   type: Boolean,
-    //   default: false,
-    // },
   },
   components: {
     ElDictTag: () => import("@/components/DictTag/index.vue"),
@@ -83,7 +74,10 @@ export default {
   },
   data() {
     const { columns } = this.$props;
-    const innerColumns = columns;
+    const innerColumns = columns.map(({ item, attr }) => ({
+      attr,
+      item: { ...item, hidden: true },
+    }));
     return {
       innerColumns: innerColumns,
       rowKey: "id",
@@ -153,30 +147,10 @@ export default {
       this.selectData = value;
     },
     //
-    onCellStyle({ row, column }) {
-      const { selectable } = this.$props;
-      // 禁止状态
-      if (!selectable(row)) {
-        return {
-          cursor: "no-drop",
-        };
-      }
-      // 选中状态
-      // if (
-      //   column.label === "#" &&
-      //   this.selectData.find((item) => item.id === row.id)
-      // ) {
-      //   return {
-      //     color: "#fff",
-      //     backgroundColor: "#409EFF",
-      //   };
-      // }
-    },
-    //
     onRowClick(row, column, event) {
-      const { radio, checkbox, selectable } = this.$props;
+      const { radio, checkbox } = this.$props;
       // 单选
-      if (radio && selectable(row)) {
+      if (radio) {
         this.selectData = [row];
         this.innerValue = this.innerValue.map((item) => ({
           ...item,
@@ -185,7 +159,7 @@ export default {
         this.$emit("row-select", this.selectData);
       }
       // 多选
-      if (checkbox && selectable(row)) {
+      if (checkbox) {
         this.$refs.superTable.toggleRowSelection(
           this.innerValue.find((item) => item.id === row.id)
         );
@@ -245,17 +219,14 @@ export default {
 <template>
   <div class="el-super-table">
     <el-table
-      v-bind="$attrs"
-      v-on="$listeners"
       ref="superTable"
       border
-      :data="innerValue"
       :row-key="rowKey"
-      :row-style="{ height: '50px' }"
-      :cell-style="onCellStyle"
-      :header-row-style="{ height: '50px' }"
+      :data="innerValue"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
+      v-bind="$attrs"
+      v-on="$listeners"
     >
       <!-- 序号 -->
       <el-table-column
@@ -275,7 +246,6 @@ export default {
       <el-table-column
         v-if="checkbox"
         :column-key="rowKey"
-        :selectable="selectable"
         fixed
         width="50"
         align="center"
@@ -289,11 +259,12 @@ export default {
         :prop="item.key"
         :label="item.title"
         :fixed="item.fixed"
-        :width="item.width"
+        :width="item.width || 200"
         show-overflow-tooltip
       >
         <template slot="header" slot-scope="scope">
-          <template v-if="iconOperation">
+          <template>
+            <span v-if="item.require" style="color: #ff4949">*</span>
             <span
               :style="{
                 color:
@@ -325,6 +296,7 @@ export default {
               }"
             ></icon-freeze>
             <icon-filter
+              v-if="filterColumns"
               v-model="item.filter"
               class="icon-filter"
               :filters="onFilters({ item, attr })"
@@ -336,12 +308,12 @@ export default {
               }"
             ></icon-filter>
             <icon-hide
+              v-if="hiddenColumns"
               v-model="item.hidden"
               class="icon-hide"
               @hide="onHide"
             ></icon-hide>
           </template>
-          <template v-else>{{ item.title }}</template>
         </template>
         <template slot-scope="scope">
           <slot :name="item.key" v-bind="scope" :item="item" :attr="attr">
@@ -382,6 +354,7 @@ export default {
                 v-bind="attr"
                 v-model="scope.row[item.key]"
                 :size="$attrs.size"
+                style="width: 100%"
               >
               </component
             ></template>
@@ -396,33 +369,27 @@ export default {
           </slot>
         </template>
       </el-table-column>
+      <slot></slot>
     </el-table>
     <div
-      v-if="pagination && buttonOperation"
       style="
-        height: 57px;
+        height: auto;
         display: flex;
         justify-content: space-between;
         align-items: center;
       "
     >
       <div>
-        <template v-show="selectState">
+        <template v-if="checkbox">
           <el-button
-            v-show="selectState"
+            v-if="selectState"
             size="mini"
             @click="selectState = !selectState"
           >
             所有列
           </el-button>
-        </template>
-        <template v-show="!selectState">
-          <button-hide v-model="innerColumns" @hide="onHide"></button-hide>
-          <button-freeze
-            v-model="showColumns"
-            @freeze="onFreeze"
-          ></button-freeze>
           <el-button
+            v-else
             :disabled="!selectData.length"
             size="mini"
             @click="selectState = !selectState"
@@ -431,8 +398,16 @@ export default {
             {{ selectData.length ? ` :${selectData.length}` : "" }}
           </el-button>
         </template>
+        <template v-if="hiddenColumns">
+          <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"
@@ -444,7 +419,7 @@ export default {
   </div>
 </template>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .el-super-table {
   position: relative;
 }

+ 0 - 1
src/layout/components/Navbar.vue

@@ -117,7 +117,6 @@
     position: relative;
     background: #fff;
     box-shadow: 0 1px 4px rgba(0,21,41,.08);
-    display: none;
 
     .hamburger-container {
       line-height: 46px;

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

@@ -243,8 +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);
-  display: none;
+  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;

+ 85 - 71
src/layout/index.vue

@@ -1,16 +1,27 @@
 <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="!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>
-        <app-main/>
-        <right-panel>
-          <settings/>
+        <app-main />
+        <right-panel v-if="dev">
+          <settings />
         </right-panel>
       </div>
     </el-scrollbar>
@@ -18,104 +29,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>

+ 2 - 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,
 };
 
 // 全局组件挂载

+ 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 };
+};

+ 88 - 39
src/views/material/basicFile/details.vue

@@ -660,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">
@@ -669,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  border :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>
 
@@ -1509,7 +1534,8 @@
 
       // 新增
       handleInster() {
-        this.$message({
+        this.$notify({
+          title: '警告',
           message: '物料只能通过申请审批增加,不能在节点直接录入!',
           type: 'warning'
         });
@@ -1529,7 +1555,8 @@
             // 查询其他标签页列表详情
             this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
           } else {
-            this.$message({
+            this.$notify({
+              title: '警告',
               message: '修改请选择单个数据!',
               type: 'warning'
             });
@@ -1583,10 +1610,11 @@
               break;
           }
         } else {
-          this.$message({
-            message: '请选择需要删除的数据!',
-            type: 'warning'
-          });
+          this.$notify({
+              title: '警告',
+              message: '请选择需要删除的数据!',
+              type: 'warning'
+            });
         }
       },
       // 其他标签页刷新
@@ -1728,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'
               });
@@ -1782,7 +1811,11 @@
               this.handleRefresh();
             })
           } else {
-            this.$message.error('存在必填项未填写');
+            this.$notify.error({
+              title: '错误',
+              message: '存在必填项未填写!'
+            });
+            
             console.log('error submit!!');
             return false;
           }
@@ -1828,10 +1861,12 @@
                 })
               })
             } else {
-              this.$message({
+              this.$notify({
+                title: '警告',
                 message: '请选择需要删除的信息!',
                 type: 'warning'
               });
+              
             }
             break;
           // 取消
@@ -1861,10 +1896,12 @@
                 })
                 // 保存
               } else {
-                this.$message({
-                  message: '不能保存空数据或存在数据为空!',
-                  type: 'warning'
-                });
+                this.$notify({
+                title: '警告',
+                message: '不能保存空数据或存在数据为空!',
+                type: 'warning'
+              });
+                
               }
             } else {
               // 非编辑状态
@@ -1876,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) => {
@@ -1895,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();
 
       },
       // 保存修改并新增
@@ -1951,7 +1990,8 @@
         console.log('其他页签详情弹窗关闭事件');
         // 处于编辑状态
         if (this.otherDeatils.isEdit) {
-          this.$message({
+          this.$notify({
+            title: '警告',
             message: '请先退出编辑操作',
             type: 'warning'
           });
@@ -2082,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'
                 });
@@ -2208,7 +2249,8 @@
           if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
-            this.$message({
+            this.$notify({
+              title: '成功',
               message: msg,
               type: 'success'
             });
@@ -2240,7 +2282,8 @@
           if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
-            this.$message({
+            this.$notify({
+              title: '成功',
               message: msg,
               type: 'success'
             });
@@ -2269,7 +2312,8 @@
           if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
-            this.$message({
+            this.$notify({
+              title: '成功',
               message: msg,
               type: 'success'
             });
@@ -2298,7 +2342,8 @@
           if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
-            this.$message({
+            this.$notify({
+              title: '成功',
               message: msg,
               type: 'success'
             });
@@ -2328,7 +2373,8 @@
           if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
-            this.$message({
+            this.$notify({
+              title: '成功',
               message: msg,
               type: 'success'
             });
@@ -2357,7 +2403,8 @@
           if (code == 200) {
             this.otherDeatils.isEdit = false;
             this.handleOtherRefresh();
-            this.$message({
+            this.$notify({
+              title: '成功',
               message: msg,
               type: 'success'
             });
@@ -2538,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 - 80px);
+      // height: 100%;
       box-sizing: border-box;
       padding: 12px;
       overflow-y: auto;

+ 51 - 28
src/views/material/basicFile/index.vue

@@ -40,6 +40,11 @@
 
       </el-row>
 
+     
+    </div>
+
+    <!-- 主体列表 -->
+    <el-card class="material-list" v-loading="loading">
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -97,17 +102,27 @@
 
 
       </el-row>
-    </div>
 
-    <!-- 主体列表 -->
-    <el-card class="material-list" v-loading="loading">
-      <el-table border :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="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`] :
@@ -119,9 +134,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>
 
@@ -216,7 +236,8 @@
       },
       // 新增
       handleInster() {
-        this.$message({
+        this.$notify({
+          title: '警告',
           message: '物料只能通过申请审批增加,不能在节点直接录入!',
           type: 'warning'
         });
@@ -231,7 +252,8 @@
             }
           });
         } else {
-          this.$message({
+          this.$notify({
+            title: '警告',
             message: `${this.checkedList.length > 1 ? '修改只能选择单个数据!' : '请选择需要修改的信息!'}`,
             type: 'warning'
           });
@@ -252,8 +274,9 @@
             }
           })
         } else {
-          this.$message({
-            message: '请选择需要删除的数据!',
+          this.$notify({
+            title: '警告',
+            message: `请选择需要删除的数据!`,
             type: 'warning'
           });
         }
@@ -364,21 +387,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;
@@ -407,10 +432,11 @@
           }
           this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
         } else {
-          this.$message({
-            message: '请选择需要导出的数据!',
-            type: 'warning'
-          });
+          this.$notify({
+                title:'警告',
+                message: '请选择需要导出的数据!',
+                type: 'warning'
+              });
         }
 
       },
@@ -543,7 +569,7 @@
 <style lang="scss">
   .material-list {
     // height: calc(100% - 100px);
-    height: calc(100% - 70px);
+    // height: calc(100% - 70px);
 
 
     .el-card__body {
@@ -551,17 +577,14 @@
       box-sizing: border-box;
 
       .el-table {
-        height: calc(100% - 35px);
+        // height: calc(100% - 35px);
         overflow: auto;
 
         .el-table__body-wrapper {
           // height: calc(100% - 150px);
-          height: calc(100% - 70px);
+          // 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;
 

+ 52 - 31
src/views/purchase/PurchaseDemandList/add.vue

@@ -15,13 +15,13 @@
             </el-form-item>
          </el-col>
 
-        <el-col :span="1.5">
+        <!-- <el-col :span="1.5">
             <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
               <el-select clearable size="mini" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
                 <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-         </el-col>
+         </el-col> -->
 
          <el-col :span="1.5">
             <el-form-item label="单据状态">
@@ -147,11 +147,14 @@
       </el-row>
 
 
-    <span>明细信息</span>
+    
       <div class="btn_grooup">
+        <span>明细信息</span>
+        <div>
         <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
         <el-button type="primary" size="mini" v-if="!sonDisable" @click="adjustPl">批量调整</el-button>
         <el-button type="primary" size="mini" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
+        </div>
       </div>
 
       <el-table
@@ -177,7 +180,7 @@
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
           <el-table-column show-overflow-tooltip label="需求客户" align="center"  prop="demandCustomerName" width="180px"/>
           <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="100px"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="220px">
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="220px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
                 <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.materialCode" @paste.native="pasteMe($event, scope, scope.$index)">
@@ -192,7 +195,7 @@
           <el-table-column show-overflow-tooltip label="单位" align="center"  prop="unitName"/>
           <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
           <el-table-column show-overflow-tooltip label="最小包装" align="center"  prop="minPackage" width="100px"/>
-          <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px">
+          <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="150px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
                 <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)"/>
@@ -248,13 +251,7 @@
           <el-table-column show-overflow-tooltip label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
           <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="100px"/>
           <!-- <el-table-column show-overflow-tooltip label="采购员" align="center"  prop="buyer"/> -->
-          <el-table-column show-overflow-tooltip label="采购周期" align="center"  prop="puPeriod" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.puPeriod"></el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <el-table-column show-overflow-tooltip label="采购周期" align="center"  prop="puPeriod" width="120px"/>
           <el-table-column show-overflow-tooltip label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -273,13 +270,7 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip label="有效期" align="center"  prop="expiry" width="100px"/>
           <el-table-column show-overflow-tooltip label="有效期单位" align="center"  prop="expiryUnit" width="100px"/>
-          <el-table-column show-overflow-tooltip label="安全库存" align="center"  prop="safeStock" width="100px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.safeStock"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <el-table-column show-overflow-tooltip label="安全库存" align="center"  prop="safeStock" width="100px"/>
           <el-table-column show-overflow-tooltip label="注册人" align="center"  prop="registrant" width="100px"/>
           <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="120px">
             <template slot-scope="scope">
@@ -317,7 +308,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="补单供应商" align="center"  prop="additionalSupplierName" width="200px">
+          <el-table-column show-overflow-tooltip label="补单供应商" align="center"  prop="additionalSupplierName" width="200px" :render-header="anotherRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplierName'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
                 <el-input clearable :disabled="sonDisable || BDZT" size="mini" v-model="scope.row.additionalSupplierName" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
@@ -346,13 +337,7 @@
           </el-table-column>
           <el-table-column show-overflow-tooltip label="调拨单号" align="center"  prop="allotCode"></el-table-column>
           <el-table-column show-overflow-tooltip label="调拨占有量" align="center"  prop="allotQty" width="100px"/>
-          <el-table-column show-overflow-tooltip label="最终净需求量" align="center"  prop="resDemandQty" width="120px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.resDemandQty"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <el-table-column show-overflow-tooltip label="最终净需求量" align="center"  prop="resDemandQty" width="120px"/>
           <el-table-column show-overflow-tooltip label="最终采购执行数量" align="center"  prop="executeQty" width="150px">
             <template slot-scope="scope">
               {{ scope.row.executeQty ? scope.row.executeQty : 0 }}
@@ -567,8 +552,8 @@ export default {
         customerName: '',
         customerCode: '',
         customerPrincipal: '',
-        demandPersonal: '',
-        demandDept: '',
+        demandPersonal: this.$store.state.user.name,
+        demandDept: this.$store.state.user.deptId,
         demandDate: '',
         createTime: '',
         source: '4',
@@ -638,6 +623,9 @@ export default {
       this.getDetails(this.row)
     } else if(this.pageStu == 'edit') {
       this.getDetails(this.row)
+    } else if (this.pageStu == 'add') {
+      if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
+      if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
     }
   },
   methods: {
@@ -652,10 +640,12 @@ export default {
       if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.isBDXQ = true
         this.BDZT = false
+        this.anotherRedStar()
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
       } else {
         this.isBDXQ = false
         this.BDZT = true
+        this.anotherRedStar()
         this.basicForm.puDemandItemList.forEach(item => {
           item.isReplenishment = 'N'
           item.additionalSupplier = null
@@ -710,6 +700,7 @@ export default {
       this.basicForm.code = ''
       this.basicForm.createBy = ''
       this.basicForm.source = '4'
+      this.basicForm.isSpeical = 'N'
       this.basicForm.puDemandItemList.forEach(item => {
         item.status = ''
         item.buyerName = ''
@@ -768,7 +759,7 @@ export default {
     },
     async save() {
       if(this.basicForm.puDemandItemList.length !== 0) {
-        this.$refs['basic'].validate((valid) => {
+        this.$refs['basic'].validate((valid, obj) => {
           if(valid) {
             this.$modal.loading("保存中...");
             if(this.sonPageStu == 'add') {
@@ -801,6 +792,14 @@ export default {
                 this.$modal.closeLoading();
               })
             }
+          } else {
+            // 校验加弹窗
+            const jiaoyan = []
+            for(let key in obj) {
+              jiaoyan.push(obj[key][0].message);
+            }
+            this.$modal.notifyWarning(jiaoyan[0]);
+            return false
           }
         })
       } else {
@@ -954,6 +953,7 @@ export default {
       console.log('删除的数组',this.delDemandItemList)
     },
     back() {
+      console.log('打印人员信息看看', this.$store.state)
       this.$emit('jugislist', true)
       this.$emit('refresh')
     },
@@ -979,9 +979,11 @@ export default {
               if(this.basicForm.billType == 'BDXQ') {
                  this.BDZT = false
                  this.isBDXQ = true
+                 this.anotherRedStar()
               } else {
                  this.BDZT = true
                  this.isBDXQ = false
+                 this.anotherRedStar()
               }
             }
           })
@@ -1554,6 +1556,25 @@ export default {
         address: ''
       }
     },
+    // 必选标识
+    addRedStar(h, { column }) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+    },
+    anotherRedStar(h, { column }) {
+      if(this.isBDXQ) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+      } else {
+       return [
+          h('span', ' ' + column.label)
+        ]; 
+      }
+    },
   }
 }
 </script>
@@ -1571,7 +1592,7 @@ export default {
 .btn_grooup {
   margin-bottom: 10px;
   display: flex;
-  justify-content: flex-end;
+  justify-content: space-between;
 }
 .hang {
   margin: auto;

+ 8 - 38
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",
       },
     },
     {
@@ -138,7 +135,10 @@ export default function useColumns() {
             },
           },
         },
-        { 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: {} },
@@ -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 };

+ 57 - 119
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 { tax, unit, currency } from "@/components/popover-select-v2/fetch";
 
 const fetchExist = async (prop) => {
   try {
@@ -143,21 +107,13 @@ export default {
     },
     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,
-        }));
+        this.params.priceApplyItems = this.params.priceApplyItems.map(
+          (item, index) => ({
+            ...item,
+            $index: index,
+          })
+        );
         return {
-          priceApplyOrgs: this.params.priceApplyOrgs.filter(
-            ({ delFlag }) => delFlag !== "2"
-          ),
           priceApplyItems: this.params.priceApplyItems.filter(
             ({ delFlag }) => delFlag !== "2"
           ),
@@ -169,35 +125,17 @@ export default {
   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;
       // task 1
-      fetchTax(rateCode).then((res) => {
+      tax(rateCode).then((res) => {
         const { ntaxrate } = res;
         row.tax = ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
       });
       // task 2
-      fetchUnit(unitIdName).then((res) => {
+      unit(unitIdName).then((res) => {
         const { id, code, name } = res;
         row.unit = id;
         row.unitCode = code;
@@ -236,10 +174,28 @@ export default {
       }
     },
     //
-    async open() {
+    async onOpen() {
       const { addType, selectData } = this.$props;
       if (addType === "add") {
         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;
       }
       if (addType === "copy") {
         const [{ id }] = selectData;
@@ -258,13 +214,6 @@ export default {
             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;
@@ -274,13 +223,10 @@ export default {
             ...item,
           })
         );
-        this.params.priceApplyOrgs = this.params.priceApplyOrgs.map((item) => ({
-          ...item,
-        }));
       }
     },
     //
-    async hide() {
+    async onHide() {
       const {
         TabColumns,
         TableColumns,
@@ -295,7 +241,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async useRowAdd(prop) {
+    async onRowAdd(prop) {
       const {
         $notify,
         TabColumns,
@@ -316,7 +262,7 @@ export default {
       });
     },
     //
-    async useRowRemove(prop, scope) {
+    async onRowRemove(prop, scope) {
       const { addType } = this.$props;
       const {
         row: { $index },
@@ -338,24 +284,18 @@ export default {
     //
     async useSubmit(prop) {
       this.$refs[prop].$refs[prop].validate(async (valid) => {
+        console.log(this.params);
         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(
+              this.params.priceApplyItems = this.params.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);
             }
@@ -382,17 +322,32 @@ export default {
     v-bind="$attrs"
     v-on="$listeners"
     :disabled="disabled"
-    @click="open"
+    @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"
@@ -440,41 +395,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>

+ 1 - 5
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: "状态" },
@@ -100,10 +99,7 @@ export default function useColumns() {
         clearable: true,
       },
     },
-  ].map(({ item, attr }) => ({
-    attr,
-    item: { ...item, hidden: true, span: item.span || 6 },
-  }));
+  ];
 
   return { TableColumns, SearchColumns };
 }

+ 20 - 24
src/views/purchase/apply/index.vue

@@ -16,16 +16,17 @@ export default {
   },
   data() {
     const { TableColumns, SearchColumns } = useColumns();
+    const page = this.$init.page();
     const params = this.$init.params(SearchColumns);
     return {
       size: "mini",
       loading: false,
       params: params,
+      page: page,
       tableData: [],
       selectData: [],
       SearchColumns: SearchColumns,
       TableColumns: TableColumns,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
     };
   },
   computed: {},
@@ -64,13 +65,13 @@ export default {
     },
     // 重 置
     useReset() {
-      this.page.pageNum = 1;
-      this.page.pageSize = 10;
+      this.page = this.$init.page();
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
     // 选 择
     useSelect(prop) {
+      console.log("prop", prop);
       this.selectData = prop;
     },
     // 明 细
@@ -92,7 +93,7 @@ export default {
       @reset="useReset"
       @submit="useQuery(params, page)"
     ></el-super-search>
-    <div style="margin: 0 0 20px 0; text-align: right">
+    <el-row class="my-4" style="text-align: right">
       <el-button-group>
         <add-button
           :size="size"
@@ -140,39 +141,34 @@ export default {
           @success="useQuery(params, page)"
         ></subm-button>
       </el-button-group>
-    </div>
+    </el-row>
     <el-super-table
       v-model="tableData"
       :size="size"
       :dict="dict"
+      :page="page"
       :columns="TableColumns"
-      stroage
-      hideOperationColumns
+      index
+      checkbox
+      pagination
+      hiddenColumns
+      filterColumns
+      height="600"
       @row-dblclick="useSee"
-      @selection-change="useSelect"
+      @row-select="useSelect"
+      @pagination="useQuery(params, page)"
     >
-      <el-table-column fixed width="55" align="center" label="#" prop="$index">
-      </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;
+  width: calc(100% - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
 }
 .el-button-group + .el-button-group {
-  margin: 0 0 0 10px;
+  margin: 0 0 0 8px;
 }
 </style>

+ 0 - 27
src/views/purchase/apply/see/columns.js

@@ -3,10 +3,6 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "priceName", title: "价格名称" },
-      attr: {},
-    },
-    {
       item: { key: "priceCode", title: "价格编码" },
       attr: {},
     },
@@ -181,29 +177,6 @@ export default function useColumns() {
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],
     },
-    {
-      item: {
-        title: "合同执行组织范围",
-        key: "priceApplyOrgs",
-      },
-      attr: {
-        value: [],
-      },
-      TableColumns: [
-        {
-          item: { key: "orgName", title: "组织", width: "auto" },
-          attr: {},
-        },
-        {
-          item: { key: "createByName", title: "创建人名称", width: "auto" },
-          attr: {},
-        },
-        {
-          item: { key: "updateByName", title: "更新人名称", width: "auto" },
-          attr: {},
-        },
-      ],
-    },
   ];
 
   return { TableColumns, TabColumns };

+ 10 - 2
src/views/purchase/apply/see/index.vue

@@ -20,8 +20,8 @@ export default {
       ],
     } = useColumns();
     return {
-      width: "50%",
-      column: 2,
+      width: "100%",
+      column: 3,
       title: "明 细",
       visible: false,
       loading: false,
@@ -115,12 +115,19 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
       @close="hide(selectData)"
     >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button :size="$attrs.size" :loading="loading" @click="hide">
+          取 消
+        </el-button>
+      </template>
       <div
         style="
           z-index: 6666;
@@ -170,6 +177,7 @@ export default {
             :size="$attrs.size"
             :dict="dict"
             :columns="columns"
+            :cell-style="{ height: '30px' }"
           >
           </el-super-table>
         </el-tab-pane>

+ 0 - 1
src/views/purchase/catalogue/columns.js

@@ -60,7 +60,6 @@ export default function useColumns() {
       item: { key: "priceType", title: "价格类型" },
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { key: "demandCode", title: "采购需求单号" }, attr: {} },
     { item: { key: "expiryEarly", title: "效期预警" }, attr: {} },
     { item: { key: "priority", title: "含税/无税优先" }, attr: {} },
     { item: { key: "createByName", title: "创建人" }, attr: {} },

+ 10 - 15
src/views/purchase/catalogue/index.vue

@@ -25,7 +25,7 @@ export default {
       selectData: [],
       TableColumns: TableColumns,
       SearchColumns: SearchColumns,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
+      page: { pageNum: 1, pageSize: 20, total: 0 },
     };
   },
   computed: {},
@@ -91,7 +91,7 @@ export default {
       @reset="useReset"
       @submit="useQuery(params, page)"
     ></el-super-search>
-    <div style="margin: 0 0 20px 0; text-align: right">
+    <div class="my-4" style="text-align: right">
       <el-button-group>
         <ena-button
           :size="size"
@@ -135,24 +135,19 @@ export default {
       v-model="tableData"
       :size="size"
       :dict="dict"
+      :page="page"
       :columns="TableColumns"
-      stroage
-      hideOperationColumns
+      index
+      checkbox
+      pagination
+      hiddenColumns
+      filterColumns
+      height="600"
       @row-dblclick="useSee"
       @selection-change="useSelect"
+      @pagination="useQuery(params, page)"
     >
-      <el-table-column fixed width="55" align="center" label="#" prop="$index">
-      </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">

+ 0 - 1
src/views/purchase/catalogue/see/columns.js

@@ -60,7 +60,6 @@ export default function useColumns() {
       item: { key: "priceType", title: "价格类型" },
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { key: "demandCode", title: "采购需求单号" }, attr: {} },
     { item: { key: "expiryEarly", title: "效期预警" }, attr: {} },
     { item: { key: "priority", title: "含税/无税优先" }, attr: {} },
     { item: { key: "createByName", title: "创建人" }, attr: {} },

+ 9 - 2
src/views/purchase/catalogue/see/index.vue

@@ -11,9 +11,9 @@ export default {
   data() {
     const { TableColumns } = useColumns();
     return {
-      column: 1,
+      column: 3,
       title: "明 细",
-      width: "25%",
+      width: "100%",
       visible: false,
       loading: false,
       params: {},
@@ -93,11 +93,18 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
     >
+      <template slot="title">
+        <span>{{ title }}</span>
+        <el-button :size="$attrs.size" :loading="loading" @click="hide">
+          取 消
+        </el-button>
+      </template>
       <div
         style="
           z-index: 6666;

+ 23 - 10
src/views/purchase/contract/add/columns.js

@@ -92,7 +92,7 @@ export default function useColumns() {
       item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
       attr: {
         is: "el-input-number",
-        precision: CONFIG.precision,
+        precision: 2,
       },
     },
     {
@@ -121,7 +121,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-input-number",
-        precision: CONFIG.precision,
+        precision: 2,
       },
     },
     {
@@ -183,7 +183,7 @@ export default function useColumns() {
     },
     {
       item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
-      attr: { is: "el-input-number", precision: CONFIG.precision },
+      attr: { is: "el-input-number", precision: 2 },
     },
     {
       item: { key: "freightMethods", title: "运费承担方式" },
@@ -333,6 +333,7 @@ export default function useColumns() {
           item: {
             title: "物料名称",
             key: "materialName",
+            require: true 
           },
           attr: {
             is: "el-popover-select-v2",
@@ -383,7 +384,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "税率%", key: "tax" },
+          item: { title: "税率%", key: "tax" ,require: true },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "ntaxrate",
@@ -400,7 +401,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "含税单价", key: "taxPrice" },
+          item: { title: "含税单价", key: "taxPrice", require: true  },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -417,7 +418,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "无税单价", key: "taxFreePrice" },
+          item: { title: "无税单价", key: "taxFreePrice",require: true  },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -524,6 +525,7 @@ export default function useColumns() {
           item: {
             title: "付款起点",
             key: "origin",
+            require: true 
           },
           attr: {
             is: "el-select",
@@ -531,14 +533,14 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "账期天数", key: "paymetDays" },
+          item: { title: "账期天数", key: "paymetDays" , require: true },
           attr: {
             is: "el-input-number",
-            precision: CONFIG.precision,
+            precision: 2,
           },
         },
         {
-          item: { title: "付款比例%", key: "ratio" },
+          item: { title: "付款比例%", key: "ratio" , require: true },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -575,6 +577,7 @@ export default function useColumns() {
           item: {
             title: "结算方式",
             key: "paymentMeans",
+            require: true 
           },
           attr: {
             is: "el-popover-select-v2",
@@ -620,6 +623,16 @@ export default function useColumns() {
         { item: { title: "组织编码", key: "org", width: "auto" }, attr: {} },
       ],
     },
-  ];
+  ].map(({item,attr,TableColumns}) =>({
+    attr,
+    item,
+    TableColumns:TableColumns.map(({item, attr}) =>({
+      attr,
+      item: { ...item, hidden: true, span: item.span || 6 },
+  
+    }))
+
+  }))
+  ;
   return { TableColumns, TabColumns };
 }

+ 27 - 9
src/views/purchase/contract/add/index.vue

@@ -126,10 +126,28 @@ export default {
       this.params.buyerName = buyerName;
       this.params.puDept = puDept;
       this.params.puDeptName = puDeptName;
-      this.params["currency"] = '1002Z0100000000001K1';
-      this.params["currencyName"] = '人民币';
+      const  {id,code, name } =  await this.getCurrency("人民币");
+      this.params.currency = id;
+      this.params.currencyCode = code;
+      this .params.currencyName = name;
       this.visible = await this.fetchCode();
     },
+    async getCurrency(search){
+
+      let page = {pageNum: 1, pageSize:10,}
+
+      const { code, rows } = await REFER(
+          {
+            isPage:true,
+            search,
+            type: 'CURRENCY_PARAM',
+          },
+          page
+      );
+      if(code == 200){
+        return rows[0];
+      }
+    },
     //
     async hide() {
       const {
@@ -184,7 +202,8 @@ export default {
       });
     },
   },
-  created() {},
+  created() {
+  },
   mounted() {},
   destroyed() {},
 };
@@ -246,6 +265,7 @@ export default {
             :dict="dict"
             :ref="tabName"
             :columns="columns"
+            :iconOperation="false"
             :size="$attrs.size"
           >
             <template slot="materialName" slot-scope="scope">
@@ -261,20 +281,18 @@ export default {
             <el-table-column fixed="right" label="操作" width="75">
               <template slot="header" slot-scope="scope">
                 <el-button
-                  circle
-                  icon="el-icon-plus"
+                  type="text"
                   :size="$attrs.size"
                   @click="useRowAdd(tabName)"
-                >
+                >增行
                 </el-button>
               </template>
               <template slot-scope="scope">
                 <el-button
-                  circle
-                  icon="el-icon-minus"
+                  type="text"
                   :size="$attrs.size"
                   @click.native.prevent="useRowRemove(tabName, scope)"
-                >
+                >删行
                 </el-button>
               </template>
             </el-table-column>

+ 15 - 5
src/views/purchase/contract/edit/columns.js

@@ -92,7 +92,7 @@ export default function useColumns() {
       item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
       attr: {
         is: "el-input-number",
-        precision: CONFIG.precision,
+        precision: 2,
       },
     },
     {
@@ -121,7 +121,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-input-number",
-        precision: CONFIG.precision,
+        precision: 2,
       },
     },
     {
@@ -183,7 +183,7 @@ export default function useColumns() {
     },
     {
       item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
-      attr: { is: "el-input-number", precision: CONFIG.precision },
+      attr: { is: "el-input-number", precision: 2 },
     },
     {
       item: { key: "freightMethods", title: "运费承担方式" },
@@ -534,7 +534,7 @@ export default function useColumns() {
           item: { title: "账期天数", key: "paymetDays" },
           attr: {
             is: "el-input-number",
-            precision: CONFIG.precision,
+            precision: 2,
           },
         },
         {
@@ -620,6 +620,16 @@ export default function useColumns() {
         { item: { title: "组织编码", key: "org", width: "auto" }, attr: {} },
       ],
     },
-  ];
+  ].map(({item,attr,TableColumns}) =>({
+    attr,
+    item,
+    TableColumns:TableColumns.map(({item, attr}) =>({
+      attr,
+      item: { ...item, hidden: true, span: item.span || 6 },
+  
+    }))
+
+  }))
+  ;
   return { TableColumns, TabColumns };
 }

+ 32 - 21
src/views/purchase/contract/edit/index.vue

@@ -234,9 +234,32 @@ export default {
       :title="title"
       :visible.sync="visible"
       append-to-body
+      :show-close="false"
       destroy-on-close
       @close="hide"
     >
+
+    <div slot="title" 
+          style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          ">
+        <h3>{{title}}</h3>
+        <div style="text-align: right">
+          <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"
@@ -249,6 +272,7 @@ export default {
         style="padding: 20px"
       ></el-super-form>
       <el-tabs v-model="tabName" style="margin: 0 20px">
+        
         <el-tab-pane
           v-for="{ item, TableColumns: columns } in TabColumns"
           :key="item.key"
@@ -262,6 +286,7 @@ export default {
             :ref="tabName"
             :columns="columns"
             :size="$attrs.size"
+            :iconOperation="false"
           >
             <template slot="materialName" slot-scope="scope">
               <component
@@ -276,45 +301,31 @@ export default {
             <el-table-column fixed="right" label="操作" width="100">
               <template slot="header" slot-scope="scope">
                 <el-button
-                  circle
-                  icon="el-icon-plus"
+                  type="text"
                   :size="$attrs.size"
                   @click="useRowAdd(tabName)"
-                >
+                >增行
                 </el-button>
               </template>
               <template slot-scope="scope">
                 <el-button
-                  circle
-                  icon="el-icon-check"
+                  type="text"
                   :size="$attrs.size"
                   @click.native.prevent="useRowSubmit(tabName, scope)"
-                >
+                >更新
                 </el-button>
                 <el-button
-                  circle
-                  icon="el-icon-minus"
+                  type="text"
                   :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="useSubmit('superForm')"
-          >确 认</el-button
-        >
-      </div>
+      
     </el-drawer>
   </el-button>
 </template>

+ 3 - 1
src/views/purchase/contract/index.vue

@@ -101,7 +101,7 @@ export default {
       @reset="useReset"
       @submit="useQuery(params, page)"
     ></el-super-search>
-    <div style="margin: 0 0 20px 0; text-align: right">
+    <div style="margin: 20px 0 ; text-align: right">
       <el-button-group>
         <add-button
           :size="size"
@@ -168,9 +168,11 @@ export default {
       v-model="tableData"
       :size="size"
       :dict="dict"
+      max-height="600"
       :columns="TableColumns"
       :selectable="setSelectable"
       checkbox
+      pagination
       @row-dblclick="useSee"
       @selection-change="useSelect"
       :page="page"

+ 15 - 5
src/views/purchase/contract/see/columns.js

@@ -92,7 +92,7 @@ export default function useColumns() {
       item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
       attr: {
         is: "el-input-number",
-        precision: CONFIG.precision,
+        precision: 2,
       },
     },
     {
@@ -121,7 +121,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-input-number",
-        precision: CONFIG.precision,
+        precision: 2,
       },
     },
     {
@@ -183,7 +183,7 @@ export default function useColumns() {
     },
     {
       item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
-      attr: { is: "el-input-number", precision: CONFIG.precision },
+      attr: { is: "el-input-number", precision: 2 },
     },
     {
       item: { key: "freightMethods", title: "运费承担方式" },
@@ -534,7 +534,7 @@ export default function useColumns() {
           item: { title: "账期天数", key: "paymetDays" },
           attr: {
             is: "el-input-number",
-            precision: CONFIG.precision,
+            precision: 2,
           },
         },
         {
@@ -620,6 +620,16 @@ export default function useColumns() {
         { item: { title: "组织编码", key: "org", width: "auto" }, attr: {} },
       ],
     },
-  ];
+  ].map(({item,attr,TableColumns}) =>({
+    attr,
+    item,
+    TableColumns:TableColumns.map(({item, attr}) =>({
+      attr,
+      item: { ...item, hidden: true, span: item.span || 6 },
+  
+    }))
+
+  }))
+  ;
   return { TableColumns, TabColumns };
 }

+ 2 - 1
src/views/purchase/contract/see/index.vue

@@ -30,7 +30,7 @@ export default {
     } = useColumns();
     return {
       column: 2,
-      width: "50%",
+      width: "100%",
       title: "明 细",
       visible: false,
       loading: false,
@@ -129,6 +129,7 @@ export default {
             :size="$attrs.size"
             :dict="dict"
             :columns="columns"
+            :iconOperation="false"
           >
           </el-super-table>
         </el-tab-pane>

+ 2 - 2
src/views/purchase/purchase-order/index.vue

@@ -551,7 +551,7 @@ export default {
     ></el-super-search>
   
     <!-- 操作 -->
-    <el-row :gutter="24" type="flex" justify="end" style="margin-bottom: 16px;">
+    <el-row :gutter="24" type="flex" justify="end" style="margin: 20px 0;">
       <el-col :span="24" style="text-align: right;">
         <el-button size="mini" type="primary" @click="handleOpenAddDrawer"
           v-hasPermi="['material:order:add']">新增</el-button>
@@ -587,6 +587,7 @@ export default {
       :columns="tableColumns"
       :selectable="setSelectable"
       checkbox
+      pagination
       :page="page"
       :iconOperation="false"
       @pagination="fetchList(params, page)"
@@ -668,7 +669,6 @@ export default {
             :columns="column.tableColumns"
             :selectable="setTabSelectable"
             :checkbox="setTabSelectable()"
-            :page="{pageNum: 1, pageSize: 10, total: 0}"
             :iconOperation="false"
             @select="handleTabSelect"
           >

+ 19 - 12
src/views/purchase/task/index.vue

@@ -19,6 +19,7 @@ export default {
     const { TableColumns, SearchColumns } = useColumns();
     const params = this.$init.params(SearchColumns);
     return {
+      key: 0,
       size: "mini",
       loading: false,
       params: params,
@@ -26,7 +27,7 @@ export default {
       selectData: [],
       TableColumns: TableColumns,
       SearchColumns: SearchColumns,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
+      page: { pageNum: 1, pageSize: 20, total: 0 },
     };
   },
   computed: {},
@@ -49,15 +50,12 @@ export default {
     async fetchList(prop, page) {
       try {
         this.loading = true;
+        this.tableData = [];
         const { pageNum, pageSize } = page;
         const { code, rows, total } = await LIST(prop, { pageNum, pageSize });
         if (code === 200) {
-          this.tableData = rows.map((item, index) => ({
-            ...item,
-            $index: (pageNum - 1) * pageSize + index + 1,
-          }));
+          this.tableData = rows;
           this.page.total = total;
-          console.log("selectData", this.selectData);
         }
       } catch (err) {
         // catch
@@ -94,13 +92,12 @@ export default {
     // 重 置
     useReset() {
       this.page.pageNum = 1;
-      this.page.pageSize = 10;
+      this.page.pageSize = 20;
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
     // 选 择
     useSelect(prop, value) {
-      console.log(prop, value);
       this.selectData = prop;
     },
     // 明 细
@@ -118,7 +115,13 @@ export default {
 </script>
 
 <template>
-  <el-card v-loading="loading" :body-style="{ padding: 0 }">
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+    }"
+  >
     <el-super-search
       v-model="params"
       :size="size"
@@ -126,8 +129,9 @@ export default {
       :columns="SearchColumns"
       @reset="useReset"
       @submit="useQuery(params, page)"
+      @aaa="useQuery(params, page)"
     ></el-super-search>
-    <div style="margin: 0 0 16px 0; text-align: right">
+    <div class="my-4" style="text-align: right">
       <el-button-group>
         <thxq-button
           :size="size"
@@ -169,11 +173,14 @@ export default {
       v-model="tableData"
       :size="size"
       :dict="dict"
+      :page="page"
       :columns="TableColumns"
       :selectable="setSelectable"
+      index
       checkbox
+      hiddenColumns
+      height="600"
       @row-select="useSelect"
-      :page="page"
       @pagination="useQuery(params, page)"
     >
     </el-super-table>
@@ -182,7 +189,7 @@ export default {
 <style scoped lang="scss">
 .el-card {
   width: calc(100% - 32px);
-  height: 100%;
+  // height: calc(100vh - 32px);
   margin: 16px;
   padding: 16px;
   border-radius: 8px;

+ 4 - 0
src/views/purchase/transferOrder/add.vue

@@ -1760,6 +1760,8 @@ export default {
       this.basicForm.updateBy = "";
       this.basicForm.updateByName = "";
       this.basicForm.updateTime = "";
+      this.isDRCk = false
+      this.isDCCk = false
     },
     handleData() {
       console.log("222");
@@ -2017,6 +2019,7 @@ export default {
         classify: null,
         customerLogistic: null,
         customerLogisticName: null,
+        delFlag: 0
       };
       this.materialInfo.push(newLine);
     },
@@ -2026,6 +2029,7 @@ export default {
         ...item,
         delFlag: index === $index ? "2" : item.delFlag,
       }));
+      console.log('看看列表',this.materialInfo)
     },
     //
     rowClassName(prop) {

+ 25 - 0
src/views/purchase/transferOrder/index.vue

@@ -76,6 +76,7 @@
           class="exporttable"
           border
           show-summary
+          :summary-method="getSummaries"
           highlight-current-row
           max-height="680"
           style="font-size: 12px;"
@@ -374,6 +375,30 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 指定列合计
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (column.property === 'qty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index];
+        }
+      });
+      return sums
+    },
     formatterBillType(row) {
       switch (row.billType) {
         case '5X-01':