Browse Source

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

002390 1 year ago
parent
commit
46f650ab9a
31 changed files with 2929 additions and 989 deletions
  1. 52 0
      src/api/business/spd/fillin/dailysale_quantity_assess.js
  2. 3 3
      src/assets/styles/index.scss
  3. 208 0
      src/views/business/spd/fillin/dailysale_quantity_assess/addmaterial.vue
  4. 209 0
      src/views/business/spd/fillin/dailysale_quantity_assess/choosematerial.vue
  5. 883 0
      src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue
  6. 223 0
      src/views/business/spd/fillin/dailysale_quantity_assess/index.vue
  7. 184 186
      src/views/business/spd/goal_management/AnnualSaleGoal.vue
  8. 122 28
      src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue
  9. 105 17
      src/views/business/spd/goal_management/MonthGoalMerge.vue
  10. 31 7
      src/views/business/spd/goal_management/MonthReturnGoal.vue
  11. 104 17
      src/views/business/spd/goal_management/MonthReturnMerge.vue
  12. 48 57
      src/views/business/spd/goal_management/MonthSaleGoal.vue
  13. 0 1
      src/views/business/spd/target/targetMk/add.vue
  14. 1 1
      src/views/purchase/DemandSummary/add.vue
  15. 56 90
      src/views/purchase/DemandSummary/index.vue
  16. 37 14
      src/views/purchase/PurchaseDemandList/add.vue
  17. 6 3
      src/views/purchase/PurchaseDemandList/index.vue
  18. 15 15
      src/views/purchase/apply/columns.js
  19. 37 37
      src/views/purchase/apply/see/columns.js
  20. 35 35
      src/views/purchase/catalogue/columns.js
  21. 25 25
      src/views/purchase/catalogue/see/columns.js
  22. 47 45
      src/views/purchase/contract/add/columns.js
  23. 54 54
      src/views/purchase/contract/columns.js
  24. 102 102
      src/views/purchase/contract/edit/columns.js
  25. 102 102
      src/views/purchase/contract/see/columns.js
  26. 103 55
      src/views/purchase/purchase-order/column.js
  27. 34 29
      src/views/purchase/task/columns.js
  28. 2 1
      src/views/purchase/task/see/columns.js
  29. 1 1
      src/views/purchase/task/xie-yi-zhi-cai/index.vue
  30. 99 63
      src/views/purchase/transferOrder/add.vue
  31. 1 1
      vue.config.js

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

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

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

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

@@ -0,0 +1,883 @@
+
+<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-dd"
+                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-date-picker
+                v-model="form.createTime"
+                clearable
+                type="date"
+                value-format="yyyy-MM-dd"
+                readonly
+              >
+              </el-date-picker>
+            </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: {
+        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) {
+            var curDate = new Date(newVal);
+            console.log('curDate',curDate);
+            /* 获取当前月份 */
+            var curMonth = curDate.getMonth();
+            /*  生成实际的月份: 由于curMonth会比实际月份小1, 故需加1 */
+            curDate.setMonth(curMonth + 1);
+            /* 将日期设置为0, 这里为什么要这样设置, 我不知道原因, 这是从网上学来的 */
+            curDate.setDate(0);
+            /* 返回当月的天数 */
+            this.numDay = curDate.getDate();
+        },
+        immediate:true,
+    }
+  },
+  computed: {
+    items() {
+      return this.form.items.filter(({ delFlag }) => delFlag !== "2");
+    },
+  },
+  async created() {
+    switch (this.openMode) {
+      case "add":
+        var now = new Date(); // 当前日期
+        var nowYear = now.getFullYear(); //当前年
+        var nowMonth = now.getMonth() ;
+        this.form.month = new Date(nowYear,nowMonth,1,"00","00");
+        // this.form.createTime = new Date();
+        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();
+    },
+    //获取当月天数
+    getCountDays(val) {
+        console.log('val',val);
+        var curDate = new Date(val);
+        console.log('curDate',curDate);
+        /* 获取当前月份 */
+        var curMonth = curDate.getMonth();
+        /*  生成实际的月份: 由于curMonth会比实际月份小1, 故需加1 */
+        curDate.setMonth(curMonth + 1);
+        /* 将日期设置为0, 这里为什么要这样设置, 我不知道原因, 这是从网上学来的 */
+        curDate.setDate(0);
+        /* 返回当月的天数 */
+        return curDate.getDate();
+    }
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+}
+</style>

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

