Ver código fonte

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

002637 1 ano atrás
pai
commit
2dc84537f7
32 arquivos alterados com 1982 adições e 524 exclusões
  1. 64 0
      src/api/business/spd/task_management/visitingPlan/visitingPlan.js
  2. 4 3
      src/assets/styles/sidebar.scss
  3. 13 5
      src/components/PopDialog/index.vue
  4. 120 105
      src/components/super-search/index.vue
  5. 25 47
      src/components/super-table/index.vue
  6. 7 16
      src/components/super-table/once/filter.vue
  7. 25 14
      src/components/super-table/once/freeze.vue
  8. 25 14
      src/components/super-table/once/sort.vue
  9. 1 1
      src/utils/request.js
  10. 604 0
      src/views/business/spd/task_management/visitingPlan/add.vue
  11. 658 0
      src/views/business/spd/task_management/visitingPlan/index.vue
  12. 7 7
      src/views/material/basicFile/details.vue
  13. 6 13
      src/views/material/basicFile/index.vue
  14. 2 2
      src/views/purchase/DemandSummary/add.vue
  15. 2 1
      src/views/purchase/DemandSummary/index.vue
  16. 282 122
      src/views/purchase/PurchaseDemandList/add.vue
  17. 2 1
      src/views/purchase/PurchaseDemandList/index.vue
  18. 0 1
      src/views/purchase/apply/add/columns.js
  19. 3 0
      src/views/purchase/apply/add/index.vue
  20. 2 2
      src/views/purchase/apply/columns.js
  21. 2 5
      src/views/purchase/catalogue/columns.js
  22. 35 31
      src/views/purchase/contract/edit/columns.js
  23. 0 11
      src/views/purchase/contract/index.vue
  24. 6 0
      src/views/purchase/purchase-order/add/index.vue
  25. 6 0
      src/views/purchase/purchase-order/edit/index.vue
  26. 6 0
      src/views/purchase/purchase-order/see/index.vue
  27. 16 25
      src/views/purchase/task/index.vue
  28. 0 0
      src/views/purchase/task/see/columns.js
  29. 13 2
      src/views/purchase/task/see/index.vue
  30. 15 11
      src/views/purchase/task/xie-yi-zhi-cai/column.js
  31. 31 84
      src/views/purchase/task/xie-yi-zhi-cai/index.vue
  32. 0 1
      vue.config.js

+ 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'
+    })
+  }

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

