436 行
19 KiB
HTML
可执行文件
436 行
19 KiB
HTML
可执行文件
<!--[1.7.90]-->
|
|
<style>
|
|
th {
|
|
background-color: #f5f7fa !important;
|
|
}
|
|
|
|
th > .cell {
|
|
white-space: nowrap !important;
|
|
text-align: center;
|
|
}
|
|
|
|
th, td {
|
|
text-align: center;
|
|
line-height: 30px;
|
|
padding: 0;
|
|
}
|
|
|
|
th > .cell, td > .cell {
|
|
text-align: center;
|
|
}
|
|
|
|
.el-pagination {
|
|
padding: 8px;
|
|
}
|
|
|
|
.el-table__row > td:last-child > .cell {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.center-content {
|
|
margin: 0 0 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.center-content .el-input__inner {
|
|
padding: 0 15px;
|
|
text-align: left;
|
|
}
|
|
|
|
.el-input {
|
|
margin-bottom: 10px;
|
|
}
|
|
.el-range-editor--small .el-range-separator{
|
|
line-height: 32px;
|
|
}
|
|
</style>
|
|
<div class="purchaseBox" id="purchase" v-cloak>
|
|
<div class="center-content">
|
|
<div>
|
|
<el-input placeholder="退货单号"
|
|
style="width: 200px"
|
|
type="text"
|
|
size="small"
|
|
clearable
|
|
@keydown.enter.exact.native.prevent="search"
|
|
v-model="order_number"></el-input>
|
|
<template>
|
|
<date-picker-range :date-time.sync="add_time"></date-picker-range>
|
|
|
|
<el-select v-model="type" placeholder="场景" size="small" clearable>
|
|
<el-option label="采购单退货" value="1"></el-option>
|
|
<el-option label="出库单退货" value="2"></el-option>
|
|
</el-select>
|
|
<select-mer-supplier :supplier-id.sync="supplier_id"></select-mer-supplier>
|
|
|
|
<el-select v-model="pay_status" placeholder="收款状态" size="small" clearable>
|
|
<el-option label="待收款" value="1"></el-option>
|
|
<el-option label="部分收款 " value="2"></el-option>
|
|
<el-option label="已收款" value="3"></el-option>
|
|
</el-select>
|
|
</template>
|
|
<el-button type="primary" plain @click="search" size="small">搜索</el-button>
|
|
<if condition="$authArr['exportOperation'] eq true">
|
|
<el-button @click="exportOperation" size="small">导出</el-button>
|
|
</if>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<template>
|
|
<el-table :data="TotalList" style="width: calc(100vw - 208px);border: none;">
|
|
<el-table-column prop="collect_money" label="应收金额"></el-table-column>
|
|
<el-table-column prop="received_money" label="已收金额"></el-table-column>
|
|
<el-table-column prop="stay_money" label="待收金额"></el-table-column>
|
|
</el-table>
|
|
</template>
|
|
</div>
|
|
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
|
|
<el-table border :data="RetreatList" style="width: calc(100vw - 208px);border: none;"
|
|
size="mini"
|
|
max-height="500"
|
|
v-loading="loading"
|
|
element-loading-text="数据获取中"
|
|
element-loading-spinner="el-icon-loading">
|
|
<el-table-column type="index" label="序号" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="supplier_name" label="供货商" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="retreat_order_number" label="退货单" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="operator" label="操作人" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="retreat_time" label="退货时间" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="collect_money" label="应收金额" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="received_money" label="已收金额" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="stay_money" label="待收金额" show-overflow-tooltip></el-table-column>
|
|
<el-table-column prop="pay_name" label="收款状态" show-overflow-tooltip></el-table-column>
|
|
<el-table-column fixed="right" label="操作" width="150px" style="border-right: none;">
|
|
<template slot-scope="scope">
|
|
<if condition="$authArr['payment'] eq true">
|
|
<el-button
|
|
@click="payment(scope.row.id,scope.row.supplier_id,scope.row.retreat_order_number,scope.row.collect_money,scope.row.received_money,scope.row.stay_money)"
|
|
type="text" size="small" v-if="scope.row.pay_status != 3">收款
|
|
</el-button>
|
|
</if>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
:current-page="currentPage"
|
|
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
|
|
:page-size="100"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="currentLen">
|
|
</el-pagination>
|
|
</div>
|
|
<!--收款-->
|
|
<div>
|
|
<el-dialog title="收款记录" :modal-append-to-body="false" :visible.sync="outerVisible">
|
|
<div>
|
|
<div style="box-sizing: border-box;padding: 10px;display: flex;justify-content: space-between; width: 100%;background: rgb(255, 117, 87);margin-bottom: 10px;">
|
|
<div style="width: 50%;font-size: 30px;color:white;">
|
|
待收金额:{{stay_money}}
|
|
</div>
|
|
<div style="width: 50%;">
|
|
<div style="display: flex;justify-content: space-between; height: 30px;line-height: 30px;font-size: 20px;color:white;">
|
|
<span>应收金额</span>
|
|
<span>{{collect_money}}</span>
|
|
</div>
|
|
<div style="display: flex;justify-content: space-between; height: 30px;line-height: 30px;font-size: 20px;color:white;">
|
|
<span>已收金额</span>
|
|
<span>{{received_money}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-form style="width: 60%;margin-left: 20%;" label-width="82px" size="small" :rules="rules" ref="form"
|
|
:model="form">
|
|
<el-form-item label="收款方式" class="input">
|
|
<el-select v-model="form.pay_type" placeholder="请选择">
|
|
<el-option label="微信" value="2"></el-option>
|
|
<el-option label="支收宝" value="3"></el-option>
|
|
<el-option label="线下" value="4"></el-option>
|
|
<el-option label="银行卡" value="5"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="付款方卡号" v-if="form.pay_type == 5" class="input">
|
|
<el-input v-model="form.bank_card" disabled></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="收款金额" class="input" prop="collect_money">
|
|
<el-input v-model="form.collect_money"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="收款日期" class="input">
|
|
<el-date-picker
|
|
size="small"
|
|
v-model="form.add_time"
|
|
type="datetime"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
placeholder="选择日期时间">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="备注" class="input">
|
|
<el-input
|
|
type="textarea"
|
|
:rows="2"
|
|
placeholder="订单备注"
|
|
v-model="form.remarks">
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button @click="Cancel">取消</el-button>
|
|
<if condition="$authArr['payment'] eq true">
|
|
<el-button type="primary" @click="submit('form')">确定</el-button>
|
|
</if>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Retail/common/js/select-supplier.js"></script>
|
|
<script type="text/javascript">
|
|
var purchase = new Vue({
|
|
el: "#purchase",
|
|
data: function () {
|
|
return {
|
|
type:"",
|
|
order_number: "",
|
|
add_time: "",
|
|
supplier_id: "",
|
|
pay_status: "",
|
|
RetreatList: [],
|
|
TotalList: [],
|
|
currentPage: 1,
|
|
currentLimit: 10,
|
|
currentLen: 0,
|
|
loading: true,
|
|
outerVisible: false,
|
|
collect_money: "",
|
|
received_money: "",
|
|
stay_money: "",
|
|
form: {
|
|
receivables_id: "",
|
|
supplier_id: "",
|
|
pay_type: "2",
|
|
collect_money: "",
|
|
remarks: "",
|
|
add_time: "",
|
|
bank_card: "",
|
|
bank_name: "",
|
|
retreat_order_number: "",
|
|
},
|
|
rules: {
|
|
collect_money: [
|
|
{required: true, message: '请输入收款金额', trigger: 'blur'},
|
|
{
|
|
validator: function (rule, value, callback) {
|
|
var reg = /^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
|
|
if (reg.test(value) == false && value != '') {
|
|
callback(new Error("请输入正确收款金额"));
|
|
} else {
|
|
callback();
|
|
}
|
|
}, trigger: 'blur'
|
|
}
|
|
],
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
handleSizeChange: function (val) {
|
|
this.currentLimit = val;//切换每页数量
|
|
this.currentPage = 1;
|
|
this.getData();
|
|
},
|
|
handleCurrentChange: function (val) {
|
|
this.currentPage = val;
|
|
this.getData();//切换页数
|
|
},
|
|
//搜索
|
|
search: function () {
|
|
this.currentPage = 1;
|
|
this.getData();
|
|
},
|
|
//查询
|
|
getData: function () {
|
|
var that = this;
|
|
that.loading = true;
|
|
var page = that.currentPage;
|
|
var limit = that.currentLimit;
|
|
var order_number = that.order_number;
|
|
var add_time = that.add_time;
|
|
var supplier_id = that.supplier_id;
|
|
var pay_status = that.pay_status;
|
|
var type = that.type;
|
|
$.ajax({
|
|
url: "{:U('RetreatList')}",
|
|
type: "post",
|
|
data: {
|
|
page: page,
|
|
limit: limit,
|
|
order_number: order_number,
|
|
add_time: add_time,
|
|
supplier_id: supplier_id,
|
|
pay_status: pay_status,
|
|
type:type
|
|
},
|
|
success: function (res) {
|
|
that.RetreatList = res.data;
|
|
that.TotalList = res.TotalList;
|
|
that.loading = false;
|
|
that.$nextTick(function () {
|
|
that.currentLen = parseInt(res.count);
|
|
})
|
|
}
|
|
})
|
|
},
|
|
//导出
|
|
exportOperation: function () {
|
|
var that = this;
|
|
var order_number = that.order_number;
|
|
var add_time = that.add_time;
|
|
var supplier_id = that.supplier_id;
|
|
var pay_status = that.pay_status;
|
|
var type = that.type;
|
|
window.location.href = "{:U('export')}?order_number=" + order_number + "&add_time=" + add_time + "&supplier_id=" + supplier_id + "&pay_status=" + pay_status + "&type=" + type
|
|
},
|
|
//取消
|
|
Cancel: function () {
|
|
this.outerVisible = false;
|
|
this.form.remarks = "";
|
|
this.form.collect_money = "";
|
|
},
|
|
payment: function (id, supplier_id, retreat_order_number, collect_money, received_money, stay_money) {
|
|
var that = this;
|
|
that.collect_money = collect_money;
|
|
that.received_money = received_money;
|
|
that.stay_money = stay_money;
|
|
that.form.receivables_id = id;
|
|
that.form.retreat_order_number = retreat_order_number;
|
|
that.form.supplier_id = supplier_id;
|
|
that.form.add_time = "";
|
|
that.form.pay_type = '2';
|
|
that.form.collect_money = '';
|
|
that.outerVisible = true;
|
|
$.ajax({
|
|
url: "{:U('SupplierInfo')}",
|
|
type: "post",
|
|
data: {supplier_id: supplier_id},
|
|
success: function (res) {
|
|
that.form.bank_card = res.bank_card;
|
|
that.form.bank_name = res.bank_name;
|
|
}
|
|
})
|
|
},
|
|
submit: function (formName) {
|
|
var that = this;
|
|
that.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
var pay_type = that.form.pay_type;
|
|
var collect_money = that.form.collect_money;
|
|
var remarks = that.form.remarks;
|
|
var add_time = that.form.add_time;
|
|
var bank_card = that.form.bank_card;
|
|
var bank_name = that.form.bank_name;
|
|
var retreat_order_number = that.form.retreat_order_number;
|
|
var supplier_id = that.form.supplier_id;
|
|
var receivables_id = that.form.receivables_id;
|
|
if (!pay_type) {
|
|
that.$message({
|
|
type: 'warning',
|
|
message: "请选择收款方式",
|
|
duration: 1000
|
|
});
|
|
return;
|
|
}
|
|
if (pay_type == 5 && (!bank_card || !bank_name)) {
|
|
that.$message({
|
|
type: 'warning',
|
|
message: "银行卡号信息或者开户银行有误",
|
|
duration: 1000
|
|
});
|
|
return;
|
|
}
|
|
if (!add_time) {
|
|
that.$message({
|
|
type: 'warning',
|
|
message: "请选择收款日期",
|
|
duration: 1000
|
|
});
|
|
return;
|
|
}
|
|
if (!retreat_order_number) {
|
|
that.$message({
|
|
type: 'warning',
|
|
message: "采购订单号缺失",
|
|
duration: 1000
|
|
});
|
|
return;
|
|
}
|
|
if (!supplier_id) {
|
|
that.$message({
|
|
type: 'warning',
|
|
message: "供货商参数缺失",
|
|
duration: 1000
|
|
});
|
|
return;
|
|
}
|
|
that.$confirm('确认收款信息无误提交后无法修改, 是否继续?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
$.ajax({
|
|
url: "{:U('Collect')}",
|
|
type: "post",
|
|
data: {
|
|
receivables_id: receivables_id,
|
|
pay_type: pay_type,
|
|
collect_money: collect_money,
|
|
remarks: remarks,
|
|
add_time: add_time,
|
|
bank_card: bank_card,
|
|
bank_name: bank_name,
|
|
retreat_order_number: retreat_order_number,
|
|
supplier_id: supplier_id
|
|
},
|
|
success: function (res) {
|
|
if (res.status == 1) {
|
|
that.$message({
|
|
type: 'success',
|
|
message: res.msg,
|
|
duration: 1000,
|
|
onClose: function () {
|
|
that.outerVisible = false;
|
|
that.getData();
|
|
}
|
|
});
|
|
} else {
|
|
that.$message({
|
|
type: 'error',
|
|
message: res.msg
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}).catch(() => {
|
|
this.$message({
|
|
type: 'info',
|
|
message: '已取消收款'
|
|
});
|
|
});
|
|
} else {
|
|
that.$message({
|
|
type: "error",
|
|
message: "请检查参数",
|
|
duration: 1000
|
|
})
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
},
|
|
created: function () {
|
|
this.getData();
|
|
}
|
|
})
|
|
</script> |