|
@@ -5,100 +5,91 @@
|
|
|
<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"><el-input v-model="mainForm.remark" placeholder="请输入发货申请单号"></el-input></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="系统自动生成" readonly></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" class="item">
|
|
|
- <div class="label">申请日期</div>
|
|
|
- <div class="value">2022123233435342</div>
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8">
|
|
|
+ <el-form-item label="制单人" prop="createMan">
|
|
|
+ <el-input v-model="mainForm.createMan" readonly></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" class="item">
|
|
|
- <div class="label">单据状态</div>
|
|
|
- <div class="value">2022123233435342</div>
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
|
|
|
+ <el-form-item label="单据日期" prop="date">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="mainForm.date"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ style="width: 100%;"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" class="item">
|
|
|
- <div class="label">经销商编号</div>
|
|
|
- <div class="value">万豪仓</div>
|
|
|
+
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8">
|
|
|
+ <el-form-item label="经销商编号" prop="jxsNum">
|
|
|
+ <el-input v-model="mainForm.jxsNum" readonly></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" class="item">
|
|
|
- <div class="label">经销商名称</div>
|
|
|
- <div class="value">2022123233435342</div>
|
|
|
+ <el-col :xs="24" :sm="12" :lg="16">
|
|
|
+ <el-form-item label="经销商名称" prop="jxsName">
|
|
|
+ <el-input v-model="mainForm.jxsName" readonly></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" class="item">
|
|
|
- <div class="label">仓库</div>
|
|
|
- <div class="value">广州格匠机电有限公司</div>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="24" :lg="24" class="item">
|
|
|
- <div class="label">备注</div>
|
|
|
- <div class="value">2022123233435342</div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8" class="item">
|
|
|
- <div class="label">制单人</div>
|
|
|
- <div class="value">广州格匠机电有限公司</div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16" class="item">
|
|
|
- <div class="label">制表日期</div>
|
|
|
- <div class="value">广州格匠机电有限公司</div>
|
|
|
+ <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-row>
|
|
|
- </div>
|
|
|
+ </el-form>
|
|
|
|
|
|
<div class="main-title">
|
|
|
- <div class="title">货品信息</div>
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
- <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
+ <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
<el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
|
|
|
- <el-table-column align="center" label="销售类型" prop="salesType" min-width="160" show-overflow-tooltip>
|
|
|
+ <el-table-column align="center" label="发货单号" prop="id" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="发货仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" 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="center" label="数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="出货状态" prop="shipStatus" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.salesType }}
|
|
|
+ {{scope.row.shipStatus | chStatusFilter}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="发货仓库" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="销售订单号" prop="retreatTime" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="产品编码" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="产品名称" prop="productName" 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="center" label="数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="是否退货" prop="isReturn" min-width="100" show-overflow-tooltip>
|
|
|
+ <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.billStatus | kpStatusFilter}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="是否退货" prop="isReturn" min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-checkbox v-model="scope.row.isReturn"></el-checkbox>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="可退数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="退货数量" prop="number" min-width="100" show-overflow-tooltip>
|
|
|
+ <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="退货数量" prop="num" min-width="120" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.num" size="small" type="number"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.number" placeholder="请输入退货数量"></el-input>
|
|
|
+ <el-input v-model="scope.row.remark" size="small"></el-input>
|
|
|
</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">2022123233435342</div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12" class="item">
|
|
|
- <div class="label">退货日期</div>
|
|
|
- <div class="value">2022123233435342</div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="item">
|
|
|
- <div class="label">退货说明</div>
|
|
|
- <div class="value">
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入退货说明"></el-input>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
|
|
|
<div class="page-footer">
|
|
|
<div class="footer" :class="classObj">
|
|
@@ -109,26 +100,119 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <el-dialog title="添加引用" :visible.sync="isShowDialog" width="80%">
|
|
|
+ <el-form ref="screenForm" :model="screenForm" size="small" label-position="left" label-width="70px">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :xs="12" :sm="12" :lg="12">
|
|
|
+ <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 label="">
|
|
|
+ <el-button size="small" @click="resetScreenForm">清空</el-button>
|
|
|
+ <el-button size="small" 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="center" label="发货单号" prop="id" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="发货仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" 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="center" label="数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="出货状态" prop="shipStatus" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.shipStatus | chStatusFilter}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.billStatus | kpStatusFilter}}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="可退数量" prop="refundableQty" min-width="100" 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 { getDetail } from "@/api/supply/return";
|
|
|
+import { getDetail, getGoodsList, addData } from "@/api/supply/return";
|
|
|
|
|
|
export default {
|
|
|
name: 'ReturnForm',
|
|
|
componentName: 'ReturnForm',
|
|
|
props: ['listItem'],
|
|
|
+ filters: {
|
|
|
+ chStatusFilter(val) {
|
|
|
+ const MAP = {
|
|
|
+ 0: '未出货',
|
|
|
+ 1: '已出货',
|
|
|
+ }
|
|
|
+ return MAP[val];
|
|
|
+ },
|
|
|
+ kpStatusFilter(val) {
|
|
|
+ const MAP = {
|
|
|
+ 0: '未开票',
|
|
|
+ 1: '已开票',
|
|
|
+ }
|
|
|
+ return MAP[val];
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
detailData: {},
|
|
|
formLoading: false,
|
|
|
mainForm: {
|
|
|
+ orderNum: '',
|
|
|
+ createMan: '',
|
|
|
+ date: '',
|
|
|
+ jxsNum: '',
|
|
|
+ jxsName: '',
|
|
|
remark: '',
|
|
|
},
|
|
|
- goodsList: [{
|
|
|
- goodsId: 1,
|
|
|
- }]
|
|
|
+ mainFormRules: {
|
|
|
+ date: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
|
|
|
+ },
|
|
|
+ goodsList: [],
|
|
|
+
|
|
|
+ isShowDialog: false,
|
|
|
+ screenForm: {
|
|
|
+ orderNum: '',
|
|
|
+ },
|
|
|
+ currentPage: 1,
|
|
|
+ listTotal: 0,
|
|
|
+
|
|
|
+ tableGoodsList: [],
|
|
|
+ tableSelection: [],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -145,7 +229,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- this.getDetail();
|
|
|
+ if(this.listItem) {
|
|
|
+ this.getDetail();
|
|
|
+ }else {
|
|
|
+ this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
|
|
|
+ this.mainForm.jxsName = JSON.parse(localStorage.getItem("supply_user")).customerName;
|
|
|
+ this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -161,8 +251,141 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 获取商品列表
|
|
|
+ getGoodsList() {
|
|
|
+ getGoodsList({
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: 10,
|
|
|
+ customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
+ id: this.screenForm.orderNum,
|
|
|
+ }).then(res => {
|
|
|
+ res.data.records.forEach(item => {
|
|
|
+ item.num = '';
|
|
|
+ item.remark = '';
|
|
|
+ item.isReturn = true;
|
|
|
+ });
|
|
|
+ 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.materialId === oldItem.materialId){
|
|
|
+ newGoodsList[j].selected = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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.orderNum) {
|
|
|
+ this.getGoodsList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 提交筛选表单
|
|
|
+ submitScreenForm() {
|
|
|
+ if(!this.screenForm.orderNum) {
|
|
|
+ return this.$errorMsg('请填写发货申请单号');
|
|
|
+ }
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.getGoodsList();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 重置筛选表单
|
|
|
+ resetScreenForm() {
|
|
|
+ this.$refs.screenForm.resetFields();
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.tableGoodsList = [];
|
|
|
+ // this.getGoodsList();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更改列表当前页
|
|
|
+ handleTableCurrentChange(val) {
|
|
|
+ if(this.tableSelection.length > 0) {
|
|
|
+ return this.$errorMsg('已选择产品不可切换');
|
|
|
+ }
|
|
|
+ this.currentPage = val;
|
|
|
+ this.getGoodsList();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 关闭 弹窗
|
|
|
+ closeDialog() {
|
|
|
+ this.isShowDialog = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 列表选择
|
|
|
+ tableSelectionChange(val) {
|
|
|
+ this.tableSelection = val;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 确定 添加产品
|
|
|
+ submitAddGoods() {
|
|
|
+ this.goodsList = this.goodsList.concat(this.tableSelection);
|
|
|
+ this.isShowDialog = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除产品
|
|
|
+ deleteItem(index) {
|
|
|
+ this.goodsList.splice(index, 1);
|
|
|
+ },
|
|
|
+
|
|
|
clickSubmitForm() {
|
|
|
+ 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].num) {
|
|
|
+ this.$errorMsg('请输入退货数量');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.goodsList[i].num > this.goodsList[i].refundableQty) {
|
|
|
+ this.$errorMsg('退货数量不能大于可退数量');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let goodsList = this.goodsList.filter(item => {
|
|
|
+ return item.isReturn;
|
|
|
+ })
|
|
|
+ goodsList = goodsList.map(item => {
|
|
|
+ return {
|
|
|
+ invoiceOrderId: item.invoiceOrderId,
|
|
|
+ num: item.num,
|
|
|
+ remark: item.remark
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ retreatTime: this.mainForm.date + ' 00:00:00',
|
|
|
+ remark: this.mainForm.remark,
|
|
|
+ retreatDocumentOrder: goodsList,
|
|
|
+ }
|
|
|
+ addData(params).then(res => {
|
|
|
+ this.$successMsg('添加成功');
|
|
|
+ this.goBack();
|
|
|
+ this.$parent.getList();
|
|
|
+ })
|
|
|
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
}
|