Browse Source

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

DongZ 1 year ago
parent
commit
d9dc0ab1ef

+ 51 - 15
src/components/super-ux-table/index.vue

@@ -62,7 +62,11 @@ export default {
     },
     height: {
       type: [String, Number],
-      default: () => "auto",
+      require: false,
+    },
+    firstSummary: {
+      type: Boolean,
+      default: false,
     },
   },
   components: {
@@ -104,6 +108,7 @@ export default {
       filterState: false,
       count: 0,
       scrollTop: 0,
+      resizeHeight: 0,
     };
   },
   computed: {
@@ -137,12 +142,13 @@ export default {
       },
       set() {},
     },
-    // height:{
-    //   get(){
-    //     return 100% -
-    //   },
-    //   set(){},
-    // }
+    tableHeight: {
+      get() {
+        let { height } = this.$props;
+        return height ? height : this.resizeHeight;
+      },
+      set() {},
+    },
   },
   watch: {
     filterRules: {
@@ -173,7 +179,35 @@ export default {
       deep: true,
     },
   },
+  directives: {
+    // 使用局部注册指令的方式
+    resize: {
+      // 指令的名称
+      bind(el, binding) {
+        // el为绑定的元素,binding为绑定给指令的对象
+        let width = "",
+          height = "";
+        function isReize() {
+          const style = document.defaultView.getComputedStyle(el);
+          if (width !== style.width || height !== style.height) {
+            binding.value(); // 关键
+          }
+          width = style.width;
+          height = style.height;
+        }
+        el.__vueSetInterval__ = setInterval(isReize, 300);
+      },
+      unbind(el) {
+        clearInterval(el.__vueSetInterval__);
+      },
+    },
+  },
   methods: {
+    resize() {
+      this.resizeHeight =
+        document.getElementsByClassName("el-super-ux-table")[0].offsetHeight -
+        55;
+    },
     //
     onSelectionChange(value) {
       this.selectData = value;
@@ -289,8 +323,11 @@ export default {
     },
     getSummaries({ columns, data }) {
       const means = []; // 合计
+
+      let { firstSummary } = this.$props;
+
       columns.forEach((column, columnIndex) => {
-        if (columnIndex === 0) {
+        if (!firstSummary && columnIndex === 0) {
           means.push("合计");
         } else {
           const values = data.map((item) => Number(item[column.property]));
@@ -304,12 +341,14 @@ export default {
           if (sumColumn.length) {
             means[columnIndex] = values.reduce((prev, curr) => {
               const value = Number(curr);
+
               if (!isNaN(value)) {
                 return prev + curr;
               } else {
                 return prev;
               }
             }, 0);
+
             means[columnIndex] = means[columnIndex].toFixed(2);
           } else {
             means[columnIndex] = "";
@@ -334,7 +373,7 @@ export default {
 </script>
 
 <template>
-  <div class="el-super-ux-table" :key="count">
+  <div class="el-super-ux-table" :key="count" v-resize="resize">
     <ux-grid
       border
       row-key
@@ -342,14 +381,13 @@ export default {
       keep-source
       show-overflow
       beautify-table
-      :height="height"
       ref="superUxTable"
       v-bind="$attrs"
+      :height="tableHeight"
       v-on="$listeners"
       :data="innerValue"
       :show-summary="showSummary"
       :summary-method="getSummaries"
-      highlight-current-row
       @row-click="onRowClick"
       @header-dragend="onWidth"
       @selection-change="onSelectionChange"
@@ -368,8 +406,7 @@ export default {
         resizable
         reserve-selection
         :column-key="rowKey"
-      >
-      </ux-table-column>
+      ></ux-table-column>
       <!-- 序号 -->
       <ux-table-column
         v-if="index"
@@ -380,8 +417,7 @@ export default {
         align="center"
         class="is-index"
         resizable
-      >
-      </ux-table-column>
+      ></ux-table-column>
       <ux-table-column
         v-for="({ item, attr }, index) in showColumns"
         :key="item.key + index"

+ 22 - 14
src/views/monitor/system/index.vue

@@ -1,14 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="OA对应单据信息" prop="oaIdentity">
-        <el-input
-          v-model="queryParams.oaIdentity"
-          placeholder="请输入OA对应单据信息"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
       <el-form-item label="来源系统">
         <el-select clearable v-model="queryParams.busDomain" size="mini" style="width: 200px"
                    @keyup.enter.native="handleQuery" clearable>
@@ -17,15 +9,21 @@
           </el-option>
         </el-select>
       </el-form-item>
-
+      <el-form-item label="OA单据信息" prop="oaIdentity">
+        <el-input
+          v-model="queryParams.oaIdentity"
+          placeholder="请输入OA对应单据信息"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery" plain>搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" type="info" @click="resetQuery" plain>重置</el-button>
         <el-button icon="el-icon-video-play" size="mini" type="success" @click="getDatas" plain>更新数据</el-button>
       </el-form-item>
-
     </el-form>
-    <el-table v-loading="loading" :data="serviceList">
+    <el-table v-loading="loading" :data="serviceList" border :height="tableHeight">
       <el-table-column label="业务域" min-width="120" align="center" prop="busDomain" :formatter="formatterBusDomain"/>
       <el-table-column label="业务类型" min-width="120" align="center" prop="monitorType">
         <template slot-scope="scope">
@@ -34,8 +32,7 @@
         </template>
       </el-table-column>
       <el-table-column label="OA单据信息" min-width="80" align="center" prop="oaIdentity"/>
-      <el-table-column label="业务域单据信息" min-width="120" align="center" prop="docIdentity"
-                       :show-overflow-tooltip="true"/>
+      <el-table-column label="业务域单据信息" min-width="120" align="center" prop="docIdentity"/>
       <el-table-column label="所属模块" min-width="80" align="center" prop="busModule" :show-overflow-tooltip="true"/>
       <el-table-column label="状态释意" min-width="80" align="center" prop="busStatusName"/>
       <el-table-column label="问题原因" min-width="150" align="center" prop="errorMsg"/>
@@ -67,6 +64,15 @@
 
   export default {
     dicts: ['oa_todo_type', 'oa_nc_bill_type', 'oa_flow_status', 'oa_busdomian_desc'],
+    computed: {
+      tableHeight:{
+        get(){
+          console.log(window,'window');
+          return window.innerHeight - 220;
+        },
+        set(){},
+      }
+    },
     data() {
       return {
         //遮罩层
@@ -163,6 +169,8 @@
       },
       //重置
       resetQuery() {
+        this.queryParams.busDomain = ''
+        this.queryParams.oaIdentity = ''
         this.resetForm("queryForm");
         this.handleQuery();
       }

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

@@ -286,7 +286,6 @@
       :dict="dict"
       :page="page"
       :columns="TableColumns"
-      :height="tableHeight"
       index
       checkbox
       pagination

File diff suppressed because it is too large
+ 318 - 370
src/views/purchase/purchase-order/add/index.vue


File diff suppressed because it is too large
+ 485 - 501
src/views/purchase/purchase-order/edit/index.vue


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

@@ -240,12 +240,14 @@ export default {
       this.page.pageNum = 1;
 
       this.page.pageSize = 10;
-      this.$refs.purchaseTable.$refs.superTable.clearSelection();
+      this.$refs.purchaseTable.$refs.superTable &&
+        this.$refs.purchaseTable.$refs.superTable.clearSelection();
 
       for (const key in this.tabTableDatas) {
         this.tabTableDatas[key] = [];
       }
-      this.$refs.puOrderItemList[0].$refs.superTable.clearSelection();
+      this.$refs.puOrderItemList[0].$refs.superTable &&
+        this.$refs.puOrderItemList[0].$refs.superTable.clearSelection();
 
       // this.checkedList = [];
 
@@ -799,7 +801,7 @@ export default {
       @pagination="fetchList(params, page)"
       @selection-change="handleSelectionChange"
     >
-      <ux-table-column fixed="right" title="操作" width="120">
+      <ux-table-column fixed="right" title="操作" width="160">
         <template slot-scope="scope">
           <el-button
             v-if="judgeIsOption('revise', scope.row)"

+ 320 - 285
src/views/purchase/purchase-order/see/index.vue

@@ -10,8 +10,8 @@ import {
 import orderApi from "@/api/business/purchase/purchase-order";
 import { PRINT } from "@/api/business/purchase/task";
 import judgeColumns from "../add/column";
-import VirtualScroll from 'el-table-virtual-scroll';
-import { VirtualColumn } from 'el-table-virtual-scroll';
+import VirtualScroll from "el-table-virtual-scroll";
+import { VirtualColumn } from "el-table-virtual-scroll";
 
 const { Columns, TabColumns } = judgeColumns();
 
@@ -20,27 +20,31 @@ const NewTabColumns = TabColumns.map((element) => ({
   ...element,
   tableColumns: initColumns(element.tableColumns),
 }));
-// 
-const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+//
+const SelectColumns = NewColumns.filter(
+  (column) => column.inputType === "Select"
+);
+NewTabColumns.forEach((column) => {
+  SelectColumns.push(
+    ...column.tableColumns.filter((cColumn) => cColumn.inputType === "Select")
+  );
 });
 
-
 export default {
   name: "SeePurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
   components: {
-    'virtual-scroll':VirtualScroll,VirtualColumn,
-    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
-    FilePrint:() => import('../print/index.vue'),
+    "virtual-scroll": VirtualScroll,
+    VirtualColumn,
+    FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
+    FilePrint: () => import("../print/index.vue"),
   },
   data() {
     return {
       visible: false,
       loading: false,
       columns: NewColumns,
-      printData:{},
+      printData: {},
       rules: initRules(NewColumns),
       params: {
         ...initParams(NewColumns),
@@ -50,33 +54,28 @@ export default {
 
       tabColumns: NewTabColumns,
       tabName: "puOrderItemList",
-      tableData:[],  //虚拟滚动加载显示的数据
+      tableData: [], //虚拟滚动加载显示的数据
     };
   },
   computed: {
-    tabHeight:{
-      get(){
-        let length = this.params['puOrderItemList'].filter(item => item.delFlag === '0').length;
-        return `${length ? 
-                  (length > 8 ? 500 :  (length *60) +170)
-                : 120}px`
+    tabHeight: {
+      get() {
+        let length = this.params["puOrderItemList"].filter(
+          (item) => item.delFlag === "0"
+        ).length;
+        return `${length ? (length > 8 ? 500 : length * 36 + 120) : 120}px`;
       },
-      set(){}
+      set() {},
     },
   },
   watch: {},
   methods: {
-    
     setVisible(prop) {
-
       this.visible = prop;
 
-      if(!this.visible){
-
-        this.$refs['orderSeeForm'].clearValidate();
-
+      if (!this.visible) {
+        this.$refs["orderSeeForm"].clearValidate();
       }
-
     },
 
     //查询详情
@@ -94,16 +93,16 @@ export default {
       }
 
       try {
-          this.loading = true;
-          const { data, code } = await PRINT({ id: this.params.id || 628 });
-          if (code === 200) {
-            this.printData = data;
-            this.loading = false;
-          }
-        } catch (err) {
-          alert(err);
-        } finally {
+        this.loading = true;
+        const { data, code } = await PRINT({ id: this.params.id || 628 });
+        if (code === 200) {
+          this.printData = data;
+          this.loading = false;
         }
+      } catch (err) {
+        alert(err);
+      } finally {
+      }
     },
     // 取 消
     handleCancel() {
@@ -112,42 +111,37 @@ export default {
         ...initParams(this.columns),
         puOrderItemList: [],
         puOrderExecuteList: [],
-      }
+      };
       this.setVisible(false);
     },
-    handleRefresh(){
-      let {id} = this.params;
+    handleRefresh() {
+      let { id } = this.params;
       this.fetchItem(id);
     },
     // 发送NC
-    async handleSendNC(){
-      console.log('发送NC');
+    async handleSendNC() {
+      console.log("发送NC");
 
       try {
-        let {code} = await orderApi.toNc({ puOrderId:this.params.id});
+        let { code } = await orderApi.toNc({ puOrderId: this.params.id });
 
-        if(code == 200){
+        if (code == 200) {
           this.handleRefresh();
         }
       } catch (error) {
-        
-      }finally{
-
+      } finally {
       }
     },
     // 判断是否能发送NC
-    judgeIsToNC(){
-
-      let {source,status,deliveryStatus} = this.params;
+    judgeIsToNC() {
+      let { source, status, deliveryStatus } = this.params;
 
       // 自制 & 状态为:自由态、驳回
       // if(source === '3' &&(status === '0' || status === '3')){
-      if(status === '2'){
-
+      if (status === "2") {
         // 发送NC之后展示 SUCCESS("0","成功"),SEND_IN("1","发送中"),FAILURE("2","失败");
         //    未发送                发送过但未成功
-        if(!deliveryStatus || (deliveryStatus && deliveryStatus !== '0')){
-
+        if (!deliveryStatus || (deliveryStatus && deliveryStatus !== "0")) {
           return true;
         }
 
@@ -156,80 +150,83 @@ export default {
 
       return false;
     },
-    beforeOpen() { 
-      
-    },
-    getSummaries({ columns, data }){
-      
-      const means = [] // 合计
+    beforeOpen() {},
+    getSummaries({ columns, data }) {
+      const means = []; // 合计
       let { tabColumns, tabName } = this;
       columns.forEach((column, columnIndex) => {
-          if (columnIndex === 0) {
-              means.push('合计')
-          } else {
-              const values = data.map(item => Number(item[column.property]));
-              
-              let sumColumn = tabColumns.find(tab => tab.key === tabName).tableColumns.filter(({key,isSummary}) => isSummary && key === column.property);
-
-              // 合计
-              // if (!values.every(value => isNaN(value))) {
-              if (sumColumn.length) {
-                  means[columnIndex] = values.reduce((prev, curr) => {
-                      const value = Number(curr);
-                      if (!isNaN(value)) {
-                          return prev + curr;
-                      } else {
-                          return prev;
-                      }
-                  }, 0);
-                  means[columnIndex] = means[columnIndex].toFixed(2); 
+        if (columnIndex === 0) {
+          means.push("合计");
+        } else {
+          const values = data.map((item) => Number(item[column.property]));
+
+          let sumColumn = tabColumns
+            .find((tab) => tab.key === tabName)
+            .tableColumns.filter(
+              ({ key, isSummary }) => isSummary && key === column.property
+            );
+
+          // 合计
+          // if (!values.every(value => isNaN(value))) {
+          if (sumColumn.length) {
+            means[columnIndex] = values.reduce((prev, curr) => {
+              const value = Number(curr);
+              if (!isNaN(value)) {
+                return prev + curr;
               } else {
-                  means[columnIndex] = '';
+                return prev;
               }
-            }
-      })
+            }, 0);
+            means[columnIndex] = means[columnIndex].toFixed(2);
+          } else {
+            means[columnIndex] = "";
+          }
+        }
+      });
       // sums[index] = sums[index] && sums[index].toFixed(2); // 保留2位小数,解决小数合计列
-      return [means]
-			
-    }
-  },
-  created() { 
-
+      return [means];
+    },
   },
-  mounted() { },
-  destroyed() { },
+  created() {},
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <el-drawer 
-    direction="btt" 
-    size="100%" 
-    :with-header="false" 
-    :visible.sync="visible" 
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
     @open="beforeOpen"
     @close="$emit('close')"
     v-loading="loading"
   >
-    <el-form 
-      size="mini" 
-      label-position="right" 
-      label-width="140px" 
-      :model="params" 
+    <el-form
+      size="mini"
+      label-position="right"
+      label-width="140px"
+      :model="params"
       :rules="rules"
       ref="orderSeeForm"
-      class="orderSeeForm" 
+      class="orderSeeForm"
     >
-        
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          ">
+          "
+        >
           <h3>查看</h3>
           <div style="text-align: right">
             <!-- <FilePrint :id="params.id"></FilePrint> -->
@@ -243,139 +240,162 @@ export default {
                 :content="params.deliveryMsg"
                 placement="bottom-end"
               >
-                <el-button 
+                <el-button
                   :key="params.deliveryStatus"
-                  :disabled="params.deliveryStatus === '1' "
-                  size="mini" 
+                  :disabled="params.deliveryStatus === '1'"
+                  size="mini"
                   type="primary"
                   @click="handleSendNC"
-                >{{  params.deliveryStatus === '1' ? '发送中' :
-                    (params.deliveryStatus === '2'? '重新发送NC' : '发送NC')
-                }}</el-button>
+                  >{{
+                    params.deliveryStatus === "1"
+                      ? "发送中"
+                      : params.deliveryStatus === "2"
+                      ? "重新发送NC"
+                      : "发送NC"
+                  }}</el-button
+                >
               </el-tooltip>
             </template>
-            
+
             <el-button size="mini" @click="handleCancel">取 消</el-button>
           </div>
         </div>
-        <el-row style="display:flex; flex-wrap: wrap;">
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+        <el-row style="display: flex; flex-wrap: wrap">
+          <el-col
+            v-for="(column, index) in columns"
+            :key="index"
+            :span="column.span || 6"
+          >
             <el-form-item :prop="column.key" :label="column.title">
-
-              <el-input v-if="column.inputType === 'Input'" 
-                v-model="params[column.key]" 
+              <el-input
+                v-if="column.inputType === 'Input'"
+                v-model="params[column.key]"
                 :placeholder="column.placeholder"
-                :clearable="column.clearable" 
-                readonly 
+                :clearable="column.clearable"
+                readonly
                 style="width: 100%"
               ></el-input>
-              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" 
-                v-model="params[column.key]" 
+              <dr-popover-select
+                v-if="column.inputType === 'PopoverSelect'"
+                v-model="params[column.key]"
                 disabled
-                :value-key="column.valueKey" 
-                :source.sync="params" 
-                :title="column.title" 
+                :value-key="column.valueKey"
+                :source.sync="params"
+                :title="column.title"
                 :type="column.referName"
-                :multiple="column.multiple" 
-                :placeholder="column.placeholder" 
+                :multiple="column.multiple"
+                :placeholder="column.placeholder"
                 :data-mapping="column.dataMapping"
                 :query-params="column.queryParams"
               ></dr-popover-select>
 
-              <el-input v-if="column.inputType === 'Textarea'" 
-                v-model="params[column.key]" 
+              <el-input
+                v-if="column.inputType === 'Textarea'"
+                v-model="params[column.key]"
                 type="textarea"
-                :placeholder="column.placeholder" 
-                :clearable="column.clearable" 
-                readonly 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                readonly
                 style="width: 100%"
               ></el-input>
 
-              <el-input-number v-if="column.inputType === 'InputNumber'" 
+              <el-input-number
+                v-if="column.inputType === 'InputNumber'"
                 v-model="params[column.key]"
-                :controls-position="column.controlsPosition" 
+                :controls-position="column.controlsPosition"
                 :placeholder="column.placeholder"
-                :clearable="column.clearable" 
+                :clearable="column.clearable"
                 :precision="column.precision"
-                disabled 
+                disabled
                 style="width: 100%"
               ></el-input-number>
-              <el-select v-if="column.inputType === 'Select'" 
-                v-model="params[column.key]" 
-                disabled 
+              <el-select
+                v-if="column.inputType === 'Select'"
+                v-model="params[column.key]"
+                disabled
                 size="mini"
-                :clearable="column.clearable" 
-                :placeholder="column.placeholder" 
-                style="width: 100%">
-                <el-option 
-                  v-for="item in dict.type[column.referName]" 
-                  :key="item.value" 
+                :clearable="column.clearable"
+                :placeholder="column.placeholder"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in dict.type[column.referName]"
+                  :key="item.value"
                   :label="item.label"
                   :value="item.value"
                 >
                 </el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" 
-                v-model="params[column.key]" 
-                multiple 
+              <el-select
+                v-if="column.inputType === 'TagSelect'"
+                v-model="params[column.key]"
+                multiple
                 clearable
-                collapse-tags 
-                :placeholder="column.placeholder" 
-                :clearable="column.clearable" 
+                collapse-tags
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
                 disabled
-                style="width: 100%">
+                style="width: 100%"
+              >
                 <template #prefix>
-                  <el-icon class="el-icon-view" 
-                    style="cursor: pointer" 
-                    @click.stop="$message.info(234)">
+                  <el-icon
+                    class="el-icon-view"
+                    style="cursor: pointer"
+                    @click.stop="$message.info(234)"
+                  >
                   </el-icon>
                 </template>
-                <el-option 
-                  v-for="item in options" 
-                  :key="item.value" 
-                  :label="item.label" 
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
                   :value="item.value"
                 >
                 </el-option>
               </el-select>
-              <el-date-picker v-if="column.inputType === 'DatePicker'" 
-                v-model="params[column.key]" 
+              <el-date-picker
+                v-if="column.inputType === 'DatePicker'"
+                v-model="params[column.key]"
                 :type="column.type"
-                :placeholder="column.placeholder" 
-                :clearable="column.clearable" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
                 readonly
-                :picker-options="column.pickerOptions" 
+                :picker-options="column.pickerOptions"
                 style="width: 100%"
               ></el-date-picker>
-              <el-checkbox v-if="column.inputType === 'Checkbox'" 
-                v-model="params[column.key]" 
-                disabled 
+              <el-checkbox
+                v-if="column.inputType === 'Checkbox'"
+                v-model="params[column.key]"
+                disabled
                 true-label="Y"
                 false-label="N"
               ></el-checkbox>
-              <file-upload-center v-if="column.inputType === 'Upload'" 
+              <file-upload-center
+                v-if="column.inputType === 'Upload'"
                 v-model="params[column.key]"
-                :file-type="column.fileType" 
+                :file-type="column.fileType"
                 :disabled="true"
               ></file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
       </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane 
-            v-for="(column, index) in tabColumns" 
-            :key="index" 
-            :label="column.title" 
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
             :name="column.key"
           >
-
             <!-- <virtual-scroll 
               :data="params[column.key].filter(item => item.delFlag === '0')" 
               :item-size="53" 
@@ -384,119 +404,134 @@ export default {
               :virtualized="true"
             >
               <template slot-scope="{ headerCellFixedStyle, cellFixedStyle }"> -->
-                <ux-grid 
-                  border
-                  use-virtual
-                  show-summary
-                  show-overflow
-                  keep-source
-                  :ref="column.key"
-                  :height="tabHeight"
-                  style="width: 100%"
-                  :data="params[column.key].filter(item => item.delFlag === '0')" 
-                  :summary-method="getSummaries"
-                >
-                
-                  <ux-table-column title="序号" type="index" width="60"></ux-table-column>
-                  <ux-table-column 
-                    v-for="(cColumn, cIndex) in column.tableColumns" 
-                    :key="cIndex" 
-                    :field="cColumn.key"
-                    :title="cColumn.title" 
-                    :width="cColumn.width || 80"
-                    resizable
-                  >
-                    <template slot="header" slot-scope="scope">
-                      <span v-if="cColumn.require" style="color: #ff4949">*</span>
-                      <span>
-                        {{ cColumn.title }}
-                      </span>
-                    </template>
-                    <template slot-scope="scope">
-                      <el-form-item  label-width="0">
-                        <span v-if="!cColumn.inputType">
-                          {{ scope.row[cColumn.key] }}
-                        </span>
-                        
-                        <el-input v-if="cColumn.inputType === 'Input'" 
-                          v-model="scope.row[cColumn.key]"
-                          :placeholder="cColumn.placeholder" 
-                          :clearable="cColumn.clearable" 
-                          readonly 
-                          size="mini"
-                          style="width: 100%"
-                        ></el-input>
-
-                        <!--  -->
-                        <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'"
-                          v-model="scope.row[cColumn.key]"
-                          :source.sync="scope.row" 
-                          :title="cColumn.title" 
-                          :value-key="cColumn.valueKey" 
-                          disabled
-                          :type="cColumn.referName" 
-                          :multiple="cColumn.multiple" 
-                          :placeholder="cColumn.placeholder"
-                          :data-mapping="cColumn.dataMapping" 
-                          :query-params="cColumn.queryParams" 
-                          size="mini" 
-                        ></dr-popover-select>
-
-                        <el-input-number v-if="cColumn.inputType === 'InputNumber'" 
-                          v-model="scope.row[cColumn.key]"
-                          :precision="cColumn.precision"
-                          :controls-position="cColumn.controlsPosition" 
-                          :placeholder="cColumn.placeholder"
-                          :clearable="cColumn.clearable" 
-                          disabled 
-                          size="mini" 
-                          style="width: 100%"
-                        ></el-input-number>
-
-                        <el-select v-if="cColumn.inputType === 'Select'" 
-                          v-model="scope.row[cColumn.key]" 
-                          disabled 
-                          size="mini"
-                          :clearable="cColumn.clearable" 
-                          :placeholder="cColumn.placeholder" 
-                          style="width: 100%">
-                          <el-option 
-                            v-for="item in dict.type[cColumn.referName]" 
-                            :key="item.value" 
-                            :label="item.label"
-                            :value="item.value"
-                          ></el-option>
-                        </el-select>
-
-                        <el-checkbox v-if="cColumn.inputType === 'Checkbox'" 
-                          v-model="scope.row[cColumn.key]" 
-                          disabled
-                          true-label="Y" 
-                          false-label="N"
-                        ></el-checkbox>
-
-
-                      </el-form-item>
-                      
-                    </template>
-                  </ux-table-column>
-                </ux-grid>
-              <!-- </template>
+            <ux-grid
+              border
+              use-virtual
+              keep-source
+              show-summary
+              show-overflow
+              beautify-table
+              :size="'mini'"
+              :ref="column.key"
+              :height="tabHeight"
+              style="width: 100%"
+              :data="params[column.key].filter((item) => item.delFlag === '0')"
+              :summary-method="getSummaries"
+              :header-row-style="{
+                color: '#515a6e',
+              }"
+            >
+              <ux-table-column
+                title="序号"
+                type="index"
+                width="60"
+              ></ux-table-column>
+              <ux-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :field="cColumn.key"
+                :title="cColumn.title"
+                :width="cColumn.width || 80"
+                resizable
+              >
+                <template slot="header" slot-scope="scope">
+                  <span v-if="cColumn.require" style="color: #ff4949">*</span>
+                  <span>
+                    {{ cColumn.title }}
+                  </span>
+                </template>
+                <template slot-scope="scope">
+                  <el-form-item label-width="0">
+                    <span v-if="!cColumn.inputType">
+                      {{ scope.row[cColumn.key] }}
+                    </span>
+
+                    <el-input
+                      v-if="cColumn.inputType === 'Input'"
+                      v-model="scope.row[cColumn.key]"
+                      :placeholder="cColumn.placeholder"
+                      :clearable="cColumn.clearable"
+                      readonly
+                      size="mini"
+                      style="width: 100%"
+                    ></el-input>
+
+                    <!--  -->
+                    <dr-popover-select
+                      v-if="cColumn.inputType === 'PopoverSelect'"
+                      v-model="scope.row[cColumn.key]"
+                      :source.sync="scope.row"
+                      :title="cColumn.title"
+                      :value-key="cColumn.valueKey"
+                      disabled
+                      :type="cColumn.referName"
+                      :multiple="cColumn.multiple"
+                      :placeholder="cColumn.placeholder"
+                      :data-mapping="cColumn.dataMapping"
+                      :query-params="cColumn.queryParams"
+                      size="mini"
+                    ></dr-popover-select>
+
+                    <el-input-number
+                      v-if="cColumn.inputType === 'InputNumber'"
+                      v-model="scope.row[cColumn.key]"
+                      :precision="cColumn.precision"
+                      :controls-position="cColumn.controlsPosition"
+                      :placeholder="cColumn.placeholder"
+                      :clearable="cColumn.clearable"
+                      disabled
+                      size="mini"
+                      style="width: 100%"
+                    ></el-input-number>
+
+                    <el-select
+                      v-if="cColumn.inputType === 'Select'"
+                      v-model="scope.row[cColumn.key]"
+                      disabled
+                      size="mini"
+                      :clearable="cColumn.clearable"
+                      :placeholder="cColumn.placeholder"
+                      style="width: 100%"
+                    >
+                      <el-option
+                        v-for="item in dict.type[cColumn.referName]"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value"
+                      ></el-option>
+                    </el-select>
+
+                    <el-checkbox
+                      v-if="cColumn.inputType === 'Checkbox'"
+                      v-model="scope.row[cColumn.key]"
+                      disabled
+                      true-label="Y"
+                      false-label="N"
+                    ></el-checkbox>
+                  </el-form-item>
+                </template>
+              </ux-table-column>
+            </ux-grid>
+            <!-- </template>
           </virtual-scroll> -->
-            
           </el-tab-pane>
         </el-tabs>
       </el-card>
-
     </el-form>
   </el-drawer>
 </template>
 
 <style scoped>
-  .orderSeeForm>>>.el-form-item{
-    margin-bottom: 12px;
-  }
-::v-deep .singleTable .el-form-item{
+.orderSeeForm >>> .el-form-item {
+  margin-bottom: 12px;
+}
+::v-deep .singleTable .el-form-item {
   margin-bottom: 0px;
 }
+::v-deep.uxbeautifyTableClass
+  .elx-header--column
+  .elx-resizable.is--line:before {
+  height: 100%;
+  background-color: #dfe6ec;
+}
 </style>

+ 7 - 5
src/views/purchase/task/index.vue

@@ -14,6 +14,7 @@ export default {
     XyzcButton: () => import("./xie-yi-zhi-cai/index.vue"),
     lcButton: () => import("./line-close/index.vue"),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
   },
   data() {
@@ -31,13 +32,14 @@ export default {
       SearchColumns: SearchColumns,
     };
   },
-  computed: {},
+  computed: {
+  },
   watch: {},
   created() {
     this.params = {
       ...this.params,
-      statusList:['0','2','3']
-    }
+      statusList: ["0", "2", "3"],
+    };
     this.useQuery(this.params, this.page);
   },
   methods: {
@@ -171,7 +173,7 @@ export default {
         ></dc-button>
       </el-button-group> -->
     </div>
-    <el-super-table
+    <el-super-ux-table
       v-model="tableData"
       :size="size"
       :dict="dict"
@@ -185,7 +187,7 @@ export default {
       @row-select="useSelect"
       @pagination="useQuery(params, page)"
     >
-    </el-super-table>
+    </el-super-ux-table>
   </el-card>
 </template>
 <style scoped lang="scss">

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

@@ -1,5 +1,5 @@
 <script>
-import { TableColumns ,BasicColumns} from "./column";
+import { TableColumns, BasicColumns } from "./column";
 import { initDicts } from "@/utils/init.js";
 import { FIRSTDIRECT, ADD } from "@/api/business/purchase/task";
 export default {
@@ -14,6 +14,7 @@ export default {
   components: {
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElDictTag: () => import("@/components/DictTag/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
     ElComputedInputV2: () => import("@/components/computed-input-v2/index.vue"),
   },
   data() {
@@ -24,11 +25,11 @@ export default {
       visible: false,
       loading: false,
       tableColumns: TableColumns,
-      basicColumns:BasicColumns,
+      basicColumns: BasicColumns,
       data: [],
-      showData:[],
-      supplier:'',
-      size:'mini',
+      showData: [],
+      supplier: "",
+      size: "mini",
     };
   },
   computed: {
@@ -38,32 +39,29 @@ export default {
       },
       set() {},
     },
-    restaurants:{
-      get(){
+    restaurants: {
+      get() {
         let allSupplier = [];
-        this.data.forEach(item =>{
-
-          let orderPriceVos = item.orderPriceVos.map(order => ({
-            value:order.supplierName,
-            id:order.supplier
-          }))
+        this.data.forEach((item) => {
+          let orderPriceVos = item.orderPriceVos.map((order) => ({
+            value: order.supplierName,
+            id: order.supplier,
+          }));
           allSupplier.push(...orderPriceVos);
-
-        })
-        allSupplier = this.uniqueFunc(allSupplier,'id');
-        console.log(allSupplier,'allSupplier');
+        });
+        allSupplier = this.uniqueFunc(allSupplier, "id");
+        console.log(allSupplier, "allSupplier");
         return allSupplier;
       },
-      set(){},
-    }
-  },
-  watch: {
+      set() {},
+    },
   },
+  watch: {},
   methods: {
     //
     async open(prop) {
       this.visible = await this.fetchItem(prop);
-      this.supplier = '';
+      this.supplier = "";
     },
     //
     hide() {
@@ -80,15 +78,18 @@ export default {
             ...item,
             orderPriceVos: item.orderPriceVos.map((cItem) => ({
               ...item,
-              customerName:'',
-              customer:'',
+              customerName: "",
+              customer: "",
               ...cItem,
-              purchaseQuantity: item.orderPriceVos.length === 1 ? (item.puQty - item.executeQty) : undefined
+              purchaseQuantity:
+                item.orderPriceVos.length === 1
+                  ? item.puQty - item.executeQty
+                  : undefined,
             })),
           }));
 
-          console.log(this.data,'this.data');
-          this.showData =  _.cloneDeep(this.data);
+          console.log(this.data, "this.data");
+          this.showData = _.cloneDeep(this.data);
           return true;
         } else {
           return false;
@@ -111,9 +112,9 @@ export default {
           ),
         }))
         .filter((item) => item.orderPriceVos.length);
-        console.log(params,'params');
-        try {
-          this.loading = true;
+      console.log(params, "params");
+      try {
+        this.loading = true;
         // try
         const { msg, code } = await ADD(params);
         if (code === 200) {
@@ -125,38 +126,34 @@ export default {
         // catch
       } finally {
         // finally
-          this.loading = false;
+        this.loading = false;
       }
     },
-    hide(){
+    hide() {
       this.visible = false;
     },
-    supplierChange(value){
-      console.log(value,'value');
+    supplierChange(value) {
+      console.log(value, "value");
     },
     // 建议值
-    querySearch(queryString, cb){
-
+    querySearch(queryString, cb) {
       let results = this.restaurants;
 
       results = queryString
         ? results.filter(this.createFilter(queryString))
         : results;
 
-    //cb是回调函数,返回筛选出的结果数据到输入框下面的输入列表
+      //cb是回调函数,返回筛选出的结果数据到输入框下面的输入列表
       cb(results);
-
     },
     createFilter(queryString) {
-
       return (item) => {
         return item.value.toUpperCase().match(queryString.toUpperCase());
       };
-
     },
-    
-    handleSelect(prop){
-      console.log(this.data,'handleSelect');
+
+    handleSelect(prop) {
+      console.log(this.data, "handleSelect");
 
       // this.tableColumns = this.tableColumns.map(({ item, attr }) =>{
 
@@ -168,7 +165,7 @@ export default {
       //     item: {...item},
       //     attr: {...attr},
       //   }
-        
+
       // })
 
       // this.$refs.superTable.forEach(item =>{
@@ -189,36 +186,35 @@ export default {
       //   onFilter();
       // })
 
-      this.showData = this.data.map(item => {
+      this.showData = this.data.map((item) => {
         return {
           ...item,
-          orderPriceVos:item.orderPriceVos.filter(order => order.supplier === prop.id),
-        }
-      })
+          orderPriceVos: item.orderPriceVos.filter(
+            (order) => order.supplier === prop.id
+          ),
+        };
+      });
     },
-    handleClear(){
-      this.showData =  _.cloneDeep(this.data);
+    handleClear() {
+      this.showData = _.cloneDeep(this.data);
     },
     // 对象数组去重
-    uniqueFunc(arr, uniId){
+    uniqueFunc(arr, uniId) {
       const res = new Map();
-      return arr.filter((item) => !res.has(item[uniId]) && res.set(item[uniId], 1));
+      return arr.filter(
+        (item) => !res.has(item[uniId]) && res.set(item[uniId], 1)
+      );
     },
-    changeQuantity(prop,value){
-
-      this.data = this.data.map(item =>{
-
-        if(item.id === prop.id){
-
-          item.orderPriceVos = item.orderPriceVos.map(order =>{
-
-            if(order.id === value.id){
-
+    changeQuantity(prop, value) {
+      this.data = this.data.map((item) => {
+        if (item.id === prop.id) {
+          item.orderPriceVos = item.orderPriceVos.map((order) => {
+            if (order.id === value.id) {
               return value;
             }
 
             return order;
-          })
+          });
 
           // item.orderPriceVos.forEach(order =>{
 
@@ -233,50 +229,39 @@ export default {
           // })
         }
         return item;
-      })
+      });
 
+      // 实时统计
+      this.$refs.superTable[0].updateFooter();
     },
-    changeDatePlan(prop,value){
-
-      this.data = this.data.map(item =>{
-
-        if(item.id === prop.id){
-
-          item.orderPriceVos = item.orderPriceVos.map(order =>{
-
-            if(order.id === value.id){
-
+    changeDatePlan(prop, value) {
+      this.data = this.data.map((item) => {
+        if (item.id === prop.id) {
+          item.orderPriceVos = item.orderPriceVos.map((order) => {
+            if (order.id === value.id) {
               return value;
             }
 
             return order;
-          })
-
+          });
         }
         return item;
-      })
+      });
     },
-    changeNote(prop,value){
-
-      this.data = this.data.map(item =>{
-
-        if(item.id === prop.id){
-
-          item.orderPriceVos = item.orderPriceVos.map(order =>{
-
-            if(order.id === value.id){
-
+    changeNote(prop, value) {
+      this.data = this.data.map((item) => {
+        if (item.id === prop.id) {
+          item.orderPriceVos = item.orderPriceVos.map((order) => {
+            if (order.id === value.id) {
               return value;
             }
 
             return order;
-          })
-
+          });
         }
         return item;
-      })
+      });
     },
-
   },
   created() {},
   mounted() {},
@@ -313,16 +298,12 @@ export default {
           v-loading="loading"
           >确 认</el-button
         >
-        <el-button
-          :size="$attrs.size"
-          @click="hide"
-          v-loading="loading"
+        <el-button :size="$attrs.size" @click="hide" v-loading="loading"
           >取 消</el-button
         >
-        
       </template>
 
-      <el-row style="padding: 0 16px;">
+      <el-row style="padding: 0 16px">
         <el-col>
           <el-autocomplete
             class="inline-input"
@@ -337,12 +318,10 @@ export default {
         </el-col>
       </el-row>
 
-
       <div v-for="(item, index) in showData" :key="index" class="m-4">
-
         <template v-if="item.orderPriceVos.length">
           <el-descriptions :column="4">
-            <template slot="title" >
+            <template slot="title">
               <template>
                 <span style="margin-right: 10px">{{ item.materialName }}</span>
                 <span style="color: tomato">{{ item.puQty }}</span>
@@ -352,28 +331,28 @@ export default {
                 >) <span> {{ item.puUnitName }}</span>
               </template>
             </template>
-  
-            <el-descriptions-item 
-              v-for="(basic,bIndex) in basicColumns"
+
+            <el-descriptions-item
+              v-for="(basic, bIndex) in basicColumns"
               :key="bIndex"
               :label="basic.item.title"
-            >{{ item[basic.item.key] }}
+              >{{ item[basic.item.key] }}
             </el-descriptions-item>
-            <el-descriptions-item 
-              label="需求数量"
-            >{{ item.puQty - (item.executeQty || 0) }}
+            <el-descriptions-item label="需求数量"
+              >{{ item.puQty - (item.executeQty || 0) }}
             </el-descriptions-item>
-            
           </el-descriptions>
-          
-          <el-super-table
+
+          <el-super-ux-table
             v-if="visible"
             ref="superTable"
             v-model="item.orderPriceVos"
+            height="auto"
             :columns="tableColumns"
             :size="$attrs.size"
             :dict="dict"
             showSummary
+            firstSummary
           >
             <!-- showSummary -->
             <template slot="purchaseQuantity" slot-scope="scope">
@@ -382,7 +361,7 @@ export default {
                 v-model="scope.row[scope.item.key]"
                 :size="$attrs.size"
                 :max="scope.attr.max(scope.row)"
-                @change="changeQuantity(item,scope.row)"
+                @change="changeQuantity(item, scope.row)"
               >
               </component>
             </template>
@@ -404,9 +383,8 @@ export default {
               >
               </component>
             </template>
-          </el-super-table>
+          </el-super-ux-table>
         </template>
-        
       </div>
     </el-drawer>
   </el-button>

Some files were not shown because too many files changed in this diff