Эх сурвалжийг харах

优化需求单、需求处理

002390 1 жил өмнө
parent
commit
7a4f1c913a

+ 62 - 109
src/views/purchase/DemandSummary/index.vue

@@ -9,7 +9,7 @@
                 <el-select
                   multiple
                   v-model="queryParams.rowStatus"
-                  size="mini"
+                  :size="size"
                   style="width: 200px"
                   clearable
                 >
@@ -27,7 +27,7 @@
               <el-form-item label="采购员">
                 <el-select
                   clearable
-                  size="mini"
+                  :size="size"
                   v-model="queryParams.buyer"
                   @clear="cleanBuyer"
                   @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
@@ -46,7 +46,7 @@
               <el-form-item label="品类">
                 <el-select
                   v-model="queryParams.materialClassifyFour"
-                  size="mini"
+                  :size="size"
                   multiple
                   collapse-tags
                   clearable
@@ -68,22 +68,18 @@
               <el-form-item label="生产厂家">
                 <el-input
                   v-model.trim="queryParams.manufacturer"
-                  size="mini"
+                  :size="size"
                   clearable
                   style="width: 200px"
                 />
               </el-form-item>
             </el-col>
-            <!-- <el-col :span="1.5"> -->
-            <!-- <el-form-item label="" label-width="20px"> -->
             <div style="position: absolute; top: 3px; right: 10px">
-              <el-button type="primary" size="mini" @click="search"
+              <el-button type="primary" :size="size" @click="search"
                 >搜索</el-button
               >
-              <el-button size="mini" plain @click="reset">重置</el-button>
+              <el-button :size="size" plain @click="reset">重置</el-button>
             </div>
-            <!-- </el-form-item> -->
-            <!-- </el-col> -->
           </el-row>
 
           <CollapseTransition>
@@ -93,7 +89,7 @@
                   <el-form-item label="预测分类">
                     <el-select
                       v-model="queryParams.forecastClassification"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                       clearable
                     >
@@ -111,7 +107,7 @@
                   <el-form-item label="审核人">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.puManagerAuditor"
                       @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')"
                       style="width: 200px"
@@ -129,7 +125,7 @@
                   <el-form-item label="注册人">
                     <el-input
                       v-model.trim="queryParams.registrant"
-                      size="mini"
+                      :size="size"
                       clearable
                       style="width: 200px"
                     />
@@ -139,7 +135,7 @@
                   <el-form-item label="业务类型">
                     <el-select
                       v-model="queryParams.businessType"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                       clearable
                     >
@@ -160,7 +156,7 @@
                   <el-form-item label="单据来源">
                     <el-select
                       v-model="queryParams.billSource"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                       clearable
                     >
@@ -178,7 +174,7 @@
                   <el-form-item label="需求客户">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.customer"
                       @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')"
                       style="width: 200px"
@@ -196,7 +192,7 @@
                   <el-form-item label="供应仓库">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.lastWarehouse"
                       @focus="chooseRefer('WAREHOUSE_PARAM', true, '供应仓库')"
                       style="width: 200px"
