文件

372 行
15 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: 20px 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.center-content .el-input__inner {
padding: 0 15px;
text-align: left;
}
.center-content-moreEditBox {
margin: 0 0 20px;
display: flex;
align-items: center;
}
.center-content-moreEditBox .el-input__inner {
padding: 0 15px;
text-align: left;
}
.el-input {
margin-bottom: 10px;
}
#moreEditBox {
display: none;
}
.el-range-editor--small .el-range-separator {
line-height: 32px;
}
</style>
<div class="purchaseBox" id="purchase" v-cloak>
<div>
<el-collapse accordion>
<el-collapse-item>
<template slot="title">
采购须知>>></i>
</template>
<div>1.新建采购单之前先创建采购仓(采购管理->仓库管理->添加)</div>
<div>2.入库操作之前先创建供给仓(库存管理->供给仓库->添加)</div>
<div>3.入库成功的商品的可售库存增加</div>
<div>4.不做入库操作的商品可在库存状况列表->补货 或者 入库单->添加->采购入库(把采购仓的商品调到供给仓,商品可售库存增加)</div>
<div>5.部分付款或已付款的采购单不可编辑</div>
</el-collapse-item>
</el-collapse>
</div>
<div class="center-content">
<div>
<el-input placeholder="批次号" style="width: 200px" type="text" clearable
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 value="" label="所有类型"></el-option>
<el-option value="1" label="常规采购单"></el-option>
<el-option value="2" label="补采购单"></el-option>
</el-select>
</template>
<if condition="$authArr['search'] eq true">
<el-button type="primary" @click="search" size="small">搜索</el-button>
</if>
<if condition="$authArr['addPurchaseOrder'] eq true">
<el-button type="primary" plain @click="addPurchaseOrder" size="small">添加</el-button>
</if>
<if condition="$authArr['exportOperation'] eq true">
<el-button @click="exportOperation" size="small">导出</el-button>
</if>
<el-button type="primary" plain @click="moreEdit" size="small">>>>更多搜索</el-button>
</div>
</div>
<div id="moreEditBox" style="height:0;padding-left: 0" class="center-content-moreEditBox">
<template>
<select-mer-supplier :supplier-id.sync="supplier_id"></select-mer-supplier>
<el-select v-model="warehouse_id" placeholder="采购仓库" size="small">
<el-option value="">所有仓库</el-option>
<el-option v-for="item in warehouse" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</template>
</div>
<div>
<template>
<el-table :data="TotalList" style="width: calc(100vw - 208px);border: none;">
<el-table-column prop="orderCount" label="订单数"></el-table-column>
<el-table-column prop="goodsCount" label="采购商品种数"></el-table-column>
<el-table-column prop="totalMoney" label="采购金额"></el-table-column>
</el-table>
</template>
</div>
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
<el-table border :data="purchaseOrderList" 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 prop="index" label="序号" show-overflow-tooltip></el-table-column>
<el-table-column prop="operator" label="操作人" show-overflow-tooltip></el-table-column>
<el-table-column prop="type_name" label="类型" show-overflow-tooltip></el-table-column>
<el-table-column prop="add_time" label="采购时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="repair_time" label="操作时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="order_number" label="批次号" show-overflow-tooltip></el-table-column>
<el-table-column prop="supplier" label="供应商" show-overflow-tooltip></el-table-column>
<el-table-column prop="warehouse" label="仓库" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_species" label="合计(种)" show-overflow-tooltip></el-table-column>
<el-table-column prop="money_total" label="金额" show-overflow-tooltip></el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" width="320px" style="border-right: none;">
<template slot-scope="scope">
<if condition="$authArr['OrderInfo'] eq true">
<el-button @click="OrderInfo(scope.row.id,scope.row.operator)" type="text" size="small">详情
</el-button>
</if>
<if condition="$authArr['edit'] eq true">
<el-button @click="edit(scope.row.id)" type="text" size="small"
v-if="scope.row.pay_status != 2 && scope.row.pay_status != 3">立即编辑
</el-button>
</if>
<if condition="$authArr['warehousing'] eq true">
<el-button @click="warehousing(scope.row.id)" type="text" size="small"
v-if="scope.row.warehouse_state == 0">全部入库
</el-button>
</if>
<el-button @click="part(scope.row.order_number,scope.row.supplier_id)" type="text" size="small"
v-if="scope.row.warehouse_state == 0">部分入库
</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>
<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() {
return {
TotalList: [],
type: "",
order_number: "",
add_time: "",
supplier_id: "",
warehouse_id: "",
warehouse: {$warehouse},
purchaseOrderList: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
loading: true,
showSetChild: false,
showEditMore: false
}
},
methods: {
//部分入库
part(order_number, supplier_id) {
layer.open({
type: 2,
content: "{:U('WarehousingRecord/addWarehousing')}?order_number=" + order_number + "&supplier_id=" + supplier_id,
title: "部分入库",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: () => {
this.getData();
}
})
},
//更多搜索
moreEdit() {
this.showEditMore = !this.showEditMore;
if (this.showEditMore) {
$("#moreEditBox").animate({"height": "60px"}, 300, () => {
$("#moreEditBox").show();
});
} else {
$("#moreEditBox").animate({"height": "0px"}, 300, () => {
$("#moreEditBox").hide();
});
}
},
//搜索
search() {
this.currentPage = 1;
this.getData();
},
handleSizeChange(val) {
this.currentLimit = val;//切换每页数量
this.currentPage = 1;
this.getData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData();//切换页数
},
//查询
getData() {
this.loading = true;
$.ajax({
url: "{:U('purchaseOrderList')}",
type: "post",
data: {
page: this.currentPage,
limit: this.currentLimit,
order_number: this.order_number,
supplier_id: this.supplier_id,
warehouse_id: this.warehouse_id,
add_time: this.add_time,
type: this.type
},
success: (res) => {
this.purchaseOrderList = res.data.list;
this.loading = false;
this.$nextTick(() => {
this.currentLen = parseInt(res.data.count);
})
}
})
$.ajax({
url: "{:U('orderTotal')}",
type: "post",
data: {
order_number: this.order_number,
supplier_id: this.supplier_id,
warehouse_id: this.warehouse_id,
add_time: this.add_time,
type: this.type
},
success: (res) => {
this.TotalList = [];
this.TotalList = res.data;
}
})
},
addPurchaseOrder() {
layer.open({
type: 2,
content: "{:U('addPurchaseOrder')}",
title: "新增采购单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: () => {
this.getData();
}
})
},
//详情
OrderInfo(id, operator) {
layer.open({
type: 2,
content: "{:U('details')}?id=" + id + '&operator=' + operator,
title: "采购单详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
},
edit(id) {
layer.open({
type: 2,
content: "{:U('warehousing')}?id=" + id,
title: "编辑采购单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: () => {
this.getData();
}
})
},
//入库
warehousing(id) {
this.$confirm('是否将该采购单所有商品入库到供给仓, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.loading = true;
$.ajax({
url: "{:U('warehousingOperation')}",
type: "post",
data: {id: id},
success: (res) => {
if (res.status == 1) {
this.$message({
type: "success",
message: res.msg,
duration: 1000,
onClose: () => {
this.loading = false;
this.getData();
}
})
} else {
this.$message({
type: "error",
message: res.msg,
duration: 1000,
onClose: () => {
this.loading = false;
this.getData();
}
})
}
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消入库'
});
});
},
//导出
exportOperation() {
var order_number = this.order_number;
var supplier_id = this.supplier_id;
var warehouse_id = this.warehouse_id;
var add_time = this.add_time;
var type = this.type;
window.location.href = "{:U('export')}?order_number=" + order_number + "&supplier_id=" + supplier_id + "&warehouse_id=" + warehouse_id + "&add_time=" + add_time + "&type=" + type
}
},
created() {
this.getData();
}
})
</script>