Переглянути джерело

客户消耗单:
1、增加SPD项目、销售供应商、供应商、利润中心、销售组织参照
2、各功能操作成功之后刷新列表
3、解决查询列表未能传递分页问题

002390 1 рік тому
батько
коміт
950c12762f

+ 2 - 2
src/api/expend/customerExpend.js

@@ -1,11 +1,11 @@
 import request from '@/utils/request'
 
 // 列表
-export function queryList(data) {
+export function queryList(params) {
   return request({
     url: `/pu/ccd/list`,
     method: 'get',
-    data: data
+    params: params,
   })
 }
 // 详情

+ 11 - 0
src/components/popover-select/components/LIACENTER_PARAM.js

@@ -0,0 +1,11 @@
+// 利润中心
+export default [
+  {
+    item: { key: "code", title: "编码", width: "auto" },
+    attr: {},
+  },
+  {
+    item: { key: "name", title: "名称", width: "auto" },
+    attr: {},
+  },
+];

+ 28 - 29
src/views/expend/customerExpend/che-hui/index.vue

@@ -2,9 +2,7 @@
 import { rebacktWork } from "@/api/purchase/workSpace.js";
 export default {
   name: "OpenOrClose",
-  dicts: [
-    "oa_templete_id",
-  ],
+  dicts: ["oa_templete_id"],
   props: {
     selectData: {
       type: Array,
@@ -31,31 +29,28 @@ export default {
   },
   methods: {
     //收回
-    useClick() {
-      if(this.selectData.length != 1){
-        this.$modal.msgWarning("请选择一条数据进行撤回!");
-        return;
-      }
-      this.$modal.loading("收回中...");
-      let row = this.selectData[0];
-      let params = {
-        billCode: row.code,
-        fdId: row.flowId,
-        fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
-          return item.label == "采购需求单";
-        }).value,
-        billMaker: row.createBy,
-      };
-      rebacktWork(params).then((res) => {
-        if (res.code === 200) {
-          this.$modal.notifySuccess("收回成功");
-          this.$modal.closeLoading();
-          // this.getList(this.params, this.Pages);
+    async useClick() {
+      try {
+        this.$modal.loading("收回中...");
+        let row = this.selectData[0];
+        let params = {
+          billCode: row.code,
+          fdId: row.flowId,
+          fdTemplateId: this.dict.type.oa_templete_id.find((item) => {
+            return item.label == "采购需求单";
+          }).value,
+          billMaker: row.createBy,
+        };
+
+        let { code, msg } = await rebacktWork(params);
+        if (code === 200) {
+          this.$notify.success(msg);
+          this.$emit("success");
         }
-      })
-      .catch((err) => {
+      } catch (error) {
+      } finally {
         this.$modal.closeLoading();
-      });
+      }
     },
   },
   created() {},
@@ -63,7 +58,11 @@ export default {
 </script>
 
 <template>
-  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
-    title
-  }}</el-button>
+  <el-button
+    v-loading="loading"
+    @click="useClick"
+    :disabled="disabled"
+    v-bind="$attrs"
+    >{{ title }}</el-button
+  >
 </template>

+ 46 - 33
src/views/expend/customerExpend/columns.js

@@ -8,28 +8,40 @@ export default function useColumns() {
       }
     },
     {
-      item: { key: "supplier", title: "供应商" },
+      item: { key: "supplierName", title: "供应商" },
       attr: {
-        is: "el-input",
+        is: "el-popover-select-v2",
+        referName: "SUPPLIER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          supplier: "code",
+          supplierName: "name",
+        },
         clearable: true,
       }
     },
     {
-      item: { key: "spdProject", title: "SPD项目" },
+      item: { key: "spdProjectName", title: "SPD项目" },
       attr: {
-        is: "el-input",
+        is: "el-popover-select-v2",
+        referName: "CUSTOMER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          spdProject: "code",
+          spdProjectName: "name",
+        },
         clearable: true,
       }
     },
     {
-      item: { key: "saleOrg_name", title: "销售组织" },
+      item: { key: "saleOrgName", title: "销售组织" },
       attr: {
         is: "el-popover-select-v2",
         referName: "ORG_PARAM",
         valueKey: "name",
         dataMapping: {
-          saleOrg: "code",
-          saleOrg_name: "name",
+          saleOrg: "id",
+          saleOrgName: "name",
         },
         clearable: true,
       }
@@ -59,7 +71,7 @@ export default function useColumns() {
       }
     },
     {
-      item: { key: "verifyState", title: "单据状态" },
+      item: { key: "status", title: "单据状态" },
       attr: {
         is: "el-select",
         dictName: "sys_status",
@@ -67,7 +79,7 @@ export default function useColumns() {
       }
     },
     {
-      item: { key: "code", title: "编码" },
+      item: { key: "code", title: "单据号" },
       attr: {
         is: "el-input",
         clearable: true,
@@ -76,7 +88,15 @@ export default function useColumns() {
   ];
   const TableColumns = [
     {
-      item: { key: "code", title: "单据号" },
+      item: { key: "status", title: "单据状态", width: 100, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "sys_status",
+        clearable: true,
+      }
+    },
+    {
+      item: { key: "code", title: "单据号", width: 150, },
       attr: {}
     },
     {
@@ -84,43 +104,43 @@ export default function useColumns() {
       attr: {}
     },
     {
-      item: { key: "supplier", title: "供应商" },
+      item: { key: "supplierName", title: "供应商" },
       attr: {}
     },
     {
-      item: { key: "calculateSupplier", title: "结算供应商" },
+      item: { key: "calculateSupplierName", title: "结算供应商" },
       attr: {}
     },
     {
-      item: { key: "startDate", title: "结算开始日期" },
+      item: { key: "startDate", title: "结算开始日期", width: 120, },
       attr: {}
     },
     {
-      item: { key: "endDate", title: "结算截止日期" },
+      item: { key: "endDate", title: "结算截止日期", width: 120, },
       attr: {}
     },
     {
-      item: { key: "spdProject", title: "SPD项目" },
+      item: { key: "spdProjectName", title: "SPD项目" },
       attr: {}
     },
     {
-      item: { key: "profileCenter", title: "利润中心" },
+      item: { key: "profileCenterName", title: "利润中心" },
       attr: {}
     },
     {
-      item: { key: "saleOrg_name", title: "销售组织" },
+      item: { key: "saleOrgName", title: "销售组织" },
       attr: {}
     },
     {
-      item: { key: "saleMonth", title: "销售月份" },
+      item: { key: "saleMonth", title: "销售月份", width: 100, },
       attr: {}
     },
     {
-      item: { key: "priceSum", title: "价税合计" },
+      item: { key: "priceSum", title: "价税合计", width: 120, },
       attr: {}
     },
     {
-      item: { key: "serviceFee", title: "服务费" },
+      item: { key: "serviceFee", title: "服务费", width: 120, },
       attr: {}
     },
     {
@@ -128,11 +148,11 @@ export default function useColumns() {
       attr: {}
     },
     {
-      item: { key: "num", title: "数量" },
+      item: { key: "num", title: "数量", width: 100, },
       attr: {}
     },
     {
-      item: { key: "isSaleOrder", title: "是否转销售订单" },
+      item: { key: "isSaleOrder", title: "是否转销售订单", width: 100, },
       attr: {
         is: "el-dict-tag",
         dictName: "sys_yes_no",
@@ -143,29 +163,22 @@ export default function useColumns() {
       attr: {}
     },
     {
-      item: { key: "isReturnMoney", title: "是否回款" },
+      item: { key: "isReturnMoney", title: "是否回款", width: 80, },
       attr: {
         is: "el-dict-tag",
         dictName: "sys_return_money",
       }
     },
     {
-      item: { key: "isTicket", title: "是否开票" },
+      item: { key: "isTicket", title: "是否开票", width: 80, },
       attr: {
         is: "el-dict-tag",
         dictName: "sys_yes_no",
       }
     },
+
     {
-      item: { key: "status", title: "单据状态" },
-      attr: {
-        is: "el-dict-tag",
-        dictName: "sys_status",
-        clearable: true,
-      }
-    },
-    {
-      item: { key: "isOpen", title: "单据打开状态" },
+      item: { key: "isOpen", title: "单据打开状态", width: 100, },
       attr: {
         is: "el-dict-tag",
         dictName: "sys_open_status",

+ 36 - 12
src/views/expend/customerExpend/edit/columns.js

@@ -33,42 +33,66 @@ export default function useColumns() {
       }
     },
     {
-      item: { key: "spdProject", title: "SPD项目" },
+      item: { key: "spdProjectName", title: "SPD项目" },
       attr: {
-        is: "el-input",
+        is: "el-popover-select-v2",
+        referName: "CUSTOMER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          spdProject: "code",
+          spdProjectName: "name",
+        },
         disabled: true,
       }
     },
     {
-      item: { key: "profileCenter", title: "利润中心" },
+      item: { key: "profileCenterName", title: "利润中心" },
       attr: {
-        is: "el-input",
+        is: "el-popover-select-v2",
+        referName: "LIACENTER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          profileCenter: "id",
+          profileCenterName: "name",
+        },
         disabled: true,
       }
     },
     {
-      item: { key: "calculateSupplier", title: "结算供应商" },
+      item: { key: "calculateSupplierName", title: "结算供应商" },
       attr: {
-        is: "el-input",
+        is: "el-popover-select-v2",
+        referName: "SUPPLIER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          calculateSupplier: "code",
+          calculateSupplierName: "name",
+        },
         disabled: true,
       }
     },
     {
-      item: { key: "supplier", title: "供应商" },
+      item: { key: "supplierName", title: "供应商" },
       attr: {
-        is: "el-input",
+        is: "el-popover-select-v2",
+        referName: "SUPPLIER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          supplier: "code",
+          supplierName: "name",
+        },
         disabled: true,
       }
     },
     {
-      item: { key: "saleOrg", title: "销售组织" },
+      item: { key: "saleOrgName", title: "销售组织" },
       attr: {
         is: "el-popover-select-v2",
         referName: "ORG_PARAM",
-        valueKey: "code",
+        valueKey: "name",
         dataMapping: {
-          saleOrg: "code",
-          saleOrg_name: "name",
+          saleOrg: "id",
+          saleOrgName: "name",
         },
         clearable: true,
       }

+ 20 - 12
src/views/expend/customerExpend/hdk-hgb/index.vue

@@ -29,15 +29,19 @@ export default {
   methods: {
     //操作状态
     useClick() {
-      let that = this;
-      this.$modal.confirm('确认操作行状态吗?').then(async function() {
-        that.loading = true;
-        return await operationStatus(that.selectData);
-      }).then(() => {
-        that.$modal.msgSuccess("操作成功");
-        that.loading = false;
-      }).catch(() => {
-        that.loading = false;
+      const { selectData } = this;
+      this.$modal.confirm("确认操作行状态吗?").then(async () => {
+        try {
+          this.$modal.loading("处理中,请稍后...");
+          let { code, msg } = await operationStatus(selectData);
+          if (code == 200) {
+            this.$notify.success(msg);
+            this.$emit("success");
+          }
+        } catch (error) {
+        } finally {
+          this.$modal.closeLoading();
+        }
       });
     },
   },
@@ -46,7 +50,11 @@ export default {
 </script>
 
 <template>
-  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
-    title
-  }}</el-button>
+  <el-button
+    v-loading="loading"
+    @click="useClick"
+    :disabled="disabled"
+    v-bind="$attrs"
+    >{{ title }}</el-button
+  >
 </template>

+ 5 - 1
src/views/expend/customerExpend/index.vue

@@ -144,7 +144,11 @@ export default {
     >
       <ux-table-column fixed="right" title="操作" align="center" width="100">
         <template slot-scope="scope">
-          <el-button type="text" :size="size" @click="useEdit(scope.row)"
+          <el-button
+            v-if="scope.row.status == 0"
+            type="text"
+            :size="size"
+            @click="useEdit(scope.row)"
             >编辑</el-button
           >
         </template>

+ 19 - 16
src/views/expend/customerExpend/ti-jiao/index.vue

@@ -29,19 +29,18 @@ export default {
   methods: {
     //提交
     useClick() {
-      if(this.selectData.length != 1){
-        this.$modal.msgWarning("请选择一条数据进行提交!");
-        return;
-      }
-      let that = this;
-      this.$modal.confirm('确认提交吗?').then(async function() {
-        that.loading = true;
-        return await submit(that.selectData[0]);
-      }).then(() => {
-        that.$modal.msgSuccess("提交成功");
-        that.loading = false;
-      }).catch(() => {
-        that.loading = false;
+      this.$modal.confirm("确认提交吗?").then(async () => {
+        try {
+          this.$modal.loading("处理中,请稍后...");
+          let { code, msg } = await submit(this.selectData[0]);
+          if (code == 200) {
+            this.$notify.success(msg);
+            this.$emit("success");
+          }
+        } catch (error) {
+        } finally {
+          this.$modal.closeLoading();
+        }
       });
     },
   },
@@ -50,7 +49,11 @@ export default {
 </script>
 
 <template>
-  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
-    title
-  }}</el-button>
+  <el-button
+    v-loading="loading"
+    @click="useClick"
+    :disabled="disabled"
+    v-bind="$attrs"
+    >{{ title }}</el-button
+  >
 </template>

+ 20 - 12
src/views/expend/customerExpend/zxsdd/index.vue

@@ -29,15 +29,19 @@ export default {
   methods: {
     //转销售订单
     useClick() {
-      let that = this;
-      this.$modal.confirm('确认转销售订单吗?').then(async function() {
-        that.loading = true;
-        return await toSaleOrder(that.selectData);
-      }).then(() => {
-        that.$modal.msgSuccess("成功");
-        that.loading = false;
-      }).catch(() => {
-        that.loading = false;
+      const { selectData } = this;
+      this.$modal.confirm("确认转销售订单吗?").then(async () => {
+        try {
+          this.$modal.loading("处理中,请稍后...");
+          let { code, msg } = await toSaleOrder(selectData);
+          if (code == 200) {
+            this.$notify.success(msg);
+            this.$emit("success");
+          }
+        } catch (error) {
+        } finally {
+          this.$modal.closeLoading();
+        }
       });
     },
   },
@@ -46,7 +50,11 @@ export default {
 </script>
 
 <template>
-  <el-button v-loading="loading" @click="useClick" :disabled="disabled" v-bind="$attrs">{{
-    title
-  }}</el-button>
+  <el-button
+    v-loading="loading"
+    @click="useClick"
+    :disabled="disabled"
+    v-bind="$attrs"
+    >{{ title }}</el-button
+  >
 </template>