@@ -214,7 +210,7 @@
                   <el-form-item label="供应库位">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.lastAllocation"
                       @focus="
                         chooseRefer(
@@ -250,14 +246,14 @@
                       <el-input
                         slot="reference"
                         clearable
-                        size="mini"
+                        :size="size"
                         v-model="queryParams.names"
                         @clear="clearMaterial"
                         style="width: 200px"
                         @paste.native="pasteMe($event)"
                       >
                         <el-button
-                          size="mini"
+                          :size="size"
                           slot="append"
                           @click="chooseMaterial"
                           >数量:{{
@@ -272,7 +268,7 @@
                   <el-form-item label="默认采购组织">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.purchaseOrg"
                       @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')"
                       style="width: 200px"
@@ -303,7 +299,7 @@
                   <el-form-item label="采购需求单号">
                     <el-input
                       v-model.trim="queryParams.code"
-                      size="mini"
+                      :size="size"
                       clearable
                       style="width: 200px"
                     />
@@ -330,11 +326,11 @@
                     <el-select
                       clearable
                       v-model="queryParams.isCustomerSpecified"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                     >
                       <el-option
-                        v-for="item in options"
+                        v-for="item in dict.type.sys_yes_no"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"
@@ -349,11 +345,11 @@
                     <el-select
                       clearable
                       v-model="queryParams.isUrgency"
-                      size="mini"
+                      :size="size"
                       style="width: 200px"
                     >
                       <el-option
-                        v-for="item in options"
+                        v-for="item in dict.type.sys_yes_no"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"
@@ -367,7 +363,7 @@
                   <el-form-item label="补单供应商">
                     <el-select
                       clearable
-                      size="mini"
+                      :size="size"
                       v-model="queryParams.additionalSupplier"
                       @focus="chooseRefer('SUPPLIER_PARAM', true, '供应商')"
                       style="width: 200px"
@@ -410,55 +406,55 @@
         ></el-divider>
 
         <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="editList"
+          <el-button type="primary" :size="size" @click="editList"
             >编辑</el-button
           >
           <el-button
             type="danger"
-            size="mini"
+            :size="size"
             v-if="!lineDisable"
             @click="cancelEdit"
             >取消编辑</el-button
           >
           <el-button
             type="success"
-            size="mini"
+            :size="size"
             v-if="!lineDisable"
             @click="saveList"
             >保存</el-button
           >
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="confirms"
             >确认</el-button
           >
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="cancels"
             >取消</el-button
           >
-          <!-- <el-button type="primary" size="mini" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
+          <!-- <el-button type="primary" :size="size" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="audits"
             >审核</el-button
           >
           <el-button
             type="primary"
-            size="mini"
+            :size="size"
             v-if="lineDisable"
             @click="closeLine"
             >行关闭</el-button
           >
 
           <el-button
-            size="mini"
+            :size="size"
             type="primary"
             style="margin: 0 10px"
             v-if="lineDisable"
@@ -467,7 +463,7 @@
             导出
           </el-button>
 
-          <!-- <el-button type="primary" size="mini">转请购</el-button> -->
+          <!-- <el-button type="primary" :size="size">转请购</el-button> -->
         </div>
         <vxe-toolbar ref="xToolbar1" custom> </vxe-toolbar>
 
@@ -527,7 +523,7 @@
           >
             <template slot-scope="scope">
               <el-input
-                size="mini"
+                :size="size"
                 :disabled="scope.row.status !== '1' || lineDisable"
                 v-model="scope.row.finalBuyQty"
                 @change="jilu(scope.$rowIndex)"
@@ -848,7 +844,7 @@
           >
             <template slot-scope="scope">
               <el-input
-                size="mini"
+                :size="size"
                 :disabled="
                   scope.row.status !== '1' ||
                   lineDisable ||
@@ -908,11 +904,11 @@
               <el-input
                 readonly
                 :disabled="scope.row.status !== '1' || lineDisable"
-                size="mini"
+                :size="size"
                 v-model="scope.row.buyerName"
               >
                 <el-button
-                  size="mini"
+                  :size="size"
                   :disabled="scope.row.status !== '1' || lineDisable"
                   slot="append"
                   icon="el-icon-more"
@@ -1046,24 +1042,20 @@
           />
           <vxe-column title="操作" align="center" width="50">
             <template slot-scope="scope">
-              <el-button type="text" size="mini" @click="check(scope.row)"
+              <el-button type="text" :size="size" @click="check(scope.row)"
                 >查看</el-button
               >
             </template>
           </vxe-column>
         </vxe-table>
 
-        <el-pagination
-          background
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="queryParams.pageNum"
-          :page-sizes="[10, 20, 50, 100, 200, 500]"
-          :page-size="50"
-          layout="total, sizes, prev, pager, next, jumper"
+        <pagination
           :total="total"
-        >
-        </el-pagination>
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList(queryParams)"
+          style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
+        />
       </el-card>
     </div>
 
@@ -1086,11 +1078,6 @@
 </template>
 
 <script>
-import Add from "./add";
-import Refers from "@/components/Refers/refers.vue";
-import TreeRefers from "@/components/Refers/treeRefer.vue";
-import popDialog from "@/components/PopDialog/index.vue";
-import CollapseTransition from "@/components/MyCollapse/collapse.vue";
 // 用于物料参照框数据
 import { getRefer } from "@/api/purchase/basic.js";
 import {
@@ -1107,6 +1094,7 @@ import {
 export default {
   name: "demandSummary",
   dicts: [
+    "sys_yes_no",
     "sys_row_status",
     "predictive_classify",
     "sys_period_unit",
@@ -1114,11 +1102,11 @@ export default {
     "sys_bill_source",
   ],
   components: {
-    Add,
-    CollapseTransition,
-    Refers,
-    TreeRefers,
-    popDialog,
+    Add: () => import("./add"),
+    CollapseTransition: () => import("@/components/MyCollapse/collapse.vue"),
+    Refers: () => import("@/components/Refers/refers.vue"),
+    TreeRefers: () => import("@/components/Refers/treeRefer.vue"),
+    popDialog: () => import("@/components/PopDialog/index.vue"),
   },
   data() {
     return {
@@ -1216,16 +1204,6 @@ export default {
       lastAllocationOptions: [],
       orgOptions: [],
       supplierOptions: [],
-      options: [
-        {
-          value: "Y",
-          label: "是",
-        },
-        {
-          value: "N",
-          label: "否",
-        },
-      ],
       referCondition: {
         type: "",
         isPage: true,
@@ -1347,33 +1325,27 @@ export default {
       };
       this.getList(this.queryParams);
     },
-    getList(params) {
-      getSummaryList(params)
-        .then((res) => {
-          if (res.code === 200) {
-            this.tableList = res.rows;
-            this.total = res.total;
-          }
-        })
-        .then(() => {
-          // 合计不显示重绘
-          this.$refs.table.doLayout();
-          this.loading = false;
-        })
-        .catch((err) => {
-          this.loading = false;
-        });
+    async getList(params) {
+      try {
+        this.loading = true;
+        let { code, rows, total } = await getSummaryList(params);
+        if (code == 200) {
+          this.tableList = rows;
+          this.total = total;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
     },
     selectAllEvent({ checked }) {
       const selection = this.$refs.table.getCheckboxRecords();
-      console.log("选中", selection);
       this.allSelection = selection;
       this.ids = selection.map((item) => item.demandItemId);
       console.log("选中数组", this.ids.join());
     },
     handleSelectionChange({ checked }) {
       const selection = this.$refs.table.getCheckboxRecords();
-      console.log("选中", selection);
       this.allSelection = selection;
       this.ids = selection.map((item) => item.demandItemId);
       console.log("选中数组", this.ids.join());
@@ -1418,16 +1390,6 @@ export default {
       // console.log(row)
       this.$refs.table.toggleCheckboxRow(row.row);
     },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-      this.queryParams.pageSize = val;
-      this.getList(this.queryParams);
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-      this.queryParams.pageNum = val;
-      this.getList(this.queryParams);
-    },
     drop() {
       this.expanded = !this.expanded;
     },
@@ -1717,10 +1679,6 @@ export default {
 .hang ::v-deep .el-form-item__content {
   margin-left: 0px !important;
 }
-.el-pagination {
-  margin-top: 10px;
-  text-align: right;
-}
 ::v-deep .vxe-body--row > td {
   border-right: none;
 }
@@ -1731,8 +1689,3 @@ export default {
   background-color: #ff8a8a !important;
 }
 </style>
-<style>
-.exporttable {
-  border: solid 1px #c0c0c0;
-}
-</style>

+ 52 - 13
src/views/purchase/PurchaseDemandList/columns.js

@@ -1,19 +1,58 @@
 export default function useColumns() {
 
   const TableColumns = [
-    { item: { key: "code", title: "需求单号", width: 150 }, attr: {} },
-    { item: { key: "demandDate", title: "需求日期", width: 150 }, attr: {} },
-    { item: { key: "createTime", title: "制单日期", width: 150 }, attr: {} },
-    { item: { key: "planType", title: "需求计划", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_plan_type" } },
-    { item: { key: "approverFinishTime", title: "审批结束日期", width: 150 }, attr: {} },
-    { item: { key: "status", title: "单据状态", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_status" } },
-    { item: { key: "billType", title: "业务类型", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_business" } },
-    { item: { key: "demandPersonalName", title: "需求人员", width: 150 }, attr: {} },
-    { item: { key: "customerName", title: "需求客户", width: 150 }, attr: {} },
-    { item: { key: "demandDeptName", title: "需求部门", width: 150 }, attr: {} },
-    { item: { key: "source", title: "单据来源", width: 150 }, attr: { is: "el-dict-tag", dictName: "sys_bill_source" } },
-    { item: { key: "approveUser", title: "当前审批人", width: 150 }, attr: {} },
-    { item: { key: "remark", title: "备注", width: 150 }, attr: {} },
+    {
+      item: { key: "code", title: "需求单号", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "demandDate", title: "需求日期", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "createTime", title: "制单日期", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "planType", title: "需求计划", width: 150 },
+      attr: { is: "el-dict-tag", dictName: "sys_plan_type" }
+    },
+    {
+      item: { key: "approverFinishTime", title: "审批结束日期", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "status", title: "单据状态", width: 150 },
+      attr: { is: "el-dict-tag", dictName: "sys_status" }
+    },
+    {
+      item: { key: "billType", title: "业务类型", width: 150 },
+      attr: { is: "el-dict-tag", dictName: "sys_business" }
+    },
+    {
+      item: { key: "demandPersonalName", title: "需求人员", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "customerName", title: "需求客户", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "demandDeptName", title: "需求部门", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "source", title: "单据来源", width: 150 },
+      attr: { is: "el-dict-tag", dictName: "sys_bill_source" }
+    },
+    {
+      item: { key: "approveUser", title: "当前审批人", width: 150 },
+      attr: {}
+    },
+    {
+      item: { key: "remark", title: "备注", width: 150 },
+      attr: {}
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {

+ 3 - 2
src/views/purchase/catalogue/index.vue

@@ -12,6 +12,7 @@ export default {
     EnaButton: () => import("./enable/index.vue"),
     ExpButton: () => import("./export/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() {
@@ -180,7 +181,7 @@ export default {
         <el-button size="mini" @click="exportAll">全部导出</el-button>
       </el-button-group>
     </div>
-    <el-super-table
+    <el-super-ux-table
       v-model="tableData"
       :size="size"
       :dict="dict"
@@ -195,7 +196,7 @@ export default {
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"
     >
-    </el-super-table>
+    </el-super-ux-table>
   </el-card>
 </template>
 <style scoped lang="scss">