浏览代码

【新增】销售出库单表

howie 3 年之前
父节点
当前提交
aec63dd214

+ 178 - 0
src/views/supply/implement/sales/components/sales_detail.vue

@@ -0,0 +1,178 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="详情"></el-page-header>
+
+    <div id="printMe">
+      <div class="main-title">
+        <div class="title">出库单信息</div>
+      </div>
+      <div class="diy-table-1">
+        <el-row :gutter="0">
+          <el-col :span="8" class="item">
+            <div class="label">出库单号</div>
+            <div class="value">{{detailData.id}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">单据日期</div>
+            <div class="value">{{detailData.orderTime}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">发货单号</div>
+            <div class="value">{{detailData.orderNo}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">经销商</div>
+            <div class="value">{{detailData.customerName}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">仓库</div>
+            <div class="value">{{detailData.correspondName}}</div>
+          </el-col>
+          <el-col :span="16" class="item">
+            <div class="label">备注</div>
+            <div class="value">{{detailData.remark}}</div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div class="main-title">
+        <div class="title">货品信息</div>
+      </div>
+      <div class="table">
+        <el-table
+          :data="detailData.saleOrderData"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+          max-height="400"
+          show-summary
+          :summary-method="$getSummaries">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ (scope.row.orderType == 'TRADE' || scope.row.orderType == 'HOME') ? scope.row.enginOrderNo : scope.row.mainOrderId }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.price | numToFixed }}
+            </template>
+          </el-table-column>
+          <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.payAmount | numToFixed }}
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
+      </div>
+
+      <div class="main-title">
+        <div class="title">审批记录</div>
+      </div>
+      <div class="diy-table-1">
+        <el-row :gutter="0">
+          <el-col :xs="12" :sm="8" :lg="8" class="item">
+            <div class="label">审批人</div>
+            <div class="value">{{detailData.approvalName}}</div>
+          </el-col>
+          <el-col :xs="12" :sm="8" :lg="8" class="item">
+            <div class="label">审批结果</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          </el-col>
+          <el-col :xs="12" :sm="8" :lg="8" class="item">
+            <div class="label">审批时间</div>
+            <div class="value">{{detailData.approvalTime}}</div>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="24" class="item">
+            <div class="label">审批说明</div>
+            <div class="value">{{detailData.approvalRemark}}</div>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+    
+
+
+  </div>
+</template>
+
+<script>
+import print from 'vue-print-nb'
+import { getDetail } from "@/api/supply/sales";
+
+export default {
+  name: 'SalesDetail',
+  componentName: 'SalesDetail',
+  props: ['listItem'],
+  directives: {
+    print
+  },
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
+  data() {
+    return {
+      printObj: {
+        id: 'printMe'
+      },
+      detailData: {},
+    }
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        if(res.data.saleOrderData) {
+          res.data.saleOrderData.forEach(item => {
+            item.sums1 = ['refundableQty'];
+            item.sums2 = ['payAmount', 'price'];
+          })
+        }
+        this.detailData = res.data;
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+</style>

+ 224 - 0
src/views/supply/implement/sales/components/sales_examine.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="审批"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">出库单信息</div>
+    </div>
+    <div class="diy-table-1">
+      <el-row :gutter="0">
+        <el-col :span="8" class="item">
+          <div class="label">出库单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据日期</div>
+          <div class="value">{{detailData.orderTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+        <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">发货单号</div>
+          <div class="value">{{detailData.orderNo}}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">经销商</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">仓库</div>
+          <div class="value">{{detailData.correspondName}}</div>
+        </el-col>
+        <el-col :span="16" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+    <div class="table">
+      <el-table
+        :data="detailData.saleOrderData"
+        element-loading-text="Loading"
+        border
+        fit
+        highlight-current-row
+        stripe
+        max-height="400"
+        show-summary
+        :summary-method="$getSummaries">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ scope.row.price | numToFixed }}
+          </template>
+        </el-table-column>
+        <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ scope.row.payAmount | numToFixed }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div class="main-title">
+      <div class="title">审批记录</div>
+    </div>
+    <div class="diy-table-1">
+      <el-row :gutter="0">
+        <el-col :span="12" class="item">
+          <div class="label">审批人</div>
+          <div class="value">{{userName}}</div>
+        </el-col>
+        <el-col :span="12" class="item">
+          <div class="label">审批日期</div>
+          <div class="value">{{getDate()}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value">
+            <el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer">
+        <el-button type="primary" @click="clickSubmitForm('OK')">审批通过</el-button>
+        <el-button type="warning" @click="clickSubmitForm('FAIL')">审批驳回</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getDetail, examineData } from "@/api/supply/sales";
+
+export default {
+  name: 'SalesDetail',
+  componentName: 'SalesDetail',
+  props: ['listItem'],
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
+  data() {
+    return {
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+      detailData: {},
+      formLoading: false,
+      examineForm: {
+        remark: '',
+      }
+    }
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    getDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormExamine');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        if(res.data.saleOrderData) {
+          res.data.saleOrderData.forEach(item => {
+            item.sums1 = ['refundableQty'];
+            item.sums2 = ['payAmount', 'price'];
+          })
+        }
+        this.detailData = res.data;
+      })
+    },
+
+    // 提交审批
+    clickSubmitForm(val) {
+      this.$confirm('此操作将审批订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let params = {
+          id: this.listItem.id,
+          approvalRemark: this.examineForm.remark,
+          examineStatus: val,
+        };
+        this.formLoading = true;
+        examineData(params).then(res => {
+          this.$successMsg();
+          this.goBack();
+          this.$parent.getList();
+        }).finally(res => {
+          this.formLoading = false;
+        })
+      }).catch(() => {});
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 30px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+</style>

