文件

561 行
25 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 10px 0;
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="sPurchasePayableApp" v-cloak>
<div class="center-content">
<div>
<el-input placeholder="批次号号"
type="text"
style="width: 200px"
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>
<select-store-supplier :supplier-id.sync="supplier_id"></select-store-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 type="primary" v-if="storeAuth.data_export==1" plain @click="exportOperation" size="small">导出</el-button>
</if>
</div>
</div>
<div v-if="supplier_type != 2">
<template>
<el-table :data="TotalList" style="width: calc(100vw - 208px);border: none;">
<el-table-column prop="payable_money" label="应付金额"></el-table-column>
<el-table-column prop="paid_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="PayableList" 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="purchase_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="purchase_time" label="采购时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="payable_money" label="应付金额" show-overflow-tooltip></el-table-column>
<el-table-column prop="paid_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.purchase_order_number,scope.row.payable_money,scope.row.paid_money,scope.row.stay_money)"
type="text" size="small" v-if="scope.row.payable_money > scope.row.paid_money">付款
</el-button>
</if>
<el-button
@click="sellInfo(scope.row.purchase_order_id)" type="text" size="small" v-if="supplier_type == 2">详情
</el-button>
</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>{{payable_money}}</span>
</div>
<div style="display: flex;justify-content: space-between; height: 30px;line-height: 30px;font-size: 20px;color:white;">
<span>已付金额</span>
<span>{{paid_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="1"></el-option>
<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 == 1" class="input">
<el-input v-model="form.advance_money" disabled></el-input>
</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="pay_money">
<el-input v-model="form.pay_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>
<!--寄售供货商销售详情-->
<el-dialog title="销售记录" :modal-append-to-body="false" :visible.sync="sell_state">
<el-input placeholder="商品名称/货号"
type="text"
size="small"
clearable
v-model="content"></el-input>
<el-button type="primary" plain @click="search_info" size="small">搜索</el-button>
<el-table border :data="SellList" 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="goods_name" label="商品名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_number" label="商品货号" show-overflow-tooltip></el-table-column>
<el-table-column prop="company" label="单位" show-overflow-tooltip></el-table-column>
<el-table-column prop="purchase_num" label="进货数量" show-overflow-tooltip></el-table-column>
<el-table-column prop="purchase_price" label="采购价" show-overflow-tooltip></el-table-column>
<el-table-column prop="num" label="售出数量" show-overflow-tooltip></el-table-column>
<el-table-column prop="should_money" label="应结金额" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChangeSell"
@current-change="handleCurrentChangeSell"
: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="sellCurrentLen">
</el-pagination>
</el-dialog>
</div>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Retail/common/js/select-supplier.js"></script>
<script type="text/javascript">
var sPurchasePayableApp = new Vue({
el: "#sPurchasePayableApp",
data: function () {
return {
supplier_type: "{$supplier_type}",
sell_state: false,
purchase_id: '',
SellList:[],
order_number: "",
add_time: "",
supplier_id: "",
pay_status: "",
PayableList: [],
TotalList: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
sellCurrentPage: 1,
sellCurrentLimit: 10,
sellCurrentLen: 0,
loading: true,
sell_loading: true,
outerVisible: false,
payable_money: "",
paid_money: "",
stay_money: "",
content:"",
form: {
payable_id: "",
supplier_id: "",
pay_type: '1',
advance_money: "",
pay_money: "",
remarks: "",
add_time: "",
bank_card: "",
bank_name: "",
purchase_order_number: "",
},
rules: {
pay_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();//切换页数
},
handleSizeChangeSell: function (val) {
this.sellCurrentLimit = val;//切换每页数量
this.sellCurrentPage = 1;
this.sellList();
},
handleCurrentChangeSell: function (val) {
this.sellCurrentPage = val;
this.sellList();//切换页数
},
//搜索
search: function () {
this.currentPage = 1;
this.getData();
this.getTotal();
},
//查询
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;
$.ajax({
url: "{:U('PayableList')}",
type: "post",
data: {
page: page,
limit: limit,
order_number: order_number,
add_time: add_time,
supplier_id: supplier_id,
pay_status: pay_status
},
success: function (res) {
that.PayableList = [];
that.PayableList = res.data.list;
that.loading = false;
that.$nextTick(function () {
that.currentLen = parseInt(res.data.count);
})
}
})
},
//统计
getTotal: 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;
$.ajax({
url: "{:U('PayableTotal')}",
type: "post",
data: {
order_number: order_number,
add_time: add_time,
supplier_id: supplier_id,
pay_status: pay_status
},
success: function (res) {
that.TotalList = [];
that.TotalList = res.data.TotalList;
}
})
},
//导出
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;
window.location.href = "{:U('export')}?order_number=" + order_number + "&add_time=" + add_time + "&supplier_id=" + supplier_id + "&pay_status=" + pay_status
},
//取消
Cancel: function () {
this.outerVisible = false;
this.form.remarks = "";
this.form.pay_money = "";
},
payment: function (id, supplier_id, purchase_order_number, payable_money, paid_money, stay_money) {
var that = this;
that.payable_money = payable_money;
that.paid_money = paid_money;
that.stay_money = stay_money;
that.form.payable_id = id;
that.form.purchase_order_number = purchase_order_number;
that.form.supplier_id = supplier_id;
that.form.add_time = "";
that.form.pay_type = '1';
that.form.pay_money = '';
that.outerVisible = true;
$.ajax({
url: "{:U('supplierInfo')}",
type: "post",
data: {supplier_id: supplier_id},
success: function (res) {
that.form.advance_money = res.advanceMoney;
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 advance_money = that.form.advance_money;
var pay_money = that.form.pay_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 purchase_order_number = that.form.purchase_order_number;
var supplier_id = that.form.supplier_id;
var payable_id = that.form.payable_id;
if (!pay_type) {
that.$message({
type: 'warning',
message: "请选择付款方式",
duration: 1000
});
return;
}
if (pay_type == 1 && parseFloat(advance_money) < parseFloat(pay_money)) {
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 (!purchase_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('payment')}",
type: "post",
data: {
payable_id: payable_id,
pay_type: pay_type,
advance_money: advance_money,
pay_money: pay_money,
remarks: remarks,
add_time: add_time,
bank_card: bank_card,
bank_name: bank_name,
purchase_order_number: purchase_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();
that.getTotal();
}
});
} else {
that.$message({
type: 'error',
message: res.msg
});
}
}
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消付款'
});
});
} else {
that.$message({
type: "error",
message: "请检查参数",
duration: 1000
})
return false;
}
});
},
sellInfo: function (id) {
this.purchase_id = id;
this.sell_state = true;
this.sellList();
},
sellList: function () {
var that = this;
var id = that.purchase_id;
var content = that.content;
var sellCurrentPage = that.sellCurrentPage;
var sellCurrentLimit = that.sellCurrentLimit;
$.ajax({
url: "{:U('sellList')}",
type: "post",
data: {
id: id,
content:content,
page:sellCurrentPage,
limit:sellCurrentLimit
},
success: function (res) {
that.SellList = [];
that.SellList = res.data.list;
that.sell_loading = false;
that.$nextTick(function () {
that.sellCurrentLen = parseInt(res.data.count);
})
}
})
},
search_info:function(){
var that = this;
that.sellCurrentPage = 1;
that.sellList();
}
},
created: function () {
this.getData();
this.getTotal();
}
})
</script>