Browse Source

待办明细审核页面及相关接口/订单管理打印数据接口调整

lph 1 year ago
parent
commit
6b41ff1266

+ 73 - 0
zkqy-ui/src/api/system/SaleAccountsReceivableDetail.js

@@ -0,0 +1,73 @@
+import request from '@/utils/request'
+
+// 查询应收帐明细列表
+export function listSaleAccountsReceivableDetail(query) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询应收帐明细详细
+export function getSaleAccountsReceivableDetail(id) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail/' + id,
+    method: 'get'
+  })
+}
+
+// 新增应收帐明细
+export function addSaleAccountsReceivableDetail(data) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改应收帐明细
+export function updateSaleAccountsReceivableDetail(data) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除应收帐明细
+export function delSaleAccountsReceivableDetail(id) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail/' + id,
+    method: 'delete'
+  })
+}
+
+/* 待办明细审核接口 */
+export function SaleAccountsReceivableDetailList(params) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail/list',
+    method: 'get',
+    params: params,
+  })
+}
+
+
+// 修改应收帐明细审核  单价和备注
+export function editAccountsReceivableDetail(data) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail/editAccountsReceivableDetail',
+    method: 'put',
+    data: data
+  })
+}
+
+// 应收账审核通过
+export function SaleAccountsPass(data) {
+  return request({
+    url: '/system/SaleAccountsReceivableDetail',
+    method: 'put',
+    data: data
+  })
+}
+

+ 20 - 3
zkqy-ui/src/views/orderMange/index.vue

@@ -1239,18 +1239,35 @@ export default {
           let payload = res.data.tableData.map((item) => {
             let { saleNo } = this.currentRow;
             return {
-              accountingType: 1,
+              accountingType: "1",
               accountsReceivableDate: new Date(),
               saleNo,
+              noticeNumber: item.noticeNumber,
               // saleProductNo: item.saleProductNo,
               productId: item.productId,
               productName: item.productName,
               productSpecifications: item.productSpecifications,
-              productcolour: item.productcolour,
+              productColour: item.productColour,
+              productId: item.productId,
               lotNumber: item.lotNumber,
+              weight: item.productNumber,
+              productPrice: item.productUnitPrice,
+              amountReceivable: Number(
+                (
+                  Number(item.productNumber) * Number(item.productUnitPrice)
+                ).toFixed(2)
+              ),
+              billingType: "1",
+              accountsReceivableRemark: res.data.form.remark,
+              receivedAmount: 0,
+              status: 1,
+              boxNum: item.boxNum,
+              productLevel: item.productLevel,
+              returnReceipt: "0",
             };
           });
           let result = await printOutsourceOrder(payload);
+          // return;
           if (result.code == 200) {
             res.data.form.printUser = this.nickName;
             outBoundPrint(res.data, "printDom", false);
@@ -1382,7 +1399,7 @@ export default {
               }
             }, 0)
             ?.toFixed(2);
