瀏覽代碼

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

001295 1 年之前
父節點
當前提交
c7b777781e

+ 2 - 2
src/views/business/spd/target/MonthSaleGoal.vue

@@ -49,7 +49,7 @@
               @keyup.enter.native="handleQuery">
             </el-popover-tree-select>
           </el-form-item>
-          <el-form-item label="客户" prop="custom" v-if="isDept && isJiwei">
+          <el-form-item label="客户" prop="custom" v-if="!(isDept && !isJiwei)">
             <el-popover-select-v2 v-model="queryParams.custom" title="客户" valueKey="name" referName="CUSTOMER_PARAM"
               :dataMapping="{ customCode: 'code', custom: 'name'}" :source.sync="queryParams" placeholder="请输入客户"
               @keyup.enter.native="handleQuery">
@@ -188,7 +188,7 @@
                 :dataMapping="{ customCode: 'code', custom: 'name'}" :source.sync="form" placeholder="请输入客户">
               </el-popover-tree-select>
             </el-form-item>
-            <el-form-item label="客户" prop="custom" v-if="isDept && isJiwei">
+            <el-form-item label="客户" prop="custom" v-if="!(isDept && !isJiwei)">
               <el-popover-select-v2 v-model="form.custom" title="客户" valueKey="name" referName="CUSTOMER_PARAM"
                 :dataMapping="{ customCode: 'code', custom: 'name'}" :source.sync="form" placeholder="请输入客户">
               </el-popover-select-v2>

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

@@ -18,6 +18,9 @@
           :size="size"
           v-if="!lineDisable"
           @click="saveLine"
+          >保存</el-button
+        >
+        <el-button
           :size="size"
           v-if="lineDisable"
           :disabled="ids.length == 0"

+ 650 - 303
src/views/purchase/workSpace/columns.js

@@ -1,317 +1,664 @@
-// 采购需求单
-const PU_DEMAND_RULE = [
-  { label: "物料编码", prop: "materialCode" },
-  { label: "物料名称", prop: "materialName" },
-  { label: "规格", prop: "specification" },
-  { label: "单位", prop: "unitName", width: 50 },
-  { label: "生产厂家/代理人", prop: "manufacturerName" },
-  { label: "实际(业务)需求量", prop: "qty", width: 130 },
-  { label: "月均销量", prop: "averageQtyMonth", width: 80 },
-  { label: "需求可用周期", prop: "demandPeriod", width: 80 },
-  { label: "业务备注", prop: "remark" },
-  {
-    label: "紧急标识",
-    prop: "isUrgency",
-    // formatter: function (row, column, cellValue, index) {
-    //   return row.isUrgency == "Y" ? "是" : "否";
-    // },
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-    width: 80,
-  },
-  {
-    label: "补单标识",
-    prop: "isReplenishment",
-    // formatter: function (row, column, cellValue, index) {
-    //   return row.isReplenishment == "Y" ? "是" : "否";
-    // },
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-    width: 80,
-  },
-];
-
-const ALLOT_RULE = [
-  { label: "物料编码", prop: "materialCode", width: 120 },
-  { label: "物料名称", prop: "materialName" },
-  { label: "规格", prop: "specification" },
-  { label: "单位", prop: "unitName" },
-  { label: "生产厂家/代理人", prop: "manufacturerName" },
-  { label: "调出仓库", prop: "deliveryWarehouseName" },
-  { label: "调出货位", prop: "deliveryAllocationName" },
-  { label: "数量", prop: "qty", width: 50 },
-  { label: "调入仓库", prop: "storageWarehouseName" },
-  { label: "调入货位", prop: "storageAllocationName" },
-];
+export default function useColumns() {
 
-// 物料申请单
-const MATERIAL_APPLY_RULE = [
-  { prop: 'name', label: '物料名称', },
-  { prop: 'code', label: '物料编码', },
-  { prop: 'specification', label: '规格' },
-  { prop: 'model', label: '型号', },
-  { prop: 'unitName', label: '计量单位', },
-  { prop: 'manufacturerName', label: '生产厂家/代理人', },
-  { prop: 'registrant', label: '注册人/上市许可持有人', },
-  { prop: 'productionPermit', label: '生产许可证', },
-  {
-    prop: 'storageCondition',
-    label: '存储条件',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_storage_condition",
-    },
-  },
-  {
-    prop: 'transportationCondition',
-    label: '运输条件',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_conditions_carriage",
-    },
-  },
-  { prop: 'originPlaceName', label: '产地', },
-  { prop: 'serviceLife', label: '使用期限/次数', },
-  { prop: 'brand', label: '品牌', },
-  { prop: 'classifyName', label: '四级分类', },
-  { prop: 'packExplain', label: '包装说明', },
-  { prop: 'deliveryPeriod', label: '交货周期', },
-  { prop: 'minOrderQty', label: '最小起订量', },
-  { prop: 'minPackQty', label: '最小包装量', },
-  { prop: 'minBatchQty', label: '最小批量', },
-  { prop: 'diCode', label: 'DI码', },
-  { prop: 'healthCode', label: '医保代码', },
-  { prop: 'manufacturersMaterialCode', label: '厂家物料编码', },
-  { prop: 'purchasingOrganizationName', label: '默认采购组织', },
-  { prop: 'puPersonnelName', label: '负责采购员', },
-  { prop: 'version', label: '版本号', },
-  {
-    prop: 'isMedicine',
-    label: '医药物料',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-  },
-  {
-    prop: 'serialNoManager',
-    label: '序列号管理',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-  },
-  {
-    prop: 'isInventoryStatus',
-    label: '批号及库存状态管理',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-  },
-  {
-    prop: 'expiryDateManagerment',
-    label: '效期管理',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-  },
-  {
-    prop: 'expiryUnitId',
-    label: '效期单位',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "period_unit",
-    },
-  },
-  { prop: 'usefulLife', label: '有效期', },
-  {
-    prop: 'usefulLifeUnitId',
-    label: '有效期至单位',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "expiry_date",
-    },
-  },
-  {
-    prop: 'nearOnsetManagerment',
-    label: '近效期管理',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-  },
-  { prop: 'recentWarningPeriod', label: '近效期预警天数', },
-  { prop: 'materialRateName', label: '物料税类', },
-  { prop: 'failCause', label: '同步失败原因', },
-  {
-    prop: 'isDrug',
-    label: '是否药品', 
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-  },
-  { prop: 'ratifyBatchNo', label: '批准文号', },
-  { prop: 'registrationNo', label: '注册证号/备案凭证编号', },
-  { prop: 'dosageFrom', label: '剂型', },
-  { prop: 'medicalInstruments',
-    label: '管理类别', 
-    attr: {
-      is: "el-dict-tag",
-      dictName: "medical_instruments",
-    },  
-  },
-  { prop: 'oriRegistrationNo', label: '旧注册证号', },
-  { prop: 'curingType',
-    label: '养护类型',
-    attr: {
-      is: "el-dict-tag",
-      dictName: "curing_type",
-    },   
-  },
-  { prop: 'drugCode', label: '药品类别编码', },
-  { prop: 'drugName', label: '药品类别名称', },
+  const SearchColumns = [
+    {
+      item: {
+        key: "docSubject",
+        title: "单据标题"
+      },
+      attr: {
+        is: "el-input",
+        clearable: true,
+      }
+    },
+    {
+      item: {
+        key: "modelIds",
+        title: "单据类型"
+      },
+      attr: {
+        is: "el-select",
+        dictName: "oa_templete_id",
+        clearable: true,
+        multiple: true,
+        collapseTags: true,
+      }
+    },
+  ];
 
