浏览代码

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!173
黄梓星 2 年之前
父节点
当前提交
8b7622eb16

+ 1 - 1
src/components/PopDialog/index.vue

@@ -8,7 +8,7 @@
             <el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()"
               @submit.native.prevent>
               <el-form-item prop="code">
-                <el-input size="small" v-model="searchForm.code" placeholder="请输入物料编号查询" clearable></el-input>
+                <el-input size="small" v-model.trim="searchForm.code" placeholder="请输入物料编号查询" clearable></el-input>
               </el-form-item>
               <el-form-item prop="name">
                 <el-input size="small" v-model="searchForm.name" placeholder="请输入物料名称查询" clearable></el-input>

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

@@ -188,7 +188,7 @@ export default {
   created() {
     if(this.pageStu == 'check') {
       console.log('数据', this.row)
-      let param = this.query
+      let param = JSON.parse(JSON.stringify(this.query))
       param.sumFlag = this.row.sumFlag
       this.getDetails(param)
     }
@@ -205,7 +205,7 @@ export default {
       //   pageNum: 1,
       //   pageSize: 10
       // }
-      // this.$emit('refresh', queryParams)
+      this.$emit('refresh')
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {
@@ -221,7 +221,7 @@ export default {
     },
     cancelEdit() {
       this.lineDisable = true
-      let param = this.query
+      let param = JSON.parse(JSON.stringify(this.query))
       param.sumFlag = this.row.sumFlag
       this.getDetails(param)
     },
@@ -230,7 +230,7 @@ export default {
         if (res.code === 200) {
           this.$modal.msgSuccess("保存成功");
           this.lineDisable = true
-          let param = this.query
+          let param = JSON.parse(JSON.stringify(this.query))
           param.sumFlag = this.row.sumFlag
           this.getDetails(param)
         }
@@ -245,7 +245,7 @@ export default {
         shutDownSummary(param).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("操作成功");
-            let param = this.query
+            let param = JSON.parse(JSON.stringify(this.query))
             param.sumFlag = this.row.sumFlag
             this.getDetails(param)
           }
@@ -258,7 +258,7 @@ export default {
       reloadBatch(param).then(res => {
         if (res.code === 200) {
           this.$modal.msgSuccess("操作成功");
-          let param = this.query
+          let param = JSON.parse(JSON.stringify(this.query))
           param.sumFlag = this.row.sumFlag
           this.getDetails(param)
         }

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

@@ -359,7 +359,7 @@
       </el-card>
     </div>
 
-    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" :query="queryParams" @refresh="reset"/>
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" :query="queryParams" @refresh="search"/>
   
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 

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

@@ -780,12 +780,7 @@ export default {
                 console.log(333)
                 if (res.code === 200) {
                   this.$modal.msgSuccess("保存成功");
-                  this.$emit('jugislist', true)
-                  let queryParams = {
-                    pageNum: 1,
-                    pageSize: 10
-                  }
-                  this.$emit('refresh', queryParams)
+                  this.back()
                 }
               })
             } else if (this.sonPageStu == 'edit') {
@@ -799,12 +794,7 @@ export default {
               editDemand(param).then(res => {
                 if (res.code === 200) {
                   this.$modal.msgSuccess("编辑成功");
-                  this.$emit('jugislist', true)
-                  let queryParams = {
-                    pageNum: 1,
-                    pageSize: 10
-                  }
-                  this.$emit('refresh', queryParams)
+                  this.back()
                 }
               })
             }
@@ -818,10 +808,11 @@ export default {
       this.$modal.loading("提交中...");
       submitDemand(this.basicForm).then(res => {
         if (res.code === 200) {
-          this.$modal.closeLoading();
           this.$modal.msgSuccess("提交成功");
           this.back()
         }
+      }).catch(err => {
+        this.$modal.closeLoading();
       })
     },
     // 增行
@@ -966,7 +957,7 @@ export default {
       //   pageNum: 1,
       //   pageSize: 10
       // }
-      // this.$emit('refresh', queryParams)
+      this.$emit('refresh')
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {

+ 1 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -277,7 +277,7 @@
       </div>
     </el-dialog>
 
-    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="resetList"/>
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
   
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 

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

+ 1 - 53
src/views/purchase/purchase-order/add/index.vue

@@ -1,7 +1,6 @@
 <script>
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-import { async } from "q";
 import { Columns, TabColumns } from "./column";
 
 const NewColumns = initColumns(Columns);
@@ -65,33 +64,6 @@ export default {
       },
       deep: true,
     },
-    // "params.puOrg": {
-    //   handler(nVal, oVal) {
-    //     console.log('nVal', nVal, 'oVal',oVal);
-    //     console.log(this.isCopy, 'this.isCopy');
-    //     // 组织变化
-    //     // if (this.visible && nVal.puOrg != oVal.puOrg) {
-    //     if (this.visible && oVal && nVal != oVal) {
-    //       for (const key in this.params) {
-    //         if (Array.isArray(this.params[key])) {
-    //           this.params[key] = [];
-    //         } else if (
-    //           key != "puOrg" &&
-    //           key != "puOrgName" &&
-    //           key != "buyer" &&
-    //           key != "buyerName" &&
-    //           key != "puDept" &&
-    //           key != "puDeptName" &&
-    //           key != "status"
-    //         ) {
-    //           this.params[key] = "";
-    //         } else {
-    //         }
-    //       }
-    //     }
-    //   },
-    //   deep: true,
-    // },
   },
   methods: {
     beforeOpen() {
@@ -307,31 +279,7 @@ export default {
           }
       })
     },
-    // 保存并新增
-    async handleSubmit() {
-      this.judgeSaveCondition(async()=>{
-        try {
-          const createById = this.params.buyer;
-          const createByName = this.params.buyerName;
-          const updateById = this.$store.state.user.id;
-          const updateByName = this.$store.state.user.name;
-          const { code, msg } = await orderApi.create({
-            createById,
-            createByName,
-            updateById,
-            updateByName,
-            ...this.params,
-          });
-          if (code === 200) {
-            this.setVisible(false);
-          }
-        } catch (err) {
-          this.$notify.error({ title: "error", message: err });
-        } finally {
-          // this.setVisible(false);
-        }
-      })
-    },
+   
     // 主表参照改变之后
    async handleReferChange(val, type, source){
       // 供应商选择  

+ 51 - 67
src/views/purchase/purchase-order/column.js

@@ -1,12 +1,9 @@
 import {
-  initPage,
-  initParams,
   initColumns,
   initDicts,
 } from "@/utils/init";
 
 export const TableColumns = [
-  // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
   { key: "puOrgName", title: "采购组织", inputType: "Input" },
   {
@@ -24,7 +21,6 @@ export const TableColumns = [
     referName: "documents_status", // 字典名
   },
   { key: "billDate", title: "订单日期",width:100,},
-  // { key: "supplier", title: "供应商" },
   { key: "supplierName", title: "供应商", inputType: "Input" },
   { key: "paymentAgreementName", title: "付款协议" },
   {
@@ -36,11 +32,8 @@ export const TableColumns = [
   },
   // { key: "paymentAgreement", title: "付款协议" },
   
-  // { key: "buyer", title: "采购员" },ut
   { key: "buyerName", title: "采购员" ,width:100,},
-  // { key: "puDept", title: "采购部门" },
   { key: "puDeptName", title: "采购部门" },
-  // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户" },
   // { 
   //   key: "isDeliver", 
@@ -73,7 +66,6 @@ export const TableColumns = [
   //   title: "由销售订单协同生成",
   //   inputType: 'Checkbox',
   // },
-  // { key: "personal", title: "人员" },
   { key: "personalName", title: "人员" ,width:120,},
   // { key: "isSendSrm", title: "是否同步SRM" },
   {
@@ -86,11 +78,8 @@ export const TableColumns = [
   { key: "deductionMoney", title: "订单抵扣余款金额" ,},
   // { key: "warehouse", title: "WMS入库仓库" },
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
-  // { key: "goodsAllocation", title: "货位" },
   { key: "goodsAllocationName", title: "货位" },
-  // { key: "customerDept", title: "客户部门" },
   { key: "customerDeptName", title: "客户部门" },
-  // { key: "supplierContacts", title: "供应商业务联系人" },
   { key: "supplierContactsName", title: "供应商业务联系人" },
   {
     key: "isUrgency",
@@ -98,7 +87,6 @@ export const TableColumns = [
     inputType: 'Checkbox',
     width:80,
   },
-  // { key: "agent", title: "代理人" }, // 建议删除
   { key: "agentName", title: "代理人" },
   {
     key: "isClose",
@@ -148,37 +136,37 @@ export const TabColumns = [
       { key: "rowNo", title: "行号",width:80, },
       // { key: "orderId", title: "采购订单ID" },
       { key: "material", title: "物料ID" },
-      { key: "materialName", title: "物料名称", width: 180 },
-      { key: "materialCode", title: "物料编码", width: 180 },
-      // { key: "materialClassify", title: "物料分类", width: 180 },
-      { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
-      { key: "specification", title: "规格", width: 180 },
-      { key: "model", title: "型号", width: 180 },
+      { key: "materialName", title: "物料名称",  },
+      { key: "materialCode", title: "物料编码",  },
+      // { key: "materialClassify", title: "物料分类",  },
+      { key: "materialManufacturersCode", title: "厂家物料编码",  },
+      { key: "specification", title: "规格",  },
+      { key: "model", title: "型号",  },
       {
         key: "isMedcine",
         title: "医药物料",
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "manufacturerName", title: "生产厂家代理人", width: 180 },
+      { key: "manufacturerName", title: "生产厂家代理人",  },
       { 
         key: "isDrug", 
         title: "物料药品属性",
         inputType: 'Checkbox',
         width:80, 
       },
-      { key: "unitName", title: "单位", width: 180 },
-      { key: "qty", title: "数量" },
+      { key: "unitName", title: "单位", width: 120 },
+      { key: "qty", title: "数量",width:120, },
       // { key: "currency", title: "币种" },
       { key: "currencyName", title: "币种" },
-      { key: "taxPrice", title: "含税单价" },
-      { key: "money", title: "价税合计" },
-      { key: "tax", title: "税率" },
-      { key: "taxDeductMoneya", title: "折扣金额" },
-      { key: "arrivalQty", title: "已到货数量" },
-      { key: "unarrivedQty", title: "未到货数量" },
-      { key: "price", title: "无税单价" },
-      { key: "notaxMoney", title: "无税金额" },
+      { key: "taxPrice", title: "含税单价" ,width:120,},
+      { key: "money", title: "价税合计" ,width:120,},
+      { key: "tax", title: "税率" ,width:120,},
+      { key: "taxDeductMoneya", title: "折扣金额",width:120, },
+      { key: "arrivalQty", title: "已到货数量" ,width:120,},
+      { key: "unarrivedQty", title: "未到货数量" ,width:120,},
+      { key: "price", title: "无税单价" ,width:120,},
+      { key: "notaxMoney", title: "无税金额" ,width:120,},
       { key: "priceSource", title: "价格目录ID" },
       {
         key: "isStorage",
@@ -210,14 +198,14 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "warehouse", title: "收货仓库", width: 180 },
-      { key: "place", title: "收货地点", width: 180 },
-      { key: "address", title: "收货地址", width: 180 },
-      { key: "productBatch", title: "产品批号", width: 180 },
-      { key: "manufactureDate", title: "生产日期", width: 180 },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", width: 180 },
-      { key: "approvalNumber", title: "批准文号", width: 180 },
-      { key: "registration", title: "注册证号", width: 180 },
+      { key: "warehouse", title: "收货仓库",  },
+      { key: "place", title: "收货地点",  },
+      { key: "address", title: "收货地址",  },
+      { key: "productBatch", title: "产品批号",  },
+      { key: "manufactureDate", title: "生产日期",  },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期",  },
+      { key: "approvalNumber", title: "批准文号",  },
+      { key: "registration", title: "注册证号",  },
       {
         key: "storageCondition",
         title: "存储条件",
@@ -248,18 +236,18 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "originalQty", title: "原始数量" },
-      { key: "originalMoney", title: "原始金额" },
-      { key: "directProductBatch", title: "直运产品批号", width: 180 },
-      { key: "discountRule", title: "折扣规则编码", width: 180 },
-      { key: "reservedQty", title: "预留数量" },
-      { key: "reservedPeriod", title: "预留周期", width: 180 },
+      { key: "originalQty", title: "原始数量" ,width:120,},
+      { key: "originalMoney", title: "原始金额" ,width:120,},
+      { key: "reservedQty", title: "预留数量",width:120, },
+      { key: "reservedPeriod", title: "预留周期",  },
       { key: "taxDeductClassify", title: "扣税类别" },
-      { key: "exchangeRate", title: "折本汇率" },
-      { key: "source", title: "上游单据号", width: 180 },
-      { key: "sourceId", title: "上游单据ID", width: 180 },
-      { key: "demandCode", title: "采购需求单号", width: 180 },
-      { key: "arrivalDatePlan", title: "计划到货日期", width: 180 },
+      { key: "exchangeRate", title: "折本汇率" ,width:100,},
+      { key: "directProductBatch", title: "直运产品批号",  },
+      { key: "discountRule", title: "折扣规则编码",  },
+      { key: "source", title: "上游单据号",  },
+      { key: "sourceId", title: "上游单据ID",  },
+      { key: "demandCode", title: "采购需求单号",  },
+      { key: "arrivalDatePlan", title: "计划到货日期",  },
       {
         key: "priceType",
         title: "价格类型",
@@ -272,10 +260,10 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
        },
-      { key: "materialClassifyOneName", title: "物料一级分类", width: 180 },
-      { key: "materialClassifyTwoName", title: "物料二级分类", width: 180 },
-      { key: "materialClassifyThreeName", title: "物料三级分类", width: 180 },
-      { key: "materialClassifyFourName", title: "物料四级分类", width: 180 },
+      { key: "materialClassifyOneName", title: "物料一级分类",  },
+      { key: "materialClassifyTwoName", title: "物料二级分类",  },
+      { key: "materialClassifyThreeName", title: "物料三级分类",  },
+      { key: "materialClassifyFourName", title: "物料四级分类",  },
       { key: "createByName", title: "创建人",width:100, },
       { key: "updateByName", title: "更新人" ,width:100,},
       
@@ -285,24 +273,20 @@ export const TabColumns = [
     title: '执行结果',
     key: 'puOrderExecuteList',
     tableColumns: [
-      // { key: "id", title: "主键" },
-      // { key: "orderId", title: "采购订单ID", width: 180 },
+      // { key: "orderId", title: "采购订单ID",  },
       { key: "rowno", title: "行号",width:80, },
-      { key: "material", title: "物料ID", width: 180 },
-      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "material", title: "物料ID", },
+      { key: "materialName", title: "物料名称", },
       { key: "specification", title: "规格" },
-      { key: "qty", title: "数量" },
-      { key: "stroageQty", title: "累计到货主数量" },
-      { key: "stockQty", title: "累计入库主数量" },
-      { key: "invoiceQty", title: "累计开票主数量" },
-      { key: "rollbackQty", title: "累计退货主数量" },
-      { key: "backStockQty", title: "累计退库主数量" },
+      { key: "qty", title: "数量",width:120, },
+      { key: "stroageQty", title: "累计到货主数量",width:120,  },
+      { key: "stockQty", title: "累计入库主数量",width:120,  },
+      { key: "invoiceQty", title: "累计开票主数量",width:120,  },
+      { key: "rollbackQty", title: "累计退货主数量",width:120,  },
+      { key: "backStockQty", title: "累计退库主数量",width:120,  },
       { key: "floatQty", title: "未到货数量" },
-      // { key: "tenantId", title: "租户号" },
-      // { key: "revision", title: "乐观锁" },
-      { key: "createByName", title: "创建人名称", width: 180 },
-      { key: "updateByName", title: "更新人名称", width: 180 },
-      // { key: "delFlag", title: "删除标记" }
+      { key: "createByName", title: "创建人名称", },
+      { key: "updateByName", title: "更新人名称", },
     ]
   },
 ];

+ 1 - 2
src/views/purchase/purchase-order/edit/index.vue

@@ -1,8 +1,7 @@
 <script>
-// import { Columns, TabColumns } from "../add/column";
 import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+import {  initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
   name: "EditPurchaseOrderDrawer",

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

@@ -5,10 +5,8 @@ import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
   initParams,
-  initColumns,
   initDicts,
 } from "@/utils/init";
-import { clearTimeout } from "timers";
 
 
 export default {
@@ -23,6 +21,7 @@ export default {
     const initTabColumns = () => TabColumns;
     return {
       loading: false,
+      tabLoading:false,
       isSimpleSearch: true,
       pageSizes: [10, 20, 50, 100],
       page: initPage(),
@@ -154,6 +153,7 @@ export default {
       this.timeOut = setTimeout(async () =>{
 
         try {
+          this.tabLoading = true;
           this.primaryResource = row;
           this.checkedTabList = [];
           const { code, msg, data } = await orderApi.details(row.id);
@@ -164,6 +164,9 @@ export default {
             }
           }
         } catch (err) {}
+        finally{
+          this.tabLoading = false;
+        }
       },this.timer)
       
     },
@@ -599,7 +602,7 @@ export default {
       @pagination="fetchList(params, page)"
     />
    
-    <div style="position: relative; padding-top: 10px;">
+    <div style="position: relative; padding-top: 10px;" v-loading="tabLoading">
       <el-row style="position: absolute; top: 30px; right: 20px;z-index: 10;">
         <el-button 
           size="mini" 

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