002201 2 anni fa
parent
commit
6edcbfa70d

+ 63 - 60
src/views/purchase/apply/add/column.js

@@ -25,13 +25,13 @@ export const FormColumns = [
     },
     require: true,
   },
-  {
-    key: "supplier",
-    title: "供应商编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
+  // {
+  //   key: "supplier",
+  //   title: "供应商编码",
+  //   inputType: "Input",
+  //   disabled: true,
+  //   readonly: true,
+  // },
   {
     key: "puOrgName",
     title: "采购组织",
@@ -45,13 +45,13 @@ export const FormColumns = [
     },
     require: true,
   },
-  {
-    key: "puOrg",
-    title: "采购组织编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
+  // {
+  //   key: "puOrg",
+  //   title: "采购组织编码",
+  //   inputType: "Input",
+  //   disabled: true,
+  //   readonly: true,
+  // },
   {
     key: "currencyName",
     title: "币种",
@@ -64,13 +64,13 @@ export const FormColumns = [
     },
     require: true,
   },
-  {
-    key: "currency",
-    title: "币种编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
+  // {
+  //   key: "currency",
+  //   title: "币种编码",
+  //   inputType: "Input",
+  //   disabled: true,
+  //   readonly: true,
+  // },
   {
     key: "explainStr",
     title: "价格合理性说明",
@@ -88,13 +88,13 @@ export const FormColumns = [
     },
     require: true,
   },
-  {
-    key: "buyer",
-    title: "采购员编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
+  // {
+  //   key: "buyer",
+  //   title: "采购员编码",
+  //   inputType: "Input",
+  //   disabled: true,
+  //   readonly: true,
+  // },
   {
     key: "puDeptName",
     title: "采购部门",
@@ -107,13 +107,13 @@ export const FormColumns = [
     },
     require: true,
   },
-  {
-    key: "puDept",
-    title: "采购部门编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
+  // {
+  //   key: "puDept",
+  //   title: "采购部门编码",
+  //   inputType: "Input",
+  //   disabled: true,
+  //   readonly: true,
+  // },
   {
     key: "createByName",
     title: "创建人",
@@ -204,10 +204,10 @@ export const TabColumns = [
         title: "生产厂家",
         key: "manufacturerName",
       },
-      {
-        title: "生产厂家编码",
-        key: "manufacturer",
-      },
+      // {
+      //   title: "生产厂家编码",
+      //   key: "manufacturer",
+      // },
       {
         title: "规格",
         key: "specification",
@@ -217,7 +217,7 @@ export const TabColumns = [
         key: "model",
       },
       {
-        title: "单位名称",
+        title: "单位",
         key: "unitName",
         inputType: "PopoverSelect",
         width: 300,
@@ -228,16 +228,16 @@ export const TabColumns = [
           unitName: "name",
         },
       },
-      {
-        title: "单位编码",
-        key: "unitCode",
-      },
+      // {
+      //   title: "单位编码",
+      //   key: "unitCode",
+      // },
       // {
       //   title: "单位ID",
       //   key: "unit",
       // },
       {
-        title: "采购单位名称",
+        title: "采购单位",
         key: "puUnitName",
         inputType: "PopoverSelect",
         width: 300,
@@ -248,10 +248,10 @@ export const TabColumns = [
           puUnitName: "name",
         },
       },
-      {
-        title: "采购单位编码",
-        key: "puUnitCode",
-      },
+      // {
+      //   title: "采购单位编码",
+      //   key: "puUnitCode",
+      // },
       // {
       //   title: "采购单位ID",
       //   key: "puUnit",
@@ -296,7 +296,7 @@ export const TabColumns = [
       },
       {
         key: "currencyName",
-        title: "币种名称",
+        title: "币种",
         inputType: "PopoverSelect",
         referName: "CURRENCY_PARAM",
         dataMapping: {
@@ -305,10 +305,10 @@ export const TabColumns = [
           currencyName: "name",
         },
       },
-      {
-        title: "币种编码",
-        key: "currencyCode",
-      },
+      // {
+      //   title: "币种编码",
+      //   key: "currencyCode",
+      // },
       // {
       //   title: "币种ID",
       //   key: "currency",
@@ -346,10 +346,10 @@ export const TabColumns = [
           customerName: "name",
         },
       },
-      {
-        title: "客户编码",
-        key: "customerCode",
-      },
+      // {
+      //   title: "客户编码",
+      //   key: "customerCode",
+      // },
       // {
       //   title: "客户ID",
       //   key: "customer",
@@ -401,7 +401,7 @@ export const TabColumns = [
     key: "priceApplyOrgs",
     tableColumns: [
       {
-        title: "组织名称",
+        title: "组织",
         key: "orgName",
         inputType: "PopoverSelect",
         referName: "ORG_PARAM",
@@ -410,16 +410,19 @@ export const TabColumns = [
           orgCode: "code",
           orgName: "name",
         },
+        width: "auto",
       },
-      { title: "组织编码", key: "org" },
+      // { title: "组织编码", key: "org" },
       // { title: "组织ID", key: "org" },
       {
         title: "创建人名称",
         key: "createByName",
+        width: "auto",
       },
       {
         title: "更新人名称",
         key: "updateByName",
+        width: "auto",
       },
     ],
   },

+ 4 - 4
src/views/purchase/apply/column.js

@@ -17,10 +17,10 @@ export const FormColumns = [
     key: "supplierName",
     title: "供应商",
   },
-  {
-    key: "puOrgName",
-    title: "采购组织",
-  },
+  // {
+  //   key: "puOrgName",
+  //   title: "采购组织",
+  // },
   {
     key: "currencyName",
     title: "币种",

+ 6 - 5
src/views/purchase/apply/index.vue

@@ -52,13 +52,12 @@ export default {
         if (code === 200) {
           this.tableData = rows.map((item, index) => ({
             ...item,
-            $index: index + 1,
+            $index: (pageNum - 1) * pageSize + index + 1,
           }));
           this.page.total = total;
           this.page.pageNum = pageNum;
           this.page.pageSize = pageSize;
-          console.log(this.page);
-          return rows[0];
+          return this.tableData;
         }
       } catch (err) {
         // catch
@@ -132,8 +131,7 @@ export default {
     async useSee(prop) {
       const { id, $index } = prop;
       const { open } = this.$refs.SeeModel;
-      await open(id);
-      await this.useQuery(this.params, { pageSize: 1, pageNum: $index });
+      await open(id, $index, this.page);
     },
     // 审 核
     async useSubmit(prop, done) {
@@ -274,6 +272,9 @@ export default {
       >
       </el-table-column>
       <el-table-column fixed width="55" align="center" type="index">
+        <template slot-scope="scope">
+          {{ scope.row.$index }}
+        </template>
       </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"

+ 21 - 36
src/views/purchase/apply/see/index.vue

@@ -11,6 +11,7 @@ export default {
     return {
       column: 3,
       title: "明 细",
+      lastPage: {},
       ...useData(Column),
     };
   },
@@ -22,13 +23,14 @@ export default {
   watch: {},
   methods: {
     //
-    async fetchItem(prop) {
+    async fetchItem(prop, index) {
       try {
         // try
         this.loading = true;
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          this.params.$index = index;
           return true;
         } else {
           return false;
@@ -42,48 +44,29 @@ export default {
       }
     },
     //
-    async open(prop) {
-      this.visible = await this.fetchItem(prop);
+    async open(prop, index, page) {
+      this.lastPage = { ...page };
+      this.visible = await this.fetchItem(prop, index);
     },
     //
     async hide() {
       this.visible = false;
+      const { params, fetchList } = this.root;
+      fetchList(params, this.lastPage);
     },
     //
-    async useQueryLast() {
-      const {
-        page: { pageNum },
-        params,
-        fetchList,
-      } = this.root;
-      const page = { pageNum: pageNum - 1, pageSize: 1 };
-      console.log("last", page);
-      if (page.pageNum < 1) {
-        return this.$notify.info({
-          message: "已经是第一页了~",
-          position: "bottom-left",
-        });
-      } else {
-        this.params = await fetchList(params, page);
+    async useQueryLast(prop) {
+      const { params, fetchList } = this.root;
+      if (prop >= 1) {
+        const [row] = await fetchList(params, { pageSize: 1, pageNum: prop });
+        this.params = row;
       }
     },
     //
-    async useQueryPrev() {
-      const {
-        page: { total, pageNum },
-        params,
-        fetchList,
-      } = this.root;
-      const page = { pageNum: pageNum + 1, pageSize: 1 };
-      console.log("prev", page);
-      if (page.pageNum > total) {
-        return this.$notify.info({
-          message: "大海是有深度的~",
-          position: "bottom-left",
-        });
-      } else {
-        this.params = await fetchList(params, page);
-      }
+    async useQueryPrev(prop) {
+      const { params, fetchList } = this.root;
+      const [row] = await fetchList(params, { pageSize: 1, pageNum: prop });
+      this.params = row;
     },
     //
     async useDelete(prop) {
@@ -122,17 +105,19 @@ export default {
         <el-tooltip effect="dark" content="上一页" placement="bottom-end">
           <el-button
             :size="size"
+            :disabled="params.$index === 1"
             circle
             icon="el-icon-top"
-            @click="useQueryLast"
+            @click="useQueryLast(params.$index - 1)"
           ></el-button>
         </el-tooltip>
         <el-tooltip effect="dark" content="下一页" placement="bottom-end">
           <el-button
             :size="size"
+            :disabled="params.$index === root.page.total"
             circle
             icon="el-icon-bottom"
-            @click="useQueryPrev"
+            @click="useQueryPrev(params.$index + 1)"
           ></el-button>
         </el-tooltip>
         <el-tooltip effect="dark" content="删 除" placement="bottom-end">

+ 29 - 40
src/views/purchase/catalogue/column.js

@@ -1,61 +1,50 @@
 export const FormColumns = [
   {
-    key: "status",
-    title: "有效状态",
-    inputType: "Select",
-    referName: "is_effective",
-    width: 100,
-  },
-  {
-    key: "enableStatus",
-    title: "启用状态",
-    inputType: "Select",
-    referName: "is_effective",
-    width: 100,
-  },
-  {
     key: "puOrgName",
     title: "采购组织",
-    inputType: "PopoverSelect",
-    referName: "ORG_PARAM",
-    valueKey: "name",
-    dataMapping: {
-      puOrg: "code",
-      puOrgName: "name",
-    },
-    require: true,
   },
-  {
-    key: "puOrg",
-    title: "采购组织编码",
-    inputType: "Input",
-    disabled: true,
-    readonly: true,
-  },
-  { key: "materialName", title: "物料名称" },
-  { key: "material", title: "物料编码" },
+  // {
+  //   key: "puOrg",
+  //   title: "采购组织编码",
+  // },
+  { key: "materialName", title: "物料" },
+  { key: "materialCode", title: "物料编码" },
   { key: "materialClassify", title: "物料一级分类" },
   { key: "manufacturerName", title: "生产厂家名称" },
-  { key: "manufacturer", title: "生产厂家" },
+  // { key: "manufacturer", title: "生产厂家" },
   { key: "model", title: "物料型号" },
   { key: "specification", title: "物料规格" },
-  { key: "supplier", title: "供应商" },
+  // { key: "supplier", title: "供应商" },
   {
     key: "supplierName",
     title: "供应商名称",
   },
-  { key: "customer", title: "客户" },
-  { key: "customerName", title: "客户名称" },
+  // { key: "customer", title: "客户" },
+  { key: "customerName", title: "客户" },
   { key: "taxPrice", title: "主含税单价" },
-  { key: "unit", title: "主单位" },
-  { key: "unitName", title: "主单位名称" },
+  // { key: "unit", title: "主单位" },
+  { key: "unitName", title: "主单位" },
   { key: "effectiveDate", title: "价格生效日期" },
   { key: "endDate", title: "价格失效日期" },
-  { key: "buyer", title: "采购员" },
-  { key: "buyerName", title: "采购员名称" },
+  // { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员" },
   { key: "source", title: "来源单据编号" },
   { key: "convertRate", title: "换算率" },
   {
+    key: "status",
+    title: "有效状态",
+    inputType: "Select",
+    referName: "is_effective",
+    width: 100,
+  },
+  {
+    key: "enableStatus",
+    title: "启用状态",
+    inputType: "Select",
+    referName: "is_effective",
+    width: 100,
+  },
+  {
     key: "materialStatus",
     title: "物料启用状态",
     inputType: "Select",
@@ -113,7 +102,7 @@ export const SearchColumns = [
     inputType: "PopoverSelect",
     width: 200,
     referName: "MATERIAL_PARAM",
-    valueKey: "id",
+    valueKey: "code",
   },
   {
     key: "status",

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

@@ -47,8 +47,14 @@ export default {
           { pageNum, pageSize }
         );
         if (code === 200) {
-          this.tableData = rows;
+          this.tableData = rows.map((item, index) => ({
+            ...item,
+            $index: (pageNum - 1) * pageSize + index + 1,
+          }));
           this.page.total = total;
+          this.page.pageNum = pageNum;
+          this.page.pageSize = pageSize;
+          return this.tableData;
         }
       } catch (err) {
         // catch
@@ -74,9 +80,9 @@ export default {
     },
     // 明 细
     async useSee(prop) {
-      const { id } = prop;
+      const { id, $index } = prop;
       const { open } = this.$refs.SeeModel;
-      await open(id);
+      await open(id, $index, this.page);
     },
     // 失 效
     async useInvalid(prop) {
@@ -248,6 +254,11 @@ export default {
         :selectable="setSelectable"
       >
       </el-table-column>
+      <el-table-column fixed width="55" align="center" type="index">
+        <template slot-scope="scope">
+          {{ scope.row.$index }}
+        </template>
+      </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"
         :key="index"

+ 132 - 0
src/views/purchase/catalogue/see/column.js

@@ -0,0 +1,132 @@
+export const FormColumns = [
+  {
+    key: "status",
+    title: "有效状态",
+    inputType: "Select",
+    referName: "is_effective",
+    width: 100,
+  },
+  {
+    key: "enableStatus",
+    title: "启用状态",
+    inputType: "Select",
+    referName: "is_effective",
+    width: 100,
+  },
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    valueKey: "name",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+    require: true,
+  },
+  {
+    key: "puOrg",
+    title: "采购组织编码",
+    inputType: "Input",
+    disabled: true,
+    readonly: true,
+  },
+  { key: "materialName", title: "物料名称" },
+  { key: "material", title: "物料编码" },
+  { key: "materialClassify", title: "物料一级分类" },
+  { key: "manufacturerName", title: "生产厂家名称" },
+  { key: "manufacturer", title: "生产厂家" },
+  { key: "model", title: "物料型号" },
+  { key: "specification", title: "物料规格" },
+  { key: "supplier", title: "供应商" },
+  {
+    key: "supplierName",
+    title: "供应商名称",
+  },
+  { key: "customer", title: "客户" },
+  { key: "customerName", title: "客户名称" },
+  { key: "taxPrice", title: "主含税单价" },
+  { key: "unit", title: "主单位" },
+  { key: "unitName", title: "主单位名称" },
+  { key: "effectiveDate", title: "价格生效日期" },
+  { key: "endDate", title: "价格失效日期" },
+  { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员名称" },
+  { key: "source", title: "来源单据编号" },
+  { key: "convertRate", title: "换算率" },
+  {
+    key: "materialStatus",
+    title: "物料启用状态",
+    inputType: "Select",
+    referName: "is_effective",
+  },
+  {
+    key: "isDistribution",
+    title: "配送价",
+    inputType: "Select",
+    referName: "is_effective",
+  },
+  {
+    key: "priceType",
+    title: "价格类型",
+    inputType: "Select",
+    referName: "sys_price_type",
+  },
+  { key: "demandCode", title: "采购需求单号" },
+  { key: "expiryEarly", title: "效期预警" },
+  { key: "priority", title: "含税/无税优先" },
+  { key: "createByName", title: "创建人" },
+  { key: "updateByName", title: "更新人名称" },
+];
+
+export const SearchColumns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "id",
+      puOrgName: "name",
+    },
+  },
+  {
+    key: "manufacturer",
+    title: "生产厂家",
+    inputType: "Input",
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "id",
+      supplierName: "name",
+    },
+  },
+  { key: "source", title: "来源单据编号", inputType: "Input" },
+  {
+    key: "material",
+    title: "物料编码",
+    inputType: "PopoverSelect",
+    width: 200,
+    referName: "MATERIAL_PARAM",
+    valueKey: "id",
+  },
+  {
+    key: "status",
+    title: "有效状态",
+    inputType: "Select",
+    referName: "is_effective",
+  },
+  {
+    key: "enableStatus",
+    title: "启用状态",
+    inputType: "Select",
+    referName: "is_effective",
+  },
+];
+
+export default { FormColumns, SearchColumns };

+ 41 - 4
src/views/purchase/catalogue/see/index.vue

@@ -1,5 +1,5 @@
 <script>
-import Column from "../column";
+import Column from "./column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
 import { ITEM } from "@/api/business/purchase/catalogue";
@@ -11,6 +11,7 @@ export default {
     return {
       column: 3,
       title: "明 细",
+      lastPage: {},
       ...useData(Column),
     };
   },
@@ -22,13 +23,14 @@ export default {
   watch: {},
   methods: {
     //
-    async fetchItem(prop) {
+    async fetchItem(prop, index) {
       try {
         // try
         this.loading = true;
         const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
+          this.params.$index = index;
           return true;
         } else {
           return false;
@@ -42,12 +44,29 @@ export default {
       }
     },
     //
-    async open(prop) {
-      this.visible = await this.fetchItem(prop);
+    async open(prop, index, page) {
+      this.lastPage = { ...page };
+      this.visible = await this.fetchItem(prop, index);
     },
     //
     async hide() {
       this.visible = false;
+      const { params, fetchList } = this.root;
+      fetchList(params, this.lastPage);
+    },
+    //
+    async useQueryLast(prop) {
+      const { params, fetchList } = this.root;
+      if (prop >= 1) {
+        const [row] = await fetchList(params, { pageSize: 1, pageNum: prop });
+        this.params = row;
+      }
+    },
+    //
+    async useQueryPrev(prop) {
+      const { params, fetchList } = this.root;
+      const [row] = await fetchList(params, { pageSize: 1, pageNum: prop });
+      this.params = row;
     },
     //
     async useInvalid(prop) {
@@ -85,6 +104,24 @@ export default {
     <template slot="title">
       <span>{{ title }}</span>
       <span>
+        <el-tooltip effect="dark" content="上一页" placement="bottom-end">
+          <el-button
+            :size="size"
+            :disabled="params.$index === 1"
+            circle
+            icon="el-icon-top"
+            @click="useQueryLast(params.$index - 1)"
+          ></el-button>
+        </el-tooltip>
+        <el-tooltip effect="dark" content="下一页" placement="bottom-end">
+          <el-button
+            :size="size"
+            :disabled="params.$index === root.page.total"
+            circle
+            icon="el-icon-bottom"
+            @click="useQueryPrev(params.$index + 1)"
+          ></el-button>
+        </el-tooltip>
         <el-tooltip
           v-if="root.hasPowerInvalid([params])"
           effect="dark"

+ 4 - 7
src/views/purchase/contract/edit/index.vue

@@ -7,7 +7,6 @@ import { initParams } from "@/utils/init";
 import { REFER } from "@/components/popover-select/api";
 import { EDIT, ITEM, TABLE } from "@/api/business/purchase/contract";
 
-
 export default {
   name: "EditDrawer",
   dicts: useDicts(Column),
@@ -21,13 +20,8 @@ export default {
     root: function () {
       return this.$parent.$parent;
     },
-    hasPowerAlteration: function () {
-      return this.$parent.$parent.hasPowerAlteration;
-    },
-  },
-  watch: {
-    
   },
+  watch: {},
   methods: {
     async fetchRefer(prop, type, source) {
       const { rateCode } = prop;
@@ -142,6 +136,9 @@ export default {
             const params = { ...this.params };
             const { msg, code } = await EDIT(params);
             if (code === 200) {
+              const { id } = this.params;
+              const { fetchItem } = this.root.$refs.SeeModel;
+              await fetchItem(id);
               this.hide();
               this.$emit("success");
               this.$notify.success(msg);

+ 6 - 6
src/views/purchase/task/first-direct/column.js

@@ -1,10 +1,10 @@
 export const TableColumns = [
-  { key: "supplier", title: "供应商" },
-  { key: "supplierName", title: "供应商名称" },
-  { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称" },
-  { key: "customer", title: "客户" },
-  { key: "customerName", title: "客户名称" },
+  // { key: "supplier", title: "供应商" },
+  { key: "supplierName", title: "供应商" },
+  // { key: "puOrg", title: "采购组织" },
+  { key: "puOrgName", title: "采购组织" },
+  // { key: "customer", title: "客户" },
+  { key: "customerName", title: "客户" },
   {
     key: "priceType",
     title: "价格类型",

+ 1 - 1
src/views/purchase/task/first-direct/index.vue

@@ -9,7 +9,7 @@ export default {
   data() {
     return {
       size: "mini",
-      title: "首次协议直采",
+      title: "协议直采",
       width: "100%",
       column: 3,
       visible: false,