-  // { prop: 'orgName', label: '所属组织', },
-  // { prop: 'barCode', label: '条形码', },
-  // { prop: 'height', label: '高度', },
-  // { prop: 'width', label: '宽度', },
+  const TableColumns = [
+    {
+      item: { key: "docSubject", title: "标题", width: "auto" },
+      attr: {
 
-  // { prop: 'length', label: '长度', },
-  // { prop: 'oneClass', label: '一级分类', },
+      },
+    },
+    {
+      item: { key: "docCreate", title: "创建人", width: 180 },
+      attr: {},
+    },
+  ];
 
+  // 采购需求单
+  const PU_DEMAND_RULE = [
+    {
+      item: { title: "物料编码", key: "materialCode" },
+      attr: {}
+    },
+    {
+      item: { title: "物料名称", key: "materialName" },
+      attr: {}
+    },
+    {
+      item: { title: "规格", key: "specification" },
+      attr: {}
+    },
+    {
+      item: { title: "单位", key: "unitName", width: 50 },
+      attr: {}
+    },
+    {
+      item: { title: "生产厂家/代理人", key: "manufacturerName" },
+      attr: {}
+    },
+    {
+      item: { title: "实际(业务)需求量", key: "qty", width: 130 },
+      attr: {}
+    },
+    {
+      item: { title: "月均销量", key: "averageQtyMonth", width: 80 },
+      attr: {}
+    },
+    {
+      item: { title: "需求可用周期", key: "demandPeriod", width: 80 },
+      attr: {}
+    },
+    {
+      item: { title: "业务备注", key: "remark" },
+      attr: {}
+    },
+    {
+      item: { title: "紧急标识", key: "isUrgency", width: 80, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: {
+        title: "补单标识", key: "isReplenishment", width: 80,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      }
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      width: item.width || 150
+    },
+  }));;
 
-  // { prop: 'twoClass', label: '二级分类', },
 
+  const ALLOT_RULE = [
+    {
+      item: { title: "物料编码", key: "materialCode", width: 120 },
+      attr: {}
+    },
+    {
+      item: { title: "物料名称", key: "materialName" },
+      attr: {}
+    },
+    {
+      item: { title: "规格", key: "specification" },
+      attr: {}
+    },
+    {
+      item: { title: "单位", key: "unitName" },
+      attr: {}
+    },
+    {
+      item: { title: "生产厂家/代理人", key: "manufacturerName" },
+      attr: {}
+    },
+    {
+      item: { title: "调出仓库", key: "deliveryWarehouseName" },
+      attr: {}
+    },
+    {
+      item: { title: "调出货位", key: "deliveryAllocationName" },
+      attr: {}
+    },
+    {
+      item: { title: "数量", key: "qty", width: 50 },
+      attr: {}
+    },
+    {
+      item: { title: "调入仓库", key: "storageWarehouseName" },
+      attr: {}
+    },
+    {
+      item: { title: "调入货位", key: "storageAllocationName" },
+      attr: {}
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      width: item.width || 150
+    },
+  }));;
 
-  // { prop: 'threeClass', label: '三级分类', },
-  // {
-  //   prop: 'isEnable',
-  //   label: '启用状态',
-  //   attr: {
-  //     is: "el-dict-tag",
-  //     dictName: "material_enable",
-  //   },
-  // },
-  // { prop: 'remark', label: '备注', },
-  // { prop: 'proposerName', label: '物料申请人', },
-  // { prop: 'serviceClass', label: '服务类', },
-];
 