@@ -0,0 +1,223 @@
+
+<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">
+            <template slot-scope="scope">
+              {{scope.row.month.substring(0,7)}}
+            </template>
+          </el-table-column>
+          <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){
+      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>

+ 184 - 186
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -98,6 +98,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>
 
@@ -290,158 +302,158 @@
         </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: 87%">
+          <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-row>
-        <el-table show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange" style="width: 100%; margin-top: 20px">
-          <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="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="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" 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" 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" 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" 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" 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 sum-text="小计" 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="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" 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" 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" 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" width="180" :render-header="addRedStar">
+                <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="addRedStar">
+                <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="addRedStar">
+                <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>
@@ -478,8 +490,6 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
   </div>
 </template>
 
@@ -633,9 +643,6 @@ export default {
         creator: [{required: true, message: '制单人不能为空', trigger: 'blur'}],
         dept: [{required: true, message: '部门不能为空', trigger: 'blur'}]
       },
-      // 参照条件
-      referCondition: {type: '', isPage: true, title: '', index: null},
-      classOptions: [],
       // 子表数组
       annualSaleGoalDetailsList: [],
       // 用户导入参数
@@ -653,6 +660,7 @@ export default {
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/goal_management/annualSaleGoal/importData"
       },
+      activeName: 'annualSaleGoalDetails'
     };
   },
   created() {
@@ -943,36 +951,6 @@ export default {
       }
       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
-      }
-    },
     // 给table添加必填项
     addRedStar(h, { column }) {
       return [
@@ -1003,7 +981,7 @@ export default {
     /** 导入按钮操作 */
     handleImport() {
       this.upload.open = true;
-      if (this.open && this.form.id !== null) {
+      if (this.open) {
         this.upload.title = "年销售目标填报明细导入"
         this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/annualSaleGoalDetails/importData/" + this.form.id
       } else {
@@ -1013,7 +991,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      if (this.open && this.form.id !== null) {
+      if (this.open) {
         this.download('goal_management/annualSaleGoalDetails/importTemplate', {
         }, `annualSaleGoalDetails_${new Date().getTime()}.xlsx`)
       } else {
@@ -1027,15 +1005,35 @@ export default {
     },
     // 文件上传成功处理
     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();
+      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);
     }
   }
 };

+ 122 - 28
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -109,6 +109,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 +157,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">
@@ -332,7 +342,7 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="年销售目标合并明细" name="annualSaleGoalMergeDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
+            <el-table max-height="300" show-summary sum-text="小计" 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">
@@ -388,7 +398,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>
@@ -456,7 +466,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="区域目标汇总(年)" name="zoneGoalSum(year)">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="areaDetailList">
+            <el-table max-height="300" show-summary sum-text="小计" 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">
@@ -485,7 +495,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>
@@ -553,7 +563,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="客户目标汇总(年)" name="customerGoalSum(year)">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="customerDetailList">
+            <el-table max-height="300" show-summary sum-text="小计" 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">
@@ -582,7 +592,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>
@@ -657,6 +667,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" />
@@ -676,6 +716,7 @@ import {
   delAnnualSaleMergeDetails,
   getAnnualSaleMergeDetails
 } from "@/api/business/spd/goal_management/annualSaleMergeDetails"
+import { getToken } from "@/utils/auth";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -837,7 +878,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() {
@@ -1215,7 +1271,6 @@ export default {
       this.$confirm('确认关闭?')
         .then(_ => {
           done();
-          this.resetQuery()
         })
         .catch(_ => {});
     },
@@ -1300,8 +1355,13 @@ export default {
       }
       mergeAnnualSaleMergeDetails(query).then(response => {
         console.log(response);
-        this.annualSaleGoalMergeDetailsList = response.data.consolidatedDetail
-        this.computeTotal()
+        if (response.data.consolidatedDetail.length > 0) {
+          this.annualSaleGoalMergeDetailsList = response.data.consolidatedDetail
+          this.computeTotal()
+        } else {
+          return this.$message.warning('未查到相关数据')
+        }
+
       })
     },
     // 获得区域目标汇总or客户目标汇总
@@ -1326,6 +1386,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 })
           }
@@ -1346,19 +1418,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') {
@@ -1371,6 +1437,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();
     }
   }
 };