+ 537 - 0
src/views/supply/implement/sales/components/sales_return_form.vue

@@ -0,0 +1,537 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" :content="listItem ? '编辑-退货申请':'新增-退货申请'"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">退货申请单信息</div>
+    </div>
+
+    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="90px" size="small" label-position="right">
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="订单号" prop="orderNum">
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
+          <el-form-item label="单据日期" prop="date">
+            <el-date-picker
+              v-model="mainForm.date"
+              disabled
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width: 100%;"
+              placeholder="系统自动生成">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="经销商编号" prop="jxsNum">
+            <el-input v-model="mainForm.jxsNum" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="16">
+          <el-form-item label="经销商名称" prop="jxsName">
+            <el-input v-model="mainForm.jxsName" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="24">
+          <el-form-item label="备注" prop="remark">
+            <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="8" :lg="8">
+          <el-form-item label="附件" prop="fileUrl">
+            <fileUpload :fileList="fileList" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+      <div>
+        <!-- <span style="font-size: 14px; margin-right: 10px">仓库</span>
+        <el-select v-model="screenForm.warehouse" placeholder="请选择发货仓库" size="small" filterable clearable :disabled="goodsList.length > 0">
+          <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+        </el-select>
+        <el-divider direction="vertical"></el-divider> -->
+        <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
+      </div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="left" label="销售出库单" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="可退数量" prop="refundableQty" min-width="80" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="申请数量" prop="invoiceNum" min-width="110" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.invoiceNum" size="mini" type="number"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="left" label="仓库" prop="correspondId" min-width="140" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.correspondId" placeholder="请选择仓库" size="mini" filterable clearable style="width: 100%">
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div class="page-footer">
+      <div class="footer">
+        <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+    <el-dialog title="添加产品" :visible.sync="isShowDialog" width="80%">
+      <el-form ref="screenForm" :model="screenForm" size="mini" label-position="left" label-width="100px">
+        <el-row :gutter="20">
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="warehouse" label="选择仓库">
+              <el-select v-model="screenForm.warehouse" placeholder="请选择仓库" filterable clearable style="width: 100%">
+                <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="type" label="存货类别">
+              <el-select v-model="screenForm.type" placeholder="选择存货类别" style="width: 100%" clearable>
+                <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="orderNum" label="销售出库单号">
+              <el-input v-model="screenForm.orderNum" placeholder="请输入销售出库单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="orderNo" label="发货申请单号">
+              <el-input v-model="screenForm.orderNo" placeholder="请输入发货申请单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="mainOrderId" label="订单号">
+              <el-input v-model="screenForm.mainOrderId" placeholder="请输入订单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="dealer" label="经销商名称">
+              <el-input v-model="screenForm.dealer" placeholder="请输入经销商名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="goodsName" label="产品名称">
+              <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="model" label="规格型号">
+              <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="24" :lg="24" class="tr">
+            <el-form-item label="">
+              <el-button @click="resetScreenForm">清空</el-button>
+              <el-button type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="table">
+        <el-table :data="tableGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="tableSelectionChange">
+          <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
+          <el-table-column align="left" label="销售出库单" prop="id" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="发货申请单号" prop="orderNo" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="120" show-overflow-tooltip>、
+            <template slot-scope="scope">
+              {{ (scope.row.orderType == 'TRADE' || scope.row.orderType == 'HOME') ? scope.row.enginOrderNo : scope.row.mainOrderId }}
+            </template>
+          </el-table-column>
+          <el-table-column align="left" label="经销商" prop="customerName" min-width="250" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
+        </el-table>
+        <div class="pagination clearfix" style="margin-top: 10px">
+          <div class="fr">
+            <el-pagination
+              @current-change="handleTableCurrentChange"
+              :current-page="currentPage"
+              :page-size="10"
+              background
+              layout="prev, pager, next"
+              :total="listTotal">
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDialog">取 消</el-button>
+        <el-button type="primary" @click="submitAddGoods">确 定</el-button>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { addReturn, getDealerList, getSalesGoodsList, getWarehouseList } from '@/api/supply/sales'
+import { getCategoryList, getDictList } from '@/api/common'
+import fileUpload from '@/components/Common/file-upload.vue'
+
+export default {
+  components: {
+    fileUpload
+  },
+  name: 'SalesReturnForm',
+  componentName: 'SalesReturnForm',
+  props: ['listItem'],
+  data() {
+    return {
+      mainForm: {
+        orderNum: '',
+        date: '',
+        jxsNum: '',
+        jxsName: '',
+        remark: '',
+        createMan: '',
+      },
+      mainFormRules: {
+        // date: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+      },
+      dealerList: [],
+      fileList: [],
+      goodsList: [],
+
+      warehouseList: [],
+      isShowDialog: false,
+      screenForm: {
+        warehouse: '',
+        type: '',
+        orderNum: '',
+        orderNo: '',
+        mainOrderId: '',
+        dealer: '',
+        goodsName: '',
+        model: '',
+      },
+      currentPage: 1,
+      listTotal: 0,
+      // typeList: [],
+      stockList: [],
+      categoryList: [],
+
+      tableGoodsList: [],
+      tableSelection: [],
+    }
+  },
+
+  created() {
+    this.getDictList();
+    this.getWarehouseList();
+    this.getDealerList();
+    this.getCategoryList();
+    if(this.listItem) {
+      this.getDetail();
+    }else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerNumber;
+      this.mainForm.jxsName = JSON.parse(localStorage.getItem("supply_user")).customerName;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+    }
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getApplyDetail({id: this.listItem.id}).then(res => {
+        let data = res.data;
+        this.mainForm.orderNum = data.id;
+        this.mainForm.date = data.orderTime;
+        this.mainForm.jxsNum = data.customerNumber;
+        this.mainForm.jxsName = data.customerName;
+        this.mainForm.createMan = data.createBy;
+        this.mainForm.remark = data.remark;
+        this.screenForm.warehouse = data.correspondId;
+        this.fileList = data.fileUrl ? [{
+          url: data.fileUrl,
+          name: data.fileName
+        }] : [];
+        // data.orders.forEach(item => {
+        //   item.orderId = item.id;
+        // })
+        this.goodsList = data.orders;
+        // this.screenForm.type = data.mainId;
+      })
+    },
+
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1
+      }).then((res) => {
+        this.warehouseList = res.data.records;
+      })
+    },
+
+    getDictList() {
+      // getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
+      //   this.typeList = res.data;
+      // })
+      getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
+        this.stockList = res.data;
+      })
+    },
+
+    // 获取经销商列表
+    getDealerList() {
+      getDealerList({
+        pageNum: 1,
+        pageSize: -1,
+        bindUser: false
+      }).then(res => {
+        this.dealerList = res.data.records;
+      })
+    },
+
+    // 获取存货类别列表
+    getCategoryList() {
+      getCategoryList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.categoryList = res.data.records;
+      })
+    },
+
+    // 库存字段
+    stockFilter(item, type) {
+      let STOCK_ORDER_INVOICE = this.stockList.find(o => o.dictCode == 'STOCK_ORDER_INVOICE').dictValue;
+      if(type === 1) {
+        return item.stockAdequate > STOCK_ORDER_INVOICE ? '充足' : item.stockAdequate;
+      }
+      if(type === 2) {
+        return item.stockCorrespond > STOCK_ORDER_INVOICE ? '充足' : item.stockCorrespond;
+      }
+    },
+
+    // 获取商品列表
+    getSalesGoodsList() {
+      getSalesGoodsList({
+        pageNum: this.currentPage,
+        pageSize: 10,
+        correspondId: this.screenForm.warehouse,
+        categoryName: this.screenForm.type,
+        id: this.screenForm.orderNum,
+        orderNo: this.screenForm.orderNo,
+        mainOrderId: this.screenForm.mainOrderId,
+        customerName: this.screenForm.dealer,
+        materialName: this.screenForm.goodsName,
+        specification: this.screenForm.model,
+      }).then(res => {
+        res.data.records.forEach(item => {
+          item.invoiceNum = '-' + item.invoiceNum;
+        })
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = res.data.records;
+        for(let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for(let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if(newItem.orderId === oldItem.orderId){
+              newGoodsList[j].selected = true;
+              newGoodsList[j].invoiceNum = oldGoodsList[i].invoiceNum;
+              break;
+            }
+          }
+        }
+        // newGoodsList.forEach(item => {
+        //   item.salesMainOrderId = item.id;
+        // })
+
+        this.tableGoodsList = newGoodsList;
+        this.listTotal = res.data.total;
+      })
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 点击 选择商品
+    openDialog() {
+      this.isShowDialog = true;
+      // if(this.screenForm.warehouse) {
+        this.getSalesGoodsList();
+      // }
+    },
+
+    // 列表选择
+    tableSelectionChange(val) {
+      this.tableSelection = val;
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      // if(!this.screenForm.warehouse) {
+      //   return this.$errorMsg('请选择仓库');
+      // }
+      this.currentPage = 1;
+      this.getSalesGoodsList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.tableGoodsList = [];
+      // this.getSalesGoodsList();
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      this.currentPage = val;
+      this.getSalesGoodsList();
+    },
+
+    // 关闭 弹窗
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
+    // 检查是否一致
+    isAllEqual(array) {
+      if (array.length > 0) {
+        return !array.some(function(item, index) {
+          return item.id !== array[0].id;
+        });
+      } else {
+        return true;
+      }
+    },
+
+    // 确定 添加产品
+    submitAddGoods() {
+      let list = this.goodsList.concat(this.tableSelection);
+      if(!this.isAllEqual(list)) {
+        return this.$errorMsg('只能选择同一个销售出库单');
+      }
+
+      this.isShowDialog = false;
+      this.tableGoodsList = [];
+
+      this.goodsList = this.goodsList.concat(this.tableSelection);
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+    },
+
+    // 保存
+    clickSubmitForm(status) {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          if(this.goodsList.length < 1) {
+            return this.$errorMsg('请添加引用');
+          }
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].invoiceNum) {
+              this.$errorMsg('请输入申请数量');
+              return;
+            }
+            if(Number(this.goodsList[i].invoiceNum) > 0) {
+              this.$errorMsg('申请数量需为负数');
+              return;
+            }
+            if(!this.goodsList[i].correspondId) {
+              this.$errorMsg('请选择仓库');
+              return;
+            }
+          }
+          // if(!this.screenForm.warehouse) {
+          //   return this.$errorMsg('请选择仓库');
+          // }
+          this.goodsList.forEach(item => {
+            item.correspondName = this.warehouseList.find(o => o.id === item.correspondId).name;
+          })
+
+          let params = {
+            // id: this.listItem ? this.listItem.id : '',
+            // orderTime: this.mainForm.date + ' 00:00:00',
+            remark: this.mainForm.remark,
+            fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
+            fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
+            correspondId: this.goodsList[0].correspondId,
+            correspondName: this.goodsList[0].correspondName,
+            id: this.goodsList[0].id,
+            saleOrderData: this.goodsList,
+            examineStatus: status,
+          }
+          if(this.listItem) {
+            editApply(params).then(res => {
+              this.$successMsg('编辑成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }else {
+            addReturn(params).then(res => {
+              this.$successMsg('添加成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+</style>

+ 456 - 0
src/views/supply/implement/sales/nsales_list.vue

@@ -0,0 +1,456 @@
+<template>
+  <div class="app-container">
+    <div v-show="!isShowDetail && !isShowExamine && !isShowReturnForm">
+      <!-- 筛选条件 -->
+      <div class="screen-container">
+        <el-form ref="screenForm" :model="screenForm" label-width="85px" size="mini" label-position="left">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item prop="orderNum" label-width="0">
+                <el-radio-group v-model="screenForm.status" @change="getList()">
+                  <el-radio-button label="">全部</el-radio-button>
+                  <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="订单号" prop="mainOrderId">
+                <el-input v-model="screenForm.mainOrderId" placeholder="请输入订单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商名称" prop="jxsName">
+                <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商编号" prop="jxsNum">
+                <el-input v-model="screenForm.jxsNum" placeholder="请输入规格型号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="产品名称" prop="chName">
+                <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="产品编码" prop="chNum">
+                <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="规格型号" prop="model">
+                <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="仓库名称" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货日期" prop="date">
+                <el-date-picker
+                  v-model="screenForm.date"
+                  type="datetimerange"
+                  range-separator="至"
+                  style="width: 100%;"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+
+            <el-col :xs="24" :sm="12" :lg="18" class="tr">
+              <el-form-item label="">
+                <el-button @click="resetScreenForm">清空</el-button>
+                <el-button type="primary" @click="submitScreenForm">搜索</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+
+      <div class="mymain-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button size="mini" type="primary" icon="el-icon-plus" @click="toReturnForm()" v-if="$checkBtnRole('refund', $route.meta.roles)">退货申请</el-button>
+            <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" :disabled="multipleSelection.length < 1" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>
+          </div>
+          <div class="fr">
+            <ExportButton :exUrl="'sale/order/export'" :exParams="exParams" />
+          </div>
+        </div>
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            @selection-change="handleSelectionChange"
+            show-summary
+            :summary-method="$getSummaries">
+            <el-table-column align="center" type="selection" width="55"></el-table-column>
+            <el-table-column align="left" label="状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.examineStatus | statusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.billStatus | billStatusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="出库单号" prop="id" min-width="110" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.id" />
+                <span>{{scope.row.id}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="发货单号" prop="orderNo" min-width="130" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.orderNo" />
+                <span>{{scope.row.orderNo}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="订单号" prop="orderNo" min-width="140" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.orderType === 'TRADE' ? scope.row.enginOrderNo : scope.row.mainOrderId" />
+                <span>{{scope.row.orderType === 'TRADE' || scope.row.orderType === 'HMOE' ? scope.row.enginOrderNo : scope.row.mainOrderId}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.customerNumber" />
+                <span>{{scope.row.customerNumber}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.customerName" />
+                <span>{{scope.row.customerName}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.materialCode" />
+                <span>{{scope.row.materialCode}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.materialOldNumber" />
+                <span>{{scope.row.materialOldNumber}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.materialName" />
+                <span>{{scope.row.materialName}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.specification" />
+                <span>{{scope.row.specification}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.payAmount | numToFixed }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="表头业务员" prop="k3ServiceName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="120" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-popconfirm
+                  style="margin-left: 10px;"
+                  title="确定弃审吗?"
+                  @onConfirm="handleAbandon(scope.row.id)"
+                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+
+    <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
+
+    <SalesDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <SalesExamine :listItem="queryItem" v-if="isShowExamine" @backListFormExamine="backList" />
+    <SalesReturnForm :listItem="queryItem" v-if="isShowReturnForm" @backListFormDetail="backList" />
+
+  </div>
+</template>
+
+<script>
+import { abandonData, examineBatch, examineJudge, getList } from '@/api/supply/sales'
+import SalesDetail from '@/views/supply/sales/components/sales_detail'
+import SalesExamine from '@/views/supply/sales/components/sales_examine'
+import SalesReturnForm from '@/views/supply/sales/components/sales_return_form'
+import ExamineDialog from '@/components/Common/examine-dialog'
+
+let that
+export default {
+  components: {
+    SalesDetail,
+    SalesExamine,
+    SalesReturnForm,
+    ExamineDialog,
+  },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    billStatusFilter(val) {
+      const MAP = {
+        1: '已开票',
+        0: '未开票',
+      }
+      return MAP[val];
+    }
+  },
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: null, // 列表数据
+      listLoading: false, // 列表加载loading
+      screenForm: { // 筛选表单数据
+        orderNum: '',
+        jxsName: '',
+        jxsNum: '',
+        chName: '',
+        chNum: '',
+        model: '',
+        warehouse: '',
+        date: '',
+        status: '',
+        mainOrderId: '',
+      },
+      statusList: [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+      ],
+
+      queryItem: {},
+      isShowDetail: false,
+      isShowExamine: false,
+      isShowReturnForm: false,
+
+      multipleSelection: [],
+      isShowExamineDialog: false,
+      examineForm: {
+        status: '',
+        remark: '',
+      },
+    }
+  },
+
+  computed: {
+    exParams() {
+      return {
+        examineStatus: this.screenForm.status,
+        orderNo: this.screenForm.orderNum,
+        customerName: this.screenForm.jxsName,
+        customerNumber: this.screenForm.jxsNum,
+        materialName: this.screenForm.chName,
+        materialNumber: this.screenForm.chNum,
+        specification: this.screenForm.model,
+        correspondName: this.screenForm.warehouse,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        mainOrderId: this.screenForm.mainOrderId,
+      }
+    },
+  },
+
+  beforeCreate() {
+    that = this;
+  },
+
+  created() {
+    this.getList();
+  },
+
+  methods: {
+    // 查询列表
+    getList() {
+      this.listLoading = true;
+
+      let params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        examineStatus: this.screenForm.status,
+        orderNo: this.screenForm.orderNum,
+        customerName: this.screenForm.jxsName,
+        customerNumber: this.screenForm.jxsNum,
+        materialName: this.screenForm.chName,
+        materialNumber: this.screenForm.chNum,
+        specification: this.screenForm.model,
+        correspondName: this.screenForm.warehouse,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        mainOrderId: this.screenForm.mainOrderId,
+      };
+      getList(params).then((res) => {
+        res.data.records.forEach(item => {
+          item.sums1 = ['refundableQty'];
+          item.sums2 = ['price', 'payAmount'];
+        })
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
+        this.listLoading = false;
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+
+    // 判断是否可以审批
+    async examineJudge(item) {
+      // 获取页面模版
+      const result = await new Promise((resolve, reject)=>{
+        examineJudge({id: item.id}).then(res => {
+          resolve(res.code == 200);
+        }).catch(res => {
+          resolve(0);
+        })
+      })
+      return result;
+    },
+
+    // 进入表单
+    toReturnForm(item) {
+      this.queryItem = item;
+      this.isShowReturnForm = true;
+    },
+
+    // 进入详情
+    toDetail(item) {
+      this.queryItem = item;
+      this.isShowDetail = true;
+    },
+
+    // 进入审批
+    async toExamine(item) {
+      const canExamine = await this.examineJudge(item);
+      if(!canExamine) {
+        return false;
+      }
+      this.queryItem = item;
+      this.isShowExamine = true;
+    },
+
+    backList() {
+      this.queryItem = {};
+      this.isShowDetail = false;
+      this.isShowExamine = false;
+      this.isShowReturnForm = false;
+    },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
+    // 打开 批量审批
+    batchExamine() {
+      this.isShowExamineDialog = true;
+    },
+
+    // 提交 批量审批
+    submitExamineForm() {
+      let ids = this.multipleSelection.map(item => {
+        return item.id;
+      });
+      examineBatch({
+        ids: ids.join(','),
+        examineStatus: this.examineForm.status,
+        approvalRemark: this.examineForm.remark,
+      }).then(res => {
+        this.isShowExamineDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
+
+    // 弃审
+    handleAbandon(id) {
+      abandonData({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>