-// 价格申报单
-const PU_PRICE_APPLY_RULE = [
-  { label: "物料编码", prop: "materialCode", width: 120 },
-  { label: "物料名称", prop: "materialName" },
-  { label: "规格", prop: "specification" },
-  { label: "型号", prop: "model" },
-  { label: "生产厂家/代理人", prop: "manufacturerName" },
-  { label: "客户", prop: "customerName" },
-  { label: "主单位", prop: "unitName" },
-  { label: "含税单价", prop: "taxPrice", width: 80 },
-  { label: "税率", prop: "tax" },
-  { label: "价格有效期(起)", prop: "periodBegin" },
-  { label: "价格有效期(止)", prop: "periodEnd" },
-  {
-    label: "首次报批",
-    prop: "isApprovalFirst",
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-    // formatter: function (row, column, cellValue, index) {
-    //   return row.isApprovalFirst == "Y" ? "是" : "否";
+  // 物料申请单
+  const MATERIAL_APPLY_RULE = [
+    {
+      item: { key: 'name', title: '物料名称', },
+      attr: {}
+    },
+    {
+      item: { key: 'code', title: '物料编码', },
+      attr: {}
+    },
+    {
+      item: { key: 'specification', title: '规格' },
+      attr: {}
+    },
+    {
+      item: { key: 'model', title: '型号', },
+      attr: {}
+    },
+    {
+      item: { key: 'unitName', title: '计量单位', },
+      attr: {}
+    },
+    {
+      item: { key: 'manufacturerName', title: '生产厂家/代理人', },
+      attr: {}
+    },
+    {
+      item: { key: 'registrant', title: '注册人/上市许可持有人', },
+      attr: {}
+    },
+    {
+      item: { key: 'productionPermit', title: '生产许可证', },
+      attr: {}
+    },
+    {
+      item: {
+        key: 'storageCondition',
+        title: '存储条件',
+        width: 100
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_storage_condition",
+      },
+    },
+    {
+      item: {
+        key: 'transportationCondition',
+        title: '运输条件',
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_conditions_carriage",
+      },
+    },
+    {
+      item: { key: 'originPlaceName', title: '产地', },
+      attr: {}
+    },
+    {
+      item: { key: 'serviceLife', title: '使用期限/次数', },
+      attr: {}
+    },
+    {
+      item: { key: 'brand', title: '品牌', },
+      attr: {}
+    },
+    {
+      item: { key: 'classifyName', title: '四级分类', },
+      attr: {}
+    },
+    {
+      item: { key:'packExplain', title: '包装说明', },
+      attr: {}
+    },
+    {
+      item: { key: 'deliveryPeriod', title: '交货周期', },
+      attr: {}
+    },
+    {
+      item: { key: 'minOrderQty', title: '最小起订量', },
+      attr: {}
+    },
+    {
+      item: { key: 'minPackQty', title: '最小包装量', },
+      attr: {}
+    },
+    {
+      item: { key: 'minBatchQty', title: '最小批量', },
+      attr: {}
+    },
+    {
+      item: { key: 'diCode', title: 'DI码', },
+      attr: {}
+    },
+    {
+      item: { key: 'healthCode', title: '医保代码', },
+      attr: {}
+    },
+    {
+      item: { key: 'manufacturersMaterialCode', title: '厂家物料编码', },
+      attr: {}
+    },
+    {
+      item: { key: 'purchasingOrganizationName', title: '默认采购组织', },
+      attr: {}
+    },
+    {
+      item: { key: 'puPersonnelName', title: '负责采购员', },
+      attr: {}
+    },
+    {
+      item: { key: 'version', title: '版本号', },
+      attr: {}
+    },
+    {
+      item: {
+        key: 'isMedicine',
+        title: '医药物料',
+        width: 100,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: {
+        key: 'serialNoManager',
+        title: '序列号管理',
+        width: 100,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: {
+        key: 'isInventoryStatus',
+        title: '批号及库存状态管理',
+        width: 100,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: {
+        key: 'expiryDateManagerment',
+        title: '效期管理',
+        width: 100,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: {
+        key: 'expiryUnitId',
+        title: '效期单位',
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "period_unit",
+      },
+    },
+    {
+      item: { key: 'usefulLife', title: '有效期', },
+      attr: {}
+    },
+    {
+      item: {
+        key: 'usefulLifeUnitId',
+        title: '有效期至单位',
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "expiry_date",
+      },
+    },
+    {
+      item: {
+        key: 'nearOnsetManagerment',
+        title: '近效期管理',
+        width: 100,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: { key: 'recentWarningPeriod', title: '近效期预警天数', },
+      attr: {}
+    },
+    {
+      item: { key: 'materialRateName', title: '物料税类', },
+      attr: {}
+    },
+    {
+      item: { key: 'failCause', title: '同步失败原因', },
+      attr: {}
+    },
+    {
+      item: {
+        key: 'isDrug',
+        title: '是否药品',
+        width: 100,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: { key: 'ratifyBatchNo', title: '批准文号', },
+      attr: {}
+    },
+    {
+      item: { key: 'registrationNo', title: '注册证号/备案凭证编号', },
+      attr: {}
+    },
+    {
+      item: { key: 'dosageFrom', title: '剂型', },
+      attr: {}
+    },
+    {
+      item: {
+        key: 'medicalInstruments',
+        title: '管理类别',
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "medical_instruments",
+      },
+    },
+    {
+      item: { key: 'oriRegistrationNo', title: '旧注册证号', },
+      attr: {}
+    },
+    {
+      item: {
+        key: 'curingType',
+        title: '养护类型',
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "curing_type",
+      },
+    },
+    {
+      item: { key: 'drugCode', title: '药品类别编码', },
+      attr: {}
+    },
+    {
+      item: { key: 'drugName', title: '药品类别名称', },
+      attr: {}
+    },
+    // { key: 'orgName', title: '所属组织', },
+    // { key: 'barCode', title: '条形码', },
+    // { key: 'height', title: '高度', },
+    // { key: 'width', title: '宽度', },
+    // { key: 'length', title: '长度', },
+    // { key: 'oneClass', title: '一级分类', },
+    // { key: 'twoClass', title: '二级分类', },
+    // { key: 'threeClass', title: '三级分类', },
+    // {
+    //   key: 'isEnable',
+    //   title: '启用状态',
+    //   attr: {
+    //     is: "el-dict-tag",
+    //     dictName: "material_enable",
+    //   },
     // },
-  },
-  { label: "调整类型", prop: "isPriceAdjustment" },
-  { label: "最近价格", prop: "recentlyPrice", width: 80 },
-  { label: "单价差", prop: "priceDiffer", width: 80 },
-  { label: "涨幅", prop: " increase" },
-  { label: "预计年采购量", prop: "yPurchaseQuantity" },
-  { label: "预计年影响金额", prop: "yAffectedAmount" },
-  {
-    label: "价格类型",
-    prop: "priceType",
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_price_type",
-    },
-  },
+    // { key: 'remark', title: '备注', },
+    // { key: 'proposerName', title: '物料申请人', },
+    // { key: 'serviceClass', title: '服务类', },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      width: item.width || 150
+    },
+  }));;
 
+  // 价格申报单
+  const PU_PRICE_APPLY_RULE = [
+    {
+      item: { title: "物料编码", key: "materialCode", width: 120 },
+      attr: {}
+    },
+    {
+      item: { title: "物料名称", key: "materialName" },
+      attr: {}
+    },
+    {
+      item: { title: "规格", key: "specification" },
+      attr: {}
+    },
+    {
+      item: { title: "型号", key: "model" },
+      attr: {}
+    },
+    {
+      item: { title: "生产厂家/代理人", key: "manufacturerName" },
+      attr: {}
+    },
+    {
+      item: { title: "客户", key: "customerName" },
+      attr: {}
+    },
+    {
+      item: { title: "主单位", key: "unitName" },
+      attr: {}
+    },
+    {
+      item: { title: "含税单价", key: "taxPrice", width: 80 },
+      attr: {}
+    },
+    {
+      item: { title: "税率", key: "tax" },
+      attr: {}
+    },
+    {
+      item: { title: "价格有效期(起)", key: "periodBegin" },
+      attr: {}
+    },
+    {
+      item: { title: "价格有效期(止)", key: "periodEnd" },
+      attr: {}
+    },
+    {
+      item: {
+        title: "首次报批",
+        key: "isApprovalFirst",
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: { title: "调整类型", key: "isPriceAdjustment" },
+      attr: {}
+    },
+    {
+      item: { title: "最近价格", key: "recentlyPrice", width: 80 },
+      attr: {}
+    },
+    {
+      item: { title: "单价差", key: "priceDiffer", width: 80 },
+      attr: {}
+    },
+    {
+      item: { title: "涨幅", key: " increase" },
+      attr: {}
+    },
+    {
+      item: { title: "预计年采购量", key: "yPurchaseQuantity" },
+      attr: {}
+    },
+    {
+      item: { title: "预计年影响金额", key: "yAffectedAmount" },
+      attr: {}
+    },
+    {
+      item: {
+        title: "价格类型",
+        key: "priceType",
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_price_type",
+      },
+    },
+    {
+      item: { title: "申请理由", key: "explainStr" },
+      attr: {}
+    },
+    // { title: "供应商名称1", key: "supplierName1" },
+    // { title: "单价1", key: "unitPrice1", width: 70 },
+    // { title: "供应商名称2", key: "supplierName2" },
+    // { title: "单价2", key: "unitPrice2", width: 70 },
+    // { title: "供应商名称3", key: "supplierName3" },
+    // { title: "单价3", key: "unitPrice3", width: 70 },
+    // {
+    //   title: "配送价",
+    //   key: "isDistributionPrice",
+    //   attr: {
+    //     is: "el-dict-tag",
+    //     dictName: "sys_number_yes_no",
+    //   },
+    //   // formatter: function (row, column, cellValue, index) {
+    //   //   return row.isDistributionPrice == "Y" ? "是" : "否";
+    //   // },
+    // },
+    // { title: "币种名称", key: "currencyName" },
+    // { title: "无税单价", key: "price" },
+    // { title: "采购换算率", key: "conversionRate" },
+    // { title: "采购单位名称", key: "puUnitName" },
+    // { title: "单位名称", key: "unitName" },
+    // { title: "预计年影响量", key: "yAffectedAmount" },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      width: item.width || 150
+    },
+  }));;
 
-  { label: "申请理由", prop: "explainStr" },
-  // { label: "供应商名称1", prop: "supplierName1" },
-  // { label: "单价1", prop: "unitPrice1", width: 70 },
-  // { label: "供应商名称2", prop: "supplierName2" },
-  // { label: "单价2", prop: "unitPrice2", width: 70 },
-  // { label: "供应商名称3", prop: "supplierName3" },
-  // { label: "单价3", prop: "unitPrice3", width: 70 },
-  // {
-  //   label: "配送价",
-  //   prop: "isDistributionPrice",
-  //   attr: {
-  //     is: "el-dict-tag",
-  //     dictName: "sys_number_yes_no",
-  //   },
-  //   // formatter: function (row, column, cellValue, index) {
-  //   //   return row.isDistributionPrice == "Y" ? "是" : "否";
-  //   // },
-  // },
-  // { label: "币种名称", prop: "currencyName" },
-  // { label: "无税单价", prop: "price" },
-  // { label: "采购换算率", prop: "conversionRate" },
-  // { label: "采购单位名称", prop: "puUnitName" },
-  // { label: "单位名称", prop: "unitName" },
-  // { label: "预计年影响量", prop: "yAffectedAmount" },
-];
 