@@ -110,12 +110,13 @@
 
   .hideSidebar {
     .sidebar-container {
-      width: 54px !important;
+      display: none;
+      // width: 54px !important;
     }
 
     .main-container {
-      margin-left: 54px;
-      // margin-left: 0;
+      // margin-left: 54px;
+      margin-left: 0;
     }
 
     .submenu-title-noDropdown {

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

+ 120 - 105
src/components/super-search/index.vue

@@ -53,6 +53,20 @@ export default {
       },
       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: {
@@ -60,7 +74,18 @@ export default {
       this.visible = !this.visible;
     },
   },
-  created() {},
+  created() {
+    console.log(
+      "span",
+      Math.ceil(
+        this.innerColumns
+          .map(({ item }) => item.span)
+          .reduce((prev, curr) => {
+            return prev + curr;
+          }) / 24
+      )
+    );
+  },
   mounted() {},
   destroyed() {},
 };
@@ -76,114 +101,104 @@ 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" type="danger" @click="$emit('reset')">
+          重置
+        </el-button>
+        <el-button :size="$attrs.size" @click="visible = !visible">
+          {{ visible ? "展开" : "收起" }}
         </el-button>
-      </el-col>
+      </el-row>
     </el-row>
-    <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="onVisible"
-      ></i>
-    </el-divider>
+    <el-divider class="m-0"> </el-divider>
   </el-form>
 </template>
 

+ 25 - 47
src/components/super-table/index.vue

@@ -145,25 +145,20 @@ export default {
     //
     onSelectionChange(value) {
       this.selectData = value;
+      this.$emit("row-select", this.selectData);
     },
     //
     onRowClick(row, column, event) {
       const { radio, checkbox } = this.$props;
       // 单选
       if (radio) {
-        this.selectData = [row];
-        this.innerValue = this.innerValue.map((item) => ({
-          ...item,
-          isChecked: item.id === row.id ? true : false,
-        }));
-        this.$emit("row-select", this.selectData);
+        this.$emit("row-select", [row]);
       }
       // 多选
       if (checkbox) {
         this.$refs.superTable.toggleRowSelection(
           this.innerValue.find((item) => item.id === row.id)
         );
-        this.$emit("row-select", this.selectData);
       }
     },
     // 冻结
@@ -223,6 +218,7 @@ export default {
       border
       :row-key="rowKey"
       :data="innerValue"
+      :highlight-current-row="radio"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
       v-bind="$attrs"
@@ -235,7 +231,6 @@ export default {
         fixed
         width="50"
         label="序号"
-        align="center"
         class="is-index"
       >
         <template slot-scope="scope">
@@ -277,42 +272,24 @@ export default {
             >
               {{ item.title }}
             </span>
-            <icon-sort
-              v-model="item.sort"
-              class="icon-sort"
-              @sort="onSort(item)"
-              :style="{
-                color: item.sort ? '#1890ff' : '',
-                display: item.sort ? 'inline-block' : '',
-              }"
-            ></icon-sort>
-            <icon-freeze
-              v-model="item.fixed"
-              class="icon-freeze"
-              @freeze="onFreeze"
-              :style="{
-                color: item.fixed ? '#1890ff' : '',
-                display: item.fixed ? 'inline-block' : '',
-              }"
-            ></icon-freeze>
-            <icon-filter
-              v-if="filterColumns"
-              v-model="item.filter"
-              class="icon-filter"
-              :filters="onFilters({ item, attr })"
-              @filter="onFilter"
-              :style="{
-                color: item.filter && item.filter.length ? '#1890ff' : '',
-                display:
-                  item.filter && item.filter.length ? 'inline-block' : '',
-              }"
-            ></icon-filter>
-            <icon-hide
-              v-if="hiddenColumns"
-              v-model="item.hidden"
-              class="icon-hide"
-              @hide="onHide"
-            ></icon-hide>
+            <template>
+              <icon-sort v-model="item.sort" @sort="onSort(item)"></icon-sort>
+              <icon-freeze
+                v-model="item.fixed"
+                @freeze="onFreeze"
+              ></icon-freeze>
+              <icon-filter
+                v-model="item.filter"
+                :filters="onFilters({ item, attr })"
+                @filter="onFilter"
+              ></icon-filter>
+              <icon-hide
+                v-if="hiddenColumns"
+                v-model="item.hidden"
+                class="icon-hide"
+                @hide="onHide"
+              ></icon-hide>
+            </template>
           </template>
         </template>
         <template slot-scope="scope">
@@ -373,7 +350,7 @@ export default {
     </el-table>
     <div
       style="
-        height: auto;
+        height: 50px;
         display: flex;
         justify-content: space-between;
         align-items: center;
@@ -423,8 +400,9 @@ export default {
 .el-super-table {
   position: relative;
 }
-.el-super-table .el-table__header .cell {
-  display: flex;
+::v-deep.el-super-table .el-table__header .cell {
+  word-break: keep-all;
+  white-space: nowrap;
   .icon-sort {
     display: none;
   }

+ 7 - 16
src/components/super-table/once/filter.vue

@@ -1,17 +1,23 @@
 <template>
   <el-popover
-    v-if="filterData.length"
+    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"
@@ -41,21 +47,12 @@
         </div>
       </div>
     </template>
-    <!-- <el-tooltip
-      slot="reference"
-      :disabled="disabled"
-      effect="dark"
-      content="筛选"
-      placement="top"
-    > -->
     <i
       slot="reference"
       class="el-icon-search pl-1"
       style="cursor: pointer; font-weight: 600; transition: 500ms"
-      :style="{ color: color }"
       @click="onOpen"
     ></i>
-    <!-- </el-tooltip> -->
   </el-popover>
 </template>
 
@@ -110,12 +107,6 @@ export default {
       },
       set() {},
     },
-    color: {
-      get() {
-        return this.$props.value && this.$props.value.length ? "#1890ff" : "";
-      },
-      set() {},
-    },
   },
   watch: {},
   methods: {

+ 25 - 14
src/components/super-table/once/freeze.vue

@@ -1,18 +1,29 @@
 <template>
-  <!-- <el-tooltip effect="dark" content="冻结" placement="top"> -->
-  <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>
-  <!-- </el-tooltip> -->
+  <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>

+ 25 - 14
src/components/super-table/once/sort.vue

@@ -1,18 +1,29 @@
 <template>
-  <!-- <el-tooltip effect="dark" content="排序" placement="top"> -->
-  <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>
-  <!-- </el-tooltip> -->
+  <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>

+ 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拦截器

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

+ 7 - 7
src/views/material/basicFile/details.vue

@@ -2,8 +2,10 @@
 <template>
   <div class="material-details" v-loading="loading">
     <!-- 操作栏 -->
-    <!-- 基本信息栏 -->
-    <div style="display: flex;justify-content: end;">
+  
+    <el-card>
+      <!-- 基本信息栏 -->
+      <div style="display: flex;justify-content: end;">
       <div v-if="activeMainTab == 'material'">
   
         <!-- 基本信息修改状态下—— 保存、保存新增、更新导入、取消 -->
@@ -111,8 +113,6 @@
       </el-row>
 
     </div>
-
-    <el-card>
     
       <div class="md-content">
         <el-form :inline="true" label-position="right" :model="basicData.value">
@@ -148,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">
 
                         <!-- 多选框 -->
@@ -296,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">
@@ -2590,7 +2590,7 @@
     box-sizing: border-box;
 
     .el-card__body {
-      height: calc(100vh - 80px);
+      height: calc(100vh - 40px);
       // height: 100%;
       box-sizing: border-box;
       padding: 12px;

+ 6 - 13
src/views/material/basicFile/index.vue

@@ -3,9 +3,11 @@
 <template>
   <div class="material-basic" v-loading="failLoad">
 
-    <!-- 操作栏 -->
-    <div>
-    
+    <!-- 主体列表 -->
+    <el-card class="material-list" v-loading="loading">
+
+      <!-- 操作栏 -->
+    <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
       <el-row :gutter="10">
         <el-col :span="1.5">
@@ -39,12 +41,7 @@
         </el-col>
 
       </el-row>
-
-     
     </div>
-
-    <!-- 主体列表 -->
-    <el-card class="material-list" v-loading="loading">
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -568,8 +565,7 @@
 
 <style lang="scss">
   .material-list {
-    // height: calc(100% - 100px);
-    // height: calc(100% - 70px);
+    height: calc(100vh - 70px);
 
 
     .el-card__body {
@@ -577,12 +573,9 @@
       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;
         }

+ 2 - 2
src/views/purchase/DemandSummary/add.vue

@@ -21,8 +21,8 @@
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-        <el-table-column show-overflow-tooltip type="selection"/>
-        <el-table-column show-overflow-tooltip label="序号" align="center" type="index" width="55"/>
+        <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' }}

+ 2 - 1
src/views/purchase/DemandSummary/index.vue

@@ -233,7 +233,8 @@
           @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="100px" :formatter="hangStatus"/>
           <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="100px"/>

+ 282 - 122
src/views/purchase/PurchaseDemandList/add.vue

@@ -5,14 +5,119 @@
     <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.code"
-                size="mini"
-                disabled
-                style="width: 200px"
-              />
-            </el-form-item>
+          <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
+            <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" style="width: 200px">
+              <el-option v-for=" dict in dict.type.sys_business" :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="需求客户">
+            <el-select clearable size="mini" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求人员">
+              <el-select clearable size="mini" v-model="basicForm.demandPersonal" :disabled="sonDisable" @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="basicForm.demandDept" size="mini" :disabled="sonDisable" @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 v-model="basicForm.planType" size="mini" style="width: 200px">
+              <el-option v-for="dict in dict.type.sys_plan_type" :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="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
+            <el-date-picker
+              v-model="basicForm.demandDate"
+              :disabled="sonDisable"
+              clearable
+              type="date"
+              value-format="yyyy-MM-dd"
+              @change="changeDemandDate"
+              size="mini"
+              style="width: 200px"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="制单日期" prop="createTime">
+            <el-date-picker
+              v-model="basicForm.createTime"
+              :disabled="sonDisable"
+              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="是否客户指定">
+            <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="mini" style="width: 200px">
+              <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="备注">
+            <el-input
+              v-model.trim="basicForm.remark"
+              size="mini"
+              :disabled="sonDisable"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="需求客户名称">
+            <el-input disabled v-model="basicForm.customerName" size="mini" style="width: 200px"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-form-item label="编码">
+            <el-input
+              v-model="basicForm.code"
+              size="mini"
+              disabled
+              style="width: 200px"
+            />
+          </el-form-item>
          </el-col>
 
         <!-- <el-col :span="1.5">
@@ -33,20 +138,6 @@
           </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="需求客户">
-              <el-select clearable size="mini" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
-                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="需求客户名称">
-              <el-input disabled v-model="basicForm.customerName" size="mini" style="width: 200px"></el-input>
-            </el-form-item>
-          </el-col>
-
-         <el-col :span="1.5">
             <el-form-item label="客户负责人">
               <el-select disabled size="mini" v-model="basicForm.customerPrincipal" style="width: 200px">
                 <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
@@ -54,43 +145,6 @@
             </el-form-item>
           </el-col>
 
-         <el-col :span="1.5">
-            <el-form-item label="需求人员">
-                <el-select clearable size="mini" v-model="basicForm.demandPersonal" :disabled="sonDisable" @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="basicForm.demandDept" size="mini" :disabled="sonDisable" @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="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
-              <el-date-picker
-                v-model="basicForm.demandDate"
-                :disabled="sonDisable"
-                clearable
-                type="date"
-                value-format="yyyy-MM-dd"
-                @change="changeDemandDate"
-                size="mini"
-                style="width: 200px"
-              >
-              </el-date-picker>
-            </el-form-item>
-         </el-col>
-
           <el-col :span="1.5">
             <el-form-item label="单据来源">
               <el-select v-model="basicForm.source" disabled size="mini" style="width: 200px">
@@ -99,51 +153,6 @@
               </el-select>
             </el-form-item>
          </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="业务类型" prop="billType" :rules="{ required: true, message: '请选择业务类型', trigger: 'blur' }">
-              <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="mini" style="width: 200px">
-                <el-option v-for=" dict in dict.type.sys_business" :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="是否客户指定">
-              <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="mini" style="width: 200px">
-                <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-         </el-col>
-
-          <el-col :span="1.5">
-            <el-form-item label="制单日期" prop="createTime">
-              <el-date-picker
-                v-model="basicForm.createTime"
-                :disabled="sonDisable"
-                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="备注">
-              <el-input
-                v-model.trim="basicForm.remark"
-                size="mini"
-                :disabled="sonDisable"
-                clearable
-                style="width: 200px"
-              />
-            </el-form-item>
-         </el-col>
       </el-row>
 
 
@@ -164,14 +173,14 @@
           :cell-style="{ borderColor: '#c0c0c0' }"
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
-          height="290"
-          max-height="290"
+          height="350"
+          max-height="350"
           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" width="50px"/>
+          <el-table-column show-overflow-tooltip type="selection" 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">
             <template slot-scope="scope">
               {{ scope.$index + 1 + '0' }}
@@ -182,7 +191,7 @@
           <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" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :show-message="false" :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)">
                   <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
@@ -197,7 +206,7 @@
           <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" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :show-message="false" :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)"/>
               </el-form-item>
             </template>
@@ -357,7 +366,7 @@
           <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
           <el-table-column show-overflow-tooltip label="价格类型" align="center"  prop="priceType" width="120px">
             <template slot-scope="scope">
-              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :show-message="false" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
                 <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.priceType">
                   <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
@@ -427,7 +436,7 @@
 
       <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 
-      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
 
 
     <!-- 批量调整参数 -->
@@ -522,7 +531,7 @@ import popDialog from '@/components/PopDialog/index.vue'
 export default {
   name: 'addDemandList',
   props: ['pageStu','row', 'disable'],
-  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
+  dicts: ['sys_processing_mode', 'sys_plan_type', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
   components: {
     Reserved,
     Refers,
@@ -554,6 +563,7 @@ export default {
         customerPrincipal: '',
         demandPersonal: this.$store.state.user.name,
         demandDept: this.$store.state.user.deptId,
+        planType: '1',
         demandDate: '',
         createTime: '',
         source: '4',
@@ -640,12 +650,10 @@ 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
@@ -979,11 +987,9 @@ export default {
               if(this.basicForm.billType == 'BDXQ') {
                  this.BDZT = false
                  this.isBDXQ = true
-                 this.anotherRedStar()
               } else {
                  this.BDZT = true
                  this.isBDXQ = false
-                 this.anotherRedStar()
               }
             }
           })
@@ -1318,6 +1324,7 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)
+      if (selection.length <= 1) {
       // 选择新物料时先清空行内其他信息
       this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
       this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
@@ -1388,7 +1395,160 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
       this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
       // 选中骨科耗材时候的物料,需求客户不必填
-
+      } else {
+        console.log('xxxxx', selection)
+        for (let i = 0;i<selection.length;i++) {
+          let line = {
+            contacts: null,
+            id: null,
+            demandId: null,
+            status: null,
+            businessDept: null,
+            businessDeptName: null,
+            materialCategory: null,
+            buyer: null,
+            buyerName: null,
+            mateiralClassifyOne: null,
+            materialClassifyOneName: null,
+            materialClassifyTwo: null,
+            materialClassifyTwoName: null,
+            materialClassifyThree: null,
+            materialClassifyThreeName: null,
+            materialClassifyFour: null,
+            materialClassifyFourName: null,
+            materialCode: null,
+            material: null,
+            materialName: null,
+            classifyId: null,
+            specification: null,
+            unit: null,
+            unitName: null,
+            manufacturerName: null,
+            registrant: null,
+            puPeriod: null,
+            expiryUnit: null,
+            expiry: null,
+            minPackage: null,
+            minOrderQty: null,
+            minBatch: null,
+            safeStock: null,
+            averageQtyMonth: null,
+            qty: null,
+            adjustmentPersonal: null,
+            adjustmentTime: null,
+            manualRegulation: null,
+            updateCause: null,
+            reservedProportion: null,
+            reservedPeriod: null,
+            reservedQty: null,
+            demandPeriod: null,
+            forecastClassify: null,
+            onemonthAvgVolume: null,
+            threemonthAvgVolume: null,
+            puFreight: null,
+            deliveryDate: null,
+            isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+            isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
+            isBatchLock: 'N',
+            isCustomerSpecified: '',
+            remark: null,
+            puRemark: null,
+            lastWarehouseQty: null,
+            resDemandQty: null,
+            lastWarehouse: null,
+            lastWarehouseName: null,
+            deliveryWarehouse: null,
+            deliveryWarehouseName: null,
+            lastAllocation: null,
+            lastAllocationName: null,
+            deliveryAllocation: null,
+            deliveryAllocationName: null,
+            passageOn: null,
+            puOrg: null,
+            purOrgName: null,
+            lastStockQty: null,
+            superiorCenterQty: null,
+            superiorAllotQty: null,
+            availableQty: null,
+            statusAllot: 'N',
+            additionalSupplier: null,
+            additionalSupplierName: null,
+            periodUnit: null,
+            demandCustomer: this.basicForm.customer,
+            demandCustomerName: this.basicForm.customerName,
+            businessDept: this.basicForm.demandDept,
+            businessDeptName: null,
+            lastStockOrg: null,
+            lastStockOrgName: null,
+            superiorStockOrg: null,
+            superiorStockOrgName: null,
+            allotCode: null,
+            deliveryAddress: null,
+            deliveryAddressName: null,
+            contacts: null,
+            contactsPhone: null,
+            address: null,
+            source: null,
+            priceType: 'order',
+            puManagerApprover: null,
+            puManagerApproverName: null,
+            processTime: null,
+            affirmer: 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,
+          }
+                // 通过选择物料查询采购员
+          queryMan(selection[i].id).then(res => {
+            if (res.code === 200 && res.rows.length !== 0) {
+              line.buyer = res.rows[0].buyer
+              line.buyerName = res.rows[0].buyerName
+            }
+          })
+          line.businessDept = selection[i].businessDepartment
+          line.businessDeptName = selection[i].businessDepartmentName
+          line.materialCode = selection[i].code
+          line.material = selection[i].id
+          line.materialName = selection[i].name
+          line.classifyId = selection[i].classifyId
+          line.materialClassifyOneName = selection[i].oneClass
+          line.materialClassifyTwoName = selection[i].twoClass
+          line.materialClassifyThreeName = selection[i].threeClass
+          line.materialClassifyFourName = selection[i].fourClass
+          line.specification = selection[i].specification
+          line.model = selection[i].model
+          line.unit = selection[i].unitId
+          line.unitName = selection[i].unitIdName
+          line.registrant = selection[i].registrant
+          line.manufacturerName = selection[i].manufacturerIdName
+          line.puPeriod = selection[i].deliveryPeriod
+          line.expiry = selection[i].usefulLife
+          line.expiryUnit = selection[i].expiryUnitIdName
+          // line.minPackage = selection[i].usefulLife
+          line.minPackage = selection[i].minPackQty
+          line.minOrderQty = selection[i].minOrderQty
+          line.minBatch = selection[i].minBatchQty
+          line.safeStock = selection[i].safeStock
+          line.purOrgName = selection[i].purchasingOrganizationName
+          line.puOrg = selection[i].purchasingOrganization
+          // 物料存储条件和运输条件
+          line.transportationCondition = selection[i].transportationCondition
+          line.storageCondition = selection[i].storageCondition
+          this.basicForm.puDemandItemList.push(line)
+        }
+        // 删除指定下标
+        this.basicForm.puDemandItemList.splice(this.tableIndex,1)
+      }
     },
     // 明细行选择业务部门参照带出业务部门数据
     chooseDept(index, type, isPage, title) {
@@ -1600,10 +1760,10 @@ export default {
 .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 .el-form-item__error{
+//   padding-top: 0;
+//   top: 70%
+// }
 .el-table ::v-deep .success-row {
   background: #f11616;
 }

+ 2 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -171,7 +171,8 @@
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <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="120" prop="approverFinishTime"/>

+ 0 - 1
src/views/purchase/apply/add/columns.js

@@ -234,7 +234,6 @@ export default function useColumns() {
                 return time.getTime() < Date.now() + 3600 * 1000 * 24 * 365;
               },
             },
-
             value: new Date(new Date().getTime() + 3600 * 1000 * 24 * 366),
           },
         },

+ 3 - 0
src/views/purchase/apply/add/index.vue

@@ -288,6 +288,9 @@ export default {
         if (valid) {
           try {
             this.loading = true;
+            if (this.addType === "copy") {
+              this.params.priceApplyOrgs = [];
+            }
             if (this.addType === "edit") {
               this.params.priceApplyItems = this.params.priceApplyItems.filter(
                 (item) => item.materialName

+ 2 - 2
src/views/purchase/apply/columns.js

@@ -16,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: {} },
@@ -35,7 +35,7 @@ export default function useColumns() {
     },
   ].map(({ item, attr }) => ({
     attr,
-    item: { ...item, hidden: true, fixed: false },
+    item: { ...item, fixed: false },
   }));
   const SearchColumns = [
     {

+ 2 - 5
src/views/purchase/catalogue/columns.js

@@ -107,6 +107,7 @@ export default function useColumns() {
       attr: {
         is: "el-popover-select-v2",
         referName: "MATERIAL_PARAM",
+        valueKey: "code",
         dataMapping: {
           material: "id",
           materialCode: "code",
@@ -121,10 +122,6 @@ export default function useColumns() {
       item: { key: "enableStatus", title: "启用状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
-  ].map(({ item, attr }) => ({
-    attr,
-    item: { ...item, hidden: true, span: item.span || 6 },
-  }));
-
+  ];
   return { TableColumns, SearchColumns };
 }

+ 35 - 31
src/views/purchase/contract/edit/columns.js

@@ -3,7 +3,7 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织", require: true },
+      item: { key: "puOrgName", title: "采购组织", require: true ,},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -32,7 +32,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { key: "buyerName", title: "采购员", require: true ,},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -46,7 +46,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true },
+      item: { key: "supplierName", title: "供应商", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -58,7 +58,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractType", title: "合同类型", require: true },
+      item: { key: "contractType", title: "合同类型", require: true ,},
       attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
     },
     {
@@ -69,7 +69,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { key: "puDeptName", title: "采购部门", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -81,33 +81,33 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierTier", title: "供应商层级", require: true },
+      item: { key: "supplierTier", title: "供应商层级", require: true ,},
       attr: { is: "el-select", dictName: "puarchase_contract_supplier_tier" },
     },
     {
-      item: { key: "contractName", title: "合同名称", require: true },
+      item: { key: "contractName", title: "合同名称", require: true, },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
+      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true ,},
       attr: {
         is: "el-input-number",
         precision: 2,
       },
     },
     {
-      item: { key: "approveFlow", title: "审批流程", require: true },
+      item: { key: "approveFlow", title: "审批流程", require: true, },
       attr: { is: "el-select", dictName: "puarchase_contract_approve_flow" },
     },
     {
-      item: { key: "consumableClass", title: "耗材类别", require: true },
+      item: { key: "consumableClass", title: "耗材类别", require: true, },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { key: "effectiveDate", title: "合同生效日期", require: true },
+      item: { key: "effectiveDate", title: "合同生效日期", require: true ,},
       attr: {
         is: "el-date-picker",
         valueFormat: "yyyy-MM-dd",
@@ -125,22 +125,22 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractFormat", title: "合同格式", require: true },
+      item: { key: "contractFormat", title: "合同格式", require: true, },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { key: "productName", title: "产品类别&名称", require: true },
+      item: { key: "productName", title: "产品类别&名称", require: true, },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "endDate", title: "合同终止日期", require: true },
+      item: { key: "endDate", title: "合同终止日期", require: true ,},
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "invoiceTax", title: "发票税率 (%)", require: true },
+      item: { key: "invoiceTax", title: "发票税率 (%)", require: true,},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "ntaxrate",
@@ -151,23 +151,23 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "emergencyDegree", title: "紧急程度", require: true },
+      item: { key: "emergencyDegree", title: "紧急程度", require: true ,},
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
     {
-      item: { key: "project", title: "项目医院", require: true },
+      item: { key: "project", title: "项目医院", require: true ,},
       attr: { is: "el-input" },
     },
     {
-      item: { key: "deliveryType", title: "交货方式", require: true },
+      item: { key: "deliveryType", title: "交货方式", require: true, },
       attr: { is: "el-select", dictName: "puarchase_contract_delivery_type" },
     },
     {
       item: { key: "source", title: "合同来源" },
-      attr: { is: "el-input", value: "自制", disabled: true },
+      attr: { is: "el-input", value: "自制", disabled: true, },
     },
     {
       item: { key: "contractPartycName", title: "合同丙方" },
@@ -182,7 +182,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
+      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true ,},
       attr: { is: "el-input-number", precision: 2 },
     },
     {
@@ -197,11 +197,11 @@ export default function useColumns() {
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "isTarget", title: "是否有指标", require: true },
+      item: { key: "isTarget", title: "是否有指标", require: true ,},
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "contractTarget", title: "合同指标", require: true },
+      item: { key: "contractTarget", title: "合同指标", require: true, },
       attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
     },
     {
@@ -213,7 +213,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "isRebate", title: "是否有返利", require: true },
+      item: { key: "isRebate", title: "是否有返利", require: true, },
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
@@ -228,7 +228,7 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { key: "rollbackPolicy", title: "退换货政策", require: true },
+      item: { key: "rollbackPolicy", title: "退换货政策", require: true ,},
       attr: { is: "el-input" },
     },
     {
@@ -282,7 +282,7 @@ export default function useColumns() {
       attr: { is: "el-input" },
     },
     {
-      item: { key: "paymentAgreement", title: "付款协议", require: true },
+      item: { key: "paymentAgreement", title: "付款协议", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -301,7 +301,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { key: "currencyName", title: "币种", require: true, },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -333,6 +333,7 @@ export default function useColumns() {
           item: {
             title: "物料名称",
             key: "materialName",
+            require: true ,
           },
           attr: {
             is: "el-popover-select-v2",
@@ -352,6 +353,7 @@ export default function useColumns() {
           item: {
             title: "物料编码",
             key: "material",
+            require: true ,
           },
           attr: {},
         },
@@ -383,7 +385,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 +402,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 +419,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 +526,7 @@ export default function useColumns() {
           item: {
             title: "付款起点",
             key: "origin",
+            require: true 
           },
           attr: {
             is: "el-select",
@@ -531,14 +534,14 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "账期天数", key: "paymetDays" },
+          item: { title: "账期天数", key: "paymetDays" ,require: true, },
           attr: {
             is: "el-input-number",
             precision: 2,
           },
         },
         {
-          item: { title: "付款比例%", key: "ratio" },
+          item: { title: "付款比例%", key: "ratio",require: true,  },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -575,6 +578,7 @@ export default function useColumns() {
           item: {
             title: "结算方式",
             key: "paymentMeans",
+            require:true,
           },
           attr: {
             is: "el-popover-select-v2",

+ 0 - 11
src/views/purchase/contract/index.vue

@@ -178,18 +178,7 @@ export default {
       :page="page"
       @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">

+ 6 - 0
src/views/purchase/purchase-order/add/index.vue

@@ -703,6 +703,12 @@ export default {
                 :label="cColumn.title"
                 :width="cColumn.width || 80"
               >
+              <template slot="header" slot-scope="scope">
+                <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                <span>
+                  {{ cColumn.title }}
+                </span>
+              </template>
                 <template slot-scope="scope">
                   <el-form-item 
                     label-width="0" 

+ 6 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -641,6 +641,12 @@ export default {
                 :label="cColumn.title" 
                 :width="cColumn.width"
                 >
+                <template slot="header" slot-scope="scope">
+                  <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                  <span>
+                    {{ cColumn.title }}
+                  </span>
+                </template>
                 <template slot-scope="scope">
 
                   <el-form-item 

+ 6 - 0
src/views/purchase/purchase-order/see/index.vue

@@ -304,6 +304,12 @@ export default {
                 :label="cColumn.title" 
                 :width="cColumn.width || 80"
               >
+                <template slot="header" slot-scope="scope">
+                  <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                  <span>
+                    {{ cColumn.title }}
+                  </span>
+                </template>
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}

+ 16 - 25
src/views/purchase/task/index.vue

@@ -1,6 +1,6 @@
 <script>
-import { dicts } from "./dicts";
 import useColumns from "./columns";
+import { dicts } from "./dicts";
 import { LIST } from "@/api/business/purchase/task";
 
 export default {
@@ -8,7 +8,7 @@ export default {
   dicts: dicts,
   components: {
     DcButton: () => import("./dao-chu/index.vue"),
-    MxButton: () => import("./ming-xi/index.vue"),
+    SeeButton: () => import("./see/index.vue"),
     ZpButton: () => import("./zhuan-pai/index.vue"),
     ThxqButton: () => import("./tui-hui-xu-qiu/index.vue"),
     XyzcButton: () => import("./xie-yi-zhi-cai/index.vue"),
@@ -17,17 +17,17 @@ export default {
   },
   data() {
     const { TableColumns, SearchColumns } = useColumns();
+    const page = this.$init.page();
     const params = this.$init.params(SearchColumns);
     return {
-      key: 0,
       size: "mini",
       loading: false,
+      page: page,
       params: params,
       tableData: [],
       selectData: [],
       TableColumns: TableColumns,
       SearchColumns: SearchColumns,
-      page: { pageNum: 1, pageSize: 20, total: 0 },
     };
   },
   computed: {},
@@ -91,8 +91,7 @@ export default {
     },
     // 重 置
     useReset() {
-      this.page.pageNum = 1;
-      this.page.pageSize = 20;
+      this.page = this.$init.page();
       this.params = this.$init.params(this.SearchColumns);
       this.useQuery(this.params, this.page);
     },
@@ -100,16 +99,6 @@ export default {
     useSelect(prop, value) {
       this.selectData = prop;
     },
-    // 明 细
-    async useSee(prop) {
-      const { open } = this.$refs.mingxi;
-      await open(prop);
-    },
-    // 导 出
-    async useExport(prop, page) {
-      const { open } = this.$refs.daochu;
-      await open(prop, page);
-    },
   },
 };
 </script>
@@ -133,6 +122,14 @@ export default {
     ></el-super-search>
     <div class="my-4" style="text-align: right">
       <el-button-group>
+        <see-button
+          :size="size"
+          :dict="dict"
+          :select-data="selectData"
+          @success="useQuery(params, page)"
+        ></see-button>
+      </el-button-group>
+      <el-button-group>
         <thxq-button
           :size="size"
           :select-data="selectData"
@@ -140,6 +137,7 @@ export default {
         ></thxq-button>
         <xyzc-button
           :size="size"
+          :dict="dict"
           :select-data="selectData"
           @success="useQuery(params, page)"
         ></xyzc-button>
@@ -151,14 +149,6 @@ export default {
           @success="useQuery(params, page)"
         >
         </zp-button>
-        <mx-button
-          v-show="false"
-          :size="size"
-          :dict="dict"
-          :select-data="selectData"
-          ref="mingxi"
-          @success="useQuery(params, page)"
-        ></mx-button>
       </el-button-group>
       <el-button-group>
         <dc-button
@@ -175,10 +165,11 @@ export default {
       :dict="dict"
       :page="page"
       :columns="TableColumns"
-      :selectable="setSelectable"
       index
       checkbox
       hiddenColumns
+      filterColumns
+      pagination
       height="600"
       @row-select="useSelect"
       @pagination="useQuery(params, page)"

+ 0 - 0
src/views/purchase/task/ming-xi/columns.js → src/views/purchase/task/see/columns.js


+ 13 - 2
src/views/purchase/task/ming-xi/index.vue → src/views/purchase/task/see/index.vue

@@ -21,8 +21,8 @@ export default {
     const { TableColumns } = useColumns();
     return {
       title: "明 细",
-      width: "25%",
-      column: 1,
+      width: "100%",
+      column: 3,
       visible: false,
       loading: false,
       TableColumns: TableColumns,
@@ -62,6 +62,10 @@ export default {
       const { id } = prop;
       this.visible = await this.fetchItem(id);
     },
+    //
+    async hide() {
+      this.visible = false;
+    },
   },
   created() {},
   mounted() {},
@@ -77,11 +81,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>
       <el-super-descriptions
         v-model="params"
         :dict="dict"

+ 15 - 11
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -2,11 +2,15 @@ import CONFIG from "@/config";
 
 export const TableColumns = [
   {
-    item: { key: "supplierName", title: "供应商" },
+    item: { key: "puOrgName", title: "采购组织" },
     attr: {},
   },
   {
-    item: { key: "puOrgName", title: "采购组织" },
+    item: { key: "demandDate", title: "需求时间" },
+    attr: {},
+  },
+  {
+    item: { key: "supplierName", title: "供应商" },
     attr: {},
   },
   {
@@ -30,7 +34,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
@@ -38,8 +42,8 @@ export const TableColumns = [
     item: { key: "taxFreePrice", title: "无税单价" },
     attr: {
       is: "el-computed-input-v2",
-      formatter: (prop = 0) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+      formatter: (prop) => {
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
@@ -47,16 +51,16 @@ export const TableColumns = [
     item: { key: "taxPrice", title: "主含税单价" },
     attr: {
       is: "el-computed-input-v2",
-      formatter: (prop = 0) => {
-        return (prop.tax * 1).toFixed(CONFIG.precision);
+      formatter: (prop) => {
+        return (prop * 1).toFixed(CONFIG.precision);
       },
     },
   },
   {
-    item: { key: "purchaseQuantity", title: "本次采购数量" },
+    item: { key: "purchaseQuantity", title: "本次采购数量", fixed: true },
     attr: {
       is: "el-input-number",
-      min: () => 0,
+      min: 0,
       max: (prop) => {
         const { puQty = 0, executeQty = 0 } = prop;
         return puQty - executeQty;
@@ -65,7 +69,7 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "arrivalDatePlan", title: "计划到货日期" },
+    item: { key: "arrivalDatePlan", title: "计划到货日期", fixed: true },
     attr: {
       is: "el-date-picker",
       valueFormat: "yyyy-MM-dd",
@@ -77,7 +81,7 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "note", title: "备注" },
+    item: { key: "note", title: "备注", fixed: true },
     attr: {
       is: "el-input",
       autosize: true,

+ 31 - 84
src/views/purchase/task/xie-yi-zhi-cai/index.vue

@@ -12,13 +12,14 @@ export default {
     },
   },
   components: {
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElDictTag: () => import("@/components/DictTag/index.vue"),
     ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
   },
   data() {
     return {
       title: "协议直采",
-      width: "50%",
+      width: "100%",
       column: 1,
       visible: false,
       loading: false,
@@ -110,94 +111,14 @@ export default {
   >
     {{ title }}
     <el-drawer
+      :show-close="false"
       :size="width"
       :title="title"
       :visible.sync="visible"
       append-to-body
     >
-      <div v-for="(item, index) in data" :key="index" style="margin: 10px">
-        <el-descriptions :size="$attrs.size" :column="column" border>
-          <template #title>
-            <span style="margin-right: 10px">{{ item.materialName }}</span>
-            <span style="color: tomato">{{ item.puQty }}</span>
-            (<span style="color: tomato">{{
-              item.puQty - (item.executeQty || 0)
-            }}</span
-            >)
-            <span> {{ item.puUnitName }}</span>
-          </template>
-          <el-descriptions-item label="需求组织">
-            {{ item.demandOrgName }}
-          </el-descriptions-item>
-          <el-descriptions-item label="采购组织">
-            {{ item.puOrgName }}
-          </el-descriptions-item>
-          <el-descriptions-item label="需求时间">
-            {{ item.demandDate }}
-          </el-descriptions-item>
-        </el-descriptions>
-        <el-table
-          v-loading="loading"
-          :size="$attrs.size"
-          :data="item.orderPriceVos"
-          style="width: 100%"
-        >
-          <el-table-column
-            v-for="(cItem, cIndex) in tableColumns"
-            :key="cIndex"
-            :prop="cItem.item.key"
-            :label="cItem.item.title"
-            :fixed="cItem.item.fixed"
-            :width="cItem.item.width || 250"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-input-number
-                v-if="cItem.attr.is === 'el-input-number'"
-                v-model="scope.row[cItem.item.key]"
-                :size="$attrs.size"
-                :min="cItem.attr.min(item)"
-                :max="cItem.attr.max(item)"
-                :controls-position="cItem.attr.controlsPosition"
-                style="width: 90%"
-              ></el-input-number>
-              <el-date-picker
-                v-else-if="cItem.attr.is === 'el-date-picker'"
-                v-model="scope.row[cItem.item.key]"
-                :size="$attrs.size"
-                :type="cItem.attr.type"
-                :value-format="cItem.attr.valueFormat"
-                :picker-options="cItem.attr.pickerOptions"
-                style="width: 90%"
-              ></el-date-picker>
-              <el-input
-                v-else-if="cItem.attr.is === 'el-input'"
-                v-model="scope.row[cItem.item.key]"
-                :size="$attrs.size"
-                autosize
-                type="textarea"
-                style="width: 90%"
-              ></el-input>
-              <el-computed-input-v2
-                v-else-if="cItem.attr.is === 'el-computed-input-v2'"
-                v-on="cItem.listeners"
-                v-model="scope.row[cItem.item.key]"
-                :source="scope.row"
-                :formatter="cItem.attr.formatter"
-                style="width: 100%"
-              ></el-computed-input-v2>
-              <el-dict-tag
-                v-else-if="cItem.attr.is === 'el-dict-tag'"
-                :size="$attrs.size"
-                :value="scope.row[cItem.item.key]"
-                :options="dict.type[cItem.attr.dictName]"
-              />
-              <span v-else>{{ scope.row[cItem.item.key] }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div style="text-align: right; margin: 20px 20px 0">
+      <template slot="title">
+        <span>{{ title }}</span>
         <el-button
           :size="$attrs.size"
           :loading="loading"
@@ -211,6 +132,32 @@ export default {
           @click="submit(data)"
           >确 认</el-button
         >
+      </template>
+      <div v-for="(item, index) in data" :key="index" class="m-4">
+        <h3 class="mb-4">
+          <span style="margin-right: 10px">{{ item.materialName }}</span>
+          <span style="color: tomato">{{ item.puQty }}</span>
+          (<span style="color: tomato">{{
+            item.puQty - (item.executeQty || 0)
+          }}</span
+          >) <span> {{ item.puUnitName }}</span>
+        </h3>
+        <el-super-table
+          v-model="item.orderPriceVos"
+          :columns="tableColumns"
+          :size="$attrs.size"
+          :dict="dict"
+        >
+          <template slot="purchaseQuantity" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :max="scope.attr.max(scope.row)"
+            >
+            </component>
+          </template>
+        </el-super-table>
       </div>
     </el-drawer>
   </el-button>

+ 0 - 1
vue.config.js

@@ -47,7 +47,6 @@ module.exports = {
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.21:8000/drp-admin`, //CKF本地
         // target: `http://172.16.13.43:8000/drp-admin`, //lz's localhost
-
          // target: `http://127.0.0.1:8000/drp-admin`,
         changeOrigin: true,
         pathRewrite: {