+ 105 - 17
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -124,6 +124,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 +172,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">
@@ -365,7 +375,7 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="月销售目标合并明细" name="monthGoalMergeDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" 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">
@@ -458,7 +468,7 @@
             </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">
@@ -492,7 +502,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">
@@ -542,6 +552,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"/>
@@ -561,6 +601,7 @@ import {
   delMonthGoalMergeDetails,
   mergeMonthSaleMergeDetails
 } from "@/api/business/spd/goal_management/monthGoalMergeDetails"
+import { getToken } from "@/utils/auth";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -715,7 +756,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() {
@@ -1205,8 +1261,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() {
@@ -1215,8 +1275,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) {
@@ -1270,6 +1330,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>

+ 31 - 7
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -97,6 +97,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">
@@ -295,14 +307,17 @@
         </el-row>
       </el-form>
       <div>
-        <el-row :gutter="10" class="mb8" style="margin-left: 94%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 87%">
+          <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-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月回款目标明细" name="monthReturnGoalDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" 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">
@@ -825,8 +840,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添加必填项
@@ -865,7 +880,7 @@ export default {
     /** 导入按钮操作 */
     handleImport() {
       this.upload.open = true;
-      if (this.open && this.form.id !== null) {
+      if (this.open) {
         this.upload.title = "月回款目标填报明细导入"
         this.upload.url = process.env.VUE_APP_BASE_API + "mk/monthReturnGoalDetails/importData/" + this.form.id
       } else {
@@ -875,7 +890,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      if (this.open && this.form.id !== null) {
+      if (this.open) {
         this.download('mk/monthReturnGoalDetails/importTemplate', {
         }, `monthReturnGoalDetails_${new Date().getTime()}.xlsx`)
       } else {
@@ -893,7 +908,16 @@ export default {
       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();
+      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() {

+ 104 - 17
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -100,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">
@@ -135,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">
@@ -322,7 +332,7 @@
       </el-row>
       <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
         <el-tab-pane label="月回款目标合并明细" name="monthReturnMergeDetails">
-          <el-table show-summary sum-text="小计" v-loading="loading" :data="monthReturnMergeDetailsList">
+          <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthReturnMergeDetailsList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -383,7 +393,7 @@
           </el-table>
         </el-tab-pane>
         <el-tab-pane label="区域目标汇总(月回款)" name="zoneGoalSum(monthReturn)">
-          <el-table show-summary sum-text="小计" :data="zoneGoalSumList">
+          <el-table max-height="300" show-summary sum-text="小计" :data="zoneGoalSumList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -441,6 +451,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>
 
@@ -457,6 +497,7 @@ import {
   getMonthReturnMergeDetails,
   mergeMonthReturnMergeDetails
 } from "@/api/business/spd/goal_management/monthReturnMergeDetails"
+import { getToken } from "@/utils/auth";
 
 // 参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -585,7 +626,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() {
@@ -814,7 +870,6 @@ export default {
       this.$confirm('确认关闭?')
         .then(_ => {
           done();
-          this.resetQuery()
         })
         .catch(_ => {});
     },
@@ -831,8 +886,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('未查到相关数据')
+        }
       })
     },
     // 计算主表合计
@@ -867,8 +926,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() {
@@ -910,6 +969,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();
     }
   }
 }

+ 48 - 57
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -97,6 +97,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>
 
@@ -297,14 +309,17 @@
         </el-row>
       </el-form>
       <div>
-        <el-row :gutter="10" class="mb8" style="margin-left: 94%">
+        <el-row :gutter="10" class="mb8" style="margin-left: 87%">
+          <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-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
-            <el-table show-summary sum-text="小计" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary sum-text="小计" 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">
@@ -351,29 +366,22 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="一级分类" align="center" 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" 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" 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>
@@ -454,8 +462,6 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
-
-    <TreeRefers ref="treeDetails" @doSubmit="selectionsToInputForDetails" :single="true"/>
   </div>
 </template>
 
@@ -600,9 +606,6 @@ export default {
         creator: [{ required: true, message: '制单人不能为空', trigger: 'blur' }],
         dept: [{ required: true, message: '部门不能为空', trigger: 'blur' }]
       },
-      // 参照条件
-      referCondition: { type: '', isPage: true, title: '', index: null },
-      classOptions: [],
       // 子表导航名
       activeName: 'monthSaleGoalDetails',
       // 用户导入参数
@@ -884,36 +887,6 @@ export default {
       }
       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
-      }
-    },
     // 子表table加必填标志
     addRedStar(h, { column }) {
       return [
@@ -932,12 +905,12 @@ export default {
     },
     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) {
@@ -952,7 +925,7 @@ export default {
     /** 导入按钮操作 */
     handleImport() {
       this.upload.open = true;
-      if (this.open && this.form.id !== null) {
+      if (this.open) {
         this.upload.title = "月销售目标填报明细导入"
         this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/monthSaleGoalDetails/importData/" + this.form.id
       } else {
@@ -962,7 +935,7 @@ export default {
     },
     /** 下载模板操作 */
     importTemplate() {
-      if (this.open && this.form.id !== null) {
+      if (this.open) {
         this.download('goal_management/monthSaleGoalDetails/importTemplate', {
         }, `monthSaleGoalDetails_${new Date().getTime()}.xlsx`)
       } else {
@@ -980,11 +953,29 @@ export default {
       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();
+      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]
     }
   }
 }

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

@@ -163,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);

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

@@ -36,7 +36,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"/>

+ 56 - 90
src/views/purchase/DemandSummary/index.vue

@@ -207,15 +207,9 @@
           <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>
@@ -241,41 +235,41 @@
           <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="100px"/>
+          <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="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="200px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandNum" label="需求单位数" align="center" prop="demandNum" width="100px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.netDemandNum" label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyPeriod" label="采购周期" align="center" prop="buyPeriod"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralPublicStock" label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouse" label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.regionPublicStock" label="区域分仓公共库存" align="center" prop="regionPublicStock" width="150px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.eachWarehouseStock" label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.commerceWarehouse" label="电商仓库" align="center" prop="commerceWarehouse"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.buyTransit" label="采购在途" align="center" prop="buyTransit"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.lendTransit" label="借出在途" align="center" prop="lendTransit"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.transferTransit" label="调拨在途" align="center" prop="transferTransit"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.stockTotal" label="库存总计" align="center" prop="stockTotal"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.minPackage" label="最小包装量" align="center" prop="minPackage" width="100px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.minOrder" label="最小订货量" align="center" prop="minOrder" width="100px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.minBatch" label="最小批量" align="center" prop="minBatch"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
+          <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 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 v-if="showColumn.suggestionPurchase" label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
+          <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="100">
+          <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
             <template slot-scope="scope">
                 <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
@@ -290,7 +284,7 @@
                 </el-input>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip v-if="showColumn.purchaseOrgName" 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>
@@ -298,16 +292,16 @@
             </template> -->
           </el-table-column>
           <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="100px"/>
+          <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="100px"/>
+          <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 v-if="showColumn.buyDiscrepancy" label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.forecastClassification" label="集团预测分类" align="center" prop="forecastClassification" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centerBinPossession" label="中心仓占有量" align="center" prop="centerBinPossession" width="120px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouseAvailable" 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 v-if="showColumn.status" label="需求单位" align="center" prop="demandUnit"/> -->
@@ -587,54 +581,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

+ 37 - 14
src/views/purchase/PurchaseDemandList/add.vue

@@ -161,7 +161,7 @@
         <span>明细信息</span>
         <div>
         <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
-        <el-button type="primary" size="mini" v-if="!sonDisable" @click="adjustPl">批量调整</el-button>
+        <el-button type="primary" size="mini" v-if="!sonDisable" @click.stop="adjustPl">批量调整</el-button>
         <el-button type="primary" size="mini" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
         </div>
       </div>
@@ -181,8 +181,10 @@
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
           :cell-class-name="cellClassName"
+          :row-key="getRowKeys"
+          ref="table"
         >
-          <el-table-column show-overflow-tooltip type="selection"/>
+          <el-table-column show-overflow-tooltip type="selection" :reserve-selection="true"/>
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px"/>
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo">
             <template slot-scope="scope">
@@ -420,7 +422,7 @@
       </el-table>
     </el-form>
       <div class="btn_group">
-        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2')">审批</el-button>
+        <el-button type="primary" size="mini"  @click="jumpOA" v-if="sonPageStu == 'check' && (row.status == '1' || row.status == '2') && basicForm.flowId">审批</el-button>
         <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
         <el-button type="primary" size="mini"  @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
         <el-button type="primary" size="mini"  @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
@@ -558,8 +560,10 @@ export default {
         customerName: '',
         customerCode: '',
         customerPrincipal: '',
-        demandPersonal: this.$store.state.user.name,
-        demandDept: this.$store.state.user.deptId,
+        demandPersonal: '',
+        demandPersonalName: '',
+        demandDept: '',
+        demandDeptName: '',
         planType: '1',
         demandDate: '',
         createTime: '',
@@ -631,6 +635,9 @@ export default {
     } else if(this.pageStu == 'edit') {
       this.getDetails(this.row)
     } else if (this.pageStu == 'add') {
+      this.loading = false
+      this.basicForm.demandPersonal = this.$store.state.user.name
+      this.basicForm.demandDept = this.$store.state.user.deptId
       if (this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
       if (this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
     }
@@ -1106,6 +1113,7 @@ export default {
       if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '需求人员') {
         this.personOptions = selection
         this.basicForm.demandPersonal = selection[0].code
+        this.basicForm.demandPersonalName = selection[0].name
       }
       if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '采购员') {
         this.purchaseManOptions = selection
@@ -1124,7 +1132,7 @@ export default {
       }
       if(this.referCondition.type == 'ADDRESS_PARAM' && this.referCondition.title == '收货地址') {
         this.adjust.deliveryAddressName = selection[0].name
-        this.adjust.deliveryAddress = selection[0].id
+        this.adjust.deliveryAddress = selection[0].code
         this.adjust.contacts = selection[0].contactsName
         this.adjust.contactsPhone = selection[0].contactsPhone
         this.adjust.address = selection[0].address
@@ -1132,6 +1140,7 @@ export default {
       if(this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection
         this.basicForm.demandDept = selection[0].id
+        this.basicForm.demandDeptName = selection[0].name
       }
       if(this.referCondition.title == '选择收货仓库') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
@@ -1149,7 +1158,7 @@ export default {
       }
       if(this.referCondition.title == '选择收货地址') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
         this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
         this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
         this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
@@ -1170,10 +1179,11 @@ export default {
       })
       console.log('复制的数组',rows);
       console.log('列表的数组',this.basicForm.puDemandItemList)
-      if (rows.length < 1000) {
+      if (rows.length < 100) {
         await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
           if (res.code === 200) {
             let rowList = res.rows
+            let newLine = []
             for (let i = 0; i<rowList.length; i++) {
             let line = {
               contacts: null,
@@ -1314,18 +1324,22 @@ export default {
               // 物料存储条件和运输条件
               line.transportationCondition = rowList[i].transportationCondition
               line.storageCondition = rowList[i].storageCondition
-              this.basicForm.puDemandItemList.push(line)
-              // console.log('临时数组', line)
+              newLine.push(line)
+              console.log('临时数组', newLine)
             }
+            // 删除指定下标
+            this.basicForm.puDemandItemList.splice(index,1,...newLine)
             this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
           }
+        }).then(() => {
+          this.$refs.table.doLayout()
         }).catch(err => {
           this.$modal.closeLoading();
         })
         this.$modal.closeLoading();
       console.log('列表', this.basicForm.puDemandItemList)
       } else {
-        this.$modal.notifyWarning("复制长度不能超过1000!");
+        this.$modal.notifyWarning("复制长度不能超过100!");
       }
     },
     // 明细行选择物料编码带出数据
@@ -1410,6 +1424,7 @@ export default {
       // 选中骨科耗材时候的物料,需求客户不必填
       } else {
         console.log('xxxxx', selection)
+        let newLine = []
         for (let i = 0;i<selection.length;i++) {
           let line = {
             contacts: null,
@@ -1557,10 +1572,12 @@ export default {
           // 物料存储条件和运输条件
           line.transportationCondition = selection[i].transportationCondition
           line.storageCondition = selection[i].storageCondition
-          this.basicForm.puDemandItemList.push(line)
+          // this.basicForm.puDemandItemList.push(line)
+          newLine.push(line)
         }
         // 删除指定下标
-        this.basicForm.puDemandItemList.splice(this.tableIndex,1)
+        this.basicForm.puDemandItemList.splice(this.tableIndex,1,...newLine)
+        // this.basicForm.puDemandItemList.splice(this.tableIndex,1)
       }
     },
     // 明细行选择业务部门参照带出业务部门数据
@@ -1736,6 +1753,7 @@ export default {
         h('span', ' ' + column.label)
       ];
     },
+    // 表格表头标星
     anotherRedStar(h, { column }) {
       if(this.isBDXQ) {
       return [
@@ -1748,13 +1766,18 @@ export default {
         ]; 
       }
     },
+    // 审批
     jumpOA() {
       toOA(this.$store.state.user.name, this.basicForm.flowId).then(res => {
         if(res.code === 200) {
           window.open(res.oaUrl)
         }
       })
-    }
+    },
+    // 解决表格选中了又自动取消的问题
+    getRowKeys(row) {
+      return row.id
+    },
   }
 }
 </script>

+ 6 - 3
src/views/purchase/PurchaseDemandList/index.vue

@@ -186,7 +186,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"
@@ -536,8 +535,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对象表示一个不可变的、原始数据的类文件对象
@@ -547,7 +548,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); // 下载完成移除元素
@@ -555,8 +556,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对象表示一个不可变的、原始数据的类文件对象
@@ -566,7 +569,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); // 下载完成移除元素

+ 15 - 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 }) => ({

+ 37 - 37
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,30 +70,30 @@ 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) => {
@@ -102,7 +102,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "tax", title: "税率%" },
+          item: { width:100,key: "tax", title: "税率%" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
@@ -111,7 +111,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "taxPrice", title: "含税单价" },
+          item: { width:100,key: "taxPrice", title: "含税单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
@@ -120,7 +120,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "price", title: "无税单价" },
+          item: { width:100,key: "price", title: "无税单价" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
@@ -129,52 +129,52 @@ export default function useColumns() {
           },
         },
         {
-          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: "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" },
     },
   ];

+ 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: "是否有指标", require: true },
+      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}) =>({

+ 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}) =>({

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

+ 34 - 29
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: {

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

@@ -8,6 +8,7 @@ export default function useColumns() {
         dictName: "purchase_task_status",
       },
     },
+    { item: { key: "existPrice", title: "是否有价格",width :150 ,inputType: "checkbox", isShow:true,}, attr: {} },
     { item: { key: "demandCode", title: "需求单号" }, attr: {} },
     { item: { key: "materialName", title: "物料" }, attr: {} },
     {
@@ -43,7 +44,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/xie-yi-zhi-cai/index.vue

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

+ 99 - 63
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>
 
@@ -506,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, '调入部门')"
@@ -522,7 +522,7 @@
                     >
                       <el-button
                         size="mini"
-                        :disabled="sonDisable"
+                        :disabled="sonDisable || isOrg"
                         slot="append"
                         icon="el-icon-more"
                         @click="
@@ -1449,6 +1449,7 @@ export default {
         currencyName: "",
         rate: 1,
         onRouteAffilliation: "",
+        oaId: '',
         qty: "",
         accountPath: "",
         customer: "",
@@ -1478,8 +1479,6 @@ export default {
         title: "",
         // 仓库编码
         stordocId: "",
-      },
-      referConditionMx: {
         orgCode: "",
         materialCode: "",
         unitCode: "",
@@ -1531,6 +1530,8 @@ export default {
       this.getDetails(this.row);
       this.isDRCk = false;
       this.isDCCk = false;
+    } else if (this.pageStu == "add") {
+      this.loading = false
     }
   },
   methods: {
@@ -1574,12 +1575,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)
@@ -1879,11 +1890,11 @@ export default {
       }
     },
 
-    chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
+    chooseRefer(type, isPage, title, drpOrg, isDirectStore, gubFlag) {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.pkOrg = pkOrg;
+      this.referCondition.drpOrg = drpOrg;
       this.referCondition.isDirectStore = isDirectStore;
       this.referCondition.gubFlag = gubFlag;
       this.$refs.refer.init(this.referCondition);
@@ -1894,21 +1905,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;
@@ -1916,18 +1913,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;
@@ -1999,6 +1985,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;
@@ -2041,12 +2077,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);
@@ -2057,31 +2093,26 @@ export default {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.pkOrg = "";
+      this.referCondition.drpOrg = "";
       this.referCondition.stordocId = stordocId;
       this.$refs.refer.init(this.referCondition);
     },
     // 明细行选择调入部门
-    chooseMxBM(index, type, isPage, title, pkOrg) {
+    chooseMxBM(index, type, isPage, title, drpOrg) {
       this.tableIndex = index;
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.pkOrg = pkOrg;
-      this.referCondition.drpOrg = pkOrg;
+      this.referCondition.drpOrg = drpOrg;
       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 = "";
@@ -2090,6 +2121,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 = "";

+ 1 - 1
vue.config.js

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