-// 采购订单
-const PU_ORDER_RULE = [
-  { label: "物料编码", prop: "materialCode", width: 120 },
-  { label: "物料名称", prop: "materialName" },
-  { label: "规格", prop: "specification" },
-  { label: "生产厂家", prop: "manufacturerName" },
-  // {label: '医药物料',  prop: 'isMedcine'},
-  { label: "单位", prop: "unitName" },
-  { label: "数量", prop: "qty", width: 60 },
-  { label: "含税单价", prop: "taxPrice", width: 80 },
-  {
-    label: "价税合计",
-    prop: "money",
-    width: 80,
-    formatter: function (row, column, cellValue, index) {
-      return row.money ? parseFloat(row.money).toFixed(2) : "0.00";
-    },
-  },
-  { label: "收货客户", prop: "customerName" },
-  { label: "税率", prop: "tax" },
-  {
-    label: "赠品",
-    prop: "isGift",
-    width: 50,
-    attr: {
-      is: "el-dict-tag",
-      dictName: "sys_number_yes_no",
-    },
-    // formatter: function (row, column, cellValue, index) {
-    //   return row.isGift == "Y" ? "是" : "否";
-    // },
-  },
-  { label: "价格类型", prop: "priceType", width: 80 },
-  { label: "折扣%", prop: "nitemdiscountrate", width: 70 },
-  { label: "注册证号", prop: "registration" },
-  { label: "需求单号", prop: "demandCode" },
-];
+  // 采购订单
+  const PU_ORDER_RULE = [
+    {
+      item: { title: "物料编码", key: "materialCode", width: 120 },
+      attr: {}
+    },
+    {
+      item: { title: "物料名称", key: "materialName" },
+      attr: {}
+    },
+    {
+      item: { title: "规格", key: "specification" },
+      attr: {}
+    },
+    {
+      item: { title: "生产厂家", key: "manufacturerName" },
+      attr: {}
+    },
+    //  title: '医药物料',  key: 'isMedcine'},
+    {
+      item: { title: "单位", key: "unitName" },
+      attr: {}
+    },
+    {
+      item: { title: "数量", key: "qty", width: 60 },
+      attr: {}
+    },
+    {
+      item: { title: "含税单价", key: "taxPrice", width: 80 },
+      attr: {}
+    },
+    {
+      item: {
+        title: "价税合计",
+        key: "money",
+        width: 80,
+      },
+      attr: {
+        formatter: function (row, column, cellValue, index) {
+          return row.money ? parseFloat(row.money).toFixed(2) : "0.00";
+        },
+      }
+    },
+    {
+      item: { title: "收货客户", key: "customerName" },
+      attr: {}
+    },
+    {
+      item: { title: "税率", key: "tax" },
+      attr: {}
+    },
+    {
+      item: {
+        title: "赠品",
+        key: "isGift",
+        width: 50,
+      },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_number_yes_no",
+      },
+    },
+    {
+      item: { title: "价格类型", key: "priceType", width: 80 },
+      attr: {}
+    },
+    {
+      item: { title: "折扣%", key: "nitemdiscountrate", width: 70 },
+      attr: {}
+    },
+    {
+      item: { title: "注册证号", key: "registration" },
+      attr: {}
+    },
+    {
+      item: { title: "需求单号", key: "demandCode" },
+      attr: {}
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      width: item.width || 150
+    },
+  }));;
 