-          if (index == 4) {
+          if (index == 6) {
             this.totalMoney = sums[index];
           }
         } else {

+ 570 - 0
zkqy-ui/src/views/system/financialManage/waitDetailsReview.vue

@@ -0,0 +1,570 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="客户" prop="customerId">
+        <el-select
+          v-model="queryParams.customerId"
+          placeholder="请选择客户"
+          clearable
+          filterable
+          @change="handleQuery"
+        >
+          <el-option
+            v-for="item in customSelectData"
+            :key="item.id"
+            :label="item.customName"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <!-- <el-form-item label="回单日期" prop="returnReceiptDate">
+        <el-date-picker
+          clearable
+          v-model="queryParams.returnReceiptDate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="请选择回单日期"
+        >
+        </el-date-picker>
+      </el-form-item> -->
+      <el-form-item label="日期范围" prop="startTime">
+        <el-date-picker
+          v-model="timeRange"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="timeRangeChange"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-loading="loading"
+      :data="SaleAccountsReceivableDetailList"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="账务类型" align="center" prop="accountingType">
+        <template slot-scope="scope">
+          {{ getDictLabel(scope.row.accountingType, "accounting_type") }}
+        </template>
+      </el-table-column>
+      <el-table-column label="客户" align="center" prop="customName" />
+      <el-table-column
+        label="应收账日期"
+        align="center"
+        prop="accountsReceivableDate"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{
+            parseTime(scope.row.accountsReceivableDate, "{y}-{m}-{d}")
+          }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="销售单号" align="center" prop="saleNo" />
+      <el-table-column label="产品编号" align="center" prop="productId" />
+      <el-table-column label="产品名称" align="center" prop="productName" />
+      <el-table-column
+        label="产品规格"
+        align="center"
+        prop="productSpecifications"
+      />
+      <el-table-column label="产品等级" align="center" prop="productLevel" />
+      <el-table-column label="产品颜色" align="center" prop="productColour" />
+      <el-table-column label="批号" align="center" prop="lotNumber" />
+      <el-table-column label="箱数" align="center" prop="boxNum" />
+      <el-table-column label="重量" align="center" prop="weight" />
+      <el-table-column label="产品单价" align="center" prop="productPrice" />
+      <el-table-column
+        label="应收金额"
+        align="center"
+        prop="amountReceivable"
+      />
+      <el-table-column label="已收金额" align="center" prop="receivedAmount" />
+      <el-table-column label="金额" align="center" prop="amounts" />
+      <el-table-column label="开票类型" align="center" prop="billingType">
+        <template slot-scope="scope">
+          {{
+            getDictLabel(
+              scope.row.billingType,
+              "accounts_receivable_billing_type"
+            )
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="应收账备注"
+        align="center"
+        prop="accountsReceivableRemark"
+      />
+      <!-- <el-table-column label="状态" align="center" prop="status" /> -->
+      <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-dropdown>
+            <el-button type="warning" plain size="small">
+              操作<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                ><el-button
+                  size="mini"
+                  type="text"
+                  @click="handleUpdate(scope.row)"
+                  >修改</el-button
+                ></el-dropdown-item
+              >
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="text"
+                  @click="passHandler(scope.row)"
+                  >通过</el-button
+                >
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改应收账明细对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="产品单价" prop="productPrice">
+          <el-input v-model="form.productPrice" placeholder="请输入产品单价" />
+        </el-form-item>
+        <el-form-item label="备注" prop="accountsReceivableRemark">
+          <el-input
+            v-model="form.accountsReceivableRemark"
+            placeholder="应收账备注"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 回单弹窗 -->
+    <el-dialog title="回单登记" :visible.sync="receiptShow" width="500px">
+      <el-form
+        ref="returnReceiptForm"
+        :model="returnReceiptForm"
+        :rules="receiptFormrules"
+        label-width="80px"
+      >
+        <el-form-item label="回单号" prop="receiptNo">
+          <el-input
+            v-model="returnReceiptForm.receiptNo"
+            placeholder="请输入回单号"
+          />
+        </el-form-item>
+        <el-form-item label="客户" prop="customId">
+          <el-select
+            v-model="returnReceiptForm.customId"
+            placeholder="请选择回单客户"
+            clearable
+            filterable
+          >
+            <el-option
+              v-for="item in customSelectData"
+              :key="item.id"
+              :label="item.customName"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="收到回单" prop="isReceive">
+          <el-radio-group v-model="returnReceiptForm.isReceive">
+            <el-radio :label="true">是</el-radio>
+            <el-radio :label="false">否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="回单日期" prop="receiveDate">
+          <el-date-picker
+            v-model="returnReceiptForm.receiveDate"
+            type="date"
+            size="normal"
+            placeholder="选择回单日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="备注" prop="receiveRemark">
+          <el-input
+            v-model="returnReceiptForm.receiveRemark"
+            size="normal"
+            clearable
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="receiptShow = false">取 消</el-button>
+        <el-button type="primary" @click="submitReceiptForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listSaleAccountsReceivableDetail,
+  getSaleAccountsReceivableDetail,
+  delSaleAccountsReceivableDetail,
+  addSaleAccountsReceivableDetail,
+  updateSaleAccountsReceivableDetail,
+  SaleAccountsReceivableDetailList,
+  editAccountsReceivableDetail,
+  SaleAccountsPass,
+} from "@/api/system/SaleAccountsReceivableDetail";
+import { getCustomList } from "@/api/system/SaleRegistrationCollection";
+import moment from "moment";
+
+export default {
+  name: "saleAccountsReceivableDetail",
+  dicts: ["accounting_type", "accounts_receivable_billing_type"],
+  data() {
+    return {
+      receiptShow: false, //回单弹窗
+      timeRange: [], //日期范围
+      customSelectData: [], //客户list
+      returnReceiptForm: {
+        receiptNo: "", //回单号
+        customId: "", //客户id
+        isReceive: true, //收到回单
+        receiveDate: "", //回单日期
+        receiveRemark: "", //回单备注
+      }, //回单
+      receiptFormrules: {},
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 应收账明细表格数据
+      SaleAccountsReceivableDetailList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        accountingType: null,
+        customerId: null,
+        accountsReceivableDate: null,
+        saleNo: null,
+        saleProductNo: null,
+        productId: null,
+        productName: null,
+        productSpecifications: null,
+        productLevel: null,
+        productColour: null,
+        lotNumber: null,
+        boxNum: null,
+        weight: null,
+        productPrice: null,
+        amountReceivable: null,
+        receivedAmount: null,
+        amounts: null,
+        paymentMethod: null,
+        billingType: null,
+        accountsReceivableRemark: null,
+        settlementUnit: null,
+        returnReceipt: null,
+        returnReceiptDate: null,
+        returnReceiptRemark: null,
+        noticeNumber: null,
+        status: 1,
+        spare1: null,
+        spare2: null,
+        spare3: null,
+        startTime: null,
+        endTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  mounted() {
+    this.initSelectData();
+  },
+  methods: {
+    // 审核通过回调
+    passHandler(row) {
+      console.log(row);
+      this.$confirm("是否通过该条数据的审批", "提示", {
+        confirmButtonText: "通过",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          let payload = {
+            id: row.id,
+            status: 2,
+          };
+          let res = await SaleAccountsPass(payload);
+          if (res.code == 200) {
+            this.$message.success("已通过");
+            this.getList();
+          } else {
+            this.$message.error("网络异常,请稍后再试");
+          }
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消通过",
+          });
+        });
+    },
+    // 根据字典value获取字典label
+    getDictLabel(value, dict) {
+      return (
+        this.dict.type[dict].find((item) => {
+          return item.value === value;
+        })?.label || ""
+      );
+    },
+    // 提交回单回调
+    submitReceiptForm() {},
+    // 回单回调
+    handlerReceipt(id) {
+      // let ids=[id]||this.ids;
+      this.receiptShow = true;
+    },
+    // 日期范围改变回调
+    timeRangeChange(val) {
+      this.queryParams.startTime = moment(val[0]).format("YYYY-MM-DD");
+      this.queryParams.endTime = moment(val[1]).format("YYYY-MM-DD");
+      this.handleQuery();
+    },
+    // 初始化下拉框选择数据
+    async initSelectData() {
+      // 客户数据
+      try {
+        let res1 = await getCustomList({ isEnablePaging: false });
+        if (res1.code == 200) {
+          this.customSelectData = res1.rows;
+        } else {
+          throw new Error(res1.msg);
+        }
+      } catch (error) {
+        this.$message.error(error);
+      }
+    },
+    /** 查询应收账明细列表 */
+    getList() {
+      this.loading = true;
+      console.log("getList", this.queryParams);
+      SaleAccountsReceivableDetailList(this.queryParams).then((response) => {
+        this.SaleAccountsReceivableDetailList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        accountingType: null,
+        customerId: null,
+        accountsReceivableDate: null,
+        saleNo: null,
+        saleProductNo: null,
+        productId: null,
+        productName: null,
+        productSpecifications: null,
+        productLevel: null,
+        productColour: null,
+        lotNumber: null,
+        boxNum: null,
+        weight: null,
+        productPrice: null,
+        amountReceivable: null,
+        receivedAmount: null,
+        amounts: null,
+        paymentMethod: null,
+        billingType: null,
+        accountsReceivableRemark: null,
+        settlementUnit: null,
+        returnReceipt: null,
+        returnReceiptDate: null,
+        returnReceiptRemark: null,
+        noticeNumber: null,
+        status: null,
+        spare1: null,
+        spare2: null,
+        spare3: null,
+        remark: null,
+        createBy: null,
+        createById: null,
+        createTime: null,
+        updateBy: null,
+        updateById: null,
+        updateTime: null,
+        delFlag: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加应收账明细";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getSaleAccountsReceivableDetail(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改单价";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.id != null) {
+            let {
+              id,
+              productPrice,
+              weight,
+              saleNo,
+              productId,
+              productColour,
+              accountsReceivableRemark,
+            } = this.form;
+            let payload = {
+              id,
+              weight,
+              accountsReceivableRemark,
+              productPrice,
+              amountReceivable: (Number(productPrice) * Number(weight)).toFixed(
+                2
+              ),
+              saleNo,
+              productId,
+              productColour,
+            };
+            editAccountsReceivableDetail(payload).then((response) => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addSaleAccountsReceivableDetail(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm('是否确认删除应收账明细编号为"' + ids + '"的数据项?')
+        .then(function () {
+          return delSaleAccountsReceivableDetail(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download(
+        "system/SaleAccountsReceivableDetail/export",
+        {
+          ...this.queryParams,
+        },
+        `SaleAccountsReceivableDetail_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
+};
+</script>