فهرست منبع

Merge branch 'historical_route' of http://172.16.100.139/new-business/drp-web into historical_route

DongZ 1 سال پیش
والد
کامیت
f618e662dc
71فایلهای تغییر یافته به همراه6406 افزوده شده و 2844 حذف شده
  1. 1 0
      package.json
  2. 52 0
      src/api/business/spd/fillin/dailysale_quantity_assess.js
  3. 28 0
      src/api/business/spd/goal_management/commonWays.js
  4. 8 0
      src/api/business/spd/starget/targetTemplate.js
  5. 3 3
      src/assets/styles/index.scss
  6. 25 25
      src/main.js
  7. 24 2
      src/utils/request.js
  8. 208 0
      src/views/business/spd/fillin/dailysale_quantity_assess/addmaterial.vue
  9. 209 0
      src/views/business/spd/fillin/dailysale_quantity_assess/choosematerial.vue
  10. 891 0
      src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue
  11. 220 0
      src/views/business/spd/fillin/dailysale_quantity_assess/index.vue
  12. 392 212
      src/views/business/spd/goal_management/AnnualSaleGoal.vue
  13. 158 66
      src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue
  14. 122 41
      src/views/business/spd/goal_management/MonthGoalMerge.vue
  15. 261 28
      src/views/business/spd/goal_management/MonthReturnGoal.vue
  16. 190 33
      src/views/business/spd/goal_management/MonthReturnMerge.vue
  17. 265 90
      src/views/business/spd/goal_management/MonthSaleGoal.vue
  18. 1 3
      src/views/business/spd/target/targetMk/add.vue
  19. 51 12
      src/views/business/spd/target/targetMk/index.vue
  20. 4 3
      src/views/business/spd/target/targetMk/item.vue
  21. 170 0
      src/views/business/spd/target/targetMk/templateDownload.vue
  22. 0 131
      src/views/business/spd/target/targetTemplate/add/columns.js
  23. 0 453
      src/views/business/spd/target/targetTemplate/add/index.vue
  24. 0 38
      src/views/business/spd/target/targetTemplate/columns.js
  25. 0 74
      src/views/business/spd/target/targetTemplate/delete/index.vue
  26. 508 0
      src/views/business/spd/target/targetTemplate/detail.vue
  27. 0 14
      src/views/business/spd/target/targetTemplate/dicts.js
  28. 231 126
      src/views/business/spd/target/targetTemplate/index.vue
  29. 0 110
      src/views/business/spd/target/targetTemplate/see/columns.js
  30. 0 170
      src/views/business/spd/target/targetTemplate/see/index.vue
  31. 129 0
      src/views/material/basicFile/columns.js
  32. 1 1
      src/views/material/basicFile/details.vue
  33. 80 17
      src/views/material/basicFile/index.vue
  34. 14 3
      src/views/purchase/DemandSummary/add.vue
  35. 247 0
      src/views/purchase/DemandSummary/colTol.vue
  36. 133 119
      src/views/purchase/DemandSummary/index.vue
  37. 20 16
      src/views/purchase/MaterialClassDivision/add.vue
  38. 16 3
      src/views/purchase/MaterialClassDivision/index.vue
  39. 351 406
      src/views/purchase/PurchaseDemandList/add.vue
  40. 31 9
      src/views/purchase/PurchaseDemandList/index.vue
  41. 124 0
      src/views/purchase/apply/add/columns.js
  42. 1 0
      src/views/purchase/apply/add/index.vue
  43. 27 15
      src/views/purchase/apply/columns.js
  44. 122 0
      src/views/purchase/apply/copy/columns.js
  45. 8 0
      src/views/purchase/apply/copy/index.vue
  46. 124 0
      src/views/purchase/apply/edit/columns.js
  47. 9 0
      src/views/purchase/apply/edit/index.vue
  48. 1 4
      src/views/purchase/apply/index.vue
  49. 183 41
      src/views/purchase/apply/see/columns.js
  50. 35 35
      src/views/purchase/catalogue/columns.js
  51. 0 1
      src/views/purchase/catalogue/index.vue
  52. 25 25
      src/views/purchase/catalogue/see/columns.js
  53. 47 45
      src/views/purchase/contract/add/columns.js
  54. 54 54
      src/views/purchase/contract/columns.js
  55. 102 102
      src/views/purchase/contract/edit/columns.js
  56. 0 1
      src/views/purchase/contract/index.vue
  57. 102 102
      src/views/purchase/contract/see/columns.js
  58. 20 16
      src/views/purchase/deliveryAddress/add.vue
  59. 16 3
      src/views/purchase/deliveryAddress/index.vue
  60. 103 55
      src/views/purchase/purchase-order/column.js
  61. 3 3
      src/views/purchase/purchase-order/index.vue
  62. 23 12
      src/views/purchase/purchase-order/print/index.vue
  63. 26 3
      src/views/purchase/purchase-order/see/index.vue
  64. 35 30
      src/views/purchase/task/columns.js
  65. 2 2
      src/views/purchase/task/index.vue
  66. 6 1
      src/views/purchase/task/see/columns.js
  67. 1 1
      src/views/purchase/task/tui-hui-xu-qiu/index.vue
  68. 1 1
      src/views/purchase/task/xie-yi-zhi-cai/index.vue
  69. 28 19
      src/views/purchase/task/zhuan-pai/index.vue
  70. 116 62
      src/views/purchase/transferOrder/add.vue
  71. 18 3
      src/views/purchase/transferOrder/index.vue

+ 1 - 0
package.json

@@ -45,6 +45,7 @@
     "clipboard": "2.0.8",
     "core-js": "^3.25.3",
     "echarts": "^5.4.0",
+    "el-table-infinite-scroll": "^2.0.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
     "fuse.js": "6.4.3",