-export default {
-  PU_DEMAND_RULE,
-  ALLOT_RULE,
-  MATERIAL_APPLY_RULE,
-  PU_PRICE_APPLY_RULE,
-  PU_ORDER_RULE,
+  return {
+    SearchColumns,
+    TableColumns,
+    PU_DEMAND_RULE,
+    ALLOT_RULE,
+    MATERIAL_APPLY_RULE,
+    PU_PRICE_APPLY_RULE,
+    PU_ORDER_RULE,
+  }
 };

+ 31 - 15
src/views/purchase/workSpace/dicts.js

@@ -1,22 +1,38 @@
 
-import RULE from "./columns";
+// import RULE from "./columns";
 
-const columns = [];
+// const columns = [];
+
+// for (const key in RULE) {
 
-for (const key in RULE) {
+//   columns.push(...RULE[key]);
 
-  columns.push(...RULE[key]);
+// }
 
-}
+// const initDicts = (prop) => {
+//   return Array.from(
+//     new Set(
+//       prop
+//         .filter((item) => item.attr && item.attr.dictName)
+//         .map((item) => item.attr.dictName)
+//     )
+//   );
+// }
 
-const initDicts = (prop) => {
-  return Array.from(
-    new Set(
-      prop
-        .filter((item) => item.attr && item.attr.dictName)
-        .map((item) => item.attr.dictName)
-    )
-  );
-}
+// export const dicts = initDicts(columns);
 
-export const dicts = initDicts(columns);
+
+import { initDicts } from "@/utils/init.js";
+const modules = require.context("./", true, /columns.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 401 - 0
src/views/purchase/workSpace/index copy.vue

@@ -0,0 +1,401 @@
+<template>
+  <div id="workSpace">
+    <el-card style="position: relative">
+      <el-form label-width="100px">
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="单据标题">
+              <el-input
+                v-model.trim="queryParams.docSubject"
+                :size="size"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="单据类型">
+              <el-select
+                multiple
+                v-model="queryParams.modelIds"
+                :size="size"
+                style="width: 200px"
+                clearable
+              >
+                <el-option
+                  v-for="dict in dict.type.oa_templete_id"
+                  :prop="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div style="position: absolute; top: 18px; right: 10px">
+        <el-button type="primary" :size="size" @click="searchList"
+          >搜索</el-button
+        >
+        <el-button :size="size" plain @click="resetList">重置</el-button>
+      </div>
+
+      <el-table
+        fit
+        :data="tableList"
+        :cell-style="{ borderColor: '#c0c0c0' }"
+        :header-cell-style="{ borderColor: '#c0c0c0' }"
+        class="exporttable"
+        max-height="410"
+        border
+        highlight-current-row
+        style="font-size: 12px"
+        @selection-change="(selection) => (ids = selection)"
+        @row-click="rowSelect"
+        @row-dblclick="doubleClick"
+        ref="tables"
+      >
+        <el-table-column
+          label="序号"
+          type="index"
+          align="center"
+          width="50px"
+        />
+        <el-table-column
+          show-overflow-tooltip
+          label="标题"
+          align="center"
+          prop="docSubject"
+        />
+        <el-table-column
+          show-overflow-tooltip
+          label="创建人"
+          align="center"
+          prop="docCreate"
+          width="100px"
+        />
+        <el-table-column fixed="right" label="操作" align="center" width="180">
+          <template slot-scope="scope">
+            <el-button type="text" :size="size" @click.stop="check(scope.row)"
+              >查看</el-button
+            >
+            <el-button type="text" :size="size" @click.stop="audit(scope.row)"
+              >审批</el-button
+            >
+            <el-button type="text" :size="size" @click.stop="reject(scope.row)"
+              >驳回</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        :total="page.total"
+        :page.sync="page.pageNum"
+        :limit.sync="page.pageSize"
+        @pagination="getList({ ...page, ...queryParams })"
+        style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
+      />
+
+      <el-card class="box-card" style="margin-top: 10px">
+        <div slot="header" class="clearfix" style="line-height: 38px">
+          <span>单据概述</span>
+        </div>
+        <el-table
+          v-if="cols.length !== 0"
+          v-loading="loading"
+          :data="sonTableList"
+          fit
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          max-height="410"
+          border
+          highlight-current-row
+          style="font-size: 12px"
+        >
+          <el-table-column
+            label="序号"
+            type="index"
+            align="center"
+            width="50px"
+          />
+          <el-table-column
+            v-for="(col, index) in cols"
+            :prop="col.prop"
+            :label="col.label"
+            :width="col.width"
+            :formatter="col.formatter"
+          >
+            <template slot-scope="scope">
+              <template v-if="col.attr">
+                <component
+                  v-if="col.attr.is === 'el-dict-tag'"
+                  v-bind="col.attr"
+                  :size="$attrs.size"
+                  :value="scope.row[col.prop]"
+                  :options="dict.type[col.attr.dictName]"
+                ></component>
+              </template>
+              <template v-else>
+                <component v-if="col.formatter" is="span">{{
+                  col.formatter(scope.row)
+                }}</component>
+                <component v-else is="span">{{
+                  scope.row[col.prop]
+                }}</component>
+              </template>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <pagination
+          :total="sonTotal"
+          :page.sync="sonQuery.pageNum"
+          :limit.sync="sonQuery.pageSize"
+          @pagination="getDetailList(checkRow)"
+          style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
+        />
+      </el-card>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import {
+  getWorkSpaceList,
+  auditWork,
+  getWorkDetailList,
+  oaBack,
+} from "@/api/purchase/workSpace.js";
+import RULE from "./columns";
+import { dicts } from "./dicts";
+export default {
+  name: "workSpace",
+  dicts: [...dicts, "oa_templete_id"],
+  components: {
+    ElDictTag: () => import("@/components/DictTag/index.vue"),
+  },
+  data() {
+    const page = this.$init.page();
+    const columns = RULE;
+    return {
+      page: page,
+      Columns: columns,
+      size: "mini",
+      queryParams: {
+        modelIds: [],
+        docSubject: "",
+      },
+      loading: false,
+      tableList: [],
+      ids: [],
+      sonTableList: [],
+      sonQuery: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      sonTotal: 0,
+      checkRow: {
+        billCode: "",
+        type: "",
+      },
+      cols: [],
+      // 记录点击行的下标
+      recordIndex: "",
+    };
+  },
+  created() {
+    this.resetList();
+  },
+  methods: {
+    async getList(params) {
+      try {
+        this.$modal.loading("加载中...");
+        let { code, rows, total } = await getWorkSpaceList(params);
+        if (code === 200) {
+          this.tableList = rows;
+          this.page.total = total;
+        }
+      } catch (error) {
+      } finally {
+        this.$modal.closeLoading();
+      }
+    },
+    searchList() {
+      let { page, queryParams } = this;
+      this.getList({ ...page, ...queryParams });
+    },
+    resetList() {
+      this.queryParams = {
+        modelIds: [],
+        docSubject: "",
+      };
+      this.page = this.$init.page();
+      this.searchList();
+    },
+    doubleClick(row) {
+      this.rowSelect(row);
+    },
+    rowSelect(row, column, event) {
+      // this.recordIndex = this.tableList.findIndex((value, index ,arr) => {
+      //   return value.billCode == row.billCode
+      // })
+      // this.check(row)
+      // 选择行存储便于子表分页
+      this.checkRow = row;
+      this.cols = [...this.Columns[row.type]];
+      this.getDetailList(this.checkRow);
+    },
+    audits() {
+      if (this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        this.$modal
+          .confirm("确认审批选中单据?")
+          .then(() => {
+            this.$modal.loading("审批中...");
+            auditWork(this.ids).then((res) => {
+              if (res.code === 200) {
+                this.$modal.closeLoading();
+                this.$modal.notifySuccess("审批成功");
+                this.searchList();
+                this.sonTableList = [];
+              }
+            });
+          })
+          .catch(() => {
+            this.$modal.closeLoading();
+            this.searchList();
+            this.sonTableList = [];
+          });
+      }
+    },
+    check(row) {
+      console.log(row);
+      this.$router.push({
+        path: row.linkUrl,
+        query: { billCode: row.billCode },
+      });
+    },
+    audit(row) {
+      this.$modal.loading("审批中...");
+      auditWork([row])
+        .then((res) => {
+          if (res.code === 200) {
+            this.$modal.closeLoading();
+            this.$modal.notifySuccess("审批成功");
+            this.searchList();
+            this.sonTableList = [];
+          }
+        })
+        // .then(() => {
+        //   this.$refs.tables.setCurrentRow(this.tableList[this.recordIndex])
+        //   let param = {
+        //     billCode: this.tableList[this.recordIndex].billCode,
+        //     type: this.tableList[this.recordIndex].type,
+        //     ...this.sonQuery
+        //   }
+        //   getWorkDetailList(param).then(res => {
+        //     if(res.code === 200) {
+        //       this.sonTableList = res.rows
+        //       this.sonTotal = res.total
+        //     }
+        //   }).catch(err => {
+        //   })
+        // })
+        .catch(() => {
+          this.$modal.closeLoading();
+          this.searchList();
+          this.sonTableList = [];
+        });
+    },
+    // 驳回
+    reject(row) {
+      this.$prompt(
+        "<div>请填写驳回原因 <span style='color:#ff6262'>注:只能驳回到起草节点</span></div>",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          inputPattern: /\s*\S+?/,
+          inputErrorMessage: "驳回原因不能为空",
+          dangerouslyUseHTMLString: true,
+        }
+      )
+        .then(async ({ value }) => {
+          try {
+            this.$modal.loading("加载中...");
+            let params = {
+              checkAmount: false,
+              fdTemplateId: row.fdTemplateId,
+              fdId: row.fdId,
+              billCode: row.billCode,
+              backReason: value,
+            };
+            console.log(params, "params");
+            const { msg, code } = await oaBack(params);
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (error) {
+          } finally {
+            this.$modal.closeLoading();
+          }
+        })
+        .catch(() => {
+          this.$modal.closeLoading();
+        });
+    },
+
+    // 获取单据概述列表
+    async getDetailList(row) {
+      try {
+        this.loading = true;
+        let param = {
+          billCode: row.billCode,
+          type: row.type,
+          ...this.sonQuery,
+        };
+        let { code, rows, total } = await getWorkDetailList(param);
+        if (code === 200) {
+          this.sonTableList = rows;
+          this.sonTotal = total;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+#workSpace {
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+}
+.el-table .el-table__header-wrapper th {
+  font-size: 14px;
+}
+</style>

+ 126 - 211
src/views/purchase/workSpace/index.vue

@@ -1,83 +1,39 @@
 <template>
-  <div id="workSpace">
-    <el-card style="position: relative">
-      <el-form label-width="100px">
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="单据标题">
-              <el-input
-                v-model.trim="queryParams.docSubject"
-                :size="size"
-                clearable
-                style="width: 200px"
-              />
-            </el-form-item>
-          </el-col>
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
+    <el-super-search
+      v-model="params"
+      :size="size"
+      :dict="dict"
+      :columns="SearchColumns"
+      @reset="resetList"
+      @submit="getList({ ...page, ...params })"
+    ></el-super-search>
 
-          <el-col :span="1.5">
-            <el-form-item label="单据类型">
-              <el-select
-                multiple
-                v-model="queryParams.modelIds"
-                :size="size"
-                style="width: 200px"
-                clearable
-              >
-                <el-option
-                  v-for="dict in dict.type.oa_templete_id"
-                  :prop="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-
-      <div style="position: absolute; top: 18px; right: 10px">
-        <el-button type="primary" :size="size" @click="searchList"
-          >搜索</el-button
-        >
-        <el-button :size="size" plain @click="resetList">重置</el-button>
-      </div>
-
-      <el-table
-        fit
-        :data="tableList"
-        :cell-style="{ borderColor: '#c0c0c0' }"
-        :header-cell-style="{ borderColor: '#c0c0c0' }"
-        class="exporttable"
-        max-height="410"
-        border
+    <div style="margin: 16px 0">
+      <el-super-ux-table
+        v-model="tableList"
+        :size="size"
+        :dict="dict"
+        :page="page"
+        :columns="TableColumns"
+        :height="tableHeight"
+        index
+        pagination
         highlight-current-row
-        style="font-size: 12px"
+        storage-key="workSpaceSuperTable"
         @selection-change="(selection) => (ids = selection)"
         @row-click="rowSelect"
-        @row-dblclick="doubleClick"
-        ref="tables"
+        @pagination="getList({ ...page, ...params })"
       >
-        <el-table-column
-          label="序号"
-          type="index"
-          align="center"
-          width="50px"
-        />
-        <el-table-column
-          show-overflow-tooltip
-          label="标题"
-          align="center"
-          prop="docSubject"
-        />
-        <el-table-column
-          show-overflow-tooltip
-          label="创建人"
-          align="center"
-          prop="docCreate"
-          width="100px"
-        />
-        <el-table-column fixed="right" label="操作" align="center" width="180">
+        <ux-table-column fixed="right" title="操作" align="center" width="180">
           <template slot-scope="scope">
             <el-button type="text" :size="size" @click.stop="check(scope.row)"
               >查看</el-button
@@ -89,79 +45,32 @@
               >驳回</el-button
             >
           </template>
-        </el-table-column>
-      </el-table>
+        </ux-table-column>
+      </el-super-ux-table>
+    </div>
 
-      <pagination
-        :total="page.total"
-        :page.sync="page.pageNum"
-        :limit.sync="page.pageSize"
-        @pagination="getList({ ...page, ...queryParams })"
-        style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
-      />
-
-      <el-card class="box-card" style="margin-top: 10px">
-        <div slot="header" class="clearfix" style="line-height: 38px">
-          <span>单据概述</span>
-        </div>
-        <el-table
+    <el-tabs v-model="tabName">
+      <el-tab-pane label="单据概述" name="first">
+        <el-super-ux-table
           v-if="cols.length !== 0"
           v-loading="loading"
-          :data="sonTableList"
-          fit
-          :cell-style="{ borderColor: '#c0c0c0' }"
-          :header-cell-style="{ borderColor: '#c0c0c0' }"
-          class="exporttable"
-          max-height="410"
-          border
+          v-model="sonTableList"
+          :size="size"
+          :dict="dict"
+          :page="tabPage"
+          :columns="cols"
+          :height="tabHeight"
+          :key="checkRow.type"
+          index
+          pagination
           highlight-current-row
-          style="font-size: 12px"
-        >
-          <el-table-column
-            label="序号"
-            type="index"
-            align="center"
-            width="50px"
-          />
-          <el-table-column
-            v-for="(col, index) in cols"
-            :prop="col.prop"
-            :label="col.label"
-            :width="col.width"
-            :formatter="col.formatter"
-          >
-            <template slot-scope="scope">
-              <template v-if="col.attr">
-                <component
-                  v-if="col.attr.is === 'el-dict-tag'"
-                  v-bind="col.attr"
-                  :size="$attrs.size"
-                  :value="scope.row[col.prop]"
-                  :options="dict.type[col.attr.dictName]"
-                ></component>
-              </template>
-              <template v-else>
-                <component v-if="col.formatter" is="span">{{
-                  col.formatter(scope.row)
-                }}</component>
-                <component v-else is="span">{{
-                  scope.row[col.prop]
-                }}</component>
-              </template>
-            </template>
-          </el-table-column>
-        </el-table>
-
-        <pagination
-          :total="sonTotal"
-          :page.sync="sonQuery.pageNum"
-          :limit.sync="sonQuery.pageSize"
           @pagination="getDetailList(checkRow)"
-          style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
-        />
-      </el-card>
-    </el-card>
-  </div>
+        >
+        </el-super-ux-table>
+        <el-empty v-else :image-size="80" description="暂无数据"></el-empty>
+      </el-tab-pane>
+    </el-tabs>
+  </el-card>
 </template>
 
 <script>
@@ -171,34 +80,46 @@ import {
   getWorkDetailList,
   oaBack,
 } from "@/api/purchase/workSpace.js";
-import RULE from "./columns";
+import useColumns from "./columns";
 import { dicts } from "./dicts";
 export default {
   name: "workSpace",
-  dicts: [...dicts, "oa_templete_id"],
+  dicts: [...dicts],
   components: {
-    ElDictTag: () => import("@/components/DictTag/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
   },
   data() {
     const page = this.$init.page();
-    const columns = RULE;
+    const {
+      SearchColumns,
+      TableColumns,
+      PU_DEMAND_RULE,
+      ALLOT_RULE,
+      MATERIAL_APPLY_RULE,
+      PU_PRICE_APPLY_RULE,
+      PU_ORDER_RULE,
+    } = useColumns();
+    const params = this.$init.params(SearchColumns);
     return {
       page: page,
-      Columns: columns,
-      size: "mini",
-      queryParams: {
-        modelIds: [],
-        docSubject: "",
+      tabPage: page,
+      Columns: {
+        PU_DEMAND_RULE,
+        ALLOT_RULE,
+        MATERIAL_APPLY_RULE,
+        PU_PRICE_APPLY_RULE,
+        PU_ORDER_RULE,
       },
+      size: "mini",
+      SearchColumns,
+      TableColumns,
+      params,
+      tabName: "first",
       loading: false,
       tableList: [],
       ids: [],
       sonTableList: [],
-      sonQuery: {
-        pageNum: 1,
-        pageSize: 10,
-      },
-      sonTotal: 0,
       checkRow: {
         billCode: "",
         type: "",
@@ -208,6 +129,32 @@ export default {
       recordIndex: "",
     };
   },
+  computed: {
+    tableHeight: {
+      get() {
+        return `${
+          this.tableList.length
+            ? this.tableList.length > 9
+              ? 350
+              : this.tableList.length * 36 + 36
+            : 120
+        }px`;
+      },
+      set() {},
+    },
+    tabHeight: {
+      get() {
+        return `${
+          this.sonTableList.length
+            ? this.sonTableList.length > 5
+              ? 300
+              : this.sonTableList.length * 36 + 60
+            : 120
+        }px`;
+      },
+      set() {},
+    },
+  },
   created() {
     this.resetList();
   },
@@ -225,21 +172,14 @@ export default {
         this.$modal.closeLoading();
       }
     },
-    searchList() {
-      let { page, queryParams } = this;
-      this.getList({ ...page, ...queryParams });
-    },
     resetList() {
-      this.queryParams = {
-        modelIds: [],
-        docSubject: "",
-      };
+      this.params = this.$init.params(this.SearchColumns);
       this.page = this.$init.page();
-      this.searchList();
-    },
-    doubleClick(row) {
-      this.rowSelect(row);
+      this.getList({ ...this.page, ...this.params });
     },
+    // doubleClick(row) {
+    //   this.rowSelect(row);
+    // },
     rowSelect(row, column, event) {
       // this.recordIndex = this.tableList.findIndex((value, index ,arr) => {
       //   return value.billCode == row.billCode
@@ -262,20 +202,19 @@ export default {
               if (res.code === 200) {
                 this.$modal.closeLoading();
                 this.$modal.notifySuccess("审批成功");
-                this.searchList();
+                this.getList({ ...this.page, ...this.params });
                 this.sonTableList = [];
               }
             });
           })
           .catch(() => {
             this.$modal.closeLoading();
-            this.searchList();
+            this.getList({ ...this.page, ...this.params });
             this.sonTableList = [];
           });
       }
     },
     check(row) {
-      console.log(row);
       this.$router.push({
         path: row.linkUrl,
         query: { billCode: row.billCode },
@@ -288,28 +227,13 @@ export default {
           if (res.code === 200) {
             this.$modal.closeLoading();
             this.$modal.notifySuccess("审批成功");
-            this.searchList();
+            this.getList({ ...this.page, ...this.params });
             this.sonTableList = [];
           }
         })
-        // .then(() => {
-        //   this.$refs.tables.setCurrentRow(this.tableList[this.recordIndex])
-        //   let param = {
-        //     billCode: this.tableList[this.recordIndex].billCode,
-        //     type: this.tableList[this.recordIndex].type,
-        //     ...this.sonQuery
-        //   }
-        //   getWorkDetailList(param).then(res => {
-        //     if(res.code === 200) {
-        //       this.sonTableList = res.rows
-        //       this.sonTotal = res.total
-        //     }
-        //   }).catch(err => {
-        //   })
-        // })
         .catch(() => {
           this.$modal.closeLoading();
-          this.searchList();
+          this.getList({ ...this.page, ...this.params });
           this.sonTableList = [];
         });
     },
@@ -359,12 +283,12 @@ export default {
         let param = {
           billCode: row.billCode,
           type: row.type,
-          ...this.sonQuery,
+          ...this.tabPage,
         };
         let { code, rows, total } = await getWorkDetailList(param);
         if (code === 200) {
           this.sonTableList = rows;
-          this.sonTotal = total;
+          this.tabPage.total = total;
         }
       } catch (error) {
       } finally {
@@ -375,27 +299,18 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped>
-#workSpace {
-  padding: 12px;
-  box-sizing: border-box;
-  overflow-y: scroll;
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
+  overflow-y: auto;
+  overflow-x: hidden;
 }
-.btn_grooup {
-  margin-bottom: 10px;
-  display: flex;
-  justify-content: flex-end;
-}
-.el-pagination {
-  margin-top: 10px;
-  text-align: right;
-}
-</style>
-<style>
-.exporttable {
-  border: solid 1px #c0c0c0;
-}
-.el-table .el-table__header-wrapper th {
-  font-size: 14px;
+
+.el-button-group + .el-button-group {
+  margin: 0 0 0 8px;
 }
 </style>