+ 52 - 0
src/api/business/spd/fillin/dailysale_quantity_assess.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询日预估销售产品数据填充列表
+export function listAssess(query) {
+  return request({
+    url: '/mk/fillin/dailySaleQuantityAssess/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询日预估销售产品数据填充详细
+export function getAssess(id) {
+  return request({
+    url: '/mk/fillin/dailySaleQuantityAssess/' + id,
+    method: 'get'
+  })
+}
+
+// 新增日预估销售产品数据填充
+export function addAssess(data) {
+  return request({
+    url: '/mk/fillin/dailySaleQuantityAssess',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改日预估销售产品数据填充
+export function updateAssess(data) {
+  return request({
+    url: '/mk/fillin/dailySaleQuantityAssess',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除日预估销售产品数据填充
+export function delAssess(id) {
+  return request({
+    url: '/mk/fillin/dailySaleQuantityAssess/' + id,
+    method: 'delete'
+  })
+}
+
+export function getSaleMaterialList(query) {
+  return request({
+    url: '/mk/fillin/dailySaleQuantityAssess/salematerial/list',
+    method: 'get',
+    params: query
+  })
+}

+ 28 - 0
src/api/business/spd/goal_management/aDemo.js → src/api/business/spd/goal_management/commonWays.js

@@ -27,3 +27,31 @@ function mergeArray() {
   const mergedArray = mergeAndSumTotalGoal(arr);
   console.log(mergedArray);
 }
+
+// 计算子表小计
+export function getSummary(param) {
+  const { columns, data } = param;
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '小计';
+      return;
+    }
+    const values = data.map(item => Number(item[column.property]));
+    if (!values.every(value => isNaN(value))) {
+      sums[index] = values.reduce((prev, curr) => {
+        const value = Number(curr);
+        if (!isNaN(value)) {
+          return ((prev * 10000000 + curr * 10000000) / 10000000).toFixed(2);
+        } else {
+          return prev;
+        }
+      }, 0);
+      sums[index] += '';
+    } else {
+      sums[index] = '*';
+    }
+  });
+
+  return sums;
+}

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

@@ -57,4 +57,12 @@ export function checkQuote(id) {
     url: '/mk/target/targetTemplate/checkQuote/' + id,
     method: 'get'
   })
+}
+
+//校验目标模板是否被引用
+export function download(id) {
+  return request({
+    url: '/mk/target/targetTemplate/download/' + id,
+    method: 'get'
+  })
 }

+ 3 - 3
src/assets/styles/index.scss

@@ -203,7 +203,7 @@ aside {
 /**修改全局的滚动条*/
 /**滚动条的宽度*/
 ::-webkit-scrollbar {
-  width: 8px;
+  width: 12px;
 }
 ::-webkit-scrollbar-thumb {
   background-color: #eaecf1;
@@ -211,8 +211,8 @@ aside {
 }
 /*表格*/
 .el-table__body-wrapper::-webkit-scrollbar {
-  width: 8px;
-  height: 8px;
+  width: 12px;
+  height: 12px;
 }
 .el-table__body-wrapper::-webkit-scrollbar-thumb {
   background-color: #a1a3a9;

+ 25 - 25
src/main.js

@@ -96,31 +96,31 @@ Vue.use(Print); //注册
 DictData.install();
 
 // el-table无限滚动解决页面渲染卡死
-Vue.directive("myscroll", {
-  bind(el, bind, vnode) {
-    const self = vnode.context;
-    let target = el.querySelector('.el-table__body-wrapper');
-    target.addEventListener("scroll", () => {
-      // 检测触底
-      if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
-        if (self.over >= self.basicForm.puDemandItemList) {
-          return;
-        }
-        self.over +=15
-      }
-    })
-  }
-})
-Vue.mixin({
-  data() {
-    return {
-      // scrollTop: 0,
-      // tableHeight: 300
-      start: 0,
-      over: 15
-    }
-  }
-})
+// Vue.directive("myscroll", {
+//   bind(el, bind, vnode) {
+//     const self = vnode.context;
+//     let target = el.querySelector('.el-table__body-wrapper');
+//     target.addEventListener("scroll", () => {
+//       // 检测触底
+//       if (target.scrollTop + target.clientHeight >= target.scrollHeight) {
+//         if (self.over >= self.basicForm.puDemandItemList) {
+//           return;
+//         }
+//         self.over +=15
+//       }
+//     })
+//   }
+// })
+// Vue.mixin({
+//   data() {
+//     return {
+//       // scrollTop: 0,
+//       // tableHeight: 300
+//       start: 0,
+//       over: 15
+//     }
+//   }
+// })
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 24 - 2
src/utils/request.js

@@ -1,11 +1,12 @@
 import axios from "axios";
 import { Notification, MessageBox, Message, Loading } from "element-ui";
 import store from "@/store";
-import { getToken } from "@/utils/auth";
+import { getToken, setToken } from "@/utils/auth";
 import errorCode from "@/utils/errorCode";
 import { tansParams, blobValidate } from "@/utils/ruoyi";
 import cache from "@/plugins/cache";
 import { saveAs } from "file-saver";
+import { sso } from "@/api/sso/ssoLogin";
 
 let downloadLoadingInstance;
 // 是否显示重新登录
@@ -88,7 +89,7 @@ service.interceptors.request.use(
 
 // 响应拦截器
 service.interceptors.response.use(
-  (res) => {
+  async (res) => {
     // 未设置状态码则默认成功状态
     const code = res.data.code || 200;
     // 获取错误信息
@@ -100,6 +101,27 @@ service.interceptors.response.use(
     ) {
       return res.data;
     }
+    if (code === 222) {
+      let userInfo = JSON.parse(localStorage.getItem("userInfo"));
+      try {
+        const ssoRes = await sso(userInfo);
+        if (ssoRes.code === 200) {
+          let token = ssoRes.token;
+          setToken(token);
+          store.commit("SET_TOKEN", token);
+          store.dispatch("GetInfo").then(() => {});
+          return await service({
+            url: res.config.url,
+            data: res.config.data,
+            method: res.config.method,
+            params: { ...res.config.params, DName: "蒙奇·D·伟涛" },
+          });
+        }
+      } catch (err) {
+        return Promise.reject("error");
+      } finally {
+      }
+    }
     if (code === 401) {
       if (!isRelogin.show) {
         isRelogin.show = true;

+ 208 - 0
src/views/business/spd/fillin/dailysale_quantity_assess/addmaterial.vue

@@ -0,0 +1,208 @@
+
+<template>
+    <div>
+        <el-button type="primary" size="mini" @click="openDialog">增行</el-button>
+        <el-dialog title="物料信息查询" :visible.sync="open" :before-close="useClose">
+            <el-form size="mini" label-width="120px" >
+                <el-row :gutter="10">
+                    <el-col :span="1.5">
+                        <el-form-item label="物料编码">
+                        <el-input
+                            v-model="queryParams.code"
+                            clearable
+                            style="width: 200px"
+                        />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="物料名称">
+                        <el-input
+                            v-model="queryParams.name"
+                            clearable
+                            style="width: 200px"
+                        />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item>
+                        <el-button type="primary" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+                        <el-button icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <el-table :data="tableData" size="mini" @row-dblclick="useDoubleClick" @selection-change="useSelectChange" height="450px">
+                <el-table-column type="selection" width="55"> </el-table-column>
+                <el-table-column show-overflow-tooltip label="编码" align="center" width="150" prop="code"/>
+                <el-table-column show-overflow-tooltip label="名称" align="center" width="200" prop="name"/>
+                <el-table-column show-overflow-tooltip label="物料分类" align="center" width="150" prop="fourClass" />
+                <el-table-column show-overflow-tooltip label="单位" align="center" width="100" prop="unitIdName"/>
+                <el-table-column show-overflow-tooltip label="规格" align="center" width="200" prop="specification" />
+            </el-table>
+            <el-pagination
+                background
+                @size-change="useChangePageSize"
+                @current-change="useCurrentChange"
+                :current-page="queryParams.pageNum"
+                :page-sizes="[10, 15, 20]"
+                :page-size="100"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total=total>
+            </el-pagination>
+            <el-card>
+            <div class="btn_group">
+                <el-col :span="1.5" style="margin: 0 10px;">
+                    <el-button type="primary" size="mini" plain @click="useConfirm">确认</el-button>
+                </el-col>
+            </div>
+        </el-card>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import materialApi from "@/api/material/basic";
+
+export default {
+  name: "dailysaleQuantityAssessDetailAddmaterial",
+  data() {
+    return {
+      //是否打开弹窗
+      open:false,
+      //搜索框参数
+      queryParams:{
+        code: null,
+        name: null,
+      },
+      page:{
+        pageNum:1,
+        pageSize:10,
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableData:[],
+      //选择的数据
+      selectionData:[],
+    };
+  },
+  watch: {},
+  created() {
+  },
+  methods: {
+    //打开弹窗
+    openDialog(){
+      this.open = true;
+      this.getList();
+    },
+    //关闭弹窗
+    useClose(done){
+        this.selectionData = [];
+        this.queryParams = {
+            code: null,
+            name: null,
+        }
+        this.page = {
+            pageNum:1,
+            pageSize:10,
+        }
+        done();
+    },
+    //获取列表数据
+    async getList() {
+      try {
+        this.loading = true;
+        const { code, data } = await materialApi.materialList(this.queryParams, this.page);
+        if (code === 200) {
+          this.tableData = data.tableBody.rows;
+          this.total = data.tableBody.total;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //多选
+    useSelectChange(selection){
+        this.selectionData = selection;
+    },
+    //确认多选
+    useConfirm(){
+      if(this.selectionData.length < 1){
+        this.$modal.msgError("未选择数据!");
+        return;
+      }
+      const arr = [];
+      for(let i in this.selectionData){
+          arr.push({
+              oneClassName:this.selectionData[i].oneClass,
+              twoClassName:this.selectionData[i].twoClass,
+              materialCode:this.selectionData[i].code,
+              materialName:this.selectionData[i].name,
+              unitName:this.selectionData[i].unitIdName,
+          });
+      }
+      this.$emit("addRow",arr);
+      this.open = false;
+    },
+    //双击选择
+    async useDoubleClick(row){
+        const arr = [];
+        arr.push({
+            oneClassName:row.oneClass,
+            twoClassName:row.twoClass,
+            materialCode:row.code,
+            materialName:row.name,
+            unitName:row.unitIdName,
+        });
+        this.$emit("addRow",arr);
+        this.open = false;
+    },
+    //搜索
+    useSearch(){
+      this.getList();
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        code: null,
+        name: null,
+      }
+      this.page = {
+        pageNum:1,
+        pageSize:10,
+      }
+      this.getList();
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.page.pageSize = val
+      this.getList()
+    },
+    //翻页
+    useCurrentChange(val){
+      this.page.pageNum = val
+      this.getList()
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<style scoped lang="scss">
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 209 - 0
src/views/business/spd/fillin/dailysale_quantity_assess/choosematerial.vue

@@ -0,0 +1,209 @@
+
+<template>
+    <div>
+        <el-button type="primary" size="mini" @click="openDialog">筛选</el-button>
+        <el-dialog title="客户历史销售物料查询" :visible.sync="open" :before-close="useClose">
+            <el-form size="mini" label-width="120px" >
+                <el-row :gutter="10">
+                    <el-col :span="1.5">
+                        <el-form-item label="物料编码">
+                        <el-input
+                            v-model="queryParams.code"
+                            clearable
+                            style="width: 200px"
+                        />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="物料名称">
+                        <el-input
+                            v-model="queryParams.name"
+                            clearable
+                            style="width: 200px"
+                        />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item>
+                        <el-button type="primary" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+                        <el-button icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <el-table :data="tableData" size="mini" @row-dblclick="useDoubleClick" @selection-change="useSelectChange" height="450px">
+                <el-table-column type="selection" width="55"> </el-table-column>
+                <el-table-column show-overflow-tooltip label="编码" align="center" width="150" prop="code"/>
+                <el-table-column show-overflow-tooltip label="名称" align="center" width="200" prop="name"/>
+                <el-table-column show-overflow-tooltip label="物料分类" align="center" width="150" prop="fourClass" />
+                <el-table-column show-overflow-tooltip label="单位" align="center" width="100" prop="unitIdName"/>
+                <el-table-column show-overflow-tooltip label="规格" align="center" width="200" prop="specification" />
+                <el-table-column show-overflow-tooltip label="生产厂家" align="center" width="200" prop="manufacturersMaterialName" />
+            </el-table>
+            <el-pagination
+                background
+                @size-change="useChangePageSize"
+                @current-change="useCurrentChange"
+                :current-page="queryParams.pageNum"
+                :page-sizes="[10, 15, 20]"
+                :page-size="100"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total=total>
+            </el-pagination>
+            <el-card>
+            <div class="btn_group">
+                <el-col :span="1.5" style="margin: 0 10px;">
+                    <el-button type="primary" size="mini" plain @click="useConfirm">确认</el-button>
+                </el-col>
+            </div>
+        </el-card>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import {getSaleMaterialList} from "@/api/business/spd/fillin/dailysale_quantity_assess";
+
+export default {
+  name: "dailysaleQuantityAssessDetailChoosematerial",
+  props: ["form"],
+  data() {
+    return {
+      //是否打开弹窗
+      open:false,
+      //搜索框参数
+      queryParams:{
+        customer: null,
+        materialCode: null,
+        materialName: null,
+        pageNum:1,
+        pageSize:10,
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableData:[],
+      //选择的数据
+      selectionData:[],
+    };
+  },
+  watch: {},
+  created() {
+  },
+  methods: {
+    //打开弹窗
+    openDialog(){
+      if(!this.form.customer){
+        this.$modal.msgError("请选择客户!");
+        return;
+      }
+      this.open = true;
+      this.getList();
+    },
+    //关闭弹窗
+    useClose(done){
+        this.selectionData = [];
+        this.queryParams = {
+            customer: null,
+            materialCode: null,
+            materialName: null,
+            pageNum:1,
+            pageSize:10,
+        }
+        done();
+    },
+    //获取列表数据
+    async getList() {
+      try {
+        this.loading = true;
+        this.queryParams.customer = this.form.customer;
+        const { code, rows, total } = await getSaleMaterialList(this.queryParams);
+        if (code === 200) {
+          this.tableData = rows;
+          this.total = total;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //多选
+    useSelectChange(selection){
+        this.selectionData = selection;
+    },
+    //确认多选
+    useConfirm(){
+      if(this.selectionData.length < 1){
+        this.$modal.msgError("未选择数据!");
+        return;
+      }
+      const arr = [];
+      for(let i in this.selectionData){
+          arr.push({
+              oneClassName:this.selectionData[i].oneClass,
+              twoClassName:this.selectionData[i].twoClass,
+              materialCode:this.selectionData[i].code,
+              materialName:this.selectionData[i].name,
+              unitName:this.selectionData[i].unitIdName,
+          });
+      }
+      this.$emit("addRow",arr);
+      this.open = false;
+    },
+    //双击选择
+    async useDoubleClick(row){
+        const arr = [];
+        arr.push({
+            oneClassName:row.oneClass,
+            twoClassName:row.twoClass,
+            materialCode:row.code,
+            materialName:row.name,
+            unitName:row.unitIdName,
+        });
+        this.$emit("addRow",arr);
+        this.open = false;
+    },
+    //搜索
+    useSearch(){
+      this.getList();
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        customer: null,
+        materialCode: null,
+        materialName: null,
+        pageNum:1,
+        pageSize:10,
+      }
+      this.getList();
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.page.pageSize = val
+      this.getList()
+    },
+    //翻页
+    useCurrentChange(val){
+      this.page.pageNum = val
+      this.getList()
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 891 - 0
src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue

@@ -0,0 +1,891 @@
+
+<template>
+  <div>
+    <el-card>
+      <el-button size="mini" plain @click="useBack">返回</el-button>
+      <el-divider></el-divider>
+      <el-form
+        size="mini"
+        :model="form"
+        :rules="rules"
+        ref="form"
+        label-width="auto"
+      >
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="编码" prop="code">
+              <el-input
+                placeholder="自动生成"
+                readonly
+                v-model="form.code"
+                style="width: 200px"
+                clearable
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="月份" prop="month">
+              <el-date-picker
+                v-model="form.month"
+                value-format="yyyy-MM"
+                type="month"
+                clearable
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="客户" prop="customer">
+              <dr-popover-select
+                size="mini"
+                v-model="form.customerName"
+                title="客户选择"
+                type="CUSTOMER_PARAM_ZT"
+                :dataMapping="{
+                  customer: 'id',
+                  customerName: 'name',
+                }"
+                :source.sync="form"
+              >
+              </dr-popover-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="创建日期" prop="createTime">
+              <el-input
+                v-model="form.createTime"
+                style="width: 200px"
+                clearable
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="创建人" prop="createByName">
+              <el-input
+                v-model="form.createByName"
+                style="width: 200px"
+                clearable
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="部门" prop="deptName">
+              <el-input
+                v-model="form.deptName"
+                style="width: 200px"
+                clearable
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </el-card>
+    <el-card style="height: 800px">
+      <div style="position: relative">
+        <el-tabs v-model="activeName" @tab-click="useSwitchTab">
+          <el-tab-pane label="明细" name="item">
+            <el-table :data="items" height="700px" size="size">
+              <el-table-column
+                label="序号"
+                type="index"
+                width="50"
+                align="center"
+                fixed
+              />
+              <el-table-column
+                show-overflow-tooltip
+                label="一级品类"
+                align="center"
+                width="150"
+                prop="oneClassName"
+              />
+              <el-table-column
+                show-overflow-tooltip
+                label="二级品类"
+                align="center"
+                width="150"
+                prop="twoClassName"
+              />
+              <el-table-column
+                show-overflow-tooltip
+                label="物料编号"
+                align="center"
+                width="150"
+                prop="materialCode"
+              />
+              <el-table-column
+                show-overflow-tooltip
+                label="物料名称"
+                align="center"
+                width="150"
+                prop="materialName"
+              />
+              <el-table-column
+                show-overflow-tooltip
+                label="单位"
+                align="center"
+                width="150"
+                prop="unitName"
+              />
+              <el-table-column
+                show-overflow-tooltip
+                label="价格(元)"
+                align="center"
+                width="150"
+                prop="price"
+              >
+                <template slot-scope="scope">
+                  <el-input-number
+                    size="mini"
+                    style="width: 130px"
+                    v-model="scope.row.price"
+                    :controls="false"
+                  >
+                  </el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column
+                show-overflow-tooltip
+                label="日 销 售 数 据 填 报"
+                align="center"
+              >
+                <el-table-column
+                  show-overflow-tooltip
+                  label="1"
+                  align="center"
+                  width="100"
+                  prop="first"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.first"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="2"
+                  align="center"
+                  width="100"
+                  prop="second"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.second"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="3"
+                  align="center"
+                  width="100"
+                  prop="third"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.third"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="4"
+                  align="center"
+                  width="100"
+                  prop="fourth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.fourth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="5"
+                  align="center"
+                  width="100"
+                  prop="fifth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.fifth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="6"
+                  align="center"
+                  width="100"
+                  prop="sixth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.sixth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="7"
+                  align="center"
+                  width="100"
+                  prop="seventh"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.seventh"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="8"
+                  align="center"
+                  width="100"
+                  prop="eighth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.eighth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="9"
+                  align="center"
+                  width="100"
+                  prop="ninth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.ninth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="10"
+                  align="center"
+                  width="100"
+                  prop="tenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.tenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="11"
+                  align="center"
+                  width="100"
+                  prop="eleventh"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.eleventh"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="12"
+                  align="center"
+                  width="100"
+                  prop="twelfth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twelfth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="13"
+                  align="center"
+                  width="100"
+                  prop="thirteenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.thirteenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="14"
+                  align="center"
+                  width="100"
+                  prop="fourteenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.fourteenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="15"
+                  align="center"
+                  width="100"
+                  prop="fifteenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.fifteenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="16"
+                  align="center"
+                  width="100"
+                  prop="sixteenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.sixteenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="17"
+                  align="center"
+                  width="100"
+                  prop="seventeenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.seventeenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="18"
+                  align="center"
+                  width="100"
+                  prop="eighteenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.eighteenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="19"
+                  align="center"
+                  width="100"
+                  prop="nineteenth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.nineteenth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="20"
+                  align="center"
+                  width="100"
+                  prop="twentieth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentieth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="21"
+                  align="center"
+                  width="100"
+                  prop="twentyFirst"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentyFirst"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="22"
+                  align="center"
+                  width="100"
+                  prop="twentySecond"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentySecond"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="23"
+                  align="center"
+                  width="100"
+                  prop="twentyThird"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentyThird"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="24"
+                  align="center"
+                  width="100"
+                  prop="twentyFourth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentyFourth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="25"
+                  align="center"
+                  width="100"
+                  prop="twentyFifth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentyFifth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="26"
+                  align="center"
+                  width="100"
+                  prop="twentySixth"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentySixth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="27"
+                  align="center"
+                  width="100"
+                  prop="twentySeventh"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentySeventh"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="28"
+                  align="center"
+                  width="100"
+                  prop="twentyEighth"
+                  v-if="numDay > '27'"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentyEighth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="29"
+                  align="center"
+                  width="100"
+                  prop="twentyNinth"
+                  v-if="numDay > '28'"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.twentyNinth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="30"
+                  align="center"
+                  width="100"
+                  prop="thirtieth"
+                  v-if="numDay > '29'"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.thirtieth"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="31"
+                  align="center"
+                  width="100"
+                  prop="thirtyFirst"
+                  v-if="numDay > '30'"
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      size="mini"
+                      v-model.number="scope.row.thirtyFirst"
+                      class="input-view"
+                      oninput="value=value.replace(/[^0-9]/g,'')"
+                    />
+                  </template>
+                </el-table-column>
+              </el-table-column>
+              <el-table-column
+                fixed="right"
+                label="操作"
+                align="center"
+                width="50"
+              >
+                <template slot-scope="scope">
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="useRowRemove(scope.$index, scope.row)"
+                    >删行</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <div style="position: absolute; right: 10px; top: 5px; display: flex">
+          <Choosematerial @addRow="addRow" :form="form"></Choosematerial>
+          <Addmaterial @addRow="addRow"></Addmaterial>
+        </div>
+      </div>
+    </el-card>
+    <el-card>
+      <div class="btn_group">
+        <el-col :span="1.5">
+          <el-button size="mini" plain @click="useBack">取消</el-button>
+        </el-col>
+        <el-col :span="1.5" style="margin: 0 10px">
+          <el-button type="primary" size="mini" plain @click="useSave"
+            >保存</el-button
+          >
+        </el-col>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import {
+  addAssess,
+  updateAssess,
+  getAssess,
+} from "@/api/business/spd/fillin/dailysale_quantity_assess";
+import Addmaterial from "./addmaterial";
+import Choosematerial from "./choosematerial";
+export default {
+  name: "dailysaleQuantityAssessDetail",
+  components: { Addmaterial, Choosematerial },
+  props: ["openMode", "row"],
+  data() {
+    return {
+      form: {
+        month: null,
+        customer: null,
+        customerName: null,
+        items: [],
+        //所选月份天数
+        numDay:31,
+      },
+      //表单校验
+      rules: {
+        month: [{ required: true, message: "月份不能为空", trigger: "blur" }],
+        customer: [
+          { required: true, message: "客户不能为空", trigger: "blur" },
+        ],
+      },
+      activeName: "item",
+    };
+  },
+  watch: {
+    'form.month': {
+      handler(newVal) {
+          console.log('newVal',newVal);
+          let arr = newVal.split('-');
+          console.log('arr.[1]',arr[1]);
+          this.numDay = this.getDays(arr[0],arr[1]);
+          console.log('this.numDay',this.numDay);
+      },
+      immediate:true,
+    }
+  },
+  computed: {
+    items() {
+      return this.form.items.filter(({ delFlag }) => delFlag !== "2");
+    },
+  },
+  async created() {
+    switch (this.openMode) {
+      case "add":
+        this.form.createTime = this.getCurrentTime();
+        this.form.month = this.getCurrentMonth();
+        this.form.createByName = this.$store.state.user.nickName;
+        this.form.dept = this.$store.state.user.deptId;
+        this.form.deptName = this.$store.state.user.deptName;
+        break;
+      case "edit":
+        await this.fetchAssess(this.row.id);
+        break;
+      case "see":
+        await this.fetchAssess(this.row.id);
+        break;
+    }
+  },
+  methods: {
+    //保存
+    async useSave() {
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          try {
+            let checkRes = this.checkBeforeSave(this.form);
+            if (!checkRes) {
+              return;
+            }
+            this.loading = true;
+            let res = null;
+            if (this.openMode === "add") {
+              res = await addAssess(this.form);
+            }
+            if (this.openMode === "edit") {
+              res = await updateAssess(this.form);
+            }
+            if (res.code === 200) {
+              this.$modal.msgSuccess("保存成功");
+              this.useBack();
+            }
+          } catch (err) {
+            console.error(err);
+          } finally {
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    //保存前校验
+    checkBeforeSave(form) {
+      return true;
+    },
+    //查询详情
+    async fetchAssess(id) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await getAssess(id);
+        if (code === 200) {
+          this.form = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //增行
+    addRow(rows) {
+      console.log("rows", rows);
+      for (let i in rows) {
+        this.form.items.push({
+          delFlag: "0",
+          $index: new Date().getTime(),
+          ...rows[i],
+        });
+      }
+    },
+    //删行
+    async useRowRemove(index, row) {
+      console.log("index", index);
+      console.log("row", row);
+      if (row.id) {
+        this.form.items.forEach((e) => {
+          if (e.id == row.id) {
+            e.delFlag = "2";
+          }
+        });
+      } else {
+        this.form.items.splice(index, 1);
+      }
+    },
+    //切换多页签
+    useSwitchTab() {},
+    //返回
+    useBack() {
+      this.$parent.useOpenDetail();
+      this.$parent.useSearch();
+    },
+    //获取当月
+    getCurrentMonth () {
+      const date = new Date()
+      let year = date.getFullYear()
+      let month = date.getMonth() + 1
+      month = month > 9 ? month : '0' + month
+      return `${year}-${month}`
+    },
+    getDays(year, month){
+      return new Date(year, month, 0).getDate()
+    },
+    getCurrentTime() {
+      var date = new Date();//当前时间
+      var year = date.getFullYear() //年
+      var month = this.repair(date.getMonth() + 1);//月
+      var day = this.repair(date.getDate());//日
+      var hour = this.repair(date.getHours());//时
+      var minute = this.repair(date.getMinutes());//分
+      var second = this.repair(date.getSeconds());//秒
+      //当前时间 
+      var curTime = year + "-" + month + "-" + day
+              + " " + hour + ":" + minute + ":" + second;
+      return curTime;
+    },
+    repair(i){
+      if (i >= 0 && i <= 9) {
+          return "0" + i;
+      } else {
+          return i;
+      }
+    }
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+}
+</style>

+ 220 - 0
src/views/business/spd/fillin/dailysale_quantity_assess/index.vue

@@ -0,0 +1,220 @@
+
+<template>
+  <div>
+    <div v-if="!openDetail">
+      <el-card>
+        <el-form size="mini" class="search_area" label-width="120px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="客户名称">
+                <el-input
+                  v-model="queryParams.customerName"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="年度">
+                <el-date-picker
+                  v-model="queryParams.month"
+                  type="month"
+                  format="yyyy-MM-dd"
+                  clearable
+                  >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="创建人">
+                <el-input
+                  v-model="queryParams.createByName"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="部门">
+                <el-input
+                  v-model="queryParams.deptName"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+                <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-divider></el-divider>
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
+        </div>
+
+        <el-table
+          :data="tableList"
+          @row-dblclick="useDoubleClick"
+          height="600px"
+        >
+          <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+          <el-table-column show-overflow-tooltip label="编码" align="center" width="200" prop="code"/>
+          <el-table-column show-overflow-tooltip label="客户名称" align="center" width="200" prop="customerName"/>
+          <el-table-column show-overflow-tooltip label="月度" align="center" width="200" prop="month"/>
+          <el-table-column show-overflow-tooltip label="部门" align="center" width="200" prop="deptName"/>
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="200" prop="createByName" />
+          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
+          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
+          <el-table-column fixed="right" label="操作" align="center" width="150">
+            <template slot-scope="scope">
+              <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
+              <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+          background
+          @size-change="useChangePageSize"
+          @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
+          :page-size="100"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+    <Detail v-if="openDetail" :openMode="openMode" :row="row"/>
+  </div>
+</template>
+
+<script>
+import Detail from './detail.vue'
+import { listAssess,delAssess, } from "@/api/business/spd/fillin/dailysale_quantity_assess";
+
+export default {
+  name: "dailysaleQuantityAssess",
+  components: {Detail},
+  data() {
+    return {
+      // 搜索框参数
+      queryParams: {
+        customerName:null,
+        month:null,
+        deptName:null,
+        deptName:null,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableList:[],
+      //是否打开详情页面
+      openDetail:false,
+      //编辑页面打开方式,add或edit或see
+      openMode:'',
+      //行数据
+      row:{},
+    };
+  },
+  created() {
+    this.getList(this.queryParams);
+  },
+  methods: {
+    //是否打开详情页面
+    useOpenDetail(){
+      this.openDetail = !this.openDetail;
+    },
+    //新增
+    useAdd(){
+      this.openMode = 'add';
+      this.openDetail = true;
+    },
+    //编辑
+    async useEdit(row){
+      this.openMode = 'edit';
+      this.row = row;
+      this.openDetail = true;
+    },
+    //删除
+    async useDel(row){
+      this.$modal.confirm('确认删除选择数据').then(() => {
+        delAssess(row.id).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }).catch(() => {})
+    },
+    //查询列表
+    getList(params){
+      console.log('params',params);
+      listAssess(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+        }
+      })
+    },
+    //双击
+    useDoubleClick(row){
+      this.openMode = 'see';
+      this.row = row;
+      this.openDetail = true;
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    //翻页
+    useCurrentChange(val){
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+    //搜索
+    useSearch() {
+      console.log(this.queryParams);
+      this.getList(this.queryParams);
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        customerName:null,
+        month:null,
+        deptName:null,
+        deptName:null,
+        pageNum: 1,
+        pageSize: 10,
+      }
+      this.getList(this.queryParams);
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 20px);
+  height: 100%;
+  margin: 10px;
+  padding: 20px;
+}
+.el-button-group + .el-button-group {
+  margin: 0 0 0 10px;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 392 - 212
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -41,6 +41,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -98,6 +101,18 @@
             </el-popover-select-v2>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -134,15 +149,13 @@
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-dropdown @command="handleCommand">
-          <el-button type="primary" size="mini" plain icon="el-icon-upload">
-            导入<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
-            <el-dropdown-item command="import">导入</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+        >导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-dropdown @command="handleCommand">
@@ -155,7 +168,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange">
@@ -292,158 +304,161 @@
         </el-row>
       </el-form>
       <div id="addDetails">
-        <el-row :gutter="10" class="mb8" style="margin-left: 94%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 80%">
+          <el-col :span="1.5">
+            <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
+          </el-col>
           <el-col :span="1.5">
             <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="el-icon-edit-outline" size="mini" @click="dialogUpdateMore.dialogFormVisible = true">批量修改</el-button>
+          </el-col>
         </el-row>
-        <el-table v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange">
-          <el-table-column type="selection" width="55" align="center" fixed />
-          <el-table-column label="销售组织" align="center" prop="saleOrg" width="180" :render-header="addRedStar">
-            <template slot-scope="scope">
-              <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
-                                    referName="ORG_PARAM"
-                                    :dataMapping="{ saleOrgCode: 'code', saleOrg: 'name'}"
-                                    :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入销售组织">
-              </el-popover-select-v2>
-            </template>
-          </el-table-column>
-          <el-table-column label="销售区域" align="center" prop="saleZone" width="180" :render-header="addRedStar">
-            <template slot-scope="scope">
-              <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
-                                    referName="MK_SALESAREA_PARAM"
-                                    :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
-                                    :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入销售区域">
-              </el-popover-select-v2>
-            </template>
-          </el-table-column>
-          <el-table-column label="客户" align="center" prop="custom" width="180" :render-header="addRedStar">
-            <template slot-scope="scope">
-              <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].custom" title="客户" valueKey="name"
-                                    referName="CUSTOMER_PARAM"
-                                    :dataMapping="{ customCode: 'code', custom: 'name'}"
-                                    :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入客户">
-              </el-popover-select-v2>
-            </template>
-          </el-table-column>
-          <el-table-column label="负责人" align="center" prop="creator" width="180" :render-header="addRedStar">
-            <template slot-scope="scope">
-              <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].creator" title="负责人" valueKey="name"
-                                    referName="CONTACTS_PARAM"
-                                    :dataMapping="{ creatorCode: 'code', creator: 'name'}"
-                                    :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入负责人">
-              </el-popover-select-v2>
-            </template>
-          </el-table-column>
-          <el-table-column label="一级分类" align="center" prop="oneLevelClassify" width="220" :render-header="addRedStar">
-            <template slot-scope="scope">
-              <el-select v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" size="mini" clearable
-                         @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
-                         style="width: 200px">
-                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </template>
-          </el-table-column>
-          <el-table-column label="二级分类" align="center" prop="twoLevelClassify" width="220">
-            <template slot-scope="scope">
-              <el-select v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" size="mini" clearable
-                         @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
-                         style="width: 200px">
-                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </template>
-          </el-table-column>
-          <el-table-column label="物料" align="center" prop="material" width="180">
-            <template slot-scope="scope">
-              <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
-                                    referName="MATERIAL_PARAM"
-                                    :dataMapping="{ materialCode: 'code', material: 'name'}"
-                                    :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
-              </el-popover-select-v2>
-            </template>
-          </el-table-column>
-          <el-table-column label="合计" align="center" prop="totalGoal" width="180">
-            <template slot-scope="scope">
-              <el-input v-model="annualSaleGoalDetailsList[scope.$index].totalGoal" disabled></el-input>
-            </template>
-          </el-table-column>
-          <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].januaryGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].februaryGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="三月" align="center" prop="marchGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].marchGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].aprilGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="五月" align="center" prop="mayGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="六月" align="center" prop="juneGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="七月" align="center" prop="julyGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="八月" align="center" prop="augustGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].augustGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].septemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].octoberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].novemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
-            <template slot-scope="scope">
-              <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
-            </template>
-          </el-table-column>
-          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
-            <template slot-scope="scope">
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-delete"
-                @click="handleDeleteDetails(scope.$index, scope.row)"
-              >删除</el-button>
-              <el-button
-                size="mini"
-                type="text"
-                icon="el-icon-delete"
-                @click="handleCopyDetails(scope.row)"
-              >复制</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
+        <el-tabs v-model="activeName">
+          <el-tab-pane label="年销售目标填报明细" name="annualSaleGoalDetails">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
+              <el-table-column label="销售组织" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
+                                        referName="ORG_PARAM"
+                                        :dataMapping="{ saleOrgCode: 'code', saleOrg: 'name'}"
+                                        :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入销售组织">
+                  </el-popover-select-v2>
+                </template>
+              </el-table-column>
+              <el-table-column label="销售区域" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
+                                        referName="MK_SALESAREA_PARAM"
+                                        :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
+                                        :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入销售区域">
+                  </el-popover-select-v2>
+                </template>
+              </el-table-column>
+              <el-table-column label="客户" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].custom" title="客户" valueKey="name"
+                                        referName="CUSTOMER_PARAM"
+                                        :dataMapping="{ customCode: 'code', custom: 'name'}"
+                                        :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入客户">
+                  </el-popover-select-v2>
+                </template>
+              </el-table-column>
+              <el-table-column label="负责人" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].creator" title="负责人" valueKey="name"
+                                        referName="CONTACTS_PARAM"
+                                        :dataMapping="{ creatorCode: 'code', creator: 'name'}"
+                                        :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入负责人">
+                  </el-popover-select-v2>
+                </template>
+              </el-table-column>
+              <el-table-column label="一级分类" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-input v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类" disabled></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column label="二级分类" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-input v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类" disabled></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column label="物料" align="center" width="220" :render-header="(h, obj) => addRedStar(h, obj, '0')">
+                <template slot-scope="scope">
+                  <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
+                                        referName="MATERIAL_PARAM"
+                                        @change="setClassify(scope.row.oneLevelClassify, scope.row.twoLevelClassify, annualSaleGoalDetailsList[scope.$index])"
+                                        :dataMapping="{ materialCode: 'code', material: 'name', oneLevelClassify: 'oneClass', twoLevelClassify: 'twoClass'}"
+                                        :source.sync="annualSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
+                  </el-popover-select-v2>
+                </template>
+              </el-table-column>
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
+                <template slot-scope="scope">
+                  <el-input v-model="annualSaleGoalDetailsList[scope.$index].totalGoal" disabled></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].januaryGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].februaryGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="三月" align="center" prop="marchGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].marchGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].aprilGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="五月" align="center" prop="mayGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="六月" align="center" prop="juneGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="七月" align="center" prop="julyGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="八月" align="center" prop="augustGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].augustGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].septemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].octoberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].novemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
+                <template slot-scope="scope">
+                  <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])" v-model="annualSaleGoalDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handleDeleteDetails(scope.$index, scope.row)"
+                  >删除</el-button>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handleCopyDetails(scope.row)"
+                  >复制</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
         <div slot="footer" class="dialog-footer" style="margin-left: 88%; margin-top: 1%">
           <el-button type="primary" @click="submitForm" size="medium">确 定</el-button>
           <el-button @click="cancel" size="medium">返 回</el-button>
@@ -451,7 +466,75 @@
       </div>
     </el-drawer>
 
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <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"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 批量修改对话框-->
+    <el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
+      <el-form>
+        <el-form-item label="修改项" label-width="100px">
+          <el-select @change="changeDialogData" v-model="dialogUpdateMore.updateName" placeholder="请选择需要批量修改的字段">
+            <el-option v-for="item in dialogUpdateMore.optionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="修改值" label-width="100px">
+          <el-popover-select-v2 v-if="dialogUpdateMore.updateName === 1"
+                                v-model="dialogUpdateMore.updateData" title="销售组织" valueKey="name"
+                                referName="ORG_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售组织">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 2"
+                                v-model="dialogUpdateMore.updateData" title="销售区域" valueKey="name"
+                                referName="MK_SALESAREA_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售区域">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 3"
+                                v-model="dialogUpdateMore.updateData" title="客户" valueKey="name"
+                                referName="CUSTOMER_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入客户">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 4"
+                                v-model="dialogUpdateMore.updateData" title="制单人" valueKey="name"
+                                referName="CONTACTS_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入制单人">
+          </el-popover-select-v2>
+          <el-input v-else placeholder="请输入修改项" disabled></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -463,11 +546,12 @@ import {
   addAnnualSaleGoal,
   updateAnnualSaleGoal
 } from "@/api/business/spd/goal_management/annualSaleGoal";
-
 import {
   delAnnualSaleGoalDetails,
   getAnnualSaleGoalDetails
 } from "@/api/business/spd/goal_management/annualSaleGoalDetails"
+import { getToken } from "@/utils/auth";
+import { getSummary } from "@/api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -604,11 +688,30 @@ export default {
         creator: [{required: true, message: '制单人不能为空', trigger: 'blur'}],
         dept: [{required: true, message: '部门不能为空', trigger: 'blur'}]
       },
-      // 参照条件
-      referCondition: {type: '', isPage: true, title: '', index: null},
-      classOptions: [],
       // 子表数组
-      annualSaleGoalDetailsList: []
+      annualSaleGoalDetailsList: [],
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/goal_management/annualSaleGoal/importData"
+      },
+      activeName: 'annualSaleGoalDetails',
+      dialogUpdateMore: {
+        updateName: null,
+        dialogFormVisible: false,
+        updateData: null,
+        optionList:[{value: 1, label: '销售组织'}, {value: 2, label: '销售区域'}, {value: 3, label: '客户'}, {value: 4, label: '制单人'},]
+      }
     };
   },
   created() {
@@ -725,7 +828,7 @@ export default {
         twoLevelClassify: null,
         materialCode: null,
         material: null,
-        totalGoal: 0,
+        totalGoal: '0.00',
         januaryGoal: null,
         februaryGoal: null,
         marchGoal: null,
@@ -748,6 +851,7 @@ export default {
       const id = row.id || this.ids
       getAnnualSaleGoal(id).then(response => {
         this.form = response.data;
+        this.saveFormTwoPoint(this.form)
         this.annualSaleGoalDetailsList = this.form.annualGoalMergeDetails
         this.open = true;
         this.title = "修改--年度销售目标";
@@ -757,11 +861,13 @@ export default {
     handleCopy(id) {
       this.reset();
       getAnnualSaleGoal(id).then(response => {
+        console.log(response);
         this.form = response.data;
         this.form.id = null
         this.form.code = null
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
+        this.saveFormTwoPoint(this.form)
         this.annualSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.annualGoalMergeDetails))
         for (const element of this.annualSaleGoalDetailsList) {
           element.id = null
@@ -772,6 +878,13 @@ export default {
         console.log(this.form);
       })
     },
+    // 进入修改复制界面保留两位小数
+    saveFormTwoPoint(form) {
+      form.goalTotal = form.goalTotal.toFixed(2)
+      for (const element of form.annualGoalMergeDetails) {
+        element.totalGoal = element.totalGoal.toFixed(2)
+      }
+    },
     /** 提交按钮 */
     submitForm() {
       if (!this.justiceDetailsList()) {
@@ -789,6 +902,7 @@ export default {
           } else {
             this.form.documentStatus = '未提交'
             this.form.annualGoalMergeDetails = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
+            console.log(this.form);
             addAnnualSaleGoal(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
@@ -887,7 +1001,7 @@ export default {
       for (const element of array) {
         sum = (sum * 1000000 + element * 1000000) / 1000000
       }
-      this.annualSaleGoalDetailsList[index].totalGoal = sum
+      this.annualSaleGoalDetailsList[index].totalGoal = sum.toFixed(2)
       this.computeTotal()
     },
     // 计算主表合计
@@ -897,70 +1011,136 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.totalGoal * 1000000) / 1000000
       }
-      this.form.goalTotal = sum
-    },
-    // 树形物料分类
-    chooseTreeReferForDetails(type, isPage, title, index) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.referCondition.index = index
-      this.$refs.treeDetails.init(this.referCondition)
-    },
-    selectionsToInputForDetails(selection) {
-      this.classOptions.push(selection)
-      if (this.referCondition.title === '一级物料分类') {
-        if (selection.code.length !== 1) {
-          return this.$message.info('请在一级分类中选择')
-        }
-        if (selection.code !== this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = null
-          this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = null
-        }
-        this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode = selection.code
-        this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassify = selection.name
-      } else if (this.referCondition.title === '二级物料分类') {
-        if (selection.code.length !== 4) {
-          return this.$message.info('请在二级分类中选择')
-        } else if (selection.code[0] !== this.annualSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          return this.$message.error('所选择的二级物料分类不属于一级分类')
-        }
-        this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = selection.code
-        this.annualSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = selection.name
-      }
+      this.form.goalTotal = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 给table添加必填项
-    addRedStar(h, { column }) {
-      return [
-        h('span', { style: 'color: #F56C6C' }, '*'),
-        h('span', '' + column.label)
-      ]
+    addRedStar(h, { column }, required) {
+      if (required === '0') {
+        return [
+          h('span', { style: 'color: #F56C6C' }, '*'),
+          h('span', '' + column.label)
+        ]
+      } else {
+        return [
+          // h('span', { style: 'color: #F56C6C' }, '*'),
+          h('span', '' + column.label)
+        ]
+      }
     },
     // 判断子表的字段是否都填了
     justiceDetailsList() {
       const arr = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
       for (const element of arr) {
-        if (element.saleOrg === null || element.saleZone === null || element.custom === null || element.creator === null || element.oneLevelClassify === null) {
-          return false
+        const flag1 = (element.saleZone !== null) && (element.saleOrg !== null) && (element.custom !== null) && (element.creator !== null) && (element.materialCode !== null) && (element.material !== null)
+        const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !== undefined) && (element.creator !== undefined) && (element.materialCode != undefined) && (element.material !== undefined)
+        if (flag1 && flag2) {
+          return true
         }
       }
-      return true
+      return false
     },
     handleCommand(command) {
       // 执行对应的功能
-      if (command === 'importModel') {
-        // 执行选项1的功能
-        console.log('导入模板');
-      } else if (command === 'import') {
-        // 执行选项2的功能
-        console.log('导入');
-      } else if (command === 'export') {
+      if (command === 'export') {
         console.log('导出主表');
         this.handleExport()
       } else if (command === 'exportDetails') {
         console.log('导出明细');
         this.handleExportDetails()
       }
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.open = true;
+      if (this.open) {
+        this.upload.title = "年销售目标填报明细导入"
+        this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/annualSaleGoalDetails/importData/" + this.form.id
+      } else {
+        this.upload.title = "年销售目标填报导入";
+        this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/annualSaleGoal/importData"
+      }
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      if (this.open) {
+        this.download('goal_management/annualSaleGoalDetails/importTemplate', {
+        }, `annualSaleGoalDetails_${new Date().getTime()}.xlsx`)
+      } else {
+        this.download('goal_management/annualSaleGoal/importTemplate', {
+        }, `annualSaleGoal_${new Date().getTime()}.xlsx`)
+      }
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      console.log(response);
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      if (this.open) {
+        const array = response.data
+        for (const arrayElement of array) {
+          arrayElement.id = null
+          this.annualSaleGoalDetailsList.push(arrayElement)
+        }
+        this.computeTotal()
+      } else {
+        this.getList();
+      }
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 选择物料后,给一级分类和二级分类复赋值
+    setClassify(one, two, obj) {
+      const oneArray = one.split("&")
+      const twoArray = two.split("&")
+      obj.oneLevelClassifyCode = oneArray[1]
+      obj.oneLevelClassify = oneArray[0]
+      obj.twoLevelClassifyCode = twoArray[1]
+      obj.twoLevelClassify = twoArray[0]
+      console.log(obj);
+    },
+    // 批量修改对话框的方法
+    dialogUpdateMoreSave() {
+      console.log(this.dialogUpdateMore);
+      if (this.dialogUpdateMore.updateData === null) {
+        return this.$message.error('请输入修改值')
+      }
+      const array = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
+      if (array.length !== 0) {
+        let condition = this.dialogUpdateMore.updateName
+        for (const element of array) {
+          if (condition === 1) {
+            element.saleOrg = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 2) {
+            element.saleZone = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 3) {
+            element.custom = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 4) {
+            element.creator = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          }
+        }
+      }
+      this.annualSaleGoalDetailsList = array
+      this.dialogUpdateMore.dialogFormVisible = !this.dialogUpdateMore.dialogFormVisible
+      this.dialogUpdateMore.updateData = null
+      this.dialogUpdateMore.updateName = null
+    },
+    changeDialogData() {
+      this.dialogUpdateMore.updateData = null
+    },
+    resetDialogUpdateMore() {
+      this.dialogUpdateMore.updateName = null
+      this.dialogUpdateMore.updateData = null
     }
   }
 };

+ 158 - 66
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -32,6 +32,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -109,6 +112,18 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -145,15 +160,13 @@
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-dropdown @command="handleCommand">
-          <el-button type="primary" size="mini" plain icon="el-icon-upload">
-            导入<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
-            <el-dropdown-item command="import">导入</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+        >导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-dropdown @command="handleCommand">
@@ -168,7 +181,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="annualSaleGoalMergeList" @selection-change="handleSelectionChange">
@@ -332,9 +344,9 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="年销售目标合并明细" name="annualSaleGoalMergeDetails">
-            <el-table v-loading="loading" :data="annualSaleGoalMergeDetailsList">
-              <el-table-column label="序号" type="index" width="55" align="center" fixed />
-              <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
+              <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalMergeDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                         referName="ORG_PARAM" disabled
@@ -343,7 +355,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="销售区域" align="center" prop="saleZone" width="180">
+              <el-table-column label="销售区域" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalMergeDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                         referName="MK_SALESAREA_PARAM" disabled
@@ -352,7 +364,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="客户" align="center" prop="custom" width="180">
+              <el-table-column label="客户" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalMergeDetailsList[scope.$index].custom" title="客户" valueKey="name"
                                         referName="CUSTOMER_PARAM" disabled
@@ -361,7 +373,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="负责人" align="center" prop="creator" width="180">
+              <el-table-column label="负责人" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalMergeDetailsList[scope.$index].creator" title="负责人" valueKey="name"
                                         referName="CONTACTS_PARAM" disabled
@@ -370,7 +382,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="一级分类" align="center" prop="oneLevelClassify" width="220">
+              <el-table-column label="一级分类" align="center" width="220">
                 <template slot-scope="scope">
                   <el-select v-model="annualSaleGoalMergeDetailsList[scope.$index].oneLevelClassify" size="mini" clearable
                              @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
@@ -379,7 +391,7 @@
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column label="二级分类" align="center" prop="twoLevelClassify" width="220">
+              <el-table-column label="二级分类" align="center" width="220">
                 <template slot-scope="scope">
                   <el-select v-model="annualSaleGoalMergeDetailsList[scope.$index].twoLevelClassify" size="mini" clearable
                              @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
@@ -388,7 +400,7 @@
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column label="合计" align="center" prop="goalSum" width="180">
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="annualSaleGoalMergeDetailsList[scope.$index].totalGoal" disabled></el-input>
                 </template>
@@ -453,28 +465,12 @@
                   <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])" v-model="annualSaleGoalMergeDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1" :min="0"></el-input-number>
                 </template>
               </el-table-column>
-              <!--            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
-                            <template slot-scope="scope">
-                              <el-button
-                                size="mini"
-                                type="text"
-                                icon="el-icon-delete"
-                                @click="handleDeleteDetails(scope.$index, scope.row)"
-                              >删除</el-button>
-                              <el-button
-                                size="mini"
-                                type="text"
-                                icon="el-icon-delete"
-                                @click="handleCopyDetails(scope.row)"
-                              >复制</el-button>
-                            </template>
-                          </el-table-column>-->
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="区域目标汇总(年)" name="zoneGoalSum(year)">
-            <el-table v-loading="loading" :data="areaDetailList">
-              <el-table-column label="序号" type="index" width="55" align="center" fixed />
-              <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="areaDetailList">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
+              <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="areaDetailList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                         referName="CUSTOMER_PARAM" disabled
@@ -483,7 +479,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="销售区域" align="center" prop="saleZone" width="180">
+              <el-table-column label="销售区域" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="areaDetailList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                         referName="CUSTOMER_PARAM" disabled
@@ -492,7 +488,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="负责人" align="center" prop="creator" width="180">
+              <el-table-column label="负责人" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="areaDetailList[scope.$index].creator" title="负责人" valueKey="name"
                                         referName="CONTACTS_PARAM" disabled
@@ -501,7 +497,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="合计" align="center" prop="goalSum" width="180">
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="areaDetailList[scope.$index].totalGoal" disabled></el-input>
                 </template>
@@ -569,9 +565,9 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="客户目标汇总(年)" name="customerGoalSum(year)">
-            <el-table v-loading="loading" :data="customerDetailList">
-              <el-table-column label="序号" type="index" width="55" align="center" fixed />
-              <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="customerDetailList">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
+              <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="customerDetailList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                         referName="CUSTOMER_PARAM" disabled
@@ -580,7 +576,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="销售区域" align="center" prop="saleZone" width="180">
+              <el-table-column label="销售区域" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="customerDetailList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                         referName="CUSTOMER_PARAM" disabled
@@ -589,7 +585,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="客户" align="center" prop="custom" width="180">
+              <el-table-column label="客户" align="center" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="customerDetailList[scope.$index].custom" title="客户" valueKey="name"
                                         referName="CUSTOMER_PARAM" disabled
@@ -598,7 +594,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="合计" align="center" prop="goalSum" width="180">
+              <el-table-column label="合计" align="center" prop="totalGoal" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="customerDetailList[scope.$index].totalGoal" disabled></el-input>
                 </template>
@@ -673,6 +669,36 @@
       </div>
     </el-drawer>
 
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <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"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <TreeRefers ref="treeQuery" @doSubmit="selectionsToInputForQuery" :single="true"/>
     <TreeRefers ref="treeMain" @doSubmit="selectionsToInputForMain" :single="true" />
     <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true" />
@@ -692,7 +718,8 @@ import {
   delAnnualSaleMergeDetails,
   getAnnualSaleMergeDetails
 } from "@/api/business/spd/goal_management/annualSaleMergeDetails"
-import deepCopy from "@gby/deep-copy";
+import { getToken } from "@/utils/auth";
+import { getSummary } from "@/api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -854,7 +881,22 @@ export default {
         }, {
           label: '二级分类', value: '二级分类'
         }],
-      activeName: 'annualSaleGoalMergeDetails'
+      activeName: 'annualSaleGoalMergeDetails',
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/goal_management/annualSaleGoalMerge/importData"
+      }
     };
   },
   created() {
@@ -965,7 +1007,7 @@ export default {
       this.customerDetailList = []
       this.activeName = 'annualSaleGoalMergeDetails'
       this.open = true;
-      this.title = "添加年度销售目标明细";
+      this.title = "添加--年度销售目标合并明细";
       this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
       this.form.annual = new Date().getFullYear().toString()
       this.form.creator = this.$store.state.user.nickName
@@ -1013,9 +1055,13 @@ export default {
       getAnnualSaleGoalMerge(id).then(response => {
         console.log(response);
         this.form = response.data;
-        this.annualSaleGoalMergeDetailsList = response.data.annualGoalMergeDetailsList
+        this.form.goalTotal = this.form.goalTotal.toFixed(2)
+        for (const element of this.form.annualGoalMergeDetailsList) {
+          element.totalGoal = element.totalGoal.toFixed(2)
+        }
+        this.annualSaleGoalMergeDetailsList = JSON.parse(JSON.stringify(this.form.annualGoalMergeDetailsList))
         this.open = true;
-        this.title = "修改年度销售目标明细";
+        this.title = "修改--年度销售目标合并明细";
       });
     },
     // 复制按钮操作
@@ -1029,9 +1075,11 @@ export default {
         this.form = response.data
         this.form.id = null
         this.form.code = null
-        this.title = "添加--年度销售目标明细";
+        this.title = "添加--年度销售目标合并明细";
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
+        this.form.goalTotal = 0
+        this.form.goalTotal = this.form.goalTotal.toFixed(2)
         this.open = true
       })
     },
@@ -1231,7 +1279,6 @@ export default {
       this.$confirm('确认关闭?')
         .then(_ => {
           done();
-          this.resetQuery()
         })
         .catch(_ => {});
     },
@@ -1286,7 +1333,10 @@ export default {
         }
         sum = (sum * 1000000 + listElement.totalGoal * 1000000) / 1000000
       }
-      this.form.goalTotal = sum
+      this.form.goalTotal = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 合并数据
     clickMerge() {
@@ -1297,6 +1347,7 @@ export default {
         return this.$message.error('当前标签不是年销售目标合并明细')
       }
       let query = JSON.parse(JSON.stringify(this.form))
+      query.annualGoalMergeDetailsList = []
       console.log(query);
       if (query.goalCategory === null || query.goalCategory === '') {
         return this.$message.error('请输入目标分类')
@@ -1315,8 +1366,15 @@ export default {
       }
       mergeAnnualSaleMergeDetails(query).then(response => {
         console.log(response);
-        this.annualSaleGoalMergeDetailsList = response.data.consolidatedDetail
-        this.computeTotal()
+        if (response.data.consolidatedDetail.length > 0) {
+          for (const consolidatedDetail of response.data.consolidatedDetail) {
+            consolidatedDetail.totalGoal = consolidatedDetail.totalGoal.toFixed(2)
+          }
+          this.annualSaleGoalMergeDetailsList = response.data.consolidatedDetail
+          this.computeTotal()
+        } else {
+          return this.$message.warning('未查到相关数据')
+        }
       })
     },
     // 获得区域目标汇总or客户目标汇总
@@ -1341,6 +1399,18 @@ export default {
           if (map.has(key)) {
             const existingObj = map.get(key)
             existingObj.totalGoal += obj.totalGoal
+            existingObj.januaryGoal += obj.januaryGoal
+            existingObj.februaryGoal += obj.februaryGoal
+            existingObj.marchGoal += obj.marchGoal
+            existingObj.aprilGoal += obj.aprilGoal
+            existingObj.mayGoal += obj.mayGoal
+            existingObj.juneGoal += obj.juneGoal
+            existingObj.julyGoal += obj.julyGoal
+            existingObj.augustGoal += obj.augustGoal
+            existingObj.septemberGoal += obj.septemberGoal
+            existingObj.octoberGoal += obj.octoberGoal
+            existingObj.novemberGoal += obj.novemberGoal
+            existingObj.decemberGoal += obj.decemberGoal
           } else {
             map.set(key, { ...obj })
           }
@@ -1361,19 +1431,13 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     handleCommand(command) {
       // 执行对应的功能
-      if (command === 'importModel') {
-        // 执行选项1的功能
-        console.log('导入模板');
-      } else if (command === 'import') {
-        // 执行选项2的功能
-        console.log('导入');
-      } else if (command === 'export') {
+      if (command === 'export') {
         console.log('导出主表');
         this.handleExport()
       } else if (command === 'exportDetails') {
@@ -1386,6 +1450,34 @@ export default {
         console.log('导出客户目标汇总')
         this.handleExportCustomSum()
       }
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.open = true;
+      this.upload.title = "年销售目标合并导入";
+      this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/annualSaleGoalMerge/importData"
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download('goal_management/annualSaleGoalMerge/importTemplate', {
+      }, `annualSaleGoalMerge_${new Date().getTime()}.xlsx`)
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      console.log(response);
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
     }
   }
 };

+ 122 - 41
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -32,6 +32,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -124,6 +127,18 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -160,15 +175,13 @@
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-dropdown @command="handleCommand">
-          <el-button type="primary" size="mini" plain icon="el-icon-upload">
-            导入<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
-            <el-dropdown-item command="import">导入</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+        >导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-dropdown @command="handleCommand">
@@ -181,7 +194,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="monthGoalMergeList" @selection-change="handleSelectionChange">
@@ -201,7 +213,7 @@
       <el-table-column label="目标类型" align="center" prop="goalCategory"/>
       <el-table-column label="目标值合计" align="center" prop="goalSum"/>
       <el-table-column label="单据状态" align="center" prop="documentStatus"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -365,8 +377,8 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="月销售目标合并明细" name="monthGoalMergeDetails">
-            <el-table v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
-              <el-table-column type="selection" width="55" align="center" fixed />
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthGoalMergeDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
@@ -450,31 +462,15 @@
                   </el-date-picker>
                 </template>
               </el-table-column>
-              <el-table-column label="目标值" align="center" prop="totalGoal" width="220">
+              <el-table-column label="目标值" align="center" prop="goalValue" width="220">
                 <template slot-scope="scope">
                   <el-input-number @change="computeTotal" v-model="monthGoalMergeDetailsList[scope.$index].goalValue" :precision="2" :step="1" :min="0"></el-input-number>
                 </template>
               </el-table-column>
-              <!--            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
-                            <template slot-scope="scope">
-                              <el-button
-                                size="mini"
-                                type="text"
-                                icon="el-icon-delete"
-                                @click="handleDeleteDetails(scope.$index, scope.row)"
-                              >删除</el-button>
-                              <el-button
-                                size="mini"
-                                type="text"
-                                icon="el-icon-delete"
-                                @click="handleCopyDetails(scope.row)"
-                              >复制</el-button>
-                            </template>
-                          </el-table-column>-->
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="区域目标汇总(月)" name="zoneGoalSum">
-            <el-table :data="zoneGoalSumList">
+            <el-table max-height="300" :data="zoneGoalSumList">
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -500,7 +496,7 @@
                   </el-date-picker>
                 </template>
               </el-table-column>
-              <el-table-column label="目标值" align="center" prop="totalGoal" width="220">
+              <el-table-column label="目标值" align="center" prop="goalValue" width="220">
                 <template slot-scope="scope">
                   <el-input-number @change="computeTotal" v-model="zoneGoalSumList[scope.$index].goalValue" :precision="2" :step="1" :min="0" disabled></el-input-number>
                 </template>
@@ -508,7 +504,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="客户目标汇总(月)" name="customGoalSum">
-            <el-table :data="customGoalSumList">
+            <el-table max-height="300" :data="customGoalSumList">
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -543,7 +539,7 @@
                   </el-date-picker>
                 </template>
               </el-table-column>
-              <el-table-column label="目标值" align="center" prop="totalGoal" width="220">
+              <el-table-column label="目标值" align="center" prop="goalValue" width="220">
                 <template slot-scope="scope">
                   <el-input-number @change="computeTotal" v-model="customGoalSumList[scope.$index].goalValue" :precision="2" :step="1" :min="0" disabled></el-input-number>
                 </template>
@@ -558,6 +554,36 @@
       </div>
     </el-drawer>
 
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <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"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <TreeRefers ref="treeQuery" @doSubmit="selectionsToInputForQuery" :single="true"/>
     <TreeRefers ref="treeMain" @doSubmit="selectionsToInputForMain" :single="true"/>
     <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
@@ -577,6 +603,8 @@ import {
   delMonthGoalMergeDetails,
   mergeMonthSaleMergeDetails
 } from "@/api/business/spd/goal_management/monthGoalMergeDetails"
+import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -731,7 +759,22 @@ export default {
       // 树形参照
       referCondition: { type: '', isPage: true, title: '', index: null },
       classOptions: [],
-      activeName: 'monthGoalMergeDetails'
+      activeName: 'monthGoalMergeDetails',
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/goal_management/annualSaleGoalMerge/importData"
+      }
     };
   },
   created() {
@@ -879,6 +922,7 @@ export default {
       const id = row.id || this.ids
       getMonthGoalMerge(id).then(response => {
         this.form = response.data;
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.monthGoalMergeDetailsList = this.form.monthMergeDetailsList
         this.open = true;
         this.title = "修改--月销售目标合并";
@@ -899,6 +943,8 @@ export default {
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
         this.form.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0')
+        this.form.goalSum = 0
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.open = true
         this.changeGoalCategoryForm()
       })
@@ -1152,7 +1198,6 @@ export default {
       this.$confirm('确认关闭?')
         .then(_ => {
           done();
-          this.resetQuery()
         })
         .catch(_ => {});
     },
@@ -1187,7 +1232,10 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 合并数据
     clickMerge() {
@@ -1198,6 +1246,7 @@ export default {
         return this.$message.error('当前标签不是月销售目标合并明细')
       }
       let query = JSON.parse(JSON.stringify(this.form))
+      query.monthGoalMergeDetailsList = []
       if (query.goalCategory === null || query.goalCategory === '') {
         return this.$message.error('请输入目标分类')
       } else if (query.goalCategory === '销售区域') {
@@ -1219,8 +1268,12 @@ export default {
       }
       mergeMonthSaleMergeDetails(query).then(response => {
         console.log(response);
-        this.monthGoalMergeDetailsList = response.data.monthGoalMergeDetails
-        this.computeTotal()
+        if (response.data.monthGoalMergeDetails.length > 0) {
+          this.monthGoalMergeDetailsList = response.data.monthGoalMergeDetails
+          this.computeTotal()
+        } else {
+          return this.$message.warning('未查到相关数据')
+        }
       })
     },
     setBeginAndEnd() {
@@ -1229,8 +1282,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     handleCommand(command) {
@@ -1284,6 +1337,34 @@ export default {
         this.customGoalSumList = mergedArray
       }
     },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.open = true;
+      this.upload.title = "月销售目标合并导入";
+      this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/monthGoalMerge/importData"
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download('goal_management/monthGoalMerge/importTemplate', {
+      }, `monthGoalMerge_${new Date().getTime()}.xlsx`)
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      console.log(response);
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
   }
 };
 </script>

+ 261 - 28
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -41,6 +41,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -97,6 +100,18 @@
             </el-popover-select-v2>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
     <el-row :gutter="10" class="mb8" style="float: right">
@@ -132,15 +147,13 @@
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-dropdown @command="handleCommand">
-          <el-button type="primary" size="mini" plain icon="el-icon-upload">
-            导入<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
-            <el-dropdown-item command="import">导入</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+        >导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-dropdown @command="handleCommand">
@@ -153,7 +166,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
@@ -172,7 +184,7 @@
       <el-table-column label="目标合计" align="center" prop="goalSum"/>
       <el-table-column label="备注" align="center" prop="notes"/>
       <el-table-column label="单据状态" align="center" prop="documentStatus"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -297,16 +309,22 @@
         </el-row>
       </el-form>
       <div>
-        <el-row :gutter="10" class="mb8" style="margin-left: 94%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 80%">
+          <el-col :span="1.5">
+            <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
+          </el-col>
           <el-col :span="1.5">
             <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="el-icon-edit-outline" size="mini" @click="dialogUpdateMore.dialogFormVisible = true">批量修改</el-button>
+          </el-col>
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月回款目标明细" name="monthReturnGoalDetails">
-            <el-table v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
-              <el-table-column type="selection" width="55" align="center" fixed />
-              <el-table-column label="销售组织" align="center" prop="saleOrg" width="180" :render-header="addRedStar">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
+              <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthReturnGoalDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                         referName="ORG_PARAM"
@@ -315,7 +333,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="销售区域" align="center" prop="saleZone" width="180" :render-header="addRedStar">
+              <el-table-column label="销售区域" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthReturnGoalDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                         referName="MK_SALESAREA_PARAM"
@@ -324,7 +342,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="客户" align="center" prop="custom" width="180" :render-header="addRedStar">
+              <el-table-column label="客户" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthReturnGoalDetailsList[scope.$index].custom" title="客户" valueKey="name"
                                         referName="CUSTOMER_PARAM"
@@ -333,7 +351,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="部门" align="center" prop="dept" width="180" :render-header="addRedStar">
+              <el-table-column label="部门" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthReturnGoalDetailsList[scope.$index].dept" title="部门" valueKey="name"
                                         referName="DEPT_PARAM"
@@ -342,7 +360,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="制单人" align="center" prop="creator" width="180" :render-header="addRedStar">
+              <el-table-column label="制单人" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthReturnGoalDetailsList[scope.$index].creator" title="负责人" valueKey="name"
                                         referName="CONTACTS_PARAM"
@@ -351,7 +369,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="月份" align="center" prop="monthly" width="250" :render-header="addRedStar">
+              <el-table-column label="月份" align="center" width="250" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-date-picker v-model="monthReturnGoalDetailsList[scope.$index].monthly" value-format="yyyy-MM" type="month" placeholder="选择月份">
                   </el-date-picker>
@@ -388,6 +406,88 @@
       </div>
     </el-drawer>
 
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <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"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 批量修改对话框-->
+    <el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
+      <el-form>
+        <el-form-item label="修改项" label-width="100px">
+          <el-select @change="changeDialogData" v-model="dialogUpdateMore.updateName" placeholder="请选择需要批量修改的字段">
+            <el-option v-for="item in dialogUpdateMore.optionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="修改值" label-width="100px">
+          <el-popover-select-v2 v-if="dialogUpdateMore.updateName === 1"
+                                v-model="dialogUpdateMore.updateData" title="销售组织" valueKey="name"
+                                referName="ORG_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售组织">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 2"
+                                v-model="dialogUpdateMore.updateData" title="销售区域" valueKey="name"
+                                referName="MK_SALESAREA_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售区域">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 3"
+                                v-model="dialogUpdateMore.updateData" title="客户" valueKey="name"
+                                referName="CUSTOMER_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入客户">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 4"
+                                v-model="dialogUpdateMore.updateData" title="部门" valueKey="name"
+                                referName="DEPT_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入部门">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 5"
+                                v-model="dialogUpdateMore.updateData" title="制单人" valueKey="name"
+                                referName="CONTACTS_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入制单人">
+          </el-popover-select-v2>
+          <el-date-picker v-else-if="dialogUpdateMore.updateName === 6"
+                          v-model="dialogUpdateMore.updateData" value-format="yyyy-MM"
+                          type="month"
+                          placeholder="选择月">
+          </el-date-picker>
+          <el-input v-else placeholder="请输入修改项" disabled></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -404,6 +504,8 @@ import {
   getMonthReturnGoalDetails,
   delMonthReturnGoalDetails
 } from "@/api/business/spd/goal_management/monthReturnGoalDetails"
+import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -525,6 +627,27 @@ export default {
             picker.$emit('pick', [start, end]);
           }
         }]
+      },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/mk/monthReturnGoal/importData"
+      },
+      dialogUpdateMore: {
+        updateName: null,
+        dialogFormVisible: false,
+        updateData: null,
+        optionList:[{value: 1, label: '销售组织'}, {value: 2, label: '销售区域'}, {value: 3, label: '客户'}, {value: 4, label: '部门'}, {value: 5, label: '制单人'}, {value: 6, label: '月份'}]
       }
     }
   },
@@ -587,6 +710,27 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        goalName: null,
+        documentDate: null,
+        annual: null,
+        customCode: null,
+        custom: null,
+        creatorCode: null,
+        creator: null,
+        saleZoneCode: null,
+        saleZone: null,
+        deptCode: null,
+        dept: null,
+        goalSum: null,
+        notes: null,
+        documentStatus: null,
+        params: { beginTime: null, endTime: null,}
+      }
+      this.documentDateRange = null
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -628,7 +772,7 @@ export default {
       const id = row.id || this.ids
       getMonthReturnGoal(id).then(response => {
         this.form = response.data;
-        console.log(this.form);
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.monthReturnGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthReturnGoalDetailsList))
         this.open = true;
         this.title = "修改--月回款目标填报";
@@ -641,6 +785,7 @@ export default {
         this.form = response.data;
         this.form.id = null
         this.form.code = null
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
         this.monthReturnGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthReturnGoalDetailsList))
@@ -655,7 +800,7 @@ export default {
     /** 提交按钮 */
     submitForm() {
       if (!this.justiceDetailsList()) {
-        return this.$message.error('子表中有必填字段未填')
+        return this.$message.error('子表中有必填字段未填,或者目标值为0')
       }
       this.$refs["form"].validate(valid => {
         if (valid) {
@@ -736,7 +881,10 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalSum * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 复制明细
     handleCopyDetails(row) {
@@ -760,8 +908,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     // 给table添加必填项
@@ -775,11 +923,13 @@ export default {
     justiceDetailsList() {
       const arr = JSON.parse(JSON.stringify(this.monthReturnGoalDetailsList))
       for (const element of arr) {
-        if (element.saleOrg === null || element.saleZone === null || element.custom === null || element.dept === null || element.creator === null || element.monthly === null || element.goalSum === null) {
-          return false
+        const flag1 = (element.saleOrg !== null) && (element.saleZone !== null) && (element.custom !== null) && (element.dept !== null) && (element.creator !== null) && (element.monthly !== null) && (element.goalSum !== 0)
+        const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !== undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.monthly !== undefined)
+        if (flag1 && flag2) {
+          return true
         }
       }
-      return true
+      return false
     },
     handleCommand(command) {
       // 执行对应的功能
@@ -796,6 +946,89 @@ export default {
         console.log('导出明细');
         this.handleExportDetails()
       }
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.open = true;
+      if (this.open) {
+        this.upload.title = "月回款目标填报明细导入"
+        this.upload.url = process.env.VUE_APP_BASE_API + "mk/monthReturnGoalDetails/importData/" + this.form.id
+      } else {
+        this.upload.title = "月回款目标填报导入";
+        this.upload.url = process.env.VUE_APP_BASE_API + "mk/monthReturnGoal/importData"
+      }
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      if (this.open) {
+        this.download('mk/monthReturnGoalDetails/importTemplate', {
+        }, `monthReturnGoalDetails_${new Date().getTime()}.xlsx`)
+      } else {
+        this.download('mk/monthReturnGoal/importTemplate', {
+        }, `monthReturnGoal_${new Date().getTime()}.xlsx`)
+      }
+    },
+    // 文件上传中处理
+    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("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      if (this.open) {
+        let array = response.data
+        for (const arrayElement of array) {
+          arrayElement.id = null
+          this.monthReturnGoalDetailsList.push(arrayElement)
+        }
+        this.computeTotal()
+      } else {
+        this.getList();
+      }
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 批量修改对话框的方法
+    dialogUpdateMoreSave() {
+      console.log(this.dialogUpdateMore);
+      if (this.dialogUpdateMore.updateData === null) {
+        return this.$message.error('请输入修改值')
+      }
+      const array = JSON.parse(JSON.stringify(this.monthReturnGoalDetailsList))
+      if (array.length !== 0) {
+        let condition = this.dialogUpdateMore.updateName
+        for (const element of array) {
+          if (condition === 1) {
+            element.saleOrg = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 2) {
+            element.saleZone = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 3) {
+            element.custom = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 4) {
+            element.dept = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 5) {
+            element.creator = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 6) {
+            element.monthly = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          }
+        }
+      }
+      this.monthReturnGoalDetailsList = array
+      this.dialogUpdateMore.dialogFormVisible = !this.dialogUpdateMore.dialogFormVisible
+      this.dialogUpdateMore.updateData = null
+      this.dialogUpdateMore.updateName = null
+    },
+    changeDialogData() {
+      this.dialogUpdateMore.updateData = null
+    },
+    resetDialogUpdateMore() {
+      this.dialogUpdateMore.updateName = null
+      this.dialogUpdateMore.updateData = null
     }
   }
 }

+ 190 - 33
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -32,6 +32,9 @@
         <el-form-item>
           <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
           <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+          <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+            <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+          </el-tooltip>
         </el-form-item>
       </el-col>
     </el-row>
@@ -100,6 +103,18 @@
           </el-popover-select-v2>
         </el-form-item>
       </el-col>
+      <el-col :span="6">
+        <el-form-item label="单据状态" prop="documentStatus">
+          <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+            <el-option
+              v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
     </el-row>
   </el-form>
   <el-row :gutter="10" class="mb8" style="float: right">
@@ -135,15 +150,13 @@
       </el-button>
     </el-col>
     <el-col :span="1.5">
-      <el-dropdown @command="handleCommand">
-        <el-button type="primary" size="mini" plain icon="el-icon-upload">
-          导入<i class="el-icon-arrow-down el-icon--right"></i>
-        </el-button>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
-          <el-dropdown-item command="import">导入</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
+      <el-button
+        type="info"
+        plain
+        icon="el-icon-upload2"
+        size="mini"
+        @click="handleImport"
+      >导入</el-button>
     </el-col>
     <el-col :span="1.5">
       <el-dropdown @command="handleCommand">
@@ -157,7 +170,6 @@
         </el-dropdown-menu>
       </el-dropdown>
     </el-col>
-    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
   </el-row>
   <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange">
     <el-table-column type="selection" width="55" align="center"/>
@@ -177,7 +189,7 @@
     <el-table-column label="目标类型" align="center" prop="goalCategory" width="180"/>
     <el-table-column label="目标值合计" align="center" prop="goalSum" width="180"/>
     <el-table-column label="单据状态" align="center" prop="documentStatus" width="180"/>
-    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
+    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
       <template slot-scope="scope">
         <el-button
           size="mini"
@@ -322,9 +334,9 @@
       </el-row>
       <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
         <el-tab-pane label="月回款目标合并明细" name="monthReturnMergeDetails">
-          <el-table v-loading="loading" :data="monthReturnMergeDetailsList">
+          <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthReturnMergeDetailsList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
-            <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
+            <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
                 <el-popover-select-v2 v-model="monthReturnMergeDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                       referName="ORG_PARAM" disabled
@@ -333,7 +345,7 @@
                 </el-popover-select-v2>
               </template>
             </el-table-column>
-            <el-table-column label="销售区域" align="center" prop="saleZone" width="180">
+            <el-table-column label="销售区域" align="center" width="180">
               <template slot-scope="scope">
                 <el-popover-select-v2 v-model="monthReturnMergeDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                       referName="MK_SALESAREA_PARAM" disabled
@@ -342,7 +354,7 @@
                 </el-popover-select-v2>
               </template>
             </el-table-column>
-            <el-table-column label="客户" align="center" prop="custom" width="180">
+            <el-table-column label="客户" align="center" width="180">
               <template slot-scope="scope">
                 <el-popover-select-v2 v-model="monthReturnMergeDetailsList[scope.$index].custom" title="客户" valueKey="name"
                                       referName="CUSTOMER_PARAM" disabled
@@ -351,7 +363,7 @@
                 </el-popover-select-v2>
               </template>
             </el-table-column>
-            <el-table-column label="部门" align="center" prop="dept" width="180">
+            <el-table-column label="部门" align="center" width="180">
               <template slot-scope="scope">
                 <el-popover-select-v2 v-model="monthReturnMergeDetailsList[scope.$index].dept" title="部门" valueKey="name"
                                       referName="DEPT_PARAM" disabled
@@ -360,7 +372,7 @@
                 </el-popover-select-v2>
               </template>
             </el-table-column>
-            <el-table-column label="制单人" align="center" prop="creator" width="180">
+            <el-table-column label="制单人" align="center" width="180">
               <template slot-scope="scope">
                 <el-popover-select-v2 v-model="monthReturnMergeDetailsList[scope.$index].creator" title="制单人" valueKey="name"
                                       referName="CONTACTS_PARAM" disabled
@@ -369,13 +381,13 @@
                 </el-popover-select-v2>
               </template>
             </el-table-column>
-            <el-table-column label="月份" align="center" prop="monthly" width="250">
+            <el-table-column label="月份" align="center" width="250">
               <template slot-scope="scope">
                 <el-date-picker disabled v-model="monthReturnMergeDetailsList[scope.$index].monthly" value-format="yyyy-MM" type="month" placeholder="选择月份">
                 </el-date-picker>
               </template>
             </el-table-column>
-            <el-table-column label="目标值" align="center" prop="totalGoal" width="220">
+            <el-table-column label="目标值" align="center" prop="goalSum" width="220">
               <template slot-scope="scope">
                 <el-input-number @change="computeTotal" v-model="monthReturnMergeDetailsList[scope.$index].goalSum" :precision="2" :step="1" :min="0"></el-input-number>
               </template>
@@ -383,14 +395,55 @@
           </el-table>
         </el-tab-pane>
         <el-tab-pane label="区域目标汇总(月回款)" name="zoneGoalSum(monthReturn)">
-          <el-table :data="zoneGoalSumList">
+          <el-table max-height="300" show-summary :summary-method="getSummaries" :data="zoneGoalSumList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
-            <el-table-column label="销售组织" align="center" prop="saleOrg" width="180" />
-            <el-table-column label="区域" align="center" prop="saleZone" width="180" />
-            <el-table-column label="部门" align="center" prop="dept" width="180" />
-            <el-table-column label="制单人" align="center" prop="creator" width="180" />
-            <el-table-column label="月份" align="center" prop="monthly" width="180" />
-            <el-table-column label="目标值" align="center" prop="goalSum" width="180" />
+            <el-table-column label="销售组织" align="center" width="180">
+              <template slot-scope="scope">
+                <el-popover-select-v2 v-model="zoneGoalSumList[scope.$index].saleOrg" title="销售组织" valueKey="name"
+                                      referName="ORG_PARAM" disabled
+                                      :dataMapping="{ saleOrgCode: 'code', saleOrg: 'name'}"
+                                      :source.sync="zoneGoalSumList[scope.$index]" placeholder="请输入销售组织">
+                </el-popover-select-v2>
+              </template>
+            </el-table-column>
+            <el-table-column label="销售区域" align="center" width="180">
+              <template slot-scope="scope">
+                <el-popover-select-v2 v-model="zoneGoalSumList[scope.$index].saleZone" title="销售区域" valueKey="name"
+                                      referName="MK_SALESAREA_PARAM" disabled
+                                      :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
+                                      :source.sync="zoneGoalSumList[scope.$index]" placeholder="请输入销售区域">
+                </el-popover-select-v2>
+              </template>
+            </el-table-column>
+            <el-table-column label="部门" align="center" width="180">
+              <template slot-scope="scope">
+                <el-popover-select-v2 v-model="zoneGoalSumList[scope.$index].dept" title="部门" valueKey="name"
+                                      referName="DEPT_PARAM" disabled
+                                      :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                      :source.sync="zoneGoalSumList[scope.$index]" placeholder="请输入客户">
+                </el-popover-select-v2>
+              </template>
+            </el-table-column>
+            <el-table-column label="制单人" align="center" width="180">
+              <template slot-scope="scope">
+                <el-popover-select-v2 v-model="zoneGoalSumList[scope.$index].creator" title="制单人" valueKey="name"
+                                      referName="CONTACTS_PARAM" disabled
+                                      :dataMapping="{ creatorCode: 'code', creator: 'name'}"
+                                      :source.sync="zoneGoalSumList[scope.$index]" placeholder="请输入制单人">
+                </el-popover-select-v2>
+              </template>
+            </el-table-column>
+            <el-table-column label="月份" align="center" width="250">
+              <template slot-scope="scope">
+                <el-date-picker disabled v-model="zoneGoalSumList[scope.$index].monthly" value-format="yyyy-MM" type="month" placeholder="选择月份">
+                </el-date-picker>
+              </template>
+            </el-table-column>
+            <el-table-column label="目标值" align="center" prop="goalSum" width="220">
+              <template slot-scope="scope">
+                <el-input-number disabled @change="computeTotal" v-model="zoneGoalSumList[scope.$index].goalSum" :precision="2" :step="1" :min="0"></el-input-number>
+              </template>
+            </el-table-column>
           </el-table>
         </el-tab-pane>
       </el-tabs>
@@ -400,6 +453,36 @@
       </div>
     </div>
   </el-drawer>
+
+  <!-- 用户导入对话框 -->
+  <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <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"
+      :auto-upload="false"
+      drag
+    >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+      <div class="el-upload__tip text-center" slot="tip">
+        <div class="el-upload__tip" slot="tip">
+          <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+        </div>
+        <span>仅允许导入xls、xlsx格式文件。</span>
+        <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+      </div>
+    </el-upload>
+    <div slot="footer">
+      <el-button type="primary" @click="submitFileForm">确 定</el-button>
+      <el-button @click="upload.open = false">取 消</el-button>
+    </div>
+  </el-dialog>
 </div>
 </template>
 
@@ -416,6 +499,8 @@ import {
   getMonthReturnMergeDetails,
   mergeMonthReturnMergeDetails
 } from "@/api/business/spd/goal_management/monthReturnMergeDetails"
+import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -544,7 +629,22 @@ export default {
           }
         }]
       },
-      documentDateRange: null
+      documentDateRange: null,
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/goal_management/annualSaleGoalMerge/importData"
+      }
     }
   },
   created() {
@@ -606,6 +706,28 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        goalName: null,
+        documentDate: null,
+        annual: null,
+        monthly: null,
+        customCode: null,
+        custom: null,
+        saleZoneCode: null,
+        saleZone: null,
+        creatorCode: null,
+        creator: null,
+        deptCode: null,
+        dept: null,
+        goalCategory: null,
+        goalSum: null,
+        documentStatus: null,
+        params: { beginTime: null, endTime: null }
+      }
+      this.documentDateRange = null
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -650,6 +772,7 @@ export default {
       const id = row.id || this.ids
       getMonthReturnMerge(id).then(response => {
         this.form = response.data;
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.monthReturnMergeDetailsList = this.form.monthReturnMergeDetailsList
         this.open = true;
         this.title = "修改--月回款目标合并";
@@ -666,6 +789,8 @@ export default {
         this.form = response.data
         this.form.id = null
         this.form.code = null
+        this.form.goalSum = 0
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.title = "添加--月销售目标合并";
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
@@ -750,7 +875,6 @@ export default {
       this.$confirm('确认关闭?')
         .then(_ => {
           done();
-          this.resetQuery()
         })
         .catch(_ => {});
     },
@@ -767,8 +891,12 @@ export default {
       }
       mergeMonthReturnMergeDetails(this.form).then(response => {
         console.log(response)
-        this.monthReturnMergeDetailsList = response.data.monthReturnMergeDetails
-        this.computeTotal()
+        if (response.data.monthReturnMergeDetails) {
+          this.monthReturnMergeDetailsList = response.data.monthReturnMergeDetails
+          this.computeTotal()
+        } else {
+          return this.$message.warning('未查到相关数据')
+        }
       })
     },
     // 计算主表合计
@@ -778,8 +906,9 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalSum * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
     },
+    getSummaries(param) { return getSummary(param) },
     // 复制明细
     handleCopyDetails(row) {
       let list = {
@@ -803,8 +932,8 @@ export default {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     getNewTwoArray() {
@@ -846,6 +975,34 @@ export default {
         console.log('导出区域目标汇总');
         this.handleExportZoneSum()
       }
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.open = true;
+      this.upload.title = "月回款目标合并导入";
+      this.upload.url = process.env.VUE_APP_BASE_API + "mk/monthReturnMerge/importData"
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.download('mk/monthReturnMerge/importTemplate', {
+      }, `monthReturnMerge_${new Date().getTime()}.xlsx`)
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      console.log(response);
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
     }
   }
 }

+ 265 - 90
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -41,6 +41,9 @@
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            <el-tooltip class="item" effect="dark" :content="showSearch?'隐藏搜索':'显示搜索'" placement="top">
+              <el-button type="warning" :icon="showSearch?'el-icon-caret-top':'el-icon-caret-bottom'" circle @click="showSearch = !showSearch"></el-button>
+            </el-tooltip>
           </el-form-item>
         </el-col>
       </el-row>
@@ -97,6 +100,18 @@
             </el-popover-select-v2>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="单据状态" prop="documentStatus">
+            <el-select v-model="queryParams.documentStatus" placeholder="请选择">
+              <el-option
+                v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
     </el-form>
 
@@ -133,15 +148,13 @@
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-dropdown @command="handleCommand">
-          <el-button type="primary" size="mini" plain icon="el-icon-upload">
-            导入<i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
-            <el-dropdown-item command="import">导入</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+        >导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-dropdown @command="handleCommand">
@@ -154,7 +167,6 @@
           </el-dropdown-menu>
         </el-dropdown>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange">
@@ -174,7 +186,7 @@
       <el-table-column label="目标合计" align="center" prop="goalSum"/>
       <el-table-column label="备注" align="center" prop="notes"/>
       <el-table-column label="单据状态" align="center" prop="documentStatus"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -299,16 +311,22 @@
         </el-row>
       </el-form>
       <div>
-        <el-row :gutter="10" class="mb8" style="margin-left: 94%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 80%">
+          <el-col :span="1.5">
+            <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
+          </el-col>
           <el-col :span="1.5">
             <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="el-icon-edit-outline" size="mini" @click="dialogUpdateMore.dialogFormVisible = true">批量修改</el-button>
+          </el-col>
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
-            <el-table v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
-              <el-table-column type="selection" width="55" align="center" fixed />
-              <el-table-column label="销售组织" align="center" prop="saleOrg" width="180" :render-header="addRedStar">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
+              <el-table-column label="序号" type="index" width="70" align="center" fixed />
+              <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                         referName="ORG_PARAM"
@@ -317,7 +335,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="销售区域" align="center" prop="saleZone" width="180" :render-header="addRedStar">
+              <el-table-column label="销售区域" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                         referName="MK_SALESAREA_PARAM"
@@ -326,7 +344,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="客户" align="center" prop="custom" width="180" :render-header="addRedStar">
+              <el-table-column label="客户" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].custom" title="客户" valueKey="name"
                                         referName="CUSTOMER_PARAM"
@@ -335,7 +353,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="部门" align="center" prop="dept" width="180" :render-header="addRedStar">
+              <el-table-column label="部门" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].dept" title="部门" valueKey="name"
                                         referName="DEPT_PARAM"
@@ -344,7 +362,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="制单人" align="center" prop="creator" width="180" :render-header="addRedStar">
+              <el-table-column label="制单人" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].creator" title="制单人" valueKey="name"
                                         referName="CONTACTS_PARAM"
@@ -353,34 +371,27 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="一级分类" align="center" prop="oneLevelClassify" width="220" :render-header="addRedStar">
+              <el-table-column label="一级分类" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
-                  <el-select v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" size="mini" clearable
-                             @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
-                             style="width: 200px">
-                    <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
+                  <el-input v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="二级分类" align="center" prop="twoLevelClassify" width="220" :render-header="addRedStar">
+              <el-table-column label="二级分类" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
-                  <el-select v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" size="mini" clearable
-                             @focus="chooseTreeReferForDetails('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
-                             style="width: 200px">
-                    <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-select>
+                  <el-input v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="物料" align="center" prop="material" width="180">
+              <el-table-column label="物料" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
                                         referName="MATERIAL_PARAM"
-                                        :dataMapping="{ materialCode: 'code', material: 'name'}"
+                                        @change="setClassify(scope.row.oneLevelClassify, scope.row.twoLevelClassify, monthSaleGoalDetailsList[scope.$index])"
+                                        :dataMapping="{ materialCode: 'code', material: 'name', oneLevelClassify: 'oneClass', twoLevelClassify: 'twoClass'}"
                                         :source.sync="monthSaleGoalDetailsList[scope.$index]" placeholder="请输入物料">
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="科室" align="center" prop="department" width="180">
+              <el-table-column label="科室" align="center" width="180">
                 <template slot-scope="scope">
                   <el-input v-model="monthSaleGoalDetailsList[scope.$index].department" placeholder="请输入科室"></el-input>
                 </template>
@@ -390,7 +401,7 @@
                   <el-input-number v-model="monthSaleGoalDetailsList[scope.$index].num" :min="0"></el-input-number>
                 </template>
               </el-table-column>
-              <el-table-column label="月份" align="center" prop="monthly" width="250" :render-header="addRedStar">
+              <el-table-column label="月份" align="center" width="250" :render-header="addRedStar">
                 <template slot-scope="scope">
                   <el-date-picker v-model="monthSaleGoalDetailsList[scope.$index].monthly" value-format="yyyy-MM" type="month" placeholder="选择月份">
                   </el-date-picker>
@@ -427,7 +438,89 @@
       </div>
     </el-drawer>
 
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <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"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+            <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 批量修改对话框-->
+    <el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
+      <el-form>
+        <el-form-item label="修改项" label-width="100px">
+          <el-select @change="changeDialogData" v-model="dialogUpdateMore.updateName" placeholder="请选择需要批量修改的字段">
+            <el-option v-for="item in dialogUpdateMore.optionList" :key="item.value" :label="item.label" :value="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="修改值" label-width="100px">
+          <el-popover-select-v2 v-if="dialogUpdateMore.updateName === 1"
+                                v-model="dialogUpdateMore.updateData" title="销售组织" valueKey="name"
+                                referName="ORG_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售组织">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 2"
+                                v-model="dialogUpdateMore.updateData" title="销售区域" valueKey="name"
+                                referName="MK_SALESAREA_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入销售区域">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 3"
+                                v-model="dialogUpdateMore.updateData" title="客户" valueKey="name"
+                                referName="CUSTOMER_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入客户">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 4"
+                                v-model="dialogUpdateMore.updateData" title="部门" valueKey="name"
+                                referName="DEPT_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入部门">
+          </el-popover-select-v2>
+          <el-popover-select-v2 v-else-if="dialogUpdateMore.updateName === 5"
+                                v-model="dialogUpdateMore.updateData" title="制单人" valueKey="name"
+                                referName="CONTACTS_PARAM"
+                                :dataMapping="{updateData: 'name'}"
+                                :source.sync="dialogUpdateMore" placeholder="请输入制单人">
+          </el-popover-select-v2>
+          <el-input v-else-if="dialogUpdateMore.updateName === 6"
+                    v-model="dialogUpdateMore.updateData" placeholder="请输入科室"
+          ></el-input>
+          <el-date-picker v-else-if="dialogUpdateMore.updateName === 7"
+            v-model="dialogUpdateMore.updateData" value-format="yyyy-MM"
+            type="month"
+            placeholder="选择月">
+          </el-date-picker>
+          <el-input v-else placeholder="请输入修改项" disabled></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -443,6 +536,8 @@ import {
   getMonthSaleGoalDetails,
   delMonthSaleGoalDetails
 } from "@/api/business/spd/goal_management/monthSaleGoalDetails"
+import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -571,11 +666,29 @@ export default {
         creator: [{ required: true, message: '制单人不能为空', trigger: 'blur' }],
         dept: [{ required: true, message: '部门不能为空', trigger: 'blur' }]
       },
-      // 参照条件
-      referCondition: { type: '', isPage: true, title: '', index: null },
-      classOptions: [],
       // 子表导航名
-      activeName: 'monthSaleGoalDetails'
+      activeName: 'monthSaleGoalDetails',
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/goal_management/monthSaleGoal/importData"
+      },
+      dialogUpdateMore: {
+        updateName: null,
+        dialogFormVisible: false,
+        updateData: null,
+        optionList:[{value: 1, label: '销售组织'}, {value: 2, label: '销售区域'}, {value: 3, label: '客户'}, {value: 4, label: '部门'}, {value: 5, label: '制单人'}, {value: 6, label: '科室'}, {value: 7, label: '月份'}]
+      }
     };
   },
   created() {
@@ -672,7 +785,7 @@ export default {
       this.reset();
       this.monthSaleGoalDetailsList = []
       this.open = true;
-      this.title = "添加月销售目标填报";
+      this.title = "添加--月销售目标填报";
       this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
       this.form.annual = new Date().getFullYear().toString()
       this.form.creator = this.$store.state.user.nickName
@@ -695,7 +808,7 @@ export default {
         material: null,
         department: null,
         num: null,
-        monthly: null,
+        monthly: new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0'),
         goalValue: 0
       }
       this.monthSaleGoalDetailsList.push(list)
@@ -707,9 +820,10 @@ export default {
       const id = row.id || this.ids
       getMonthSaleGoal(id).then(response => {
         this.form = response.data;
-        this.monthSaleGoalDetailsList = this.form.monthDetailsList
+        this.form.goalSum = this.form.goalSum.toFixed(2)
+        this.monthSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthDetailsList))
         this.open = true;
-        this.title = "修改月销售目标填报";
+        this.title = "修改--月销售目标填报";
       });
     },
     // 复制按钮
@@ -719,6 +833,7 @@ export default {
         this.form = response.data;
         this.form.id = null
         this.form.code = null
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
         this.monthSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthDetailsList))
@@ -733,7 +848,7 @@ export default {
     /** 提交按钮 */
     submitForm() {
       if (!this.justiceDetailsList()) {
-        return this.$message.error('子表有必填字段未填')
+        return this.$message.error('子表有必填字段未填,或者目标值为0')
       }
       this.$refs["form"].validate(valid => {
         if (valid) {
@@ -838,38 +953,9 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
       }
-      this.form.goalSum = sum
-    },
-    // 树形物料分类
-    chooseTreeReferForDetails(type, isPage, title, index) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.referCondition.index = index
-      this.$refs.treeDetails.init(this.referCondition)
-    },
-    selectionsToInputForDetails(selection) {
-      this.classOptions.push(selection)
-      if (this.referCondition.title === '一级物料分类') {
-        if (selection.code.length !== 1) {
-          return this.$message.info('请在一级分类中选择')
-        }
-        if (selection.code !== this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = null
-          this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = null
-        }
-        this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode = selection.code
-        this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassify = selection.name
-      } else if (this.referCondition.title === '二级物料分类') {
-        if (selection.code.length !== 4) {
-          return this.$message.info('请在二级分类中选择')
-        } else if (selection.code[0] !== this.monthSaleGoalDetailsList[this.referCondition.index].oneLevelClassifyCode) {
-          return this.$message.error('所选择的二级物料分类不属于一级分类')
-        }
-        this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassifyCode = selection.code
-        this.monthSaleGoalDetailsList[this.referCondition.index].twoLevelClassify = selection.name
-      }
+      this.form.goalSum = sum.toFixed(2)
     },
+    getSummaries(param) { return getSummary(param) },
     // 子表table加必填标志
     addRedStar(h, { column }) {
       return [
@@ -880,37 +966,126 @@ export default {
     justiceDetailsList() {
       const arr = JSON.parse(JSON.stringify(this.monthSaleGoalDetailsList))
       for (const element of arr) {
-        if (element.saleOrg === null || element.saleZone === null || element.custom === null || element.dept === null || element.creator === null || element.oneLevelClassify === null || element.twoLevelClassify === null || element.monthly === null || element.goalValue === 0) {
-          return false
+        const flag1 = (element.saleOrg !== null) && (element.saleZone !== null) && (element.custom !== null) && (element.dept !== null) && (element.creator !== null) && (element.materialCode !== null) && (element.material !== null) && (element.monthly !== null) && (element.goalValue !== 0)
+        const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !== undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.materialCode !== undefined) && (element.material !== undefined) && (element.monthly !== undefined)
+        if (flag1 && flag2) {
+          return true
         }
       }
-      return true
+      return false
     },
     setBeginAndEnd() {
       let array = this.documentDateRange
-      if (array !== null) {
+      if (this.documentDateRange !== null) {
         this.queryParams.params.beginTime = array[0]
         this.queryParams.params.endTime = array[1]
       } else {
-        this.queryParams.beginTime = null
-        this.queryParams.endTime = null
+        this.queryParams.params.beginTime = null
+        this.queryParams.params.endTime = null
       }
     },
     handleCommand(command) {
-      // 执行对应的功能
-      if (command === 'importModel') {
-        // 执行选项1的功能
-        console.log('导入模板');
-      } else if (command === 'import') {
-        // 执行选项2的功能
-        console.log('导入');
-      } else if (command === 'export') {
+      if (command === 'export') {
         console.log('导出主表');
         this.handleExport()
       } else if (command === 'exportDetails') {
         console.log('导出明细');
         this.handleExportDetails()
       }
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.open = true;
+      if (this.open) {
+        this.upload.title = "月销售目标填报明细导入"
+        this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/monthSaleGoalDetails/importData/" + this.form.id
+      } else {
+        this.upload.title = "月销售目标填报导入";
+        this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/monthSaleGoal/importData"
+      }
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      if (this.open) {
+        this.download('goal_management/monthSaleGoalDetails/importTemplate', {
+        }, `monthSaleGoalDetails_${new Date().getTime()}.xlsx`)
+      } else {
+        this.download('goal_management/monthSaleGoal/importTemplate', {
+        }, `monthSaleGoal_${new Date().getTime()}.xlsx`)
+      }
+    },
+    // 文件上传中处理
+    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("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      if (this.open) {
+        let array = response.data
+        for (const arrayElement of array) {
+          arrayElement.id = null
+          this.monthSaleGoalDetailsList.push(arrayElement)
+        }
+        this.computeTotal()
+      } else {
+        this.getList();
+      }
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    // 选择物料后,给一级分类和二级分类复赋值
+    setClassify(one, two, obj) {
+      const oneArray = one.split("&")
+      const twoArray = two.split("&")
+      obj.oneLevelClassifyCode = oneArray[1]
+      obj.oneLevelClassify = oneArray[0]
+      obj.twoLevelClassifyCode = twoArray[1]
+      obj.twoLevelClassify = twoArray[0]
+    },
+    // 批量修改对话框的方法
+    dialogUpdateMoreSave() {
+      console.log(this.dialogUpdateMore);
+      if (this.dialogUpdateMore.updateData === null) {
+        return this.$message.error('请输入修改值')
+      }
+      const array = JSON.parse(JSON.stringify(this.monthSaleGoalDetailsList))
+      if (array.length !== 0) {
+        let condition = this.dialogUpdateMore.updateName
+        for (const element of array) {
+          if (condition === 1) {
+            element.saleOrg = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 2) {
+            element.saleZone = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 3) {
+            element.custom = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 4) {
+            element.dept = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 5) {
+            element.creator = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 6) {
+            element.department = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          } else if (condition === 7) {
+            element.monthly = JSON.parse(JSON.stringify(this.dialogUpdateMore.updateData))
+          }
+        }
+      }
+      this.monthSaleGoalDetailsList = array
+      this.dialogUpdateMore.dialogFormVisible = !this.dialogUpdateMore.dialogFormVisible
+      this.dialogUpdateMore.updateData = null
+      this.dialogUpdateMore.updateName = null
+    },
+    changeDialogData() {
+      this.dialogUpdateMore.updateData = null
+    },
+    resetDialogUpdateMore() {
+      this.dialogUpdateMore.updateName = null
+      this.dialogUpdateMore.updateData = null
     }
   }
 }

+ 1 - 3
src/views/business/spd/target/targetMk/add.vue

@@ -11,7 +11,6 @@
                 disabled
                 style="width: 200px"
               />
-              <!-- <div>{{form.code}}</div> -->
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -94,7 +93,7 @@
         </el-card>
       </el-form>
     </el-card>
-    <el-card  style="height:500px">
+    <el-card  style="height:600px">
       <Item ref="child" v-if="isItem" :pageStu="pageStu" :template="template" :form="form" :columns="headers" :latestTemplate="latestTemplate"></Item>
     </el-card>
     <el-card>
@@ -164,7 +163,6 @@ export default {
   watch: {
 	  'form.template': {
       async handler(newVal) {
-        console.log('111');
         this.isItem = false;
         await this.fetchTemplate(newVal);
         await this.fetchHeaderData(newVal);

+ 51 - 12
src/views/business/spd/target/targetMk/index.vue

@@ -5,6 +5,22 @@
         <el-form class="search_area" label-width="120px">
           <el-row :gutter="10">
             <el-col :span="1.5">
+              <el-form-item label="单据状态" prop="status">
+                <el-select
+                  size="mini"
+                  v-model="queryParams.status"
+                  clearable
+                >
+                  <el-option
+                    v-for="dict in dict.type.sys_status"
+                    :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-input
                   v-model="queryParams.code"
@@ -61,22 +77,29 @@
       
         <div class="btn_grooup">
           <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
-          <el-button type="primary" size="mini" @click="useAdd">模板导出</el-button>
-          <el-button type="primary" size="mini" @click="useAdd">导入</el-button>
+          <TemplateDownload/>
+          <el-button type="primary" size="mini" @click="useUpload">导入</el-button>
         </div>
 
         <el-table 
-          :data="tableList" 
-          fit
-          max-height="480"
-          style="font-size: 12px;"
+          :data="tableList"
           @selection-change="useSelectionRow"
           @row-dblclick="useDoubleClick"
+          height="600px"
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column label="序号" type="index" width="50" align="center" fixed/>
           <el-table-column show-overflow-tooltip label="单据编号" align="center" width="200" prop="code"/>
           <el-table-column show-overflow-tooltip label="单据日期" align="center" width="200" prop="date"/>
           <el-table-column show-overflow-tooltip label="目标名称" align="center" width="200" prop="name"/>
+          <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.sys_status"
+                :value="scope.row.status"
+              />
+            </template>
+          </el-table-column>
           <el-table-column show-overflow-tooltip label="年度" align="center" width="200" prop="templateData.year"/>
           <el-table-column show-overflow-tooltip label="模板" align="center" width="200" prop="templateData.name"/>
           <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200" prop="templateData.startTime" />
@@ -117,11 +140,16 @@
           <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
           <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
           <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
-          <el-table-column fixed="right" label="操作" align="center" width="200">
+          <el-table-column fixed="right" label="操作" align="center" width="150">
             <template slot-scope="scope">
-              <!-- <el-button type="text" size="mini" @click="useSubmit(scope.row)">提交</el-button> -->
-              <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
-              <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
+              <div v-if="scope.row.status == '0' || scope.row.status == '3'">
+                <el-button type="text" size="mini" @click="useSubmit(scope.row)">提交</el-button>
+                <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
+                <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
+              </div>
+              <div v-if="scope.row.status == '1'">
+                <el-button type="text" size="mini" @click="useRevocation(scope.row)">撤回</el-button>
+              </div>
             </template>
           </el-table-column>
         </el-table>
@@ -144,14 +172,15 @@
 
 <script>
 import Add from './add.vue'
+import TemplateDownload from './templateDownload.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import { listTarget,delTarget } from "@/api/business/spd/starget/target";
 export default {
   name: 'target',
   dicts: [
-    "mk_periodic_unit","mk_dimensionality","mk_index_type"
+    "sys_status","mk_periodic_unit","mk_dimensionality","mk_index_type"
   ],
-  components: { Add,CollapseTransition},
+  components: { Add,TemplateDownload,CollapseTransition},
   data() {
     return {
       expanded: false,
@@ -161,6 +190,7 @@ export default {
       page: '',
       // 搜索框参数
       queryParams: {
+        status: '',
         code: '',
         name: '',
         template:'',
@@ -174,6 +204,7 @@ export default {
       tableList:[],
       disable: false,
       rowDetail:{},
+      openTemplateDownload:false,
     }
   },
   created() {
@@ -186,10 +217,18 @@ export default {
       this.page = 'add'
       this.disable = false
     },
+    //导入
+    useUpload(){
+
+    },
     //提交
     useSubmit(){
       
     },
+    //撤回
+    useRevocation(){
+
+    },
     //修改
     useEdit(row){
       this.isList = false

+ 4 - 3
src/views/business/spd/target/targetMk/item.vue

@@ -6,10 +6,10 @@
       </div>
     </el-row>
     <!-- 渲染表头 -->
-    <el-table :data="items" style="width: 100%" height="500px">
+    <el-table :data="items" height="500px">
       <el-table-column label="序号" type="index" width="50" align="center" fixed>
       </el-table-column>
-      <el-table-column show-overflow-tooltip v-for="head in headers" :prop="head.prop" :label="head.modelName" width="150" align="center">
+      <el-table-column show-overflow-tooltip v-for="head in headers" :prop="head.prop" :label="head.modelName" width="200" align="center">
         <template slot-scope="scope">
           <div v-if="pageStu == 'add' || pageStu == 'edit'">
             <div v-if="scope.row[head.prop].type == 'D'">
@@ -82,7 +82,6 @@ export default {
   async created() {
     this.processHeadersData(this.template.unfold,this.columns);
     this.itemTemplate = this.formatItem(this.columns);
-    console.log('this.itemTemplate',this.itemTemplate);
     if(this.pageStu == 'edit' || this.pageStu == 'see'){
       if(!this.latestTemplate){
         await this.fetchTargetItem(this.form.id);
@@ -93,6 +92,8 @@ export default {
     //增行
     useAdd(){
       this.items.push(this.itemTemplate);
+      console.log('this.itemTemplate',this.itemTemplate);
+      console.log('this.items',this.items);
     },
     //删行
     useDel(index){

+ 170 - 0
src/views/business/spd/target/targetMk/templateDownload.vue

@@ -0,0 +1,170 @@
+<template>
+  <div>
+    <el-button type="primary" size="mini" @click="openDialog">模板导出</el-button>
+    <el-dialog
+      title="选择目标模板"
+      :visible.sync="open"
+    >
+      <el-form size="mini" label-width="120px" >
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="年度">
+              <el-input
+                v-model="queryParams.year"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="模板名称">
+              <el-input
+                v-model="queryParams.name"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item>
+              <el-button type="primary" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+              <el-button icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <el-table 
+          :data="tableData"
+          size="mini"
+          @row-dblclick="useDoubleClick"
+          height="450px"
+        >
+        <el-table-column show-overflow-tooltip label="年度" align="center" width="100" prop="year">
+          <template slot-scope="scope">
+            {{scope.row.year}}
+          </template>
+        </el-table-column>
+        <el-table-column show-overflow-tooltip label="模板名称" align="center" width="200" prop="name"/>
+        <el-table-column show-overflow-tooltip label="开始日期" align="center" width="150" prop="startTime" />
+        <el-table-column show-overflow-tooltip label="结束日期" align="center" width="150" prop="deadlineTime" />
+        <el-table-column show-overflow-tooltip label="周期" align="center" width="100" prop="cycle">
+          <template slot-scope="scope">
+            <dict-tag
+              :options="dict.type.mk_periodic_unit"
+              :value="scope.row.cycle"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column show-overflow-tooltip label="创建人" align="center" width="150" prop="createByName" />
+        <el-table-column show-overflow-tooltip label="创建时间" align="center" width="150" prop="createTime" />
+      </el-table>
+      <el-pagination
+          background
+          @size-change="useChangePageSize"
+          @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
+          :page-size="100"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listTargetTemplate,download } from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: 'templateList',
+  dicts: ["mk_periodic_unit"],
+  data() {
+    return {
+      //是否打开弹窗
+      open:false,
+      //搜索框参数
+      queryParams:{
+        year: null,
+        name: null,
+        pageNum: 1,
+        pageSize: 10
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableData:[],
+    };
+  },
+  watch: {},
+  created() {
+  },
+  methods: {
+    //打开弹窗
+    openDialog(){
+      this.open = true;
+      this.getList();
+    },
+    //获取列表数据
+    async getList() {
+      try {
+        this.loading = true;
+        const { code, rows, total } = await listTargetTemplate(this.queryParams);
+        if (code === 200) {
+          this.tableData = rows;
+          this.total = total;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //双击选择
+    async useDoubleClick(row){
+      try {
+        await download(row.id);
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.open = false;
+      }
+    },
+    //搜索
+    useSearch(){
+      this.getList(this.queryParams);
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        year: null,
+        name: null,
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams);
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    //翻页
+    useCurrentChange(val){
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<style lang="scss" scoped>
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

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

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

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

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

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

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

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

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

+ 508 - 0
src/views/business/spd/target/targetTemplate/detail.vue

@@ -0,0 +1,508 @@
+
+<template>
+    <div>
+        <el-card>
+            <el-button size="mini" plain @click="useBack">返回</el-button>
+            <el-divider></el-divider>
+            <el-form size="mini" :model="form" :rules="rules" ref="form" label-width="auto">
+                <el-row :gutter="10">
+                    <el-col :span="1.5">
+                        <el-form-item label="年份" prop="year" >
+                            <el-date-picker
+                                v-model="form.year"
+                                type="year"
+                                clearable
+                                >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="模板名称" prop="name">
+                            <el-input
+                                v-model="form.name"
+                                style="width: 200px"
+                                clearable
+                            />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="开始日期" prop="startTime">
+                            <el-date-picker
+                                v-model="form.startTime"
+                                clearable
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                style="width: 200px"
+                                >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="结束日期" prop="deadlineTime">
+                            <el-date-picker
+                                v-model="form.deadlineTime"
+                                clearable
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                style="width: 200px"
+                                >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="周期" prop="cycle">
+                            <el-select v-model="form.cycle" clearable>
+                                <el-option
+                                v-for="dict in dict.type.mk_periodic_unit"
+                                :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 v-model="form.unfold" clearable>
+                                <el-option
+                                v-for="dict in dict.type.mk_expansion_mode"
+                                :key="dict.value"
+                                :label="dict.label"
+                                :value="dict.value"
+                                ></el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+        </el-card>
+        <el-card style="height:800px">
+            <div style='position: relative;'>
+                <el-tabs v-model="activeName" @tab-click="useSwitchTab">
+                    <el-tab-pane label="指标" name="indexs">
+                        <el-table :data="indexs" height="600px" size="size">
+                            <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+                            <el-table-column show-overflow-tooltip label="指标" align="center" width="200" prop="target">
+                                <template slot-scope="scope">
+                                    <el-select v-model="scope.row.target" size="mini" clearable>
+                                        <el-option
+                                        v-for="dict in dict.type.mk_index_type"
+                                        :key="dict.value"
+                                        :label="dict.label"
+                                        :value="dict.value"
+                                        ></el-option>
+                                    </el-select>
+                                </template>
+                            </el-table-column>
+                            <el-table-column fixed="right" label="操作" align="center" width="150">
+                                <template slot-scope="scope">
+                                    <el-button type="text" size="mini" @click="useRowRemove(scope.row)">删行</el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-tab-pane>
+                    <el-tab-pane label="维度" name="dimensionalitys">
+                        <el-table :data="dimensionalitys" height="600px" size="size">
+                            <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+                            <el-table-column show-overflow-tooltip label="维度" align="center" width="200" prop="dimensionality">
+                                <template slot-scope="scope">
+                                    <el-select v-model="scope.row.dimensionality" size="mini" clearable>
+                                        <el-option
+                                        v-for="dict in dict.type.mk_dimensionality"
+                                        :key="dict.value"
+                                        :label="dict.label"
+                                        :value="dict.value"
+                                        ></el-option>
+                                    </el-select>
+                                </template>
+                            </el-table-column>
+                            <el-table-column fixed="right" label="操作" align="center" width="150">
+                                <template slot-scope="scope">
+                                <el-button type="text" size="mini" @click="useRowRemove(scope.row)">删行</el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-tab-pane>
+                    <el-tab-pane label="周期" name="cycles">
+                        <el-table :data="form.cycles" height="600px" size="size">
+                            <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+                            <el-table-column show-overflow-tooltip label="周期" align="center" width="200" prop="name">
+                                <template slot-scope="scope">
+                                    <el-input
+                                        size="mini"
+                                        v-model="scope.row.name"
+                                        style="width: 150px"
+                                        clearable
+                                    />
+                                </template>
+                            </el-table-column>
+                            <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200" prop="startTime">
+                                <template slot-scope="scope">
+                                    <el-date-picker
+                                        v-model="scope.row.startTime"
+                                        size="mini"
+                                        clearable
+                                        type="date"
+                                        value-format="yyyy-MM-dd"
+                                        style="width: 150px"
+                                        >
+                                    </el-date-picker>
+                                </template>
+                            </el-table-column>
+                            <el-table-column show-overflow-tooltip label="结束日期" align="center" width="200" prop="deadlineTime">
+                                <template slot-scope="scope">
+                                    <el-date-picker
+                                        v-model="scope.row.deadlineTime"
+                                        size="mini"
+                                        clearable
+                                        type="date"
+                                        value-format="yyyy-MM-dd"
+                                        style="width: 150px"
+                                        >
+                                    </el-date-picker>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-tab-pane>
+                </el-tabs>
+                <el-button @click="useRowAdd" v-if="activeName == 'indexs' || activeName == 'dimensionalitys'" size='mini' style='position: absolute;right:10px;top:5px;'>增行</el-button>
+                <el-button @click="useResetCycle" v-if="activeName == 'cycles'" size='mini' style='position: absolute;right:10px;top:5px;'>重算周期</el-button>
+            </div>
+        </el-card>
+        <el-card>
+            <div class="btn_group">
+                <el-col :span="1.5">
+                    <el-button size="mini" plain @click="useBack">取消</el-button>
+                </el-col>
+                <el-col :span="1.5" style="margin: 0 10px;">
+                    <el-button type="primary" size="mini" plain @click="useSave">保存</el-button>
+                </el-col>
+            </div>
+        </el-card>
+    </div>
+</template>
+
+<script>
+import {
+  addTargetTemplate,
+  updateTargetTemplate,
+  getTargetTemplate,
+} from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: "targettemplateDetail",
+  dicts: ["mk_periodic_unit","mk_expansion_mode","mk_index_type","mk_dimensionality"],
+  components: {},
+  props: ['openMode','row'],
+  data() {
+    return {
+      form:{
+        indexs:[],
+        dimensionalitys:[],
+        cycles:[],
+      },
+      //表单校验
+      rules: {
+        year: [
+          { required: true, message: "年份不能为空", trigger: "blur" },
+        ],
+        name: [
+          { required: true, message: "目标名称不能为空", trigger: "blur" },
+        ],
+        startTime: [
+          { required: true, message: "开始日期不能为空", trigger: "blur" },
+        ],
+        deadlineTime: [
+          { required: true, message: "结束日期不能为空", trigger: "blur" },
+        ],
+        cycle: [
+          { required: true, message: "周期不能为空", trigger: "blur" },
+        ],
+      },
+      activeName: 'indexs',
+    };
+  },
+  computed: {
+    indexs(){
+        return this.form.indexs.filter(
+            ({ delFlag }) => delFlag !== "2"
+        );
+    },
+    dimensionalitys(){
+        return this.form.dimensionalitys.filter(
+            ({ delFlag }) => delFlag !== "2"
+        );
+    }
+  },
+  async created() {
+    switch(this.openMode){
+        case "add":
+            var date = new Date();
+            this.form.year = date.getFullYear() + '-' + '01' + '-' + '01';
+            this.form.startTime = date.getFullYear() + '-' + '01' + '-' + '01';
+            this.form.deadlineTime = date.getFullYear() + '-' + '12' + '-' + '31';
+            this.form.cycle = 'month';
+            break;
+        case "edit":
+            await this.fetchTemplate(this.row.id);
+            break;
+        case "see":
+            await this.fetchTemplate(this.row.id);
+            break;
+    }
+  },
+  methods: {
+    //保存
+    async useSave() {
+        console.log("form",this.form);
+        this.$refs["form"].validate(async (valid) => {
+            if (valid) {
+                try {
+                    let checkRes = this.checkBeforeSave(this.form);
+                    if(!checkRes){
+                        return;
+                    }
+                    this.loading = true;
+                    let res = null;
+                    if (this.openMode === "add") {
+                        res = await addTargetTemplate(this.form);
+                    }
+                    if (this.openMode === "edit") {
+                        res = await updateTargetTemplate(this.form);
+                    }
+                    if (res.code === 200) {
+                        this.$modal.msgSuccess("保存成功");
+                        this.useBack();
+                    }
+                } catch (err) {
+                    console.error(err);
+                } finally {
+                    this.loading = false;
+                }
+            } else {
+                return false;
+            }
+        });
+    },
+    //保存前校验
+    checkBeforeSave(form){
+        if(form.indexs){
+            let arr = form.indexs.filter(item => item.delFlag != '2');
+            if(arr.length < 1){
+                this.$modal.msgError("指标页签不能为空!");
+                return false;
+            }
+            arr = arr.filter(item => !item.target);
+            console.log("arr",arr);
+            if(arr.length > 0){
+                this.$modal.msgError("指标页签不能存在空数据!");
+                return false;
+            }
+        }else{
+            this.$modal.msgError("指标页签不能为空!");
+            return false;
+        }
+        if(form.dimensionalitys){
+            let arr = form.dimensionalitys.filter(item => item.delFlag != '2');
+            if(arr.length < 1){
+                this.$modal.msgError("维度页签不能为空!");
+                return false;
+            }
+            arr = arr.filter(item => !item.dimensionality);
+            if(arr.length > 0){
+                this.$modal.msgError("维度页签不能存在空数据!");
+                return false;
+            }
+        }else{
+            this.$modal.msgError("维度页签不能为空!");
+            return false;
+        }
+        if(form.cycles){
+            let arr = form.cycles.filter(item => item.delFlag != '2');
+            if(arr.length < 1){
+                this.$modal.msgError("周期页签不能为空!");
+                return false;
+            }
+        }else{
+            this.$modal.msgError("周期页签不能为空!");
+            return false;
+        }
+    },
+    //查询详情
+    async fetchTemplate(id) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await getTargetTemplate(id);
+        if (code === 200) {
+          this.form = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //增行
+    async useRowAdd() {
+        let row = {};
+        if(this.activeName == "indexs"){
+            row = {
+                target: null,
+            }
+        }
+        if(this.activeName == "dimensionalitys"){
+            row = {
+                dimensionality: null,
+            }
+        }
+        this.form[this.activeName].push({
+            delFlag: "0",
+            $index: new Date().getTime(),
+            ...row,
+        });
+        console.log("this.form[this.activeName]",this.form[this.activeName]);
+    },
+    //删行
+    async useRowRemove(row) {
+      if (row.id) {
+        this.form[this.activeName].forEach(e => {
+          if(e.id == row.id){
+            e.delFlag = '2'
+          }
+        });
+      }else{
+        this.form[this.activeName] = form[this.activeName].filter(item => item.$index != row.$index);
+      }
+      console.log("this.form[this.activeName]",this.form[this.activeName]);
+    },
+    //切换多页签
+    useSwitchTab(){
+
+    },
+    //返回
+    useBack(){
+        this.$parent.useOpenDetail();
+        this.$parent.useSearch();
+    },
+    //重算周期
+    useResetCycle(){
+      if(!this.form.startTime || !this.form.deadlineTime || !this.form.cycle){
+        this.$modal.msgError("开始日期、结束日期、周期不能存在空值!");
+        return;
+      }
+      if(this.form.startTime > this.form.deadlineTime){
+        this.$modal.msgError("开始日期不能大于结束日期!");
+        return;
+      }
+      this.form.cycles = [];
+      var cycles = [];
+      var start = new Date(this.form.startTime);
+      var deadline = new Date(this.form.deadlineTime);
+      start.setHours( 0, 0, 0);
+      deadline.setHours( 0, 0, 0);
+      if(this.form.cycle == 'period'){
+        cycles.push({
+          name:'目标期间',
+          startTime:start,
+          deadlineTime:deadline,
+        });
+      }else{
+        while(deadline >= start){
+          console.log(start);
+          if(this.form.cycle == 'day'){
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:start,
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+1);
+            start = new Date(start);
+          }
+          if(this.form.cycle == 'week'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+7),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+7);
+            start = new Date(start);
+          }
+          if(this.form.cycle == 'month'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+30),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+30);
+            start = new Date(start);
+          }
+          if(this.form.cycle == 'season'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+90),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+90);
+            start = new Date(start);
+          }
+        }
+      }
+      this.form.cycles = cycles;
+      console.log('this.form.cycles',this.form.cycles);
+    },
+    //日期名称格式化
+    formatDateTime(date, format) {
+      const o = {
+        'M+': date.getMonth() + 1, // 月份
+        'd+': date.getDate(), // 日
+        'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时
+        'H+': date.getHours(), // 小时
+        'm+': date.getMinutes(), // 分
+        's+': date.getSeconds(), // 秒
+        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+        S: date.getMilliseconds(), // 毫秒
+        a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午
+        A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM
+      };
+      if (/(y+)/.test(format)) {
+        format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+      }
+      for (let k in o) {
+        if (new RegExp('(' + k + ')').test(format)) {
+          format = format.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+          );
+        }
+      }
+      return format;
+    }
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+} 
+</style>

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

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

+ 231 - 126
src/views/business/spd/target/targetTemplate/index.vue

@@ -1,151 +1,247 @@
+
+<template>
+  <div>
+    <div v-if="!openDetail">
+      <el-card>
+        <el-form size="mini" class="search_area" label-width="120px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="年度">
+                <el-date-picker
+                  v-model="queryParams.params.year"
+                  type="year"
+                  clearable
+                  >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="模板名称">
+                <el-input
+                  v-model="queryParams.name"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="开始日期">
+                <el-date-picker
+                  size="mini"
+                  v-model="dateRange"
+                  style="width: 240px"
+                  value-format="yyyy-MM-dd"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始"
+                  end-placeholder="结束"
+                ></el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+                <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-divider></el-divider>
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
+        </div>
+
+        <el-table 
+          :data="tableList"
+          @row-dblclick="useDoubleClick"
+          height="600px"
+        >
+          <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+          <el-table-column show-overflow-tooltip label="年度" align="center" width="200" prop="year">
+            <template slot-scope="scope">
+              {{scope.row.year.substring(0,4)}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="模板名称" align="center" width="200" prop="name"/>
+          <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200" prop="startTime"/>
+          <el-table-column show-overflow-tooltip label="结束日期" align="center" width="200" prop="deadlineTime"/>
+          <el-table-column show-overflow-tooltip label="周期" align="center" width="200" prop="cycle">
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.mk_periodic_unit"
+                :value="scope.row.cycle"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="按列展开" align="center" width="200" prop="unfold">
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.mk_expansion_mode"
+                :value="scope.row.unfold"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="200" prop="createByName" />
+          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
+          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
+          <el-table-column fixed="right" label="操作" align="center" width="150">
+            <template slot-scope="scope">
+              <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
+              <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+          background
+          @size-change="useChangePageSize"
+          @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
+          :page-size="100"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+    <Detail v-if="openDetail" :openMode="openMode" :row="row"/>
+  </div>
+</template>
+
 <script>
-import { dicts } from "./dicts";
-import useColumns from "./columns";
-import { listTargetTemplate } from "@/api/business/spd/starget/targetTemplate";
+import Detail from './detail.vue'
+import { listTargetTemplate,delTargetTemplate,checkQuote, } from "@/api/business/spd/starget/targetTemplate";
 
 export default {
   name: "targettemplate",
-  dicts: dicts,
-  components: {
-    SeeButton: () => import("./see/index.vue"),
-    AddButton: () => import("./add/index.vue"),
-    DeleButton: () => import("./delete/index.vue"),
-    ElSuperTable: () => import("@/components/super-table/index.vue"),
-    ElSuperSearch: () => import("@/components/super-search/index.vue"),
-  },
+  dicts: ["mk_periodic_unit","mk_expansion_mode"],
+  components: {Detail},
   data() {
-    const { TableColumns, SearchColumns } = useColumns();
-    const params = this.$init.params(SearchColumns);
     return {
-      size: "mini",
-      loading: false,
-      params: params,
-      tableData: [],
-      selectData: [],
-      SearchColumns: SearchColumns,
-      TableColumns: TableColumns,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
+      // 搜索框参数
+      queryParams: {
+        name:null,
+        pageNum: 1,
+        pageSize: 10,
+        params:{
+          year:null,
+        }
+      },
+      // 查询日期范围
+      dateRange: [],
+      //总条数
+      total: 0,
+      //列表数据
+      tableList:[],
+      //是否打开详情页面
+      openDetail:false,
+      //编辑页面打开方式,add或edit或see
+      openMode:'',
+      //行数据
+      row:{},
     };
   },
   created() {
-    console.log('this.$refs',this.$refs);
-    this.useQuery(this.params, this.page);
+    this.getList(this.queryParams);
   },
   methods: {
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { code, rows, total } = await listTargetTemplate(
-          {...prop,...page}
-        );
-        if (code === 200) {
-          this.tableData = rows;
-          this.page.total = total;
-          console.log('this.tableData',this.tableData);
+    //是否打开详情页面
+    useOpenDetail(){
+      this.openDetail = !this.openDetail;
+    },
+    //新增
+    useAdd(){
+      this.openMode = 'add';
+      this.openDetail = true;
+    },
+    //编辑
+    async useEdit(row){
+      const { code, data } = await checkQuote(row.id);
+      if (code == "200") {
+        if (data) {
+          this.$modal.msgError("该目标模板存在引用,无法修改!");
+          this.visible = false;
+          return;
         }
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
+      } else {
+        this.$modal.msgError("校验该目标模板是否存在引用异常,无法修改!");
+        this.visible = false;
+        return;
       }
+      this.openMode = 'edit';
+      this.row = row;
+      this.openDetail = true;
     },
-    // 查 询
-    useQuery(prop, page) {
-      this.selectData = [];
-      this.fetchList(prop, page);
+    //删除
+    async useDel(row){
+      const { code, data } = await checkQuote(row.id);
+      if (code == "200") {
+        if (data) {
+          this.$modal.msgError("该目标模板存在引用,无法删除!");
+          this.visible = false;
+          return;
+        }
+      } else {
+        this.$modal.msgError("校验该目标模板是否存在引用异常,无法删除!");
+        this.visible = false;
+        return;
+      }
+      this.$modal.confirm('确认删除选择数据').then(() => {
+        delTarget(row.id).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("删除成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }).catch(() => {})
+    },
+    //查询列表
+    getList(params){
+      listTargetTemplate(this.addDateRange(params, this.dateRange)).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+        }
+      })
     },
-    // 重 置
-    useReset() {
-      this.page.pageNum = 1;
-      this.page.pageSize = 10;
-      this.params = this.$init.params(this.SearchColumns);
-      this.useQuery(this.params, this.page);
+    //双击
+    useDoubleClick(row){
+      this.openMode = 'see';
+      this.row = row;
+      this.openDetail = true;
     },
-    // 选 择
-    useSelect(prop) {
-      this.selectData = prop;
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
     },
-    // 明 细
-    async useSee(prop) {
-      const { open } = this.$refs.SeeButton;
-      await open([prop]);
+    //翻页
+    useCurrentChange(val){
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+    //搜索
+    useSearch() {
+      console.log(this.queryParams);
+      this.getList(this.queryParams);
+    },
+    //重置
+    useReset(){
+      this.dateRange = [];
+      this.queryParams = {
+        name: '',
+        pageNum: 1,
+        pageSize: 10,
+        params:{
+          year:'',
+        },
+      }
+      this.getList(this.queryParams);
     },
   },
 };
 </script>
 
-<template>
-  <el-card v-loading="loading" :body-style="{ padding: 0 }">
-    <el-super-search
-      v-model="params"
-      :size="size"
-      :dict="dict"
-      :columns="SearchColumns"
-      @reset="useReset"
-      @submit="useQuery(params, page)"
-    ></el-super-search>
-    <div style="margin: 0 0 20px 0; text-align: right">
-      <el-button-group>
-        <add-button
-          :size="size"
-          :select-data="[]"
-          :dict="dict"
-          add-type="add"
-          @success="useQuery(params, page)"
-        ></add-button>
-      </el-button-group>
-      <el-button-group>
-        <see-button
-          v-show="false"
-          :size="size"
-          :dict="dict"
-          :model="params"
-          :select-data="selectData"
-          ref="SeeButton"
-          @success="useQuery(params, page)"
-        ></see-button>
-      </el-button-group>
-    </div>
-    <el-super-table
-      v-model="tableData"
-      :size="size"
-      :dict="dict"
-      :columns="TableColumns"
-      stroage
-      hideOperationColumns
-      @row-dblclick="useSee"
-      @selection-change="useSelect"
-    >
-      <el-table-column fixed="right" label="操作" align="center" width="150">
-        <template slot-scope="scope">
-          <add-button
-          :size="size"
-          :dict="dict"
-          :select-data="scope.row"
-          add-type="edit"
-          @success="useQuery(params, page)"
-        ></add-button>
-        <dele-button
-          :size="size"
-          :select-data="scope.row"
-          @success="useQuery(params, page)"
-        ></dele-button>
-        </template>
-      </el-table-column>
-      <!-- <el-table-column fixed width="55" align="center" type="selection">
-      </el-table-column> -->
-    </el-super-table>
-    <pagination
-      :total="page.total"
-      :page.sync="page.pageNum"
-      :limit.sync="page.pageSize"
-      @pagination="useQuery(params, page)"
-      style="height: 32px; margin: 20px 0 0 0; padding: 0 !important"
-    />
-  </el-card>
-</template>
 <style scoped lang="scss">
 .el-card {
   width: calc(100% - 20px);
@@ -156,4 +252,13 @@ export default {
 .el-button-group + .el-button-group {
   margin: 0 0 0 10px;
 }
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>

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

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

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

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

+ 129 - 0
src/views/material/basicFile/columns.js

@@ -0,0 +1,129 @@
+export const SearchColumns = [
+
+  {
+    item:{
+      key: "code",
+      title: "物料编码",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "code",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "name",
+      title: "物料名称",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "isEnable",
+      title: "启用状态",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "material_enable",
+    },
+  },
+  {
+    item:{
+      key: "isSync",
+      title: "是否同步NC",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key: "registrant",
+      title: "生产厂家/代理人",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MANUFACTURER_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "storageCondition",
+      title: "存储条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_storage_condition",
+    },
+  },
+  {
+    item:{
+      key: "transportationCondition",
+      title: "运输条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_conditions_carriage",
+    },
+  },
+  {
+    item:{
+      key: "isMedicine",
+      title: "是否医药物料",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key:'classifyAbc',
+      title:'ABC分类',
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "abc_type",
+    }
+  },
+];
+
+export const OtherDictColumns = [
+  {
+    item:{
+      key:"expiryUnitId",
+      title:'效期管理',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "period_unit",
+    }
+  },
+  {
+    item:{
+      key:'usefulLifeUnitId',
+      title:'有效期至单位',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "expiry_date",
+    }
+  },
+  
+]

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

@@ -114,7 +114,7 @@
 
     </div>
     
-      <div class="md-content">
+      <div class="md-content" :key="basicData.value.id">
         <el-form :inline="true" label-position="right" :model="basicData.value">
           <!-- <el-form-item label="所属组织"></el-form-item> -->
           <el-form-item label="物料编码">

+ 80 - 17
src/views/material/basicFile/index.vue

@@ -6,10 +6,18 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
 
-      <!-- 操作栏 -->
+      
     <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
-      <el-row :gutter="10">
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="handleResetQuery"
+        @submit="handleQuery"
+      ></el-super-search>
+      <!-- <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
             <el-form-item label="物料编码">
@@ -19,14 +27,12 @@
               <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
             </el-form-item>
             <el-form-item label="启用状态">
-              <!-- 0=已启用,2=已停用 -->
               <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
                 <el-option key="0" label="已启用" value="0"></el-option>
                 <el-option key="2" label="已停用" value="2"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="是否同步NC">
-              <!-- 是否同步;2=否,0=是 -->
               <el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
                 <el-option key="0" label="是" value="0"></el-option>
                 <el-option key="2" label="否" value="2"></el-option>
@@ -40,8 +46,9 @@
           </el-form>
         </el-col>
 
-      </el-row>
+      </el-row> -->
     </div>
+    <!-- 操作栏 -->
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -101,9 +108,11 @@
       </el-row>
 
       <el-table 
+        v-if="tableHeader.length"
         border 
         :data="taskList" 
         ref="materialTable" 
+        max-height="550"
         @cell-dblclick="handledbClick" 
         :row-key="getRowKey"
         @selection-change="handleSelectionChange" 
@@ -111,7 +120,7 @@
         @select-all="handleSelectAll"
       >
         <!--  -->
-        <el-table-column type="selection" width="45" :reserve-selection="true"/>
+        <el-table-column type="selection" width="45" :reserve-selection="true" fixed/>
         <el-table-column type="index" label="序号" width="55" align="center"/>
         <el-table-column 
           width="150" 
@@ -120,13 +129,27 @@
           align="center"
           show-overflow-tooltip
         >
-          <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
           <template slot-scope="scope">
-            {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
+            <span v-if="h.apiUrl">{{scope.row[`${h.prop}Name`]}}</span>
+            <el-checkbox 
+              v-else-if="h.attribute == 'checkbox'"
+              v-model="scope.row[h.prop]"
+              disabled
+              true-label="0" 
+              false-label="2"
+            ></el-checkbox>
+            <el-dict-tag
+              v-else-if="h.dictId"
+              :value="scope.row[h.prop]"
+              :options="dict.type[h.dictId]"
+            ></el-dict-tag>
+
+            <span v-else>{{ scope.row[h.prop] || '--' }}</span>
+            <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
             (h.attribute == 'checkbox' ?
             (scope.row[h.prop] == '0' ? '√' : '')
             : scope.row[h.prop])
-            }}
+            }} -->
           </template>
         </el-table-column>
       </el-table>
@@ -174,12 +197,24 @@
 <script>
   import './style/index.scss';
   import materialApi from '@/api/material/basic';
+  import { SearchColumns,OtherDictColumns } from './columns';
+  import { initDicts } from "@/utils/init.js";
 
   export default {
     name: "material-basic",
+    dicts:[...initDicts([...SearchColumns,...OtherDictColumns])],
+    // dicts:[],
+    components: {
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
+      ElDictTag: () => import("@/components/DictTag/index.vue"),
+    },
     data() {
+      const params = this.$init.params(SearchColumns);
       return {
         failLoad: false,
+        params:params,
+        SearchColumns:SearchColumns,
+        size:'mini',
         // 物料基本信息数据
         taskList: [],
         // 查询表单字段
@@ -289,17 +324,25 @@
       },
       // 重置查询条件
       handleResetQuery() {
-        for (const key in this.queryForm) {
+        // for (const key in this.queryForm) {
 
-          this.queryForm[key] = '';
-        }
+        //   this.queryForm[key] = '';
+        // }
+
+        this.queryParams.pageNum = 1;
+      
+        this.queryParams.pageSize = 10;
+
+        this.params = this.$init.params(SearchColumns);
+
+        this.handleQuery();
       },
       // 刷新
       handleRefresh() {
         this.getMaterialList('material');
-        for (const key in this.queryForm) {
-          this.queryForm[key] = '';
-        }
+        // for (const key in this.queryForm) {
+        //   this.queryForm[key] = '';
+        // }
       },
       // 过滤
       handleFilter(e) {
@@ -495,6 +538,7 @@
       },
       // 获取物料列表信息
       getMaterialList(templateCode, query) {
+        // (params, page)
         let _this = this;
         this.loading = true;
         let page = {
@@ -504,7 +548,8 @@
 
         let param = {
           templateCode,
-          ...this.queryForm
+          ...this.params
+          // ...this.queryForm
         }
         // console.log(param, 'param');
         materialApi.materialList(param, page).then((res) => {
@@ -523,6 +568,24 @@
         materialApi.tagList({templateCode}).then(res => {
           console.log(res, '获取物料列表表头');
           if (res.code == 200) {
+
+            // let dictList = []
+            // res.data.forEach(item =>{
+            //   if(item.dictId){
+            //     // 字典
+            //     dictList.push({
+            //       item:{...item},
+            //       attr:{
+            //         dictName:item.dictId
+            //       }
+            //     });
+                
+            //   }
+            // })
+            // console.log(dictList,'dictList');
+            // console.log(this,'this');
+            // this.dict =[...initDicts([...SearchColumns,...dictList])]
+
             this.tableHeader = res.data;
           }
         })
@@ -565,7 +628,7 @@
 
 <style lang="scss">
   .material-list {
-    height: calc(100vh - 70px);
+    // height: calc(100vh - 70px);
 
 
     .el-card__body {

+ 14 - 3
src/views/purchase/DemandSummary/add.vue

@@ -10,7 +10,8 @@
         <el-button type="primary" size="mini" v-if="lineDisable" @click="reloadBatch">重取批量</el-button>
       </div>
 
-      <el-table 
+      <el-table
+          v-loading="loading"
           :data="tableList" 
           fit
           :cell-style="{ borderColor: '#c0c0c0' }"
@@ -21,6 +22,8 @@
           max-height="580"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
+          @row-click="rowSelect"
+          ref="table"
         >
         <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"/>
@@ -35,7 +38,7 @@
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
         <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
         <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="230"/>
-        <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/>
+        <!-- <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/> -->
         <el-table-column show-overflow-tooltip label="月销量" align="center" prop="totalMonthlySales"/>
         <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod"/>
         <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="120"/>
@@ -170,6 +173,7 @@ export default {
   },
   data() {
     return{
+      loading: true,
       hangStatus(row) {
         switch (row.status) {
           case '0':
@@ -246,6 +250,9 @@ export default {
       this.ids = selection.map(item => item.demandItemId)
       console.log('选中数组', this.ids.join())
     },
+    rowSelect(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
     back() {
       this.$emit('jugislist', true)
       // let queryParams = {
@@ -261,6 +268,10 @@ export default {
         if (res.code === 200) {
           this.tableList = res.data
         }
+      }).then(() => {
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
       })
     },
     editLine() {
@@ -406,6 +417,6 @@ export default {
   justify-content: flex-end;
 } 
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
 </style>

+ 247 - 0
src/views/purchase/DemandSummary/colTol.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="colTol">
+    <el-drawer
+      title="隐藏列"
+      :visible.sync="open"
+      direction="rtl"
+      @close='upIsShow'
+      size="20%">
+      <transition name="fade">
+        <div class="columnOption">
+          <div class="content">
+            <el-row v-for="(item, index) in arrs" :key="index" style="font-size: 14px;font-weight: bold;margin-bottom: 10px;padding: 0 20px;">
+              <el-col :span="18">
+                <span>{{item.label}}</span>
+              </el-col>
+              <el-col :span="6">
+                <el-switch size="mini" v-model="prop[item.prop]"></el-switch>
+              </el-col>
+            </el-row>
+              <!-- <el-switch v-model="prop.materialClassifyOneName">一级品类</el-switch>
+              <el-switch v-model="prop.materialCode">物料编码</el-switch>
+              <el-switch v-model="prop.materialName">品名</el-switch>
+              <el-switch v-model="prop.specification">规格</el-switch>
+              <el-switch v-model="prop.unit">单位</el-switch>
+              <el-switch v-model="prop.manufacturer">生产厂家/代理人</el-switch>
+              <el-switch v-model="prop.demandNum">需求单位数</el-switch>
+              <el-switch v-model="prop.evensalesforyear">近1月月均需求</el-switch>
+              <el-switch v-model="prop.evensalesforthrmonth">近3月月均需求</el-switch>
+              <el-switch v-model="prop.netDemandNum">总最终净需求量</el-switch>
+              <el-switch v-model="prop.totalMonthlySales">总月销量</el-switch>
+              <el-switch v-model="prop.demandCycle">需求可用周期</el-switch>
+              <el-switch v-model="prop.dullQut">呆滞量</el-switch>
+              <el-switch v-model="prop.buyPeriod">采购周期</el-switch>
+              <el-switch v-model="prop.centralPublicStock">中心公共库存</el-switch>
+              <el-switch v-model="prop.centralWarehouse">中心仓专属货位</el-switch>
+              <el-switch v-model="prop.regionPublicStock">区域分仓公共库存</el-switch>
+              <el-switch v-model="prop.eachWarehouseStock">各项目仓库存</el-switch>
+              <el-switch v-model="prop.commerceWarehouse">电商仓库</el-switch>
+              <el-switch v-model="prop.buyTransit">采购在途</el-switch>
+              <el-switch v-model="prop.lendTransit">借出在途</el-switch>
+              <el-switch v-model="prop.transferTransit">调拨在途</el-switch>
+              <el-switch v-model="prop.stockTotal">库存总计</el-switch>
+              <el-switch v-model="prop.minPackage">最小包装量</el-switch>
+              <el-switch v-model="prop.minOrder">最小订货量</el-switch>
+              <el-switch v-model="prop.minBatch">最小批量</el-switch>
+              <el-switch v-model="prop.artificialAdjust">人工调整数</el-switch>
+              <el-switch v-model="prop.modifyReason">修改原因</el-switch>
+              <el-switch v-model="prop.suggestionPurchase">建议采购量</el-switch>
+              <el-switch v-model="prop.finalBuyQty">最终采购量</el-switch>
+              <el-switch v-model="prop.materialClassifyTwoName">二级品类</el-switch>
+              <el-switch v-model="prop.materialClassifyThreeName">三级品类</el-switch>
+              <el-switch v-model="prop.materialClassifyFourName">四级品类</el-switch>
+              <el-switch v-model="prop.buyerName">采购员</el-switch>
+              <el-switch v-model="prop.purchaseOrgName">默认采购组织</el-switch>
+              <el-switch v-model="prop.validityPeriod">有效期</el-switch>
+              <el-switch v-model="prop.validityPeriodUnit">有效期单位</el-switch>
+              <el-switch v-model="prop.businessType">业务类型</el-switch>
+              <el-switch v-model="prop.safetyStock">安全库存量</el-switch>
+              <el-switch v-model="prop.billSource">单据来源</el-switch>
+              <el-switch v-model="prop.registrant">注册人</el-switch>
+              <el-switch v-model="prop.buyDiscrepancy">总需与终采差异</el-switch>
+              <el-switch v-model="prop.forecastClassification">集团预测分类</el-switch>
+              <el-switch v-model="prop.centerBinPossession">中心仓占有量</el-switch>
+              <el-switch v-model="prop.centralWarehouseAvailable">中心仓可用量</el-switch>
+              <el-switch v-model="prop.puManagerAuditor">采购经理审核人</el-switch> -->
+            </div>
+            <!-- <div class="footer">
+              <el-button size="mini" type="primary" plain @click="saveColumn"
+                >确认</el-button
+              >
+            </div> -->
+        </div>
+      </transition>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    isVisible: {
+      type: Boolean,
+      default: false
+    },
+    showColumn: {
+      type: Object,
+      default: {}
+    },
+    arrs: {
+      type: Array,
+      default: []
+    }
+  },
+  data() {
+    return {
+      open: false,
+      // 列的配置化对象,存储配置信息
+      prop: {},
+      column: {
+        status: true,
+        materialClassifyOneName: true,
+        materialCode: true,
+        materialName: true,
+        specification: true,
+        unit: true,
+        manufacturer: true,
+        demandNum: true,
+        evensalesforyear: true,
+        evensalesforthrmonth: true,
+        netDemandNum: true,
+        totalMonthlySales: true,
+        demandCycle: true,
+        dullQut: true,
+        buyPeriod: true,
+        centralPublicStock: true,
+        centralWarehouse: true,
+        regionPublicStock: true,
+        eachWarehouseStock: true,
+        commerceWarehouse: true,
+        buyTransit: true,
+        lendTransit: true,
+        transferTransit: true,
+        stockTotal: true,
+        minPackage: true,
+        minOrder: true,
+        minBatch: true,
+        artificialAdjust: true,
+        modifyReason: true,
+        suggestionPurchase: true,
+        finalBuyQty: true,
+        materialClassifyTwoName: true,
+        materialClassifyThreeName: true,
+        materialClassifyFourName: true,
+        buyerName: true,
+        purchaseOrgName: true,
+        validityPeriod: true,
+        validityPeriodUnit: true,
+        businessType: true,
+        safetyStock: true,
+        billSource: true,
+        registrant: true,
+        buyDiscrepancy: true,
+        forecastClassification: true,
+        centerBinPossession: true,
+        centralWarehouseAvailable: true,
+        puManagerAuditor: true,
+      },
+    }
+  },
+  mounted() {
+    // 发请求得到checkListInitData的列的名字
+    if(localStorage.getItem("columnSet")){
+      this.prop = JSON.parse(localStorage.getItem("columnSet"))
+    }else{
+      this.prop = {
+        status: true,
+        materialClassifyOneName: true,
+        materialCode: true,
+        materialName: true,
+        specification: true,
+        unit: true,
+        manufacturer: true,
+        demandNum: true,
+        evensalesforyear: true,
+        evensalesforthrmonth: true,
+        netDemandNum: true,
+        totalMonthlySales: true,
+        demandCycle: true,
+        dullQut: true,
+        buyPeriod: true,
+        centralPublicStock: true,
+        centralWarehouse: true,
+        regionPublicStock: true,
+        eachWarehouseStock: true,
+        commerceWarehouse: true,
+        buyTransit: true,
+        lendTransit: true,
+        transferTransit: true,
+        stockTotal: true,
+        minPackage: true,
+        minOrder: true,
+        minBatch: true,
+        artificialAdjust: true,
+        modifyReason: true,
+        suggestionPurchase: true,
+        finalBuyQty: true,
+        materialClassifyTwoName: true,
+        materialClassifyThreeName: true,
+        materialClassifyFourName: true,
+        buyerName: true,
+        purchaseOrgName: true,
+        validityPeriod: true,
+        validityPeriodUnit: true,
+        businessType: true,
+        safetyStock: true,
+        billSource: true,
+        registrant: true,
+        buyDiscrepancy: true,
+        forecastClassification: true,
+        centerBinPossession: true,
+        centralWarehouseAvailable: true,
+        puManagerAuditor: true,
+      };
+    }
+  },
+  methods: {
+    upIsShow() {
+      this.$emit('update:isVisible',false)//修改isDrawer的值
+    },
+    //设置列的 显示/隐藏
+	  changeShow(item) {
+      item.show = !item.show
+    },
+    // showColumnOption() {
+    //   this.isShowColumn = true;
+    // },
+    saveColumn() {
+      localStorage.setItem("columnSet",JSON.stringify(this.prop))
+      // this.isShowColumn = false;
+      this.upIsShow()
+    },
+  },
+  watch: {
+    isVisible: {
+      handler(newValue) {
+        this.open = newValue
+      }
+    },
+    // 监听复选框配置列所有的变化
+    prop: {
+      handler: function (newnew, oldold) {
+        console.log('新值',newnew);
+        console.log('获取到表头没有?', this.arrs)
+        this.column = newnew;
+        this.$emit('update:showColumn', this.column)
+        // 这里需要让表格重新绘制一下,否则会产生固定列错位的情况
+        this.$nextTick(() => {
+          // this.$refs.table.doLayout();
+          this.$emit('reDraw')
+        });
+      },
+      deep: true,
+      immediate: true
+    },
+  }
+}
+</script>

+ 133 - 119
src/views/purchase/DemandSummary/index.vue

@@ -22,7 +22,7 @@
             <el-col :span="1.5">
               <el-form-item label="品类">
                 <el-select
-                v-model="queryParams.materialClassifyFourName"
+                v-model="queryParams.materialClassifyFour"
                 size="mini"
                 clearable
                 @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
@@ -45,8 +45,8 @@
             <!-- <el-col :span="1.5"> -->
               <!-- <el-form-item label="" label-width="20px"> -->
                 <div style="position: absolute;top: 3px;right: 10px;">
-                  <el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
-                  <el-button size="mini" icon="el-icon-refresh" plain @click="reset">重置</el-button>
+                  <el-button type="primary" size="mini" @click="search">搜索</el-button>
+                  <el-button size="mini" plain @click="reset">重置</el-button>
                 </div>
               <!-- </el-form-item> -->
             <!-- </el-col> -->
@@ -207,19 +207,14 @@
           <el-button type="primary" size="mini" v-if="lineDisable" @click="audits">审核</el-button>
           <el-button type="primary" size="mini" v-if="lineDisable" @click="closeLine">行关闭</el-button>
 
-          <el-dropdown size="mini" v-if="lineDisable" @command="handleCommand">
-            <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="Excel导出">Excel导出</el-dropdown-item>
-              <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
+          <el-button size="mini" type="primary" style="margin: 0 10px;" v-if="lineDisable" @click="handleCommand">
+            导出
+          </el-button>
 
           <!-- <el-button type="primary" size="mini">转请购</el-button> -->
         </div>
-        <el-table 
+        <el-table
+          v-loading="loading"
           :data="tableList" 
           fit
           :cell-style="{ borderColor: '#c0c0c0' }"
@@ -233,83 +228,86 @@
           max-height="355"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
+          @row-click="rowSelect"
+          @row-dblclick="doubleClick"
+          ref="table"
           :key="isUpdate"
         >
           <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"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="150px"/>
-          <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="150px"/>
-          <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification" width="150px"/>
-          <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
-          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
-          <el-table-column show-overflow-tooltip label="需求单位数" align="center" prop="demandNum" width="100px"/>
-          <el-table-column show-overflow-tooltip label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
-          <el-table-column show-overflow-tooltip label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
-          <el-table-column show-overflow-tooltip label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
-          <el-table-column show-overflow-tooltip label="总月销量" align="center" prop="totalMonthlySales"/>
-          <el-table-column show-overflow-tooltip label="需求可用周期" align="center" prop="demandCycle" width="120px"/>
-          <el-table-column show-overflow-tooltip label="呆滞量" align="center" prop="dullQut"/>
-          <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="buyPeriod"/>
-          <el-table-column show-overflow-tooltip label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
-          <el-table-column show-overflow-tooltip label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
-          <el-table-column show-overflow-tooltip label="区域分仓公共库存" align="center" prop="regionPublicStock" width="150px"/>
-          <el-table-column show-overflow-tooltip label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
-          <el-table-column show-overflow-tooltip label="电商仓库" align="center" prop="commerceWarehouse"/>
-          <el-table-column show-overflow-tooltip label="采购在途" align="center" prop="buyTransit"/>
-          <el-table-column show-overflow-tooltip label="借出在途" align="center" prop="lendTransit"/>
-          <el-table-column show-overflow-tooltip label="调拨在途" align="center" prop="transferTransit"/>
-          <el-table-column show-overflow-tooltip label="库存总计" align="center" prop="stockTotal"/>
-          <el-table-column show-overflow-tooltip label="最小包装量" align="center" prop="minPackage" width="100px"/>
-          <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrder" width="100px"/>
-          <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch"/>
-          <el-table-column show-overflow-tooltip label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
-          <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="modifyReason" width="150px">
+          <el-table-column show-overflow-tooltip  label="序号" type="index" align="center" width="50px" fixed="left"/>
+          <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行号" align="center" prop="rowNo"/> -->
+          <el-table-column show-overflow-tooltip v-if="showColumn.status" label="行状态" align="center" prop="status" width="100px" :formatter="hangStatus"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyOneName" label="一级品类" align="center" prop="materialClassifyOneName" width="80"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialCode" label="物料编码" align="center" prop="materialCode" width="150px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialName" label="品名" align="center" prop="materialName" width="150px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.specification" label="规格" align="center" prop="specification" width="100px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.unit" label="单位" align="center" prop="unit"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.manufacturer" label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.demandNum" label="需求单位数" align="center" prop="demandNum" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.netDemandNum" label="总最终净需求量" align="center" prop="netDemandNum" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales" width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.buyPeriod" label="采购周期" align="center" prop="buyPeriod" width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.centralPublicStock" label="中心公共库存" align="center" prop="centralPublicStock" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouse" label="中心仓专属货位" align="center" prop="centralWarehouse" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.regionPublicStock" label="区域分仓公共库存" align="center" prop="regionPublicStock" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.eachWarehouseStock" label="各项目仓库存" align="center" prop="eachWarehouseStock" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.commerceWarehouse" label="电商仓库" align="center" prop="commerceWarehouse"  width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.buyTransit" label="采购在途" align="center" prop="buyTransit"  width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.lendTransit" label="借出在途" align="center" prop="lendTransit"  width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.transferTransit" label="调拨在途" align="center" prop="transferTransit"  width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.stockTotal" label="库存总计" align="center" prop="stockTotal" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.minPackage" label="最小包装量" align="center" prop="minPackage"  width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.minOrder" label="最小订货量" align="center" prop="minOrder"  width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.minBatch" label="最小批量" align="center" prop="minBatch"  width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.modifyReason" label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
-                <el-input :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason"/>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
-          <!-- <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
-          <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="100">
+          <el-table-column show-overflow-tooltip v-if="showColumn.suggestionPurchase" label="建议采购量" align="center" prop="suggestionPurchase"  width="80px"/>
+          <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
+          <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
             <template slot-scope="scope">
-                <el-input :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
-          <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="120px"/>
-          <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="120px"/>
-          <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyTwoName" label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyThreeName" label="三级品类" align="center" prop="materialClassifyThreeName" width="120px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyFourName" label="四级品类" align="center" prop="materialClassifyFourName" width="120px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.buyerName" label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
                   <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="230px">
+          <el-table-column show-overflow-tooltip v-if="showColumn.purchaseOrgName" label="默认采购组织" align="center" prop="purchaseOrgName" width="150px">
             <!-- <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
                   <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
                 </el-input>
             </template> -->
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="有效期" align="center" prop="validityPeriod"/>
-          <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
-          <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
-          <el-table-column show-overflow-tooltip label="安全库存量" align="center" prop="safetyStock" width="100px"/>
-          <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="billSource" :formatter="formatterSource"/>
-          <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="120px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.validityPeriod" label="有效期" align="center" prop="validityPeriod"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.validityPeriodUnit" label="有效期单位" align="center" prop="validityPeriodUnit" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.businessType" label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.safetyStock" label="安全库存量" align="center" prop="safetyStock" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.billSource" label="单据来源" align="center" prop="billSource" :formatter="formatterSource"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.registrant" label="注册人" align="center" prop="registrant" width="120px"/>
           <!-- <el-table-column label="可用量" align="center" prop="qty"/> -->
-          <el-table-column show-overflow-tooltip label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
-          <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassification" width="120px"/>
-          <el-table-column show-overflow-tooltip label="中心仓占有量" align="center" prop="centerBinPossession" width="120px"/>
-          <el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="120px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.buyDiscrepancy" label="总需与终采差异" align="center" prop="buyDiscrepancy" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.forecastClassification" label="集团预测分类" align="center" prop="forecastClassification" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.centerBinPossession" label="中心仓占有量" align="center" prop="centerBinPossession" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouseAvailable" label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="80px"/>
           <!-- <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/> -->
           <!-- <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/> -->
-          <!-- <el-table-column show-overflow-tooltip label="需求单位" align="center" prop="demandUnit"/> -->
-          <el-table-column show-overflow-tooltip label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
+          <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="需求单位" align="center" prop="demandUnit"/> -->
+          <el-table-column show-overflow-tooltip v-if="showColumn.puManagerAuditor" label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
           <el-table-column
           fixed="right"
           label="操作"
@@ -322,6 +320,10 @@
         </el-table-column>
         </el-table>
 
+        <el-button size="mini" style="position: absolute;left: 20px;bottom: 20px;" @click="tols.open = true">隐藏列</el-button>
+
+        <colTol :isVisible.sync="tols.open" @reDraw="reDraw" :showColumn.sync="showColumn" :arrs.sync="arrs"/>
+
         <el-pagination
           background
           @size-change="handleSizeChange"
@@ -341,12 +343,13 @@
 
     <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
 
-    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
   </div>
 </template>
 
 <script>
 import Add from './add'
+import colTol from './colTol.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import popDialog from '@/components/PopDialog/index.vue'
@@ -357,6 +360,7 @@ export default {
   dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
   components: {
     Add,
+    colTol,
     CollapseTransition,
     Refers,
     TreeRefers,
@@ -364,6 +368,12 @@ export default {
   },
   data() {
     return {
+      loading: true,
+      showColumn: {},
+      arrs:[],
+      tols: {
+        open: false
+      },
       hangStatus(row) {
         switch (row.status) {
           case '0':
@@ -420,7 +430,7 @@ export default {
         rowStatus: ['1'],
         buyer: '',
         buyerName: '',
-        materialClassifyFourName: '',
+        materialClassifyFour: '',
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -480,6 +490,10 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    reDraw() {
+      this.$refs.table.doLayout();
+      console.log(111)
+    },
     // 指定列合计
     getSummaries(param) {
       const { columns, data } = param;
@@ -514,7 +528,7 @@ export default {
         rowStatus: ['1'],
         buyer: '',
         buyerName: '',
-        materialClassifyFourName: '',
+        materialClassifyFour: '',
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -543,7 +557,24 @@ export default {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
+          let arrs = []
+          this.$refs.table.$children.forEach(item => {
+            if (item.label != undefined && item.prop != undefined) {
+              arrs.push({
+                label: item.label,
+                prop: item.prop
+              })
+            }
+          })
+          this.arrs = arrs
+          console.log('获取表头数据', arrs)
         }
+      }).then(() => {
+        // 合计不显示重绘
+        this.$refs.table.doLayout()
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
       })
     },
     handleSelectionChange(selection) {
@@ -552,54 +583,26 @@ export default {
       this.ids = selection.map(item => item.demandItemId)
       console.log('选中数组', this.ids.join())
     },
-    handleCommand(command) {
-      if(command == 'Excel导出') {
-        if(this.allSelection.length == 0) {
-          this.$modal.notifyWarning("请选中至少一条数据");
-        } else {
-          exportList(this.allSelection).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 = '导出Excel'; // 下载后文件名
-            document.body.appendChild(downloadElement);
-            downloadElement.click(); // 点击下载
-            document.body.removeChild(downloadElement); // 下载完成移除元素
-            window.URL.revokeObjectURL(href); // 释放blob对象
-          })
-        }
-      }
-
-      if (command == '导出明细') {
-        if (this.allSelection.length == 0 || this.allSelection.length > 1) {
-          this.$modal.notifyWarning("明细只能进行单条导出!");
-        } else {
-          let param = this.queryParams
-          param.sumFlag = this.allSelection[0].sumFlag
-          exportItems(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对象
-          })
-        }
-      }
+    handleCommand() {
+      this.$modal.loading("正在导出数据,请稍后...");
+      let param = this.queryParams
+      exportItems(param).then(res => {
+        this.$modal.closeLoading();
+        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 = '采购需求处理导出'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
+      })
     },
     check(row) {
       this.isList = false
@@ -607,6 +610,16 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    // 表格选中数据
+    rowSelect(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`);
       this.queryParams.pageSize = val
@@ -761,13 +774,14 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialClassifyFourName = selection.name
+      this.queryParams.materialClassifyFour = selection.name
     },
     // 搜索区物料编码
     chooseMaterial() {
       this.$refs.materialRefer.init()
     },
     selectMaterial(selection) {
+      console.log('选择的物料', selection)
       this.queryParams.materialCode = selection[0].code
       this.queryParams.names = selection[0].name
     },
@@ -808,7 +822,7 @@ export default {
   text-align: right;
 }
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;

+ 20 - 16
src/views/purchase/MaterialClassDivision/add.vue

@@ -6,7 +6,7 @@
       <el-row :gutter="10">
         <el-col :span="1.5">
             <el-form-item label="物料分类编码">
-              <el-input :disabled="disable"  size="mini" style="width: 200px" readonly v-model="basicForm.materialClassify">
+              <el-input :disabled="sonDisable"  size="mini" style="width: 200px" readonly v-model="basicForm.materialClassify">
                 <el-button slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
               </el-input>
             </el-form-item>
@@ -86,7 +86,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料编码">
-              <el-input :disabled="disable" style="width: 200px" size="mini" readonly v-model="basicForm.materialCode">
+              <el-input :disabled="sonDisable" style="width: 200px" size="mini" readonly v-model="basicForm.materialCode">
                   <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
               </el-input>
               <el-input v-show="false" style="width: 200px" size="mini" v-model="basicForm.material"></el-input>
@@ -110,7 +110,7 @@
               <el-input
                 v-model="basicForm.manufacturer"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -124,7 +124,7 @@
                     v-model="basicForm.org"
                     size="mini"
                     style="width: 200px"
-                    :disabled="disable"
+                    :disabled="sonDisable"
                     clearable
                     @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
                   >
@@ -144,7 +144,7 @@
                   ref="staffs"
                   size="mini"
                   style="width: 200px"
-                  :disabled="disable"
+                  :disabled="sonDisable"
                   v-model="basicForm.orderPersonal"
                   clearable
                   @clear="clean('订单员')"
@@ -177,7 +177,7 @@
                   ref="staffs2"
                   size="mini"
                   style="width: 200px"
-                  :disabled="disable"
+                  :disabled="sonDisable"
                   v-model="basicForm.buyer"
                   clearable
                   @clear="clean('采购员')"
@@ -222,7 +222,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -232,15 +232,12 @@
     </el-form>
 
     <div class="btn_group">
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
-      </el-col>
+      <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check'">编辑</el-button>
+        <el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
       <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
+        <el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'edit'">提交</el-button>
       </el-col> -->
-      <el-col :span="1.5">
         <el-button size="mini" plain @click="back">返回</el-button>
-      </el-col>
     </div>
     </el-card>
     <fourClass
@@ -287,6 +284,9 @@ export default {
   },
   data() {
     return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       basicForm: {
         materialClassify: '',
         materialClassifyName: '',
@@ -338,7 +338,7 @@ export default {
   },
   methods: {
     save() {
-      if(this.pageStu == 'add') {
+      if(this.sonPageStu == 'add') {
         this.$modal.loading("保存中...");
         addDivision(this.basicForm).then(res => {
           if (res.code === 200) {
@@ -349,7 +349,7 @@ export default {
         }).catch(err => {
           this.$modal.closeLoading();
         })
-      } else if(this.pageStu == 'edit') {
+      } else if(this.sonPageStu == 'edit') {
         this.$modal.loading("保存中...");
         editDivision(this.basicForm).then(res => {
           this.$modal.notifySuccess("编辑成功");
@@ -360,6 +360,10 @@ export default {
         })
       }
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     submit() {},
     back() {
       this.$emit('jugislist', true)
@@ -475,7 +479,7 @@ export default {
   // width: 100%;
   // margin: 20px 0;
   display: flex;
-  // justify-content: center;
+  justify-content: space-between;
   position: absolute;
   top: 10px;right: 20px;
 } 

+ 16 - 3
src/views/purchase/MaterialClassDivision/index.vue

@@ -47,8 +47,8 @@
           <!-- <el-col :span="1.5"> -->
             <!-- <el-form-item label="" label-width="20px"> -->
             <div style="position: absolute;top: 3px;right: 10px;">
-              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+              <el-button size="mini" plain @click="resetList">重置</el-button>
             </div>
             <!-- </el-form-item> -->
           <!-- </el-col> -->
@@ -219,6 +219,9 @@
           max-height="390"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
+          @row-click="rowSelect"
+          @row-dblclick="doubleClick"
+          ref="table"
         >
           <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"/>
@@ -403,6 +406,10 @@ export default {
       console.log('选中', selection)
       this.allSelection = selection
     },
+    // 表格选中数据
+    rowSelect(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
     handleCommand(command) {
       alert(command)
     },
@@ -417,6 +424,12 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
     edit(row) {
       this.isList = false
       this.page = 'edit'
@@ -499,7 +512,7 @@ export default {
   margin-top: 0;
 }
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 351 - 406
src/views/purchase/PurchaseDemandList/add.vue


+ 31 - 9
src/views/purchase/PurchaseDemandList/index.vue

@@ -5,7 +5,7 @@
         <el-form class="search_area" label-width="100px">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="单据编码">
+              <el-form-item label="需求单号">
                 <el-input
                   v-model.trim="queryParams.code"
                   size="mini"
@@ -43,8 +43,8 @@
             <!-- <el-col :span="1.5"> -->
               <!-- <el-form-item label="" label-width="20px"> -->
                 <div style="position: absolute;top: 3px;right: 10px;">
-                  <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-                  <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+                  <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+                  <el-button size="mini" plain @click="resetList">重置</el-button>
                 </div>
               <!-- </el-form-item> -->
             <!-- </el-col> -->
@@ -159,7 +159,8 @@
           <!-- <el-button type="primary" size="mini">打印</el-button> -->
         </div>
         
-        <el-table 
+        <el-table
+          v-loading="loading"
           :data="tableList" 
           fit
           :cell-style="{ borderColor: '#c0c0c0' }"
@@ -170,10 +171,13 @@
           highlight-current-row
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
+          @row-click="rowSelect"
+          @row-dblclick="doubleClick"
+          ref="tables"
         >
           <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="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"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
@@ -185,7 +189,6 @@
           <!-- <el-table-column show-overflow-tooltip label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
           <!-- <el-table-column show-overflow-tooltip label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
           <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
-          <el-table-column show-overflow-tooltip label="组织" align="center" width="200" prop="orgName"/>
           <el-table-column show-overflow-tooltip label="备注" align="center" width="150" prop="remark" />
           <el-table-column
           fixed="right"
@@ -310,6 +313,7 @@ export default {
   dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
   data() {
     return {
+      loading: true,
       // 导入参数
       upload: {
         // 是否显示弹出层(导入)
@@ -457,6 +461,10 @@ export default {
           this.tableList = res.rows
           this.total = res.total
         }
+      }).then(() => {
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
       })
     },
     handleSelectionChange(selection) {
@@ -530,8 +538,10 @@ export default {
         if (this.ids.length == 0) {
           this.$modal.notifyWarning("请选中至少一条数据");
         } else {
+          this.$modal.loading("正在导出数据,请稍后...");
           let param = {all: false, ids: this.ids}
           exportDemand(param).then(res => {
+            this.$modal.closeLoading();
             const blob = new Blob([res], {
               type: "application/vnd.ms-excel;charset=UTF-8",
             });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
@@ -541,7 +551,7 @@ export default {
             // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
             // var name = fileName.split(";")[0]; //切割成文件名
             downloadElement.href = href;  //下载地址
-            downloadElement.download = '选中导出'; // 下载后文件名
+            downloadElement.download = '采购需求单选中导出' + this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
             document.body.appendChild(downloadElement);
             downloadElement.click(); // 点击下载
             document.body.removeChild(downloadElement); // 下载完成移除元素
@@ -549,8 +559,10 @@ export default {
           })
         }
       } else {
+        this.$modal.loading("正在导出数据,请稍后...");
         let param2 = {all: true}
         exportDemand(param2).then(res => {
+          this.$modal.closeLoading();
           const blob = new Blob([res], {
             type: "application/vnd.ms-excel;charset=UTF-8",
           });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
@@ -560,7 +572,7 @@ export default {
           // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
           // var name = fileName.split(";")[0]; //切割成文件名
           downloadElement.href = href;  //下载地址
-          downloadElement.download = '全部导出'; // 下载后文件名
+          downloadElement.download = '采购需求单全部导出' + this.parseTime(new Date().getTime()) + ".xlsx"; 
           document.body.appendChild(downloadElement);
           downloadElement.click(); // 点击下载
           document.body.removeChild(downloadElement); // 下载完成移除元素
@@ -579,6 +591,16 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    // 表格选中数据
+    rowSelect(row) {
+      this.$refs.tables.toggleRowSelection(row);
+    },
     edit(row) {
       this.isList = false
       this.page = 'edit'
@@ -727,7 +749,7 @@ export default {
   text-align: right;
 }
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
  ::v-deep .el-card .el-form-item {
   margin-bottom: 10px;

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

@@ -282,6 +282,130 @@ export default function useColumns() {
             value: "N",
           },
         },
+
+        {
+          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },{
+          item: { width:100,key: "priceDiffer", title: "单价差" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "increase", title: "涨幅" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+        {
+          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName", title: "供应商名称" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice", title: "中标价" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice", title: "单价" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit", title: "利润比" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName1", title: "供应商名称1" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice1", title: "单价1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit1", title: "利润比1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName2", title: "供应商名称2" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice2", title: "单价2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit2", title: "利润比2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

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

@@ -241,6 +241,7 @@ export default {
             :ref="tabName"
             :columns="columns"
             :size="$attrs.size"
+            style="padding: 20px 10px;height: 400px;"
           >
             <template slot="materialName" slot-scope="scope">
               <component

+ 27 - 15
src/views/purchase/apply/columns.js

@@ -2,35 +2,35 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "priceCode", title: "价格编码" }, attr: {} },
+    { item: { key: "priceCode", title: "价格编码" ,  width:150 }, attr: {} },
     {
-      item: { key: "status", title: "状态" },
-      attr: { is: "el-dict-tag", dictName: "sys_status" },
+      item: { key: "status", title: "状态" ,  width:100},
+      attr: { is: "el-dict-tag", dictName: "sys_status",  width:100 },
     },
-    { item: { key: "supplierName", title: "供应商" }, attr: {} },
-    { item: { key: "currencyName", title: "币种" }, attr: {} },
+    { item: { key: "supplierName", title: "供应商" ,  width:150}, attr: {} },
+    { item: { key: "currencyName", title: "币种" ,  width:100}, attr: {} },
     {
-      item: { key: "explainStr", title: "价格合理性说明" },
+      item: { key: "explainStr", title: "价格合理性说明" ,  width:100},
       attr: {},
     },
-    { item: { key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { key: "puDeptName", title: "采购部门" }, attr: {} },
+    { item: { key: "buyerName", title: "采购员",  width:100 }, attr: {} },
+    { item: { key: "puDeptName", title: "采购部门" ,  width:100}, attr: {} },
     {
-      item: { key: "file", title: "附件", filter: false },
+      item: { key: "file", title: "附件", filter: false,  width:100 },
       attr: { is: "el-file-preview" },
     },
-    { item: { key: "createByName", title: "创建人" }, attr: {} },
+    { item: { key: "createByName", title: "创建人",  width:100 }, attr: {} },
     {
-      item: { key: "isEffective", title: "是否已推价格" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      item: { key: "isEffective", title: "是否已推价格" ,  width:100},
+      attr: { is: "el-dict-tag", dictName: "is_effective" ,  width:100},
     },
     {
-      item: { key: "effectiveDate", title: "生效日期" },
+      item: { key: "effectiveDate", title: "生效日期" ,  width:100},
       attr: {},
     },
-    { item: { key: "source", title: "来源单据号" }, attr: {} },
+    { item: { key: "source", title: "来源单据号",  width:100 }, attr: {} },
     {
-      item: { key: "sourceType", title: "来源单据类型" },
+      item: { key: "sourceType", title: "来源单据类型" ,  width:100},
       attr: {},
     },
   ].map(({ item, attr }) => ({
@@ -44,7 +44,19 @@ export default function useColumns() {
     },
   }));
   const SearchColumns = [
+    
+    { 
+      item:{
+        key: "priceCode",
+        title: "价格编码", 
+      },
+      attr: {
+        clearable:true,
+        is: "el-input",
+      },
+    },
     {
+      
       item: { key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",

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

@@ -281,6 +281,128 @@ export default function useColumns() {
             value: "N",
           },
         },
+        {
+          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },{
+          item: { width:100,key: "priceDiffer", title: "单价差" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "increase", title: "涨幅" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+        {
+          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName", title: "供应商名称" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice", title: "中标价" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice", title: "单价" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit", title: "利润比" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName1", title: "供应商名称1" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice1", title: "单价1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit1", title: "利润比1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName2", title: "供应商名称2" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice2", title: "单价2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit2", title: "利润比2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

+ 8 - 0
src/views/purchase/apply/copy/index.vue

@@ -116,9 +116,17 @@ export default {
       try {
         // try
         this.loading = true;
+        const { tabName, TabColumns } = this;
+        const { TableColumns } = TabColumns.find(
+          ({ item: { key } }) => key === tabName
+        );
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
+            ...this.$init.params(TableColumns),
+            ...item,
+          }));
           return true;
         } else {
           return false;

+ 124 - 0
src/views/purchase/apply/edit/columns.js

@@ -281,6 +281,130 @@ export default function useColumns() {
             value: "N",
           },
         },
+
+        {
+          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },
+        {
+          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-select",
+            dictName: "is_effective",
+            value: "N",
+          },
+        },{
+          item: { width:100,key: "priceDiffer", title: "单价差" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "increase", title: "涨幅" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+        {
+          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName", title: "供应商名称" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice", title: "中标价" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice", title: "单价" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit", title: "利润比" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName1", title: "供应商名称1" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice1", title: "单价1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit1", title: "利润比1" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
+        {
+          item: { width:150,key: "supplierName2", title: "供应商名称2" },
+          attr: {is: "el-input"},
+        },{
+          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "unitPrice2", title: "单价2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },{
+          item: { width:150,key: "profit2", title: "利润比2" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+          },
+        },
+
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

+ 9 - 0
src/views/purchase/apply/edit/index.vue

@@ -139,9 +139,17 @@ export default {
       try {
         // try
         this.loading = true;
+        const { tabName, TabColumns } = this;
+        const { TableColumns } = TabColumns.find(
+          ({ item: { key } }) => key === tabName
+        );
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
+            ...this.$init.params(TableColumns),
+            ...item,
+          }));
           return true;
         } else {
           return false;
@@ -299,6 +307,7 @@ export default {
             :ref="tabName"
             :columns="columns"
             :size="$attrs.size"
+            style="padding: 20px 10px;height: 400px;"
           >
             <template slot="materialName" slot-scope="scope">
               <component

+ 1 - 4
src/views/purchase/apply/index.vue

@@ -62,7 +62,6 @@ export default {
     },
     // 查 询
     useQuery(prop, page) {
-      this.selectData = [];
       this.fetchList(prop, page);
     },
     // 重 置
@@ -73,7 +72,6 @@ export default {
     },
     // 选 择
     useSelect(prop) {
-      console.log("prop", prop);
       this.selectData = prop;
     },
     // 明 细
@@ -105,8 +103,7 @@ export default {
     ></el-super-search>
     <el-row class="my-4" style="text-align: right">
       <el-button-group>
-        <add-button :size="size" :dict="dict" @success="useQuery(params, page)">
-        </add-button>
+        <add-button :size="size" :dict="dict" @success="useQuery(params, page)"></add-button>
         <copy-button
           :size="size"
           :dict="dict"

+ 183 - 41
src/views/purchase/apply/see/columns.js

@@ -3,62 +3,62 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "priceCode", title: "价格编码" },
+      item: { width:100,key: "priceCode", title: "价格编码" },
       attr: {},
     },
     {
-      item: { key: "supplierName", title: "供应商" },
+      item: { width:100,key: "supplierName", title: "供应商" },
       attr: {},
     },
     {
-      item: { key: "puOrgName", title: "采购组织" },
+      item: { width:100,key: "puOrgName", title: "采购组织" },
       attr: {},
     },
     {
-      item: { key: "currencyName", title: "币种" },
+      item: { width:100,key: "currencyName", title: "币种" },
       attr: {},
     },
     {
-      item: { key: "explainStr", title: "价格合理性说明" },
+      item: { width:100,key: "explainStr", title: "价格合理性说明" },
       attr: {},
     },
     {
-      item: { key: "buyerName", title: "采购员" },
+      item: { width:100,key: "buyerName", title: "采购员" },
       attr: {},
     },
     {
-      item: { key: "puDeptName", title: "采购部门" },
+      item: { width:100,key: "puDeptName", title: "采购部门" },
       attr: {},
     },
     {
-      item: { key: "createByName", title: "创建人" },
+      item: { width:100,key: "createByName", title: "创建人" },
       attr: {},
     },
     {
-      item: { key: "source", title: "来源单据号" },
+      item: { width:100,key: "source", title: "来源单据号" },
       attr: {},
     },
     {
-      item: { key: "isEffective", title: "是否已推价格" },
+      item: { width:100,key: "isEffective", title: "是否已推价格" },
       attr: {
         is: "el-dict-tag",
         dictName: "is_effective",
       },
     },
     {
-      item: { key: "effectiveDate", title: "生效日期" },
+      item: { width:100,key: "effectiveDate", title: "生效日期" },
       attr: {},
     },
     {
-      item: { key: "file", title: "附件" },
+      item: { width:100,key: "file", title: "附件" },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { key: "sourceType", title: "来源单据类型" },
+      item: { width:100,key: "sourceType", title: "来源单据类型" },
       attr: {},
     },
     {
-      item: { key: "status", title: "单据状态" },
+      item: { width:100,key: "status", title: "单据状态" },
       attr: {
         is: "el-dict-tag",
         dictName: "sys_status",
@@ -70,111 +70,253 @@ export default function useColumns() {
     {
       item: {
         title: "物料信息表",
-        key: "priceApplyItems",
+        width:100,key: "priceApplyItems",
       },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { key: "materialName", title: "物料名称" },
+          item: { width:100,key: "materialName", title: "物料名称" },
           attr: {},
         },
-        { item: { key: "materialCode", title: "物料编码" }, attr: {} },
-        { item: { key: "manufacturerName", title: "生产厂家" }, attr: {} },
-        { item: { key: "specification", title: "规格" }, attr: {} },
-        { item: { key: "model", title: "型号" }, attr: {} },
+        { item: { width:100,key: "materialCode", title: "物料编码" }, attr: {} },
+        { item: { width:100,key: "manufacturerName", title: "生产厂家" }, attr: {} },
+        { item: { width:100,key: "specification", title: "规格" }, attr: {} },
+        { item: { width:100,key: "model", title: "型号" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位" },
+          item: { width:100,key: "unitName", title: "单位" },
           attr: {},
         },
         {
-          item: { key: "puUnitName", title: "采购单位" },
+          item: { width:100,key: "puUnitName", title: "采购单位" },
           attr: {},
         },
         {
-          item: { key: "conversionRate", title: "采购换算率" },
+          item: { width:100,key: "conversionRate", title: "采购换算率" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
             },
           },
         },
         {
-          item: { key: "tax", title: "税率%" },
+          item: { width:100,key: "tax", title: "税率%" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
             },
           },
         },
         {
-          item: { key: "taxPrice", title: "含税单价" },
+          item: { width:100,key: "taxPrice", title: "含税单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
             },
           },
         },
         {
-          item: { key: "price", title: "无税单价" },
+          item: { width:100,key: "price", title: "无税单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
             },
           },
         },
         {
-          item: { key: "currencyName", title: "币种" },
+          item: { width:100,key: "currencyName", title: "币种" },
           attr: {},
         },
         {
-          item: { key: "periodBegin", title: "价格有效期(起)" },
+          item: { width:100,key: "periodBegin", title: "价格有效期(起)" },
           attr: {},
         },
         {
-          item: { key: "periodEnd", title: "价格有效期(止)" },
+          item: { width:100,key: "periodEnd", title: "价格有效期(止)" },
           attr: {},
         },
         {
-          item: { key: "customerName", title: "客户" },
+          item: { width:100,key: "customerName", title: "客户" },
           attr: {},
         },
-        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        { item: { width:100,key: "recentlyPrice", title: "最近价格" }, attr: {} },
         {
-          item: { key: "isApprovalFirst", title: "首次报批" },
+          item: { width:100,key: "isApprovalFirst", title: "首次报批" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
         },
         {
-          item: { key: "isPriceAdjustment", title: "价格调整" },
+          item: { width:100,key: "isPriceAdjustment", title: "价格调整" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
         },
         {
-          item: { key: "priceType", title: "价格类型" },
+          item: { width:100,key: "priceType", title: "价格类型" },
           attr: {
             is: "el-dict-tag",
             dictName: "sys_price_type",
           },
         },
         {
-          item: { key: "isDistributionPrice", title: "配送价" },
+          item: { width:100,key: "isDistributionPrice", title: "配送价" },
           attr: {
             is: "el-dict-tag",
             dictName: "is_effective",
           },
         },
-        { item: { key: "createByName", title: "创建人名称" }, attr: {} },
-        { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+
+        {
+          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "is_effective",
+          },
+        },
+        {
+          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          attr: {
+            is: "el-dict-tag",
+            dictName: "is_effective",
+          },
+        },{
+          item: { width:100,key: "priceDiffer", title: "单价差" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "increase", title: "涨幅" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+        {
+          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "supplierName", title: "供应商名称" },
+          attr: {},
+        },{
+          item: { width:100,key: "bidPrice", title: "中标价" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },{
+          item: { width:100,key: "unitPrice", title: "单价" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },{
+          item: { width:100,key: "profit", title: "利润比" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "supplierName1", title: "供应商名称1" },
+          attr: {},
+        },{
+          item: { width:100,key: "bidPrice1", title: "中标价1" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },{
+          item: { width:100,key: "unitPrice1", title: "单价1" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },{
+          item: { width:100,key: "profit1", title: "利润比1" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+        {
+          item: { width:100,key: "supplierName2", title: "供应商名称2" },
+          attr: {},
+        },{
+          item: { width:100,key: "bidPrice2", title: "中标价2" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },{
+          item: { width:100,key: "unitPrice2", title: "单价2" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },{
+          item: { width:100,key: "profit2", title: "利润比2" },
+          attr: {
+            is: "el-computed-input-v2",
+            formatter: (prop) => {
+              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+            },
+          },
+        },
+
+
+
+        { item: { width:100,key: "createByName", title: "创建人名称" }, attr: {} },
+        { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
       ],
     },
   ];

+ 35 - 35
src/views/purchase/catalogue/columns.js

@@ -3,22 +3,22 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织" },
+      item: { width:100,key: "puOrgName", title: "采购组织" },
       attr: {},
     },
-    { item: { key: "materialName", title: "物料" }, attr: {} },
-    { item: { key: "materialCode", title: "物料编码" }, attr: {} },
-    { item: { key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
-    { item: { key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
-    { item: { key: "model", title: "物料型号" }, attr: {} },
-    { item: { key: "specification", title: "物料规格" }, attr: {} },
+    { item: { width:150,key: "materialName", title: "物料" }, attr: {} },
+    { item: { width:150,key: "materialCode", title: "物料编码" }, attr: {} },
+    { item: { width:100,key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
+    { item: { width:100,key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
+    { item: { width:100,key: "model", title: "物料型号" }, attr: {} },
+    { item: { width:100,key: "specification", title: "物料规格" }, attr: {} },
     {
-      item: { key: "supplierName", title: "供应商名称" },
+      item: { width:100,key: "supplierName", title: "供应商名称" },
       attr: {},
     },
-    { item: { key: "customerName", title: "客户" }, attr: {} },
+    { item: { width:100,key: "customerName", title: "客户" }, attr: {} },
     {
-      item: { key: "taxPrice", title: "主含税单价" },
+      item: { width:100,key: "taxPrice", title: "主含税单价" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -26,13 +26,13 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "unitName", title: "主单位" }, attr: {} },
-    { item: { key: "effectiveDate", title: "价格生效日期" }, attr: {} },
-    { item: { key: "endDate", title: "价格失效日期" }, attr: {} },
-    { item: { key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { key: "applyCode", title: "来源单据" }, attr: {} },
+    { item: { width:100,key: "unitName", title: "主单位" }, attr: {} },
+    { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
+    { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
+    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width:100,key: "applyCode", title: "来源单据" }, attr: {} },
     {
-      item: { key: "convertRate", title: "换算率" },
+      item: { width:100,key: "convertRate", title: "换算率" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -41,29 +41,29 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "status", title: "有效状态" },
+      item: { width:100,key: "status", title: "有效状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "enableStatus", title: "启用状态" },
+      item: { width:100,key: "enableStatus", title: "启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "materialStatus", title: "物料启用状态" },
+      item: { width:100,key: "materialStatus", title: "物料启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "isDistribution", title: "配送价" },
+      item: { width:100,key: "isDistribution", title: "配送价" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "priceType", title: "价格类型" },
+      item: { width:100,key: "priceType", title: "价格类型" },
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { key: "expiryEarly", title: "效期预警" }, attr: {} },
-    { item: { key: "priority", title: "含税/无税优先" }, attr: {} },
-    { item: { key: "createByName", title: "创建人" }, attr: {} },
-    { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+    { item: { width:100,key: "expiryEarly", title: "效期预警" }, attr: {} },
+    { item: { width:100,key: "priority", title: "含税/无税优先" }, attr: {} },
+    { item: { width:100,key: "createByName", title: "创建人" }, attr: {} },
+    { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
   ].map(({ item, attr }) => ({
     attr,
     item: {
@@ -77,11 +77,11 @@ export default function useColumns() {
 
   const SearchColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织" },
+      item: { width:100,key: "puOrgName", title: "采购组织" },
       attr: {
         is: "el-popover-select-v2",
         referName: "ORG_PARAM",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         dataMapping: {
           puOrg: "id",
           puOrgName: "name",
@@ -89,15 +89,15 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "manufacturer", title: "生产厂家" },
+      item: { width:100,key: "manufacturer", title: "生产厂家" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "supplierName", title: "供应商" },
+      item: { width:100,key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",
         referName: "SUPPLIER_PARAM",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         dataMapping: {
           supplier: "id",
           supplierName: "name",
@@ -105,15 +105,15 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "applyCode", title: "来源单据" },
+      item: { width:100,key: "applyCode", title: "来源单据" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "materialCode", title: "物料编码" },
+      item: { width:100,key: "materialCode", title: "物料编码" },
       attr: {
         is: "el-popover-select-v2",
         referName: "MATERIAL_PARAM",
-        valueKey: "code",
+        valuewidth:100,key: "code",
         dataMapping: {
           material: "id",
           materialCode: "code",
@@ -121,11 +121,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "status", title: "有效状态" },
+      item: { width:100,key: "status", title: "有效状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
     {
-      item: { key: "enableStatus", title: "启用状态" },
+      item: { width:100,key: "enableStatus", title: "启用状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
   ];

+ 0 - 1
src/views/purchase/catalogue/index.vue

@@ -58,7 +58,6 @@ export default {
     },
     // 查 询
     useQuery(prop, page) {
-      this.selectData = [];
       this.fetchList(prop, page);
     },
     // 重 置

+ 25 - 25
src/views/purchase/catalogue/see/columns.js

@@ -3,22 +3,22 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织" },
+      item: { width:100,key: "puOrgName", title: "采购组织" },
       attr: {},
     },
-    { item: { key: "materialName", title: "物料" }, attr: {} },
-    { item: { key: "materialCode", title: "物料编码" }, attr: {} },
-    { item: { key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
-    { item: { key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
-    { item: { key: "model", title: "物料型号" }, attr: {} },
-    { item: { key: "specification", title: "物料规格" }, attr: {} },
+    { item: { width:100,key: "materialName", title: "物料" }, attr: {} },
+    { item: { width:100,key: "materialCode", title: "物料编码" }, attr: {} },
+    { item: { width:100,key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
+    { item: { width:100,key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
+    { item: { width:100,key: "model", title: "物料型号" }, attr: {} },
+    { item: { width:100,key: "specification", title: "物料规格" }, attr: {} },
     {
-      item: { key: "supplierName", title: "供应商名称" },
+      item: { width:100,key: "supplierName", title: "供应商名称" },
       attr: {},
     },
-    { item: { key: "customerName", title: "客户" }, attr: {} },
+    { item: { width:100,key: "customerName", title: "客户" }, attr: {} },
     {
-      item: { key: "taxPrice", title: "主含税单价" },
+      item: { width:100,key: "taxPrice", title: "主含税单价" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -26,13 +26,13 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "unitName", title: "主单位" }, attr: {} },
-    { item: { key: "effectiveDate", title: "价格生效日期" }, attr: {} },
-    { item: { key: "endDate", title: "价格失效日期" }, attr: {} },
-    { item: { key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { key: "source", title: "来源单据" }, attr: {} },
+    { item: { width:100,key: "unitName", title: "主单位" }, attr: {} },
+    { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
+    { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
+    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width:100,key: "source", title: "来源单据" }, attr: {} },
     {
-      item: { key: "convertRate", title: "换算率" },
+      item: { width:100,key: "convertRate", title: "换算率" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -41,29 +41,29 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "status", title: "有效状态" },
+      item: { width:100,key: "status", title: "有效状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "enableStatus", title: "启用状态" },
+      item: { width:100,key: "enableStatus", title: "启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "materialStatus", title: "物料启用状态" },
+      item: { width:100,key: "materialStatus", title: "物料启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "isDistribution", title: "配送价" },
+      item: { width:100,key: "isDistribution", title: "配送价" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { key: "priceType", title: "价格类型" },
+      item: { width:100,key: "priceType", title: "价格类型" },
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { key: "expiryEarly", title: "效期预警" }, attr: {} },
-    { item: { key: "priority", title: "含税/无税优先" }, attr: {} },
-    { item: { key: "createByName", title: "创建人" }, attr: {} },
-    { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
+    { item: { width:100,key: "expiryEarly", title: "效期预警" }, attr: {} },
+    { item: { width:100,key: "priority", title: "含税/无税优先" }, attr: {} },
+    { item: { width:100,key: "createByName", title: "创建人" }, attr: {} },
+    { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
   ].map(({ item, attr }) => ({
     attr,
     item: { ...item, hidden: true, fixed: false },

+ 47 - 45
src/views/purchase/contract/add/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,width:150 },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -14,7 +14,7 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "code", title: "合同编码" }, attr: { is: "el-input" } },
+    { item: { key: "code", title: "合同编码",width:150 }, attr: { is: "el-input" } },
     {
       item: { key: "status", title: "状态" },
       attr: {
@@ -25,14 +25,14 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "lastPuMoney", title: "上年度采购额" },
+      item: { key: "lastPuMoney", title: "上年度采购额",width:100 },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { key: "buyerName", title: "采购员", require: true,width:100 },
       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,width:100 },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -58,18 +58,18 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractType", title: "合同类型", require: true },
+      item: { key: "contractType", title: "合同类型", require: true ,width:100},
       attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
     },
     {
-      item: { key: "puMoneyYear", title: "本年度采购额" },
+      item: { key: "puMoneyYear", title: "本年度采购额",width:100 },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { key: "puDeptName", title: "采购部门", require: true ,width:100},
       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 ,width:100},
       attr: { is: "el-select", dictName: "puarchase_contract_supplier_tier" },
     },
     {
-      item: { key: "contractName", title: "合同名称", require: true },
+      item: { key: "contractName", title: "合同名称", require: true ,width:100},
       attr: { is: "el-input" },
     },
     {
-      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
+      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true,width:100 },
       attr: {
         is: "el-input-number",
         precision: 2,
       },
     },
     {
-      item: { key: "approveFlow", title: "审批流程", require: true },
+      item: { key: "approveFlow", title: "审批流程", require: true,width:100 },
       attr: { is: "el-select", dictName: "puarchase_contract_approve_flow" },
     },
     {
-      item: { key: "consumableClass", title: "耗材类别", require: true },
+      item: { key: "consumableClass", title: "耗材类别", require: true,width:100 },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { key: "effectiveDate", title: "合同生效日期", require: true },
+      item: { key: "effectiveDate", title: "合同生效日期", require: true,width:100 },
       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,width:100 },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { key: "productName", title: "产品类别&名称", require: true },
+      item: { key: "productName", title: "产品类别&名称", require: true,width:100 },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "endDate", title: "合同终止日期", require: true },
+      item: { key: "endDate", title: "合同终止日期", require: true ,width:100},
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "invoiceTax", title: "发票税率 (%)", require: true },
+      item: { key: "invoiceTax", title: "发票税率 (%)", require: true ,width:100},
       attr: {
         is: "el-popover-select-v2",
         valueKey: "ntaxrate",
@@ -151,26 +151,26 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "emergencyDegree", title: "紧急程度", require: true },
+      item: { key: "emergencyDegree", title: "紧急程度", require: true,width:100 },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
     {
-      item: { key: "project", title: "项目医院", require: true },
+      item: { key: "project", title: "项目医院", require: true,width:100 },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "deliveryType", title: "交货方式", require: true },
+      item: { key: "deliveryType", title: "交货方式", require: true,width:100 },
       attr: { is: "el-select", dictName: "puarchase_contract_delivery_type" },
     },
     {
-      item: { key: "source", title: "合同来源" },
+      item: { key: "source", title: "合同来源",width:100 },
       attr: { is: "el-input", value: "自制", disabled: true },
     },
     {
-      item: { key: "contractPartycName", title: "合同丙方" },
+      item: { key: "contractPartycName", title: "合同丙方",width:100 },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -182,30 +182,30 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
+      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true,width:100 },
       attr: { is: "el-input-number", precision: 2 },
     },
     {
-      item: { key: "freightMethods", title: "运费承担方式" },
+      item: { key: "freightMethods", title: "运费承担方式",width:100 },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_freight_methods",
       },
     },
     {
-      item: { key: "signDate", title: "合同签订日期" },
+      item: { key: "signDate", title: "合同签订日期",width:100 },
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "isTarget", title: "是否有指标" },
+      item: { key: "isTarget", title: "是否有指标", require: true,width:100 },
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "contractTarget", title: "合同指标" },
+      item: { key: "contractTarget", title: "合同指标" ,width:100},
       attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
     },
     {
-      item: { key: "exemptionPostageCondtion", title: "包邮条件", span: 12 },
+      item: { key: "exemptionPostageCondtion", title: "包邮条件", span: 12 ,width:100},
       attr: {
         is: "el-input",
         placeholder:
@@ -213,26 +213,26 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "isRebate", title: "是否有返利", require: true },
+      item: { key: "isRebate", title: "是否有返利", require: true,width:100 },
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "rebatePolicy", title: "返利政策", span: 18, require: true },
+      item: { key: "rebatePolicy", title: "返利政策", span: 18, require: true ,width:100},
       attr: {
         is: "el-input",
         placeholder: '当【是否有返利】="有"时,必填',
       },
     },
     {
-      item: { key: "externalContract", title: "外部合同号" },
+      item: { key: "externalContract", title: "外部合同号",width:100 },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "rollbackPolicy", title: "退换货政策", require: true },
+      item: { key: "rollbackPolicy", title: "退换货政策", require: true,width:100 },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "enquiryCode", title: "询价单号" },
+      item: { key: "enquiryCode", title: "询价单号",width:100 },
       attr: { is: "el-input" },
     },
     {
@@ -241,11 +241,13 @@ export default function useColumns() {
         title: "合同主要内容",
         require: true,
         span: 24,
+        width:100
+        
       },
       attr: { is: "el-input", type: "textarea" },
     },
     {
-      item: { key: "refusalReasons", title: "拒绝理由", span: 24 },
+      item: { key: "refusalReasons", title: "拒绝理由", span: 24,width:100 },
       attr: { is: "el-input" },
     },
     // {
@@ -257,32 +259,32 @@ export default function useColumns() {
     //   attr: { is: "el-file-upload", fileType: ["pdf"], disabled: true },
     // },
     {
-      item: { key: "externalFile", title: "对外附件", span: 24 },
+      item: { key: "externalFile", title: "对外附件", span: 24,width:100 },
       attr: { is: "el-file-upload", fileType: ["pdf"] },
     },
     {
-      item: { key: "puFile", title: "采购商盖章合同附件", span: 24 },
+      item: { key: "puFile", title: "采购商盖章合同附件", span: 24,width:100 },
       attr: { is: "el-file-upload", fileType: ["pdf"] },
     },
     {
-      item: { key: "supplierFile", title: "供应商盖章合同附件", span: 24 },
+      item: { key: "supplierFile", title: "供应商盖章合同附件", span: 24,width:100},
       attr: { is: "el-file-upload", fileType: ["pdf"] },
     },
     {
-      item: { key: "projectCode", title: "项目编号" },
+      item: { key: "projectCode", title: "项目编号" ,width:100},
       attr: { is: "el-input" },
     },
     {
-      item: { key: "projectName", title: "项目名称" },
+      item: { key: "projectName", title: "项目名称",width:100 },
       attr: { is: "el-input" },
     },
     { item: { key: "area", title: "区域" }, attr: { is: "el-input" } },
     {
-      item: { key: "consigneePhone", title: "收货人联系方式" },
+      item: { key: "consigneePhone", title: "收货人联系方式",width:100 },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "paymentAgreement", title: "付款协议", require: true },
+      item: { key: "paymentAgreement", title: "付款协议", require: true,width:100 },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -294,14 +296,14 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "taxPrice", title: "价税合计" },
+      item: { key: "taxPrice", title: "价税合计",width:100 },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { key: "currencyName", title: "币种", require: true,width:100 },
       attr: {
         is: "el-popover-select-v2",
         valueKey: "name",
@@ -313,7 +315,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriod", title: "质保期" },
+      item: { key: "guaranteePeriod", title: "质保期",width:100 },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,

+ 54 - 54
src/views/purchase/contract/columns.js

@@ -2,14 +2,14 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "puOrgName", title: "采购组织" }, attr: {} },
-    { item: { key: "code", title: "合同编码" }, attr: {} },
+    { item: { width:100,key: "puOrgName", title: "采购组织" }, attr: {} },
+    { item: { width:100,key: "code", title: "合同编码" }, attr: {} },
     {
-      item: { key: "status", title: "状态" },
+      item: { width:100,key: "status", title: "状态" },
       attr: { is: "el-dict-tag", dictName: "documents_status" },
     },
     {
-      item: { key: "lastPuMoney", title: "上年度采购额" },
+      item: { width:100,key: "lastPuMoney", title: "上年度采购额" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -17,17 +17,17 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { key: "supplierName", title: "供应商" }, attr: {} },
+    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width:100,key: "supplierName", title: "供应商" }, attr: {} },
     {
-      item: { key: "contractType", title: "合同类型" },
+      item: { width:100,key: "contractType", title: "合同类型" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_type",
       },
     },
     {
-      item: { key: "puMoneyYear", title: "本年度采购额" },
+      item: { width:100,key: "puMoneyYear", title: "本年度采购额" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -35,20 +35,20 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "puDeptName", title: "采购部门" }, attr: {} },
+    { item: { width:100,key: "puDeptName", title: "采购部门" }, attr: {} },
     {
-      item: { key: "supplierTier", title: "供应商层级" },
+      item: { width:100,key: "supplierTier", title: "供应商层级" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_supplier_tier",
       },
     },
     {
-      item: { key: "contractName", title: "合同名称" },
+      item: { width:100,key: "contractName", title: "合同名称" },
       attr: {},
     },
     {
-      item: { key: "grossRateAverage", title: "平均毛利率 (%)" },
+      item: { width:100,key: "grossRateAverage", title: "平均毛利率 (%)" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -57,25 +57,25 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "approveFlow", title: "审批流程" },
+      item: { width:100,key: "approveFlow", title: "审批流程" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_approve_flow",
       },
     },
     {
-      item: { key: "consumableClass", title: "耗材类别" },
+      item: { width:100,key: "consumableClass", title: "耗材类别" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { key: "effectiveDate", title: "合同生效日期" },
+      item: { width:100,key: "effectiveDate", title: "合同生效日期" },
       attr: {},
     },
     {
-      item: { key: "brandGrossRate", title: "同类品牌及毛利率 (%)" },
+      item: { width:100,key: "brandGrossRate", title: "同类品牌及毛利率 (%)" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -84,19 +84,19 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractFormat", title: "合同格式" },
+      item: { width:100,key: "contractFormat", title: "合同格式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { key: "productName", title: "产品类别&名称" },
+      item: { width:100,key: "productName", title: "产品类别&名称" },
       attr: {},
     },
-    { item: { key: "endDate", title: "合同终止日期" }, attr: {} },
+    { item: { width:100,key: "endDate", title: "合同终止日期" }, attr: {} },
     {
-      item: { key: "invoiceTax", title: "发票税率 (%)" },
+      item: { width:100,key: "invoiceTax", title: "发票税率 (%)" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -105,110 +105,110 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "emergencyDegree", title: "紧急程度" },
+      item: { width:100,key: "emergencyDegree", title: "紧急程度" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
-    { item: { key: "project", title: "项目医院" }, attr: {} },
+    { item: { width:100,key: "project", title: "项目医院" }, attr: {} },
     {
-      item: { key: "deliveryType", title: "交货方式" },
+      item: { width:100,key: "deliveryType", title: "交货方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_delivery_type",
       },
     },
-    { item: { key: "source", title: "合同来源" }, attr: {} },
+    { item: { width:100,key: "source", title: "合同来源" }, attr: {} },
     {
-      item: { key: "contractPartycName", title: "合同丙方" },
+      item: { width:100,key: "contractPartycName", title: "合同丙方" },
       attr: {},
     },
     {
-      item: { key: "guaranteePeriodEnd", title: "质保期限" },
+      item: { width:100,key: "guaranteePeriodEnd", title: "质保期限" },
       attr: {},
     },
     {
-      item: { key: "freightMethods", title: "运费承担方式" },
+      item: { width:100,key: "freightMethods", title: "运费承担方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_freight_methods",
       },
     },
     {
-      item: { key: "signDate", title: "合同创建时间" },
+      item: { width:100,key: "signDate", title: "合同创建时间" },
       attr: {},
     },
     {
-      item: { key: "isTarget", title: "是否有指标" },
+      item: { width:100,key: "isTarget", title: "是否有指标" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "contractTarget", title: "合同指标" },
+      item: { width:100,key: "contractTarget", title: "合同指标" },
       attr: {},
     },
     {
-      item: { key: "exemptionPostageCondtion", title: "包邮条件" },
+      item: { width:100,key: "exemptionPostageCondtion", title: "包邮条件" },
       attr: {},
     },
     {
-      item: { key: "isRebate", title: "是否有返利" },
+      item: { width:100,key: "isRebate", title: "是否有返利" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "rebatePolicy", title: "返利政策" },
+      item: { width:100,key: "rebatePolicy", title: "返利政策" },
       attr: {},
     },
     {
-      item: { key: "externalContract", title: "外部合同号" },
+      item: { width:100,key: "externalContract", title: "外部合同号" },
       attr: {},
     },
     {
-      item: { key: "rollbackPolicy", title: "退换货政策" },
+      item: { width:100,key: "rollbackPolicy", title: "退换货政策" },
       attr: {},
     },
-    { item: { key: "enquiryCode", title: "询价单号" }, attr: {} },
+    { item: { width:100,key: "enquiryCode", title: "询价单号" }, attr: {} },
     {
-      item: { key: "contractContent", title: "合同主要内容" },
+      item: { width:100,key: "contractContent", title: "合同主要内容" },
       attr: {},
     },
     {
-      item: { key: "refusalReasons", title: "拒绝理由" },
+      item: { width:100,key: "refusalReasons", title: "拒绝理由" },
       attr: {},
     },
     {
-      item: { key: "pigeonhole", title: "是否归档" },
+      item: { width:100,key: "pigeonhole", title: "是否归档" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "pigeonholeFile", title: "归档附件" },
+      item: { width:100,key: "pigeonholeFile", title: "归档附件" },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { key: "externalFile", title: "对外附件" },
+      item: { width:100,key: "externalFile", title: "对外附件" },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { key: "puFile", title: "采购商盖章合同附件" },
+      item: { width:100,key: "puFile", title: "采购商盖章合同附件" },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { key: "supplierFile", title: "供应商盖章合同附件" },
+      item: { width:100,key: "supplierFile", title: "供应商盖章合同附件" },
       attr: { is: "el-file-preview" },
     },
-    { item: { key: "projectCode", title: "项目编号" }, attr: {} },
-    { item: { key: "projectName", title: "项目名称" }, attr: {} },
-    { item: { key: "area", title: "区域" }, attr: {} },
+    { item: { width:100,key: "projectCode", title: "项目编号" }, attr: {} },
+    { item: { width:100,key: "projectName", title: "项目名称" }, attr: {} },
+    { item: { width:100,key: "area", title: "区域" }, attr: {} },
     {
-      item: { key: "consigneePhone", title: "收货人联系方式" },
+      item: { width:100,key: "consigneePhone", title: "收货人联系方式" },
       attr: {},
     },
     {
-      item: { key: "paymentAgreement", title: "付款协议" },
+      item: { width:100,key: "paymentAgreement", title: "付款协议" },
       attr: {},
     },
     {
-      item: { key: "taxPrice", title: "价税合计" },
+      item: { width:100,key: "taxPrice", title: "价税合计" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
@@ -216,9 +216,9 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "currencyName", title: "币种" }, attr: {} },
+    { item: { width:100,key: "currencyName", title: "币种" }, attr: {} },
     {
-      item: { key: "guaranteePeriod", title: "质保期" },
+      item: { width:100,key: "guaranteePeriod", title: "质保期" },
       attr: {},
     },
   ].map(({ item, attr }) => ({
@@ -235,7 +235,7 @@ export default function useColumns() {
   const SearchColumns = [
     {
       item: {
-        key: "contractName",
+        width:100,key: "contractName",
         title: "合同名称",
       },
       attr: {
@@ -243,7 +243,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "status", title: "状态" },
+      item: { width:100,key: "status", title: "状态" },
       attr: {
         is: "el-select",
         dictName: "documents_status",
@@ -251,7 +251,7 @@ export default function useColumns() {
     },
     {
       item: {
-        key: "pigeonhole",
+        width:100,key: "pigeonhole",
         title: "是否归档",
       },
       attr: {

+ 102 - 102
src/views/purchase/contract/edit/columns.js

@@ -3,10 +3,10 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织", require: true ,},
+      item: { width:100,key: "puOrgName", title: "采购组织", require: true ,},
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "ORG_PARAM",
         dataMapping: {
           puOrg: "code",
@@ -14,9 +14,9 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "code", title: "合同编码" }, attr: { is: "el-input" } },
+    { item: { width:100,key: "code", title: "合同编码" }, attr: { is: "el-input" } },
     {
-      item: { key: "status", title: "状态" },
+      item: { width:100,key: "status", title: "状态" },
       attr: {
         is: "el-select",
         dictName: "documents_status",
@@ -25,17 +25,17 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "lastPuMoney", title: "上年度采购额" },
+      item: { width:100,key: "lastPuMoney", title: "上年度采购额" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true ,},
+      item: { width:100,key: "buyerName", title: "采购员", require: true ,},
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "CONTACTS_PARAM",
         dataMapping: {
           buyer: "code",
@@ -46,10 +46,10 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true, },
+      item: { width:100,key: "supplierName", title: "供应商", require: true, },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "SUPPLIER_PARAM",
         dataMapping: {
           supplier: "code",
@@ -58,21 +58,21 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractType", title: "合同类型", require: true ,},
+      item: { width:100,key: "contractType", title: "合同类型", require: true ,},
       attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
     },
     {
-      item: { key: "puMoneyYear", title: "本年度采购额" },
+      item: { width:100,key: "puMoneyYear", title: "本年度采购额" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true, },
+      item: { width:100,key: "puDeptName", title: "采购部门", require: true, },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "DEPT_PARAM",
         dataMapping: {
           puDept: "code",
@@ -81,33 +81,33 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierTier", title: "供应商层级", require: true ,},
+      item: { width:100,key: "supplierTier", title: "供应商层级", require: true ,},
       attr: { is: "el-select", dictName: "puarchase_contract_supplier_tier" },
     },
     {
-      item: { key: "contractName", title: "合同名称", require: true, },
+      item: { width:100,key: "contractName", title: "合同名称", require: true, },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true ,},
+      item: { width:100,key: "grossRateAverage", title: "平均毛利率 (%)", require: true ,},
       attr: {
         is: "el-input-number",
         precision: 2,
       },
     },
     {
-      item: { key: "approveFlow", title: "审批流程", require: true, },
+      item: { width:100,key: "approveFlow", title: "审批流程", require: true, },
       attr: { is: "el-select", dictName: "puarchase_contract_approve_flow" },
     },
     {
-      item: { key: "consumableClass", title: "耗材类别", require: true, },
+      item: { width:100,key: "consumableClass", title: "耗材类别", require: true, },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { key: "effectiveDate", title: "合同生效日期", require: true ,},
+      item: { width:100,key: "effectiveDate", title: "合同生效日期", require: true ,},
       attr: {
         is: "el-date-picker",
         valueFormat: "yyyy-MM-dd",
@@ -115,7 +115,7 @@ export default function useColumns() {
     },
     {
       item: {
-        key: "brandGrossRate",
+        width:100,key: "brandGrossRate",
         title: "同类品牌及毛利率 (%)",
         require: true,
       },
@@ -125,25 +125,25 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractFormat", title: "合同格式", require: true, },
+      item: { width:100,key: "contractFormat", title: "合同格式", require: true, },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { key: "productName", title: "产品类别&名称", require: true, },
+      item: { width:100,key: "productName", title: "产品类别&名称", require: true, },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "endDate", title: "合同终止日期", require: true ,},
+      item: { width:100,key: "endDate", title: "合同终止日期", require: true ,},
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "invoiceTax", title: "发票税率 (%)", require: true,},
+      item: { width:100,key: "invoiceTax", title: "发票税率 (%)", require: true,},
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "ntaxrate",
+        valuewidth:100,key: "ntaxrate",
         referName: "TAX_RATE_PARAM",
         dataMapping: {
           invoiceTax: "ntaxrate",
@@ -151,29 +151,29 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "emergencyDegree", title: "紧急程度", require: true ,},
+      item: { width:100,key: "emergencyDegree", title: "紧急程度", require: true ,},
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
     {
-      item: { key: "project", title: "项目医院", require: true ,},
+      item: { width:100,key: "project", title: "项目医院", require: true ,},
       attr: { is: "el-input" },
     },
     {
-      item: { key: "deliveryType", title: "交货方式", require: true, },
+      item: { width:100,key: "deliveryType", title: "交货方式", require: true, },
       attr: { is: "el-select", dictName: "puarchase_contract_delivery_type" },
     },
     {
-      item: { key: "source", title: "合同来源" },
+      item: { width:100,key: "source", title: "合同来源" },
       attr: { is: "el-input", value: "自制", disabled: true, },
     },
     {
-      item: { key: "contractPartycName", title: "合同丙方" },
+      item: { width:100,key: "contractPartycName", title: "合同丙方" },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "SUPPLIER_PARAM",
         dataMapping: {
           contractPartyc: "code",
@@ -182,30 +182,30 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true ,},
+      item: { width:100,key: "guaranteePeriodEnd", title: "质保期限", require: true ,},
       attr: { is: "el-input-number", precision: 2 },
     },
     {
-      item: { key: "freightMethods", title: "运费承担方式" },
+      item: { width:100,key: "freightMethods", title: "运费承担方式" },
       attr: {
         is: "el-select",
         dictName: "puarchase_contract_freight_methods",
       },
     },
     {
-      item: { key: "signDate", title: "合同签订日期" },
+      item: { width:100,key: "signDate", title: "合同签订日期" },
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "isTarget", title: "是否有指标", require: true ,},
+      item: { width:100,key: "isTarget", title: "是否有指标", require: true ,},
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "contractTarget", title: "合同指标", require: true, },
+      item: { width:100,key: "contractTarget", title: "合同指标", require: true, },
       attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
     },
     {
-      item: { key: "exemptionPostageCondtion", title: "包邮条件", span: 12 },
+      item: { width:100,key: "exemptionPostageCondtion", title: "包邮条件", span: 12 },
       attr: {
         is: "el-input",
         placeholder:
@@ -213,31 +213,31 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "isRebate", title: "是否有返利", require: true, },
+      item: { width:100,key: "isRebate", title: "是否有返利", require: true, },
       attr: { is: "el-select", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "rebatePolicy", title: "返利政策", span: 18 },
+      item: { width:100,key: "rebatePolicy", title: "返利政策", span: 18 },
       attr: {
         is: "el-input",
         placeholder: '当【是否有返利】="有"时,必填',
       },
     },
     {
-      item: { key: "externalContract", title: "外部合同号" },
+      item: { width:100,key: "externalContract", title: "外部合同号" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "rollbackPolicy", title: "退换货政策", require: true ,},
+      item: { width:100,key: "rollbackPolicy", title: "退换货政策", require: true ,},
       attr: { is: "el-input" },
     },
     {
-      item: { key: "enquiryCode", title: "询价单号" },
+      item: { width:100,key: "enquiryCode", title: "询价单号" },
       attr: { is: "el-input" },
     },
     {
       item: {
-        key: "contractContent",
+        width:100,key: "contractContent",
         title: "合同主要内容",
         require: true,
         span: 24,
@@ -245,47 +245,47 @@ export default function useColumns() {
       attr: { is: "el-input", type: "textarea" },
     },
     {
-      item: { key: "refusalReasons", title: "拒绝理由", span: 24 },
+      item: { width:100,key: "refusalReasons", title: "拒绝理由", span: 24 },
       attr: { is: "el-input" },
     },
     // {
-    //   item: { key: "pigeonhole", title: "是否归档" },
+    //   item: { width:100,key: "pigeonhole", title: "是否归档" },
     //   attr: { is: "el-select", dictName: "sys_yes_no", disabled: true },
     // },
     // {
-    //   item: { key: "pigeonholeFile", title: "归档附件", span: 24 },
+    //   item: { width:100,key: "pigeonholeFile", title: "归档附件", span: 24 },
     //   attr: { is: "el-file-upload", fileType: ["pdf"], disabled: true },
     // },
     {
-      item: { key: "externalFile", title: "对外附件", span: 24 },
+      item: { width:100,key: "externalFile", title: "对外附件", span: 24 },
       attr: { is: "el-file-upload", fileType: ["pdf"] },
     },
     {
-      item: { key: "puFile", title: "采购商盖章合同附件", span: 24 },
+      item: { width:100,key: "puFile", title: "采购商盖章合同附件", span: 24 },
       attr: { is: "el-file-upload", fileType: ["pdf"] },
     },
     {
-      item: { key: "supplierFile", title: "供应商盖章合同附件", span: 24 },
+      item: { width:100,key: "supplierFile", title: "供应商盖章合同附件", span: 24 },
       attr: { is: "el-file-upload", fileType: ["pdf"] },
     },
     {
-      item: { key: "projectCode", title: "项目编号" },
+      item: { width:100,key: "projectCode", title: "项目编号" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "projectName", title: "项目名称" },
+      item: { width:100,key: "projectName", title: "项目名称" },
       attr: { is: "el-input" },
     },
-    { item: { key: "area", title: "区域" }, attr: { is: "el-input" } },
+    { item: { width:100,key: "area", title: "区域" }, attr: { is: "el-input" } },
     {
-      item: { key: "consigneePhone", title: "收货人联系方式" },
+      item: { width:100,key: "consigneePhone", title: "收货人联系方式" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "paymentAgreement", title: "付款协议", require: true, },
+      item: { width:100,key: "paymentAgreement", title: "付款协议", require: true, },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "PAYAGREEMENT_PARAM",
         dataMapping: {
           paymentAgreement: "code",
@@ -294,17 +294,17 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "taxPrice", title: "价税合计" },
+      item: { width:100,key: "taxPrice", title: "价税合计" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true, },
+      item: { width:100,key: "currencyName", title: "币种", require: true, },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "CURRENCY_PARAM",
         dataMapping: {
           currency: "code",
@@ -313,7 +313,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriod", title: "质保期" },
+      item: { width:100,key: "guaranteePeriod", title: "质保期" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
@@ -326,18 +326,18 @@ export default function useColumns() {
 
   const TabColumns = [
     {
-      item: { title: "物料基本信息", key: "contractItemList" },
+      item: { title: "物料基本信息", width:100,key: "contractItemList" },
       attr: { value: [] },
       TableColumns: [
         {
           item: {
             title: "物料名称",
-            key: "materialName",
+            width:100,key: "materialName",
             require: true ,
           },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
               material: "code",
@@ -352,7 +352,7 @@ export default function useColumns() {
         {
           item: {
             title: "物料编码",
-            key: "material",
+            width:100,key: "material",
             require: true ,
           },
           attr: {},
@@ -360,24 +360,24 @@ export default function useColumns() {
         {
           item: {
             title: "规格",
-            key: "specification",
+            width:100,key: "specification",
           },
           attr: {},
         },
         {
           item: {
             title: "生产厂家",
-            key: "manufacturer",
+            width:100,key: "manufacturer",
           },
           attr: {
             is: "el-input",
           },
         },
         {
-          item: { title: "采购单位", key: "puUnit" },
+          item: { title: "采购单位", width:100,key: "puUnit" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "UNIT_PARAM",
             dataMapping: {
               puUnit: "name",
@@ -385,10 +385,10 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "税率%", key: "tax" ,require: true, },
+          item: { title: "税率%", width:100,key: "tax" ,require: true, },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "ntaxrate",
+            valuewidth:100,key: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: {
               tax: "ntaxrate",
@@ -396,20 +396,20 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "采购数量", key: "qty" },
+          item: { title: "采购数量", width:100,key: "qty" },
           attr: {
             is: "el-input-number",
           },
         },
         {
-          item: { title: "含税单价", key: "taxPrice" ,require: true, },
+          item: { title: "含税单价", width:100,key: "taxPrice" ,require: true, },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { title: "含税金额合计", key: "taxMoney" },
+          item: { title: "含税金额合计", width:100,key: "taxMoney" },
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
@@ -419,7 +419,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "无税单价", key: "taxFreePrice" ,require: true, },
+          item: { title: "无税单价", width:100,key: "taxFreePrice" ,require: true, },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -431,7 +431,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "无税金额合计", key: "taxFreeMoney" },
+          item: { title: "无税金额合计", width:100,key: "taxFreeMoney" },
           attr: {
             formatter: (prop) => {
               const { qty = 0, tax = 0, taxPrice = 0 } = prop;
@@ -445,16 +445,16 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "注册证号及备案凭证号", key: "registration" },
+          item: { title: "注册证号及备案凭证号", width:100,key: "registration" },
           attr: {
             is: "el-input",
           },
         },
         {
-          item: { title: "收货客户", key: "customerName" },
+          item: { title: "收货客户", width:100,key: "customerName" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "CUSTOMER_PARAM",
             dataMapping: {
               customer: "code",
@@ -465,67 +465,67 @@ export default function useColumns() {
       ],
     },
     {
-      item: { title: "合同条款", key: "contractClauseList" },
+      item: { title: "合同条款", width:100,key: "contractClauseList" },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { title: "条款编码", key: "code", width: "auto" },
+          item: { title: "条款编码", width:100,key: "code", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "条款名称", key: "name", width: "auto" },
+          item: { title: "条款名称", width:100,key: "name", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "条款内容", key: "content", width: "auto" },
+          item: { title: "条款内容", width:100,key: "content", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "变量序号", key: "variableRowno", width: "auto" },
+          item: { title: "变量序号", width:100,key: "variableRowno", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "变量内容", key: "variableContent", width: "auto" },
+          item: { title: "变量内容", width:100,key: "variableContent", width: "auto" },
           attr: { is: "el-input" },
         },
       ],
     },
     {
-      item: { title: "合同费用", key: "contractExpenseList" },
+      item: { title: "合同费用", width:100,key: "contractExpenseList" },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { title: "费用编码", key: "code", width: "auto" },
+          item: { title: "费用编码", width:100,key: "code", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "费用名称", key: "name", width: "auto" },
+          item: { title: "费用名称", width:100,key: "name", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "费用金额", key: "money", width: "auto" },
+          item: { title: "费用金额", width:100,key: "money", width: "auto" },
           attr: { is: "el-input-number", precision: CONFIG.precision },
         },
       ],
     },
     {
-      item: { title: "付款协议信息", key: "contractAgreementList" },
+      item: { title: "付款协议信息", width:100,key: "contractAgreementList" },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { title: "付款阶段", key: "satge" },
+          item: { title: "付款阶段", width:100,key: "satge" },
           attr: { is: "el-input-number" },
         },
         {
           item: {
             title: "付款起点",
-            key: "origin",
+            width:100,key: "origin",
             require: true 
           },
           attr: {
@@ -534,21 +534,21 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "账期天数", key: "paymetDays" ,require: true, },
+          item: { title: "账期天数", width:100,key: "paymetDays" ,require: true, },
           attr: {
             is: "el-input-number",
             precision: 2,
           },
         },
         {
-          item: { title: "付款比例%", key: "ratio",require: true,  },
+          item: { title: "付款比例%", width:100,key: "ratio",require: true,  },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { title: "付款金额", key: "money" },
+          item: { title: "付款金额", width:100,key: "money" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -557,7 +557,7 @@ export default function useColumns() {
         {
           item: {
             title: "是否预付款",
-            key: "isAdvance",
+            width:100,key: "isAdvance",
           },
           attr: {
             is: "el-select",
@@ -567,7 +567,7 @@ export default function useColumns() {
         {
           item: {
             title: "是否质保金",
-            key: "isQuality",
+            width:100,key: "isQuality",
           },
           attr: {
             is: "el-select",
@@ -577,12 +577,12 @@ export default function useColumns() {
         {
           item: {
             title: "结算方式",
-            key: "paymentMeans",
+            width:100,key: "paymentMeans",
             require:true,
           },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "BALATYPE_PARAM",
             dataMapping: {
               paymentMeans: "name",
@@ -592,7 +592,7 @@ export default function useColumns() {
         {
           item: {
             title: "需进度确认",
-            key: "schedule",
+            width:100,key: "schedule",
           },
           attr: {
             is: "el-select",
@@ -602,18 +602,18 @@ export default function useColumns() {
       ],
     },
     {
-      item: { title: "合同执行组织范围", key: "contractApplyOrgList" },
+      item: { title: "合同执行组织范围", width:100,key: "contractApplyOrgList" },
       attr: { value: [] },
       TableColumns: [
         {
           item: {
             title: "组织名称",
-            key: "orgName",
+            width:100,key: "orgName",
             width: "auto",
           },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "ORG_PARAM",
             dataMapping: {
               org: "code",
@@ -621,7 +621,7 @@ export default function useColumns() {
             },
           },
         },
-        { item: { title: "组织编码", key: "org", width: "auto" }, attr: {} },
+        { item: { title: "组织编码", width:100,key: "org", width: "auto" }, attr: {} },
       ],
     },
   ].map(({item,attr,TableColumns}) =>({

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

@@ -67,7 +67,6 @@ export default {
     },
     // 查 询
     useQuery(prop, page) {
-      this.selectData = [];
       this.fetchList(prop, page);
     },
     // 重 置

+ 102 - 102
src/views/purchase/contract/see/columns.js

@@ -3,10 +3,10 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { key: "puOrgName", title: "采购组织", require: true },
+      item: { width:100,key: "puOrgName", title: "采购组织", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "ORG_PARAM",
         dataMapping: {
           puOrg: "code",
@@ -14,9 +14,9 @@ export default function useColumns() {
         },
       },
     },
-    { item: { key: "code", title: "合同编码" }, attr: { is: "el-input" } },
+    { item: { width:100,key: "code", title: "合同编码" }, attr: { is: "el-input" } },
     {
-      item: { key: "status", title: "状态" },
+      item: { width:100,key: "status", title: "状态" },
       attr: {
         is: "el-dict-tag",
         dictName: "documents_status",
@@ -25,17 +25,17 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "lastPuMoney", title: "上年度采购额" },
+      item: { width:100,key: "lastPuMoney", title: "上年度采购额" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "buyerName", title: "采购员", require: true },
+      item: { width:100,key: "buyerName", title: "采购员", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "CONTACTS_PARAM",
         dataMapping: {
           buyer: "code",
@@ -46,10 +46,10 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierName", title: "供应商", require: true },
+      item: { width:100,key: "supplierName", title: "供应商", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "SUPPLIER_PARAM",
         dataMapping: {
           supplier: "code",
@@ -58,21 +58,21 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractType", title: "合同类型", require: true },
+      item: { width:100,key: "contractType", title: "合同类型", require: true },
       attr: { is: "el-dict-tag", dictName: "puarchase_contract_contract_type" },
     },
     {
-      item: { key: "puMoneyYear", title: "本年度采购额" },
+      item: { width:100,key: "puMoneyYear", title: "本年度采购额" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "puDeptName", title: "采购部门", require: true },
+      item: { width:100,key: "puDeptName", title: "采购部门", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "DEPT_PARAM",
         dataMapping: {
           puDept: "code",
@@ -81,33 +81,33 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "supplierTier", title: "供应商层级", require: true },
+      item: { width:100,key: "supplierTier", title: "供应商层级", require: true },
       attr: { is: "el-dict-tag", dictName: "puarchase_contract_supplier_tier" },
     },
     {
-      item: { key: "contractName", title: "合同名称", require: true },
+      item: { width:100,key: "contractName", title: "合同名称", require: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
+      item: { width:100,key: "grossRateAverage", title: "平均毛利率 (%)", require: true },
       attr: {
         is: "el-input-number",
         precision: 2,
       },
     },
     {
-      item: { key: "approveFlow", title: "审批流程", require: true },
+      item: { width:100,key: "approveFlow", title: "审批流程", require: true },
       attr: { is: "el-dict-tag", dictName: "puarchase_contract_approve_flow" },
     },
     {
-      item: { key: "consumableClass", title: "耗材类别", require: true },
+      item: { width:100,key: "consumableClass", title: "耗材类别", require: true },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { key: "effectiveDate", title: "合同生效日期", require: true },
+      item: { width:100,key: "effectiveDate", title: "合同生效日期", require: true },
       attr: {
         is: "el-date-picker",
         valueFormat: "yyyy-MM-dd",
@@ -115,7 +115,7 @@ export default function useColumns() {
     },
     {
       item: {
-        key: "brandGrossRate",
+        width:100,key: "brandGrossRate",
         title: "同类品牌及毛利率 (%)",
         require: true,
       },
@@ -125,25 +125,25 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "contractFormat", title: "合同格式", require: true },
+      item: { width:100,key: "contractFormat", title: "合同格式", require: true },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { key: "productName", title: "产品类别&名称", require: true },
+      item: { width:100,key: "productName", title: "产品类别&名称", require: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "endDate", title: "合同终止日期", require: true },
+      item: { width:100,key: "endDate", title: "合同终止日期", require: true },
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "invoiceTax", title: "发票税率 (%)", require: true },
+      item: { width:100,key: "invoiceTax", title: "发票税率 (%)", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "ntaxrate",
+        valuewidth:100,key: "ntaxrate",
         referName: "TAX_RATE_PARAM",
         dataMapping: {
           invoiceTax: "ntaxrate",
@@ -151,29 +151,29 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "emergencyDegree", title: "紧急程度", require: true },
+      item: { width:100,key: "emergencyDegree", title: "紧急程度", require: true },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
     {
-      item: { key: "project", title: "项目医院", require: true },
+      item: { width:100,key: "project", title: "项目医院", require: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "deliveryType", title: "交货方式", require: true },
+      item: { width:100,key: "deliveryType", title: "交货方式", require: true },
       attr: { is: "el-dict-tag", dictName: "puarchase_contract_delivery_type" },
     },
     {
-      item: { key: "source", title: "合同来源" },
+      item: { width:100,key: "source", title: "合同来源" },
       attr: { is: "el-input", value: "自制", disabled: true },
     },
     {
-      item: { key: "contractPartycName", title: "合同丙方" },
+      item: { width:100,key: "contractPartycName", title: "合同丙方" },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "SUPPLIER_PARAM",
         dataMapping: {
           contractPartyc: "code",
@@ -182,30 +182,30 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriodEnd", title: "质保期限", require: true },
+      item: { width:100,key: "guaranteePeriodEnd", title: "质保期限", require: true },
       attr: { is: "el-input-number", precision: 2 },
     },
     {
-      item: { key: "freightMethods", title: "运费承担方式" },
+      item: { width:100,key: "freightMethods", title: "运费承担方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_freight_methods",
       },
     },
     {
-      item: { key: "signDate", title: "合同签订日期" },
+      item: { width:100,key: "signDate", title: "合同签订日期" },
       attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
     },
     {
-      item: { key: "isTarget", title: "是否有指标", require: true },
+      item: { width:100,key: "isTarget", title: "是否有指标", require: true },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "contractTarget", title: "合同指标", require: true },
+      item: { width:100,key: "contractTarget", title: "合同指标", require: true },
       attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
     },
     {
-      item: { key: "exemptionPostageCondtion", title: "包邮条件", span: 12 },
+      item: { width:100,key: "exemptionPostageCondtion", title: "包邮条件", span: 12 },
       attr: {
         is: "el-input",
         placeholder:
@@ -213,31 +213,31 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "isRebate", title: "是否有返利", require: true },
+      item: { width:100,key: "isRebate", title: "是否有返利", require: true },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { key: "rebatePolicy", title: "返利政策", span: 18 },
+      item: { width:100,key: "rebatePolicy", title: "返利政策", span: 18 },
       attr: {
         is: "el-input",
         placeholder: '当【是否有返利】="有"时,必填',
       },
     },
     {
-      item: { key: "externalContract", title: "外部合同号" },
+      item: { width:100,key: "externalContract", title: "外部合同号" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "rollbackPolicy", title: "退换货政策", require: true },
+      item: { width:100,key: "rollbackPolicy", title: "退换货政策", require: true },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "enquiryCode", title: "询价单号" },
+      item: { width:100,key: "enquiryCode", title: "询价单号" },
       attr: { is: "el-input" },
     },
     {
       item: {
-        key: "contractContent",
+        width:100,key: "contractContent",
         title: "合同主要内容",
         require: true,
         span: 24,
@@ -245,47 +245,47 @@ export default function useColumns() {
       attr: { is: "el-input", type: "textarea" },
     },
     {
-      item: { key: "refusalReasons", title: "拒绝理由", span: 24 },
+      item: { width:100,key: "refusalReasons", title: "拒绝理由", span: 24 },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "pigeonhole", title: "是否归档" },
+      item: { width:100,key: "pigeonhole", title: "是否归档" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no", disabled: true },
     },
     {
-      item: { key: "pigeonholeFile", title: "归档附件", span: 24 },
+      item: { width:100,key: "pigeonholeFile", title: "归档附件", span: 24 },
       attr: { is: "el-file-preview", fileType: ["pdf"], disabled: true },
     },
     {
-      item: { key: "externalFile", title: "对外附件", span: 24 },
+      item: { width:100,key: "externalFile", title: "对外附件", span: 24 },
       attr: { is: "el-file-preview", fileType: ["pdf"] },
     },
     {
-      item: { key: "puFile", title: "采购商盖章合同附件", span: 24 },
+      item: { width:100,key: "puFile", title: "采购商盖章合同附件", span: 24 },
       attr: { is: "el-file-preview", fileType: ["pdf"] },
     },
     {
-      item: { key: "supplierFile", title: "供应商盖章合同附件", span: 24 },
+      item: { width:100,key: "supplierFile", title: "供应商盖章合同附件", span: 24 },
       attr: { is: "el-file-preview", fileType: ["pdf"] },
     },
     {
-      item: { key: "projectCode", title: "项目编号" },
+      item: { width:100,key: "projectCode", title: "项目编号" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "projectName", title: "项目名称" },
+      item: { width:100,key: "projectName", title: "项目名称" },
       attr: { is: "el-input" },
     },
-    { item: { key: "area", title: "区域" }, attr: { is: "el-input" } },
+    { item: { width:100,key: "area", title: "区域" }, attr: { is: "el-input" } },
     {
-      item: { key: "consigneePhone", title: "收货人联系方式" },
+      item: { width:100,key: "consigneePhone", title: "收货人联系方式" },
       attr: { is: "el-input" },
     },
     {
-      item: { key: "paymentAgreement", title: "付款协议", require: true },
+      item: { width:100,key: "paymentAgreement", title: "付款协议", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "PAYAGREEMENT_PARAM",
         dataMapping: {
           paymentAgreement: "code",
@@ -294,17 +294,17 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "taxPrice", title: "价税合计" },
+      item: { width:100,key: "taxPrice", title: "价税合计" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
       },
     },
     {
-      item: { key: "currencyName", title: "币种", require: true },
+      item: { width:100,key: "currencyName", title: "币种", require: true },
       attr: {
         is: "el-popover-select-v2",
-        valueKey: "name",
+        valuewidth:100,key: "name",
         referName: "CURRENCY_PARAM",
         dataMapping: {
           currency: "code",
@@ -313,7 +313,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { key: "guaranteePeriod", title: "质保期" },
+      item: { width:100,key: "guaranteePeriod", title: "质保期" },
       attr: {
         is: "el-input-number",
         precision: CONFIG.precision,
@@ -326,17 +326,17 @@ export default function useColumns() {
 
   const TabColumns = [
     {
-      item: { title: "物料基本信息", key: "contractItemList" },
+      item: { title: "物料基本信息", width:100,key: "contractItemList" },
       attr: { value: [] },
       TableColumns: [
         {
           item: {
             title: "物料名称",
-            key: "materialName",
+            width:100,key: "materialName",
           },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
               material: "code",
@@ -351,31 +351,31 @@ export default function useColumns() {
         {
           item: {
             title: "物料编码",
-            key: "material",
+            width:100,key: "material",
           },
           attr: {},
         },
         {
           item: {
             title: "规格",
-            key: "specification",
+            width:100,key: "specification",
           },
           attr: {},
         },
         {
           item: {
             title: "生产厂家",
-            key: "manufacturer",
+            width:100,key: "manufacturer",
           },
           attr: {
             is: "el-input",
           },
         },
         {
-          item: { title: "采购单位", key: "puUnit" },
+          item: { title: "采购单位", width:100,key: "puUnit" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "UNIT_PARAM",
             dataMapping: {
               puUnit: "name",
@@ -383,10 +383,10 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "税率%", key: "tax" },
+          item: { title: "税率%", width:100,key: "tax" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "ntaxrate",
+            valuewidth:100,key: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: {
               tax: "ntaxrate",
@@ -394,20 +394,20 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "采购数量", key: "qty" },
+          item: { title: "采购数量", width:100,key: "qty" },
           attr: {
             is: "el-input-number",
           },
         },
         {
-          item: { title: "含税单价", key: "taxPrice" },
+          item: { title: "含税单价", width:100,key: "taxPrice" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { title: "含税金额合计", key: "taxMoney" },
+          item: { title: "含税金额合计", width:100,key: "taxMoney" },
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
@@ -417,7 +417,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "无税单价", key: "taxFreePrice" },
+          item: { title: "无税单价", width:100,key: "taxFreePrice" },
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
@@ -429,7 +429,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "无税金额合计", key: "taxFreeMoney" },
+          item: { title: "无税金额合计", width:100,key: "taxFreeMoney" },
           attr: {
             formatter: (prop) => {
               const { qty = 0, tax = 0, taxPrice = 0 } = prop;
@@ -443,16 +443,16 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "注册证号及备案凭证号", key: "registration" },
+          item: { title: "注册证号及备案凭证号", width:100,key: "registration" },
           attr: {
             is: "el-input",
           },
         },
         {
-          item: { title: "收货客户", key: "customerName" },
+          item: { title: "收货客户", width:100,key: "customerName" },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "CUSTOMER_PARAM",
             dataMapping: {
               customer: "code",
@@ -463,67 +463,67 @@ export default function useColumns() {
       ],
     },
     {
-      item: { title: "合同条款", key: "contractClauseList" },
+      item: { title: "合同条款", width:100,key: "contractClauseList" },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { title: "条款编码", key: "code", width: "auto" },
+          item: { title: "条款编码", width:100,key: "code", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "条款名称", key: "name", width: "auto" },
+          item: { title: "条款名称", width:100,key: "name", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "条款内容", key: "content", width: "auto" },
+          item: { title: "条款内容", width:100,key: "content", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "变量序号", key: "variableRowno", width: "auto" },
+          item: { title: "变量序号", width:100,key: "variableRowno", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "变量内容", key: "variableContent", width: "auto" },
+          item: { title: "变量内容", width:100,key: "variableContent", width: "auto" },
           attr: { is: "el-input" },
         },
       ],
     },
     {
-      item: { title: "合同费用", key: "contractExpenseList" },
+      item: { title: "合同费用", width:100,key: "contractExpenseList" },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { title: "费用编码", key: "code", width: "auto" },
+          item: { title: "费用编码", width:100,key: "code", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "费用名称", key: "name", width: "auto" },
+          item: { title: "费用名称", width:100,key: "name", width: "auto" },
           attr: { is: "el-input" },
         },
         {
-          item: { title: "费用金额", key: "money", width: "auto" },
+          item: { title: "费用金额", width:100,key: "money", width: "auto" },
           attr: { is: "el-input-number", precision: CONFIG.precision },
         },
       ],
     },
     {
-      item: { title: "付款协议信息", key: "contractAgreementList" },
+      item: { title: "付款协议信息", width:100,key: "contractAgreementList" },
       attr: {
         value: [],
       },
       TableColumns: [
         {
-          item: { title: "付款阶段", key: "satge" },
+          item: { title: "付款阶段", width:100,key: "satge" },
           attr: { is: "el-input-number" },
         },
         {
           item: {
             title: "付款起点",
-            key: "origin",
+            width:100,key: "origin",
           },
           attr: {
             is: "el-dict-tag",
@@ -531,21 +531,21 @@ export default function useColumns() {
           },
         },
         {
-          item: { title: "账期天数", key: "paymetDays" },
+          item: { title: "账期天数", width:100,key: "paymetDays" },
           attr: {
             is: "el-input-number",
             precision: 2,
           },
         },
         {
-          item: { title: "付款比例%", key: "ratio" },
+          item: { title: "付款比例%", width:100,key: "ratio" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
         {
-          item: { title: "付款金额", key: "money" },
+          item: { title: "付款金额", width:100,key: "money" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -554,7 +554,7 @@ export default function useColumns() {
         {
           item: {
             title: "是否预付款",
-            key: "isAdvance",
+            width:100,key: "isAdvance",
           },
           attr: {
             is: "el-dict-tag",
@@ -564,7 +564,7 @@ export default function useColumns() {
         {
           item: {
             title: "是否质保金",
-            key: "isQuality",
+            width:100,key: "isQuality",
           },
           attr: {
             is: "el-dict-tag",
@@ -574,11 +574,11 @@ export default function useColumns() {
         {
           item: {
             title: "结算方式",
-            key: "paymentMeans",
+            width:100,key: "paymentMeans",
           },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "BALATYPE_PARAM",
             dataMapping: {
               paymentMeans: "name",
@@ -588,7 +588,7 @@ export default function useColumns() {
         {
           item: {
             title: "需进度确认",
-            key: "schedule",
+            width:100,key: "schedule",
           },
           attr: {
             is: "el-dict-tag",
@@ -598,18 +598,18 @@ export default function useColumns() {
       ],
     },
     {
-      item: { title: "合同执行组织范围", key: "contractApplyOrgList" },
+      item: { title: "合同执行组织范围", width:100,key: "contractApplyOrgList" },
       attr: { value: [] },
       TableColumns: [
         {
           item: {
             title: "组织名称",
-            key: "orgName",
+            width:100,key: "orgName",
             width: "auto",
           },
           attr: {
             is: "el-popover-select-v2",
-            valueKey: "name",
+            valuewidth:100,key: "name",
             referName: "ORG_PARAM",
             dataMapping: {
               org: "code",
@@ -617,7 +617,7 @@ export default function useColumns() {
             },
           },
         },
-        { item: { title: "组织编码", key: "org", width: "auto" }, attr: {} },
+        { item: { title: "组织编码", width:100,key: "org", width: "auto" }, attr: {} },
       ],
     },
   ].map(({item,attr,TableColumns}) =>({

+ 20 - 16
src/views/purchase/deliveryAddress/add.vue

@@ -30,7 +30,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-select size="mini" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+              <el-select size="mini" v-model="basicForm.warehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
                 <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -38,7 +38,7 @@
 
          <el-col :span="1.5">
           <el-form-item label="仓库属性">
-              <el-select :disabled="disable" v-model="basicForm.warehouseProperty" size="mini" style="width: 200px">
+              <el-select :disabled="sonDisable" v-model="basicForm.warehouseProperty" size="mini" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -50,7 +50,7 @@
               <el-input
                 v-model="basicForm.address"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -59,7 +59,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-select size="mini" v-model="basicForm.contacts" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+              <el-select size="mini" v-model="basicForm.contacts" :disabled="sonDisable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
                 <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.code" />
               </el-select>
             </el-form-item>
@@ -70,7 +70,7 @@
               <el-input
                 v-model="basicForm.contactsPhone"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -82,7 +82,7 @@
               <el-select
                 v-model="basicForm.materialClassify"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
                 style="width: 200px"
@@ -123,7 +123,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="mini"
-                :disabled="disable"
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -134,15 +134,12 @@
     </el-form>
 
     <div class="btn_group">
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
-      </el-col>
+      <el-button type="primary" size="mini"  @click="editPage" v-if="sonPageStu == 'check'">编辑</el-button>
+        <el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
       <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="mini" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
+        <el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'edit'">提交</el-button>
       </el-col> -->
-      <el-col :span="1.5">
         <el-button size="mini" plain @click="back">返回</el-button>
-      </el-col>
     </div>
     </el-card>
 
@@ -172,6 +169,9 @@ export default {
   },
   data() {
     return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       basicForm: {
         code: '',
         name: '',
@@ -219,7 +219,7 @@ export default {
   },
   methods: {
     save() {
-      if(this.pageStu == 'add') {
+      if(this.sonPageStu == 'add') {
         this.$modal.loading("保存中...");
         addAddress(this.basicForm).then(res => {
           if (res.code === 200) {
@@ -230,7 +230,7 @@ export default {
         }).catch(err => {
           this.$modal.closeLoading();
         })
-      } else if (this.pageStu == 'edit') {
+      } else if (this.sonPageStu == 'edit') {
         this.$modal.loading("保存中...");
         editAddress(this.basicForm).then(res => {
           if (res.code === 200) {
@@ -243,6 +243,10 @@ export default {
         })
       }
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     submit() {},
     back() {
       this.$emit('jugislist', true)
@@ -316,7 +320,7 @@ export default {
   // width: 100%;
   // margin: 20px 0;
   display: flex;
-  // justify-content: center;
+  justify-content: space-between;
   position: absolute;
   top: 10px;right: 20px;
 } 

+ 16 - 3
src/views/purchase/deliveryAddress/index.vue

@@ -42,8 +42,8 @@
           <!-- <el-col :span="1.5"> -->
             <!-- <el-form-item label="" label-width="20px"> -->
             <div style="position: absolute;top: 3px;right: 10px;">
-              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+              <el-button size="mini" plain @click="resetList">重置</el-button>
             </div>
             <!-- </el-form-item> -->
           <!-- </el-col> -->
@@ -180,6 +180,9 @@
           max-height="430"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
+          @row-click="rowSelect"
+          @row-dblclick="doubleClick"
+          ref="table"
         >
           <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"/>
@@ -421,6 +424,10 @@ export default {
       console.log('选中', selection)
       this.allSelection = selection
     },
+    // 表格选中数据
+    rowSelect(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
     handleCommand(command) {
       alert(command)
     },
@@ -435,6 +442,12 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
     edit(row) {
       this.isList = false
       this.page = 'edit'
@@ -517,7 +530,7 @@ export default {
   text-align: right;
 }
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;

+ 103 - 55
src/views/purchase/purchase-order/column.js

@@ -5,12 +5,14 @@ export const TableColumns = [
       key: "puOrgName", title: "采购组织", inputType: "Input",},
     attr:{
       isHidden:true,
+      width:150, 
     },
   },
   {
     item:{ 
       key: "billType",
       title: "订单类型",
+      width:150, 
     },
     attr:{
       isHidden:true,
@@ -54,7 +56,7 @@ export const TableColumns = [
     },
   },
   { 
-    item:{key: "paymentAgreementName", title: "付款协议",},
+    item:{key: "paymentAgreementName", title: "付款协议",width:100, },
     attr:{
       isHidden:true,
     },
@@ -80,13 +82,13 @@ export const TableColumns = [
     },
   },
   { 
-    item:{key: "puDeptName", title: "采购部门",},
+    item:{key: "puDeptName", title: "采购部门",width:100, },
     attr:{
       isHidden:true,
     },
   },
   { 
-    item:{key: "customerName", title: "收货客户" ,},
+    item:{key: "customerName", title: "收货客户" ,width:100,},
     attr:{
       isHidden:true,
     },
@@ -125,7 +127,7 @@ export const TableColumns = [
   },
   // { item:{key: "freezeCause", title: "冻结原因" },
   { 
-    item:{key: "qty", title: "总数量",width:100,},
+    item:{key: "qty", title: "总数量",width:80,},
     attr:{
       isHidden:true,
     },
@@ -134,7 +136,7 @@ export const TableColumns = [
     item:{
       key: "money", 
       title: "价税合计",
-      width:100,
+      width:80,
       // precision:2,
     },
     attr:{
@@ -179,6 +181,7 @@ export const TableColumns = [
     item:{
       key: "rebateMoney", 
       title: "订单使用返利金额" ,
+      width:100,
       // precision:2,
     },
     attr:{
@@ -197,7 +200,9 @@ export const TableColumns = [
             return prop ? (prop * 1).toFixed(2) : prop;
           },
       isHidden:true,
+     
     },
+    width:100,
   },
   // { item:{key: "warehouse", title: "WMS入库仓库" },
   { 
@@ -205,24 +210,28 @@ export const TableColumns = [
     attr:{
       isHidden:true,
     },
+    width:100,
   }, //WMS入库仓库名称
   { 
     item:{ key: "goodsAllocationName", title: "货位",},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{key: "customerDeptName", title: "客户部门" ,},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{key: "supplierContactsName", title: "供应商业务联系人",},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   {
     item:{
@@ -268,6 +277,7 @@ export const TableColumns = [
           },
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "paymentMoney", title: "累计付款金额" ,precision:2,},
@@ -278,6 +288,7 @@ export const TableColumns = [
           },
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "invoiceMoney", title: "发票金额" ,precision:2,},
@@ -288,6 +299,7 @@ export const TableColumns = [
           },
       isHidden:true,
     },
+    width:100,
   },
   // { item:{key: "supplierPersonal", title: "供应商业务员" },
   { 
@@ -295,12 +307,14 @@ export const TableColumns = [
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "marketingCode", title: "销售订单号" ,},
     attr:{
       isHidden:true,
     },
+    width:150,
   },
   // { item:{key: "flowId", title: "OA流程ID" },
   // { 
@@ -317,6 +331,7 @@ export const TableColumns = [
     attr:{
       isHidden:true,
     },
+    width:150,
   },
   { 
     item:{ key: "address", title: "收货地址" ,},
@@ -329,12 +344,13 @@ export const TableColumns = [
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   {
     item:{
       key: "isSendWms",
       title: "已同步WMS",
-      width:120,
+      width:80,
     },
     attr:{
       is: "el-checkbox",
@@ -349,18 +365,21 @@ export const TableColumns = [
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "closeTime", title: "最终关闭日期" ,},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "processTypeName", title: "处理方式" ,},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{
@@ -374,24 +393,28 @@ export const TableColumns = [
       disabled:true,
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "projectNowName", title: "在建工程项目" ,},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "operatingItemsName", title: "经营性项目" ,},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "isArrivalReson", title: "到货超期原因" ,},
     attr:{
       isHidden:true,
     },
+    width:100,
   },
   { 
     item:{ key: "createByName", title: "创建人" ,width:100,},
@@ -461,56 +484,65 @@ export const TabColumns = [
       },
       // { item:{key: "orderId", title: "采购订单ID" },
       { 
-        item:{ key: "demandCode", title:"采购需求单号"},
+        item:{ key: "demandCode", title:"采购需求单号",width:150,},
         attr:{
           isHidden:true,
         },
+        
       },
       { 
         item:{
           key: "contractNo",
           title:"合同编号",
+          width:150,
         },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "material", title: "物料ID" },
+        item:{key: "material", title: "物料ID",width:10, },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "materialName", title: "物料名称",  },
+        item:{key: "materialName", title: "物料名称",width:150,  },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "materialCode", title: "物料编码",  },
+        item:{key: "materialCode", title: "物料编码", width:150,  },
         attr:{
           isHidden:true,
         },
+       
       },
       // { item:{key: "materialClassify", title: "物料分类",  },},
       { 
-        item:{key: "materialManufacturersCode", title: "厂家物料编码",  },
+        item:{key: "materialManufacturersCode", title: "厂家物料编码", width:100,  },
         attr:{
           isHidden:true,
         },
+       
       },
       { 
-        item:{key: "specification", title: "规格",  },
+        item:{key: "specification", title: "规格",width:100,  },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "model", title: "型号",width: 120  },
+        item:{key: "model", title: "型号",width: 100  },
         attr:{
           isHidden:true,
         },
+        
       },
       {
         item:{
@@ -526,10 +558,11 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "manufacturerName", title: "生产厂家代理人",  },
+        item:{key: "manufacturerName", title: "生产厂家代理人", width:150, },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
         item:{
@@ -546,25 +579,26 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "unitName", title: "单位", width: 120 },
+        item:{key: "unitName", title: "单位", width: 80 },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "qty", title: "数量",width:120, },
+        item:{key: "qty", title: "数量",width:80, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "currencyName", title: "币种" },
+        item:{key: "currencyName", title: "币种", width:100, },
         attr:{
           isHidden:true,
         },
+       
       },
       { 
-        item:{key: "taxPrice", title: "含税单价" ,width:120,precision:2,},
+        item:{key: "taxPrice", title: "含税单价" ,width:80,precision:2,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -573,7 +607,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "money", title: "价税合计" ,width:120, precision:2,},
+        item:{key: "money", title: "价税合计" ,width:80, precision:2,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -582,7 +616,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "tax", title: "税率" ,width:120, precision:2,},
+        item:{key: "tax", title: "税率" ,width:80, precision:2,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -591,7 +625,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "taxDeductMoneya", title: "折扣金额", width:120, precision:2, },
+        item:{key: "taxDeductMoneya", title: "折扣金额", width:80, precision:2, },
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -600,7 +634,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "arrivalQty", title: "已到货数量" , width:120,},
+        item:{key: "arrivalQty", title: "已到货数量" , width:80,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -609,7 +643,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "unarrivedQty", title: "未到货数量" , width:120,},
+        item:{key: "unarrivedQty", title: "未到货数量" , width:80,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -618,7 +652,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "price", title: "无税单价" , idth:120, precision:2,},
+        item:{key: "price", title: "无税单价" , idth:80, precision:2,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -627,7 +661,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "notaxMoney", title: "无税金额" , width:120, precision:2,},
+        item:{key: "notaxMoney", title: "无税金额" , width:80, precision:2,},
         attr:{
           is: "el-computed-input-v2",
           formatter: (prop) => {
@@ -636,10 +670,11 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "priceSource", title: "价格目录ID" },
+        item:{key: "priceSource", title: "价格目录ID", width:10, },
         attr:{
           isHidden:true,
         },
+       
       },
       {
         item:{
@@ -716,74 +751,86 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "warehouse", title: "收货仓库",  },
+        item:{key: "warehouse", title: "收货仓库", width:100, },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "place", title: "收货地点",  },
+        item:{key: "place", title: "收货地点", width:100,  },
         attr:{
           isHidden:true,
         },
+       
       },
       { 
-        item:{key: "address", title: "收货地址",  },
+        item:{key: "address", title: "收货地址",width:100,  },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "productBatch", title: "产品批号",  },
+        item:{key: "productBatch", title: "产品批号", width:100, },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "manufactureDate", title: "生产日期",  },
+        item:{key: "manufactureDate", title: "生产日期", width:100, },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "efficacyLoseDate", title: "有效期至/失效日期",  },
+        item:{key: "efficacyLoseDate", title: "有效期至/失效日期",width:100,  },
         attr:{
           isHidden:true,
         },
+        
       },
       { 
-        item:{key: "approvalNumber", title: "批准文号",  },
+        item:{key: "approvalNumber", title: "批准文号",  width:100, },
         attr:{
           isHidden:true,
         },
+       
       },
       { 
-        item:{key: "registration", title: "注册证号",  },
+        item:{key: "registration", title: "注册证号", width:100, },
         attr:{
           isHidden:true,
         },
+        
       },
       {
         item:{
           
           key: "storageCondition",
           title: "存储条件",
+          width:100,
         },
         attr:{
           is: "el-dict-tag",
           dictName: "sys_storage_condition",
-        }
+        },
+        
       },
       {
         item:{
           
           key: "carriageCondition",
           title: "运输条件",
+          width:100,
         },
         attr:{
           is: "el-dict-tag",
           dictName: "sys_conditions_carriage",
-        }
+        },
+        
       },
       {
         item:{
@@ -830,7 +877,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "originalQty", title: "原始数量" ,width:120,},
+        item:{key: "originalQty", title: "原始数量" ,width:80,},
         attr:{
           isHidden:true,
         },
@@ -839,7 +886,7 @@ export const TabColumns = [
         item:{
           key: "originalMoney", 
           title: "原始金额" ,
-          width:120,
+          width:80,
         },
         attr:{
           is: "el-computed-input-v2",
@@ -849,50 +896,50 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "reservedQty", title: "预留数量",width:120, },
+        item:{key: "reservedQty", title: "预留数量",width:80, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "reservedPeriod", title: "预留周期",  },
+        item:{key: "reservedPeriod", title: "预留周期", width:100,  },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "taxDeductClassify", title: "扣税类别" },
+        item:{key: "taxDeductClassify", title: "扣税类别" , width:100,},
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "exchangeRate", title: "折本汇率" ,width:100,},
+        item:{key: "exchangeRate", title: "折本汇率" ,width:80,},
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "directProductBatch", title: "直运产品批号",  },
+        item:{key: "directProductBatch", title: "直运产品批号", width:100,  },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "discountRule", title: "折扣规则编码",  },
+        item:{key: "discountRule", title: "折扣规则编码", width:100,  },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "source", title: "上游单据号",  },
+        item:{key: "source", title: "上游单据号", width:150,  },
         attr:{
           isHidden:true,
         },
       },
       // { item:{key: "sourceId", title: "上游单据ID",  },},
       { 
-        item:{key: "arrivalDatePlan", title: "计划到货日期",  },
+        item:{key: "arrivalDatePlan", title: "计划到货日期", width:100,  },
         attr:{
           isHidden:true,
         },
@@ -901,7 +948,8 @@ export const TabColumns = [
         item:{
           
           key: "priceType",
-          title: "价格类型",
+          title: "价格类型"
+          , width:100,
         },
         attr:{
           is: "el-dict-tag",
@@ -924,25 +972,25 @@ export const TabColumns = [
         },
        },
       { 
-        item:{key: "materialClassifyOneName", title: "物料一级分类",  },
+        item:{key: "materialClassifyOneName", title: "物料一级分类",  width:100, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "materialClassifyTwoName", title: "物料二级分类",  },
+        item:{key: "materialClassifyTwoName", title: "物料二级分类",  width:100, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "materialClassifyThreeName", title: "物料三级分类",  },
+        item:{key: "materialClassifyThreeName", title: "物料三级分类",  width:100, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "materialClassifyFourName", title: "物料四级分类",  },
+        item:{key: "materialClassifyFourName", title: "物料四级分类",  width:100, },
         attr:{
           isHidden:true,
         },
@@ -967,19 +1015,19 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "material", title: "物料ID", },
+        item:{key: "material", title: "物料ID", width:1, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "materialName", title: "物料名称", },
+        item:{key: "materialName", title: "物料名称", width:150, },
         attr:{
           isHidden:true,
         },
       },
       { 
-        item:{key: "specification", title: "规格" },
+        item:{key: "specification", title: "规格", width:100, },
         attr:{
           isHidden:true,
         },
@@ -1021,7 +1069,7 @@ export const TabColumns = [
         },
       },
       { 
-        item:{key: "floatQty", title: "未到货数量" },
+        item:{key: "floatQty", title: "未到货数量",width:120, },
         attr:{
           isHidden:true,
         },

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

@@ -662,8 +662,7 @@ export default {
           :disabled="judgeIsLineReturn()"
         >行退回</el-button>
       </el-row>
-      <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
-       
+      <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px;height: 1000px;">
         <el-tab-pane 
           v-for="(column, index) in tabColumns" 
           :key="index" 
@@ -671,9 +670,10 @@ export default {
           :name="column.key"
         >
           <el-super-table
+            style="padding: 20px 10px;height: 800px;"
             v-model="tabTableDatas[column.key]"
             :ref="column.key"
-            max-height="200"
+            max-height="500"
             :dict="dict"
             :columns="column.tableColumns"
             :selectable="setTabSelectable"

+ 23 - 12
src/views/purchase/purchase-order/print/index.vue

@@ -163,8 +163,13 @@ export default {
       type: [String, Number],
       require: true,
     },
+    value:{
+      type:Object,
+      require:true
+    }
   },
   data() {
+    console.log(this.value,'this.value');
     return {
       visible: false,
       disabled: false,
@@ -205,7 +210,8 @@ export default {
         standard: "",
         extarCss: "",
       },
-      params: {},
+      // params: {},
+      // params: this.value,
     };
   },
   computed: {
@@ -215,6 +221,11 @@ export default {
       },
       set: function () {},
     },
+    params:{
+      get:function(){
+        return this.value;
+      }
+    }
   },
   watch: {},
   methods: {
@@ -249,17 +260,17 @@ export default {
     },
   },
   async created() {
-    try {
-      this.disabled = true;
-      const { data, code } = await PRINT({ id: this.$props.id || 628 });
-      if (code === 200) {
-        this.params = data;
-        this.disabled = false;
-      }
-    } catch (err) {
-      alert(err);
-    } finally {
-    }
+    // try {
+    //   this.disabled = true;
+    //   const { data, code } = await PRINT({ id: this.$props.id || 628 });
+    //   if (code === 200) {
+    //     this.params = data;
+    //     this.disabled = false;
+    //   }
+    // } catch (err) {
+    //   alert(err);
+    // } finally {
+    // }
   },
   mounted() {},
   destroyed() {},

+ 26 - 3
src/views/purchase/purchase-order/see/index.vue

@@ -8,6 +8,7 @@ import {
 } from "@/utils/init/index.js";
 import { Columns, TabColumns } from "../add/column";
 import orderApi from "@/api/business/purchase/purchase-order";
+import { PRINT } from "@/api/business/purchase/task";
 
 const NewColumns = initColumns(Columns);
 const NewTabColumns = TabColumns.map((element) => ({
@@ -26,12 +27,14 @@ export default {
   dicts: initDicts(SelectColumns),
   components: {
     FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+    FilePrint:() => import('../print/index.vue'),
   },
   data() {
     return {
       visible: false,
-      loading:false,
+      loading: false,
       columns: NewColumns,
+      printData:{},
       rules: initRules(NewColumns),
       params: {
         ...initParams(NewColumns),
@@ -72,6 +75,18 @@ export default {
       } finally {
         this.loading = false;
       }
+
+      try {
+          this.loading = true;
+          const { data, code } = await PRINT({ id: this.params.id || 628 });
+          if (code === 200) {
+            this.printData = data;
+            this.loading = false;
+          }
+        } catch (err) {
+          alert(err);
+        } finally {
+        }
     },
     // 取 消
     handleCancel() {
@@ -119,9 +134,13 @@ export default {
 
       return false;
     },
-    beforeOpen() { },
+    beforeOpen() { 
+      
+    },
+  },
+  created() { 
+
   },
-  created() { },
   mounted() { },
   destroyed() { },
 };
@@ -144,6 +163,7 @@ export default {
       :rules="rules"
       ref="orderSeeForm" 
     >
+        
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -156,6 +176,8 @@ export default {
           ">
           <h3>查看</h3>
           <div style="text-align: right">
+            <!-- <FilePrint :id="params.id"></FilePrint> -->
+            <FilePrint v-model="printData"></FilePrint>
             <el-button size="mini" @click="handleRefresh">刷新</el-button>
             <template v-if="judgeIsToNC()">
               <el-tooltip
@@ -176,6 +198,7 @@ export default {
                 }}</el-button>
               </el-tooltip>
             </template>
+            
             <el-button size="mini" @click="handleCancel">取 消</el-button>
           </div>
         </div>

+ 35 - 30
src/views/purchase/task/columns.js

@@ -1,78 +1,83 @@
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "code", title: "订单生成单号" }, attr: {} },
+    { item: { key: "code", title: "订单生成单号",width :160 }, attr: {} },
     {
-      item: { key: "status", title: "状态" },
+      item: { key: "status", title: "状态" ,width :100},
       attr: {
         is: "el-dict-tag",
         dictName: "purchase_task_status",
       },
     },
-    { item: { key: "demandCode", title: "需求单号" }, attr: {} },
-    { item: { key: "materialName", title: "物料" }, attr: {} },
+
+    {
+      item: { key: "existPrice", title: "是否有价格",width :100 },
+      attr: { is: "el-dict-tag", dictName: "sys_true_false" },
+    },
+    { item: { key: "demandCode", title: "需求单号",width :150 }, attr: {} },
+    { item: { key: "materialName", title: "物料",width :150 }, attr: {} },
     {
-      item: { key: "materialCode", title: "物料编码" },
+      item: { key: "materialCode", title: "物料编码",width :150 },
       attr: {},
     },
     {
-      item: { key: "materialDesc", title: "物料描述" },
+      item: { key: "materialDesc", title: "物料描述",width :100 },
       attr: {},
     },
     {
-      item: { key: "manufacturerName", title: "生产厂家" },
+      item: { key: "manufacturerName", title: "生产厂家" ,width :100},
       attr: {},
     },
-    { item: { key: "puQty", title: "采购数量" }, attr: {} },
+    { item: { key: "puQty", title: "采购数量",width :100 }, attr: {} },
     {
-      item: { key: "executeQty", title: "已执行数量" },
+      item: { key: "executeQty", title: "已执行数量" ,width :100},
       attr: {},
     },
     {
-      item: { key: "residueQty", title: "未执行数量" },
+      item: { key: "residueQty", title: "未执行数量",width :100 },
       attr: {},
     },
     {
-      item: { key: "priceType", title: "价格类型" },
+      item: { key: "priceType", title: "价格类型" ,width :100},
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { key: "puUnitName", title: "采购单位" }, attr: {} },
-    { item: { key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { key: "puUnitName", title: "采购单位",width :100 }, attr: {} },
+    { item: { key: "buyerName", title: "采购员",width :100 }, attr: {} },
     {
-      item: { key: "supplierName", title: "建议供应商" },
+      item: { key: "supplierName", title: "建议供应商",width :100 },
       attr: {},
     },
-    { item: { key: "puOrgName", title: "采购组织" }, attr: {} },
-    { item: { key: "currencyName", title: "币种" }, attr: {} },
-    { item: { key: "source", title: "需求来源" }, attr: {} },
+    { item: { key: "puOrgName", title: "采购组织",width :100 }, attr: {} },
+    { item: { key: "currencyName", title: "币种",width :100 }, attr: {} },
+    { item: { key: "source", title: "需求单号" ,width :100}, attr: {} },
     {
-      item: { key: "customerName", title: "收货客户" },
+      item: { key: "customerName", title: "收货客户",width :100 },
       attr: {},
     },
     {
-      item: { key: "assignSupplierName", title: "指定供应商" },
+      item: { key: "assignSupplierName", title: "指定供应商" ,width :100},
       attr: {},
     },
-    { item: { key: "demandDate", title: "需求时间" }, attr: {} },
-    { item: { key: "projectName", title: "项目名称" }, attr: {} },
+    { item: { key: "demandDate", title: "需求时间",width :100 }, attr: {} },
+    { item: { key: "projectName", title: "项目名称",width :100 }, attr: {} },
     {
-      item: { key: "demandPersonalName", title: "需求人" },
+      item: { key: "demandPersonalName", title: "需求人",width :100 },
       attr: {},
     },
     {
-      item: { key: "demandOrgName", title: "需求组织" },
+      item: { key: "demandOrgName", title: "需求组织" ,width :100},
       attr: {},
     },
     {
-      item: { key: "demandDeptName", title: "需求部门" },
+      item: { key: "demandDeptName", title: "需求部门",width :100 },
       attr: {},
     },
     {
-      item: { key: "isBack", title: "是否退回" },
-      attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
+      item: { key: "isBack", title: "是否退回",width :100 },
+      attr: { is: "el-dict-tag", dictName: "sys_yes_no" ,width :100},
     },
-    { item: { key: "baskCause", title: "退回原因" }, attr: {} },
-    { item: { key: "backDate", title: "退回日期" }, attr: {} },
-    { item: { key: "unitName", title: "单位" }, attr: {} },
+    { item: { key: "baskCause", title: "退回原因" ,width :100}, attr: {} },
+    { item: { key: "backDate", title: "退回日期",width :100 }, attr: {} },
+    { item: { key: "unitName", title: "单位" ,width :100}, attr: {} },
   ].map(({ item, attr }) => ({
     attr,
     item: {
@@ -198,7 +203,7 @@ export default function useColumns() {
     {
       item: {
         key: "documentsCodes",
-        title: "需求来源",
+        title: "采购需求单号",
         span: 12,
       },
       attr: {

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

@@ -151,14 +151,14 @@ export default {
         >
         </zp-button>
       </el-button-group>
-      <el-button-group>
+      <!-- <el-button-group>
         <dc-button
           :size="size"
           :page="page"
           :data="params"
           @success="useQuery(params, page)"
         ></dc-button>
-      </el-button-group>
+      </el-button-group> -->
     </div>
     <el-super-table
       v-model="tableData"

+ 6 - 1
src/views/purchase/task/see/columns.js

@@ -8,6 +8,11 @@ export default function useColumns() {
         dictName: "purchase_task_status",
       },
     },
+    { item: { key: "existPrice", title: "是否有价格",width :150 ,}, attr: {
+      is: "el-dict-tag",
+      dictName: "is_effective",
+
+    } },
     { item: { key: "demandCode", title: "需求单号" }, attr: {} },
     { item: { key: "materialName", title: "物料" }, attr: {} },
     {
@@ -43,7 +48,7 @@ export default function useColumns() {
     },
     { item: { key: "puOrgName", title: "采购组织" }, attr: {} },
     { item: { key: "currencyName", title: "币种" }, attr: {} },
-    { item: { key: "source", title: "需求来源" }, attr: {} },
+    { item: { key: "source", title: "需求单号" }, attr: {} },
     {
       item: { key: "customerName", title: "收货客户" },
       attr: {},

+ 1 - 1
src/views/purchase/task/tui-hui-xu-qiu/index.vue

@@ -44,7 +44,7 @@ export default {
         const {
           params: { baskCause },
         } = this;
-        const documentIds = prop.map((item) => item.id);
+        const documentIds = prop.map((item) => Number(item.id));
         const { msg, code } = await DOCUMENTSRETURN({
           baskCause,
           documentIds,

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

@@ -18,7 +18,7 @@ export default {
   },
   data() {
     return {
-      title: "协议直采",
+      title: "订单生成",
       width: "100%",
       column: 1,
       visible: false,

+ 28 - 19
src/views/purchase/task/zhuan-pai/index.vue

@@ -16,13 +16,17 @@ export default {
       title: "转 派",
       visible: false,
       loading: false,
-      params: { id: "", buyer: "", buyerName: "" },
+      // params: { id: "", buyer: "", buyerName: "" },
+      params:[],
+      buyerModel:{buyer: "", buyerName: ""},
     };
   },
   computed: {
     disabled: {
       get() {
-        return this.selectData.length !== 1;
+        // return this.selectData.length !== 1;
+        // add by wjie
+        return this.selectData.length < 1;
       },
       set() {},
     },
@@ -31,29 +35,34 @@ export default {
   methods: {
     //
     open(prop) {
+      let arr = prop.filter((element) => element.status != '0');
+      if(arr.length > 0){
+        this.$modal.notifyWarning("您所选的单据中存在非自由态,无法进行操作,请确认数据!");
+        return;
+      }
+      this.params = prop;
       this.visible = true;
-      this.params.id = prop.id;
     },
     //
     hide() {
       this.visible = false;
-      this.params.id = "";
-      this.params.buyer = "";
-      this.params.buyerName = "";
+      // this.params.id = "";
+      // this.params.buyer = "";
+      // this.params.buyerName = "";
+      this.params = [];
+      this.buyerModel = {buyer: "", buyerName: ""};
     },
     //
     async submit(prop) {
       try {
         // try
         this.loading = true;
-        const { id, buyer, buyerName } = prop;
-        const { msg, code } = await MODEIFYBUYER([
-          {
-            id,
-            buyer,
-            buyerName,
-          },
-        ]);
+        const { buyer, buyerName } = prop;
+        for(let i in this.selectData){
+          this.selectData[i].buyer = buyer;
+          this.selectData[i].buyerName = buyerName;
+        }
+        const { msg, code } = await MODEIFYBUYER(this.selectData);
         if (code === 200) {
           this.hide();
           this.$emit("success");
@@ -78,7 +87,7 @@ export default {
     v-bind="$attrs"
     v-on="$listeners"
     :disabled="disabled"
-    @click="open(selectData[0])"
+    @click="open(selectData)"
   >
     {{ title }}
     <el-dialog
@@ -99,7 +108,7 @@ export default {
           type="primary"
           :size="$attrs.size"
           :loading="loading"
-          @click="submit(params)"
+          @click="submit(buyerModel)"
           >确 认</el-button
         >
       </div>
@@ -113,15 +122,15 @@ export default {
       </el-alert>
       <el-form
         :size="$attrs.size"
-        :model="params"
+        :model="buyerModel"
         label-width="0px"
         label-position="right"
         style="padding: 0"
       >
         <el-form-item prop="" label="">
           <el-popover-select-v2
-            v-model="params.buyerName"
-            :source.sync="params"
+            v-model="buyerModel.buyerName"
+            :source.sync="buyerModel"
             :data-mapping="{ buyer: 'code', buyerName: 'name' }"
             valueKey="name"
             referName="CONTACTS_PARAM"

+ 116 - 62
src/views/purchase/transferOrder/add.vue

@@ -18,6 +18,19 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="调入库存组织">
+              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
+                @clear="clean('调入库存组织')"
+                @change="controlCk('调入库存组织')"
+                @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
+                style="width: 200px"
+              >
+                <el-option v-for="item in ruOrgOptions" :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 :disabled="sonDisable || isOrg"
                 size="mini"
@@ -60,19 +73,6 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="调入库存组织">
-              <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
-                @clear="clean('调入库存组织')"
-                @change="controlCk('调入库存组织')"
-                @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
-                style="width: 200px"
-              >
-                <el-option v-for="item in ruOrgOptions" :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 :disabled="sonDisable || isOrg"
                 size="mini"
@@ -161,7 +161,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="总数量">
-              <el-input clearable :disabled="sonDisable" v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
+              <el-input disabled v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
             </el-form-item>
           </el-col>
 
@@ -285,6 +285,7 @@
             </div>
             
             <el-table
+              v-loading="loading"
               :data="materialInfo"
               fit
               border
@@ -299,7 +300,7 @@
                 prop="rowno"
               >
                 <template slot-scope="scope">
-                  {{ scope.$index + 1 + "0" }}
+                  {{ scope.row.rowno = scope.$index + 1 + "0" }}
                 </template>
               </el-table-column>
               <el-table-column
@@ -505,7 +506,7 @@
                   <el-form-item class="hang">
                     <el-input
                       clearable
-                      :disabled="sonDisable"
+                      :disabled="sonDisable || isOrg"
                       size="mini"
                       v-model="scope.row.storageDeptName"
                       @clear="cleanMx(scope.$index, '调入部门')"
@@ -521,7 +522,7 @@
                     >
                       <el-button
                         size="mini"
-                        :disabled="sonDisable"
+                        :disabled="sonDisable || isOrg"
                         slot="append"
                         icon="el-icon-more"
                         @click="
@@ -1337,7 +1338,7 @@
             (row.status == '1' || row.status == '2') &&
             row.oaId
           "
-          >跳转OA</el-button
+          >审批</el-button
         >
         <el-button
           type="primary"
@@ -1348,6 +1349,14 @@
           >复制</el-button
         >
         <el-button
+          type="primary"
+          size="mini"
+          plain
+          @click="editPage"
+          v-if="sonPageStu == 'check' && row.status == '0'"
+          >编辑</el-button
+        >
+        <el-button
           type="danger"
           size="mini"
           plain
@@ -1423,6 +1432,7 @@ export default {
   },
   data() {
     return {
+      loading: true,
       // 不能直接改变props传来的值
       sonPageStu: this.pageStu,
       sonDisable: this.disable,
@@ -1447,6 +1457,7 @@ export default {
         currencyName: "",
         rate: 1,
         onRouteAffilliation: "",
+        oaId: '',
         qty: "",
         accountPath: "",
         customer: "",
@@ -1476,8 +1487,6 @@ export default {
         title: "",
         // 仓库编码
         stordocId: "",
-      },
-      referConditionMx: {
         orgCode: "",
         materialCode: "",
         unitCode: "",
@@ -1529,6 +1538,8 @@ export default {
       this.getDetails(this.row);
       this.isDRCk = false;
       this.isDCCk = false;
+    } else if (this.pageStu == "add") {
+      this.loading = false
     }
   },
   methods: {
@@ -1572,12 +1583,22 @@ export default {
         item.storageAllocationName = null;
       });
     },
-    // 输入数量或者主数量同步改变
+    // 输入数量或者主数量同步改变,计算基本信息总数量
     getZSL(scope) {
       scope.row.qty = scope.row.mainQty;
+      let sum = 0
+      this.materialInfo.forEach(item => {
+        sum += Number(item.qty)
+        this.basicForm.qty = sum
+      })
     },
     getSL(scope) {
       scope.row.mainQty = scope.row.qty;
+      let sum = 0
+      this.materialInfo.forEach(item => {
+        sum += Number(item.qty)
+        this.basicForm.qty = sum
+      })
     },
     copy() {
       // await this.getDetails(this.row)
@@ -1630,6 +1651,10 @@ export default {
       this.isDRCk = false;
       this.isDCCk = false;
     },
+    editPage() {
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+    },
     toNC() {
       againToNC(this.row)
         .then((res) => {
@@ -1764,7 +1789,11 @@ export default {
           // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
           this.controlCk();
         }
-      });
+      }).then(() => {
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
+      })
     },
     // 回显参照框
     reBackRefer(type, id, title) {
@@ -1888,21 +1917,7 @@ export default {
         this.basicForm.deliveryInventoryOrg = selection[0].id;
         this.basicForm.deliveryInventoryOrgCode = selection[0].code;
         this.basicForm.deliveryInventoryOrgName = selection[0].name;
-        // 清空调出仓库,部门
-        this.basicForm.deliveryWarehouse = "";
-        this.basicForm.deliveryWarehouseCode = "";
-        this.basicForm.deliveryWarehouseName = "";
-        this.basicForm.deliveryDept = "";
-        this.basicForm.deliveryDeptName = "";
-        // 选择调入库存组织时判断调拨方式
-        if (
-          this.basicForm.storageInventoryOrg ==
-          this.basicForm.deliveryInventoryOrg
-        ) {
-          this.basicForm.allotType = "4";
-        } else {
-          this.basicForm.allotType = "2";
-        }
+        this.clearDCZZ()
       }
       if (this.referCondition.title == "调入库存组织") {
         this.ruOrgOptions = selection;
@@ -1910,18 +1925,7 @@ export default {
         this.basicForm.storageInventory = selection[0].code;
         this.basicForm.storageInventoryOrgName = selection[0].name;
         this.basicForm.onRouteAffilliation = selection[0].name;
-        // 选择调入库存组织清空仓库
-        this.basicForm.storageWarehouse = "";
-        this.basicForm.storageWarehouseName = "";
-        // 选择调入库存组织时判断调拨方式
-        if (
-          this.basicForm.storageInventoryOrg ==
-          this.basicForm.deliveryInventoryOrg
-        ) {
-          this.basicForm.allotType = "4";
-        } else {
-          this.basicForm.allotType = "2";
-        }
+        this.clearDRZZ()
       }
       if (this.referCondition.title == "调出业务员") {
         this.manOptions = selection;
@@ -1993,6 +1997,56 @@ export default {
       // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
       this.controlCk();
     },
+    // 调出库存组织清空相关数据
+    clearDCZZ() {
+      // 清空调出仓库,部门
+      this.basicForm.deliveryWarehouse = "";
+      this.basicForm.deliveryWarehouseCode = "";
+      this.basicForm.deliveryWarehouseName = "";
+      this.basicForm.deliveryDept = "";
+      this.basicForm.deliveryDeptName = "";
+      // 清空调出货位且禁用
+      this.materialInfo.forEach((item) => {
+        item.deliveryAllocation = null;
+        item.deliveryAllocationName = null;
+      });
+      this.isDCCk = true;
+      // 选择调入库存组织时判断调拨方式
+      if (
+        this.basicForm.storageInventoryOrg ==
+        this.basicForm.deliveryInventoryOrg
+      ) {
+        this.basicForm.allotType = "4";
+      } else {
+        this.basicForm.allotType = "2";
+      }
+    },
+    // 调入库存组织清空相关数据
+    clearDRZZ() {
+      // 选择调入库存组织清空仓库
+      this.basicForm.storageWarehouse = "";
+      this.basicForm.storageWarehouseName = "";
+      // 清空调入部门
+      this.materialInfo.forEach((item) => {
+        item.storageDept = null;
+        item.storageDeptName = null;
+      });
+      // 清空调入货位且禁用
+      this.materialInfo.forEach((item) => {
+        item.storageAllocation = null;
+        item.storageAllocationName = null;
+      });
+      this.isDRCk = true
+      // 选择调入库存组织时判断调拨方式
+      if (
+        this.basicForm.storageInventoryOrg ==
+        this.basicForm.deliveryInventoryOrg
+      ) {
+        this.basicForm.allotType = "4";
+      } else {
+        this.basicForm.allotType = "2";
+      }
+    },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
@@ -2035,12 +2089,12 @@ export default {
     // 明细行选择批次号
     chooseBatch(index) {
       this.tableIndex = index;
-      this.referConditionMx.orgId = this.basicForm.deliveryInventoryOrg;
-      this.referConditionMx.materialCode =
+      this.referCondition.orgId = this.basicForm.deliveryInventoryOrg;
+      this.referCondition.materialCode =
       this.materialInfo[this.tableIndex].materialCode;
-      this.referConditionMx.unitId = this.materialInfo[this.tableIndex].unit;
-      this.referConditionMx.warehouseId = this.basicForm.deliveryWarehouse;
-      this.$refs.batchRefer.init(this.referConditionMx);
+      this.referCondition.unitId = this.materialInfo[this.tableIndex].unit;
+      this.referCondition.warehouseId = this.basicForm.deliveryWarehouse;
+      this.$refs.batchRefer.init(this.referCondition);
     },
     selectBatch(selection) {
       console.log("选中的批次号", selection);
@@ -2062,20 +2116,15 @@ export default {
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
       this.referCondition.pkOrg = pkOrg;
-      this.referCondition.drpOrg = pkOrg;
       this.$refs.refer.init(this.referCondition);
     },
     // 选择框彻底清空
     clean(val) {
       if (val == "调出库存组织") {
-        this.basicForm.deliveryInventoryOrg = "";
-        this.basicForm.deliveryInventoryOrgCode = "";
-        this.basicForm.deliveryInventoryOrgName = "";
+        this.clearDCZZ()
       }
       if (val == "调入库存组织") {
-        this.basicForm.storageInventoryOrg = "";
-        this.basicForm.storageInventory = "";
-        this.basicForm.storageInventoryOrgName = "";
+        this.clearDRZZ()
       }
       if (val == "调出业务员") {
         this.basicForm.businessPersonal = "";
@@ -2084,6 +2133,11 @@ export default {
       if (val == "调入仓库") {
         this.basicForm.storageWarehouse = "";
         this.basicForm.storageWarehouseName = "";
+        this.materialInfo.forEach((item) => {
+          item.storageAllocation = null;
+          item.storageAllocationName = null;
+        });
+        this.isDRCk = true
       }
       if (val == "调出仓库") {
         this.basicForm.deliveryWarehouse = "";
@@ -2166,6 +2220,6 @@ export default {
   margin-left: 0px !important;
 }
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
 </style>

+ 18 - 3
src/views/purchase/transferOrder/index.vue

@@ -39,8 +39,8 @@
               </el-form-item>
             </el-col>
             <div style="position: absolute;top: 3px;right: 10px;">
-              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+              <el-button size="mini" plain @click="resetList">重置</el-button>
             </div>
           </el-row>
 
@@ -69,6 +69,7 @@
         </div>
 
         <el-table 
+          v-loading="loading"
           :data="tableList" 
           fit
           :cell-style="{ borderColor: '#c0c0c0' }"
@@ -83,6 +84,7 @@
           style="font-size: 12px;"
           ref="multipleTable"
           @row-click="select"
+          @row-dblclick="doubleClick"
         >
           <el-table-column show-overflow-tooltip label="单据号" align="center" prop="code" width="150px"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="status" width="100px" :formatter="formatterStatus"/>
@@ -336,6 +338,7 @@ export default {
   },
   data() {
     return {
+      loading: true,
       expanded: false,
       // 页面配置
       isList: true,
@@ -460,6 +463,12 @@ export default {
           this.total = res.total
           this.materialInfo = res.rows[0].stAllotMaterialList
         }
+      }).then(() => {
+        // 合计不显示重绘
+        this.$refs.multipleTable.doLayout()
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
       })
     },
     addOrder() {
@@ -473,6 +482,12 @@ export default {
       this.rowDetail = row
       this.disable = true
     },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
     edit(row) {
       this.isList = false
       this.page = 'edit'
@@ -561,7 +576,7 @@ export default {
   text-align: right;
 }
 ::v-deep .el-table__row > td {
-  border: none;
+  border-right: none;
 }
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است