mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
供应商管理、采购记录、报损记录、盘点记录
This commit is contained in:
parent
0a01cd95bd
commit
618979614a
@ -13,4 +13,15 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page-pagination{
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.cardBox{
|
||||
padding: 20px 20px 0;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||
margin-bottom: 15px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
81
resources/frontend/src/api/supplyChain.js
vendored
Normal file
81
resources/frontend/src/api/supplyChain.js
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
import http from "@/util/http.js"
|
||||
|
||||
export function getSupplier(params) {
|
||||
return http({
|
||||
url: "/api/supplier",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function removeSupplier(id) {
|
||||
return http({
|
||||
url: `/api/supplier/${id}`,
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
export function addSupplier(data) {
|
||||
return http({
|
||||
url: "/api/supplier",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateSupplier(id, data) {
|
||||
return http({
|
||||
url: `/api/supplier/${id}`,
|
||||
method: "patch",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getPurchaseLog(params) {
|
||||
return http({
|
||||
url: "/api/supplier/purchase_record",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getLossLog(params) {
|
||||
return http({
|
||||
url: "/api/supplier/loss_record",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function addLossLog(data) {
|
||||
return http({
|
||||
url: "/api/supplier/loss_record",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateLossLog(id, data) {
|
||||
return http({
|
||||
url: `/api/supplier/loss_record/${id}`,
|
||||
method: "patch",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDailyStock(params) {
|
||||
return http({
|
||||
url: "/api/supplier/daily_stock_record",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function addDailyStock(data) {
|
||||
return http({
|
||||
url: "/api/supplier/daily_stock_record",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
4
resources/frontend/src/main.js
vendored
4
resources/frontend/src/main.js
vendored
@ -7,7 +7,9 @@ import "element-ui/lib/theme-chalk/index.css";
|
||||
import "@/css/style.css";
|
||||
import "./router/main";
|
||||
|
||||
Vue.use(ElementUI);
|
||||
Vue.use(ElementUI, {
|
||||
size: 'small'
|
||||
});
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
new Vue({
|
||||
|
||||
28
resources/frontend/src/router/list.js
vendored
28
resources/frontend/src/router/list.js
vendored
@ -110,8 +110,28 @@ const list = [
|
||||
name: "销售数据",
|
||||
component: () => import("../views/dataCenter/salesReport.vue"),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
{
|
||||
path: "SUPPLIER_MANAGE",
|
||||
name: "供应商管理",
|
||||
component: () => import("../views/supplyChain/supplier.vue")
|
||||
},
|
||||
{
|
||||
path: "PURCHASE_RECORD",
|
||||
name: "采购记录",
|
||||
component: () => import("../views/supplyChain/procureLog.vue")
|
||||
},
|
||||
{
|
||||
path: "LOSS_RECORD",
|
||||
name: "报损记录",
|
||||
component: () => import("../views/supplyChain/lossRecord.vue")
|
||||
},
|
||||
{
|
||||
path: "DAILY_STOCK_RECORD",
|
||||
name: "每日盘点记录",
|
||||
component: () => import("../views/supplyChain/dailyStock.vue")
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default list;
|
||||
export default list
|
||||
|
||||
@ -3,17 +3,17 @@
|
||||
<el-container>
|
||||
<el-container>
|
||||
<el-aside :class="show ? 'aside-show' : 'aside-hide'">
|
||||
<el-menu router background-color="#282c34" text-color="#fff" :default-active="$route.path"
|
||||
<el-menu router background-color="#282c34" :unique-opened="true" text-color="#fff" :default-active="$route.path"
|
||||
:default-openeds="openeds">
|
||||
<div v-for="item in menu" :key="item.id">
|
||||
<el-menu-item :index="item.code" v-if="!item.children">
|
||||
<el-menu-item :index="'/' + item.code" v-if="!item.children">
|
||||
<span>{{ item.name }}</span>
|
||||
</el-menu-item>
|
||||
<el-submenu v-else :index="item.code">
|
||||
<el-submenu v-else :index="'/' + item.code">
|
||||
<template slot="title">
|
||||
<span>{{ item.name }}</span>
|
||||
</template>
|
||||
<el-menu-item :index="children.code" :key="children.id" v-for="children in item.children">{{
|
||||
<el-menu-item :index="'/' + children.code" :key="children.id" v-for="children in item.children">{{
|
||||
children.name }}
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
@ -58,13 +58,14 @@ export default {
|
||||
mounted() {
|
||||
getMenu().then((res) => {
|
||||
this.menu = res.data.data;
|
||||
console.log(this.menu)
|
||||
});
|
||||
this.usernmae = localStorage.getItem('userName');
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [], // 侧边栏
|
||||
show: true, // 导航栏折叠
|
||||
show: false, // 导航栏折叠
|
||||
levelData: [], // table导航栏
|
||||
titie: [], // 面包屑
|
||||
head: "", // 路由name
|
||||
@ -241,13 +242,11 @@ export default {
|
||||
.el-menu-item:hover {
|
||||
outline: 0 !important;
|
||||
background: #5470c6 !important;
|
||||
border-radius: 5px !important;
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
color: #fff !important;
|
||||
background: #5470c6 !important;
|
||||
border-radius: 5px !important;
|
||||
}
|
||||
|
||||
.el-menu-item-group__title {
|
||||
|
||||
222
resources/frontend/src/views/supplyChain/dailyStock.vue
Normal file
222
resources/frontend/src/views/supplyChain/dailyStock.vue
Normal file
@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<div class="pageBox">
|
||||
<div class="cardBox">
|
||||
<div class="searchBox">
|
||||
<div class="row">
|
||||
<span>sku标题:</span>
|
||||
<el-input v-model="filter.title" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品编号:</span>
|
||||
<el-input v-model="filter.external_sku_id" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>创建时间:</span>
|
||||
<el-date-picker
|
||||
v-model="addTime"
|
||||
type="datetimerange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 340px">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-card>
|
||||
<div class="opaBox">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
<el-button type="warning" icon="el-icon-upload2" @click="handleImport">导入</el-button>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="supplierList" style="width: 100%" border>
|
||||
<el-table-column prop="id" label="ID" width="80" align="center" />
|
||||
<el-table-column prop="goods_sku.title" label="商品标题" />
|
||||
<el-table-column prop="sku_id" label="skuID" />
|
||||
<el-table-column prop="day" label="日期" />
|
||||
<el-table-column prop="inventory" label="盘点库存" />
|
||||
<el-table-column prop="inventory_time" label="盘点时间" />
|
||||
</el-table>
|
||||
<div class="page-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
layout="prev, pager, next, jumper, sizes, total"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="新增" :visible.sync="dialogVisible" width="500px">
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="规格编码:">
|
||||
<el-input v-model="curInfo.external_sku_id" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点库存:">
|
||||
<el-input v-model="curInfo.inventory" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="commitSupplier" :loading="commitloading">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="导入" :visible.sync="showImport" width="500px">
|
||||
<div style="text-align: center;">
|
||||
<el-upload class="upload-demo" drag action="" :limit="1" :multiple="false"
|
||||
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||
:file-list="fileList" :auto-upload="false" :on-change="importFileChange" :on-remove="fileRemove">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showImport = false">取 消</el-button>
|
||||
<el-button type="primary" @click="commitUpload" :loading="commitloading">上 传</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDailyStock, addDailyStock } from "@/api/supplyChain"
|
||||
import axios from "axios"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
supplierList: [],
|
||||
dialogVisible: false,
|
||||
curInfo: {},
|
||||
commitloading: false,
|
||||
filter: {
|
||||
title: '',
|
||||
external_sku_id: ''
|
||||
},
|
||||
addTime: [],
|
||||
showImport: false,
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
let params = {
|
||||
page: this.page,
|
||||
per_page: this.pageSize,
|
||||
...this.filter,
|
||||
start_time: this.addTime ? this.addTime[0] : '',
|
||||
end_time: this.addTime ? this.addTime[1] : ''
|
||||
}
|
||||
getDailyStock(params).then((res) => {
|
||||
this.supplierList = res.data.data
|
||||
this.total = res.data.meta.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page = 1
|
||||
this.pageSize = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleSearch() {
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
},
|
||||
// 新增供应商
|
||||
handleAdd() {
|
||||
this.curInfo = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
commitSupplier() {
|
||||
this.commitloading = true
|
||||
addDailyStock(this.curInfo).then((res) => {
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
this.$message({ type: "success", message: "新增成功!" })
|
||||
this.dialogVisible = false
|
||||
this.commitloading = false
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
},
|
||||
handleImport() {
|
||||
this.fileList = []
|
||||
this.showImport = true
|
||||
},
|
||||
importFileChange(file, fileList) {
|
||||
console.log(fileList)
|
||||
this.fileList = fileList
|
||||
},
|
||||
fileRemove() {
|
||||
this.fileList = []
|
||||
},
|
||||
commitUpload() {
|
||||
if(this.fileList.length) {
|
||||
this.commitloading = true
|
||||
const params = new FormData();
|
||||
params.append("inventoryFile", this.fileList[0].raw)
|
||||
let token = localStorage.getItem("token")
|
||||
axios.post("/api/daily_stock_record/purchase_import", params, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.$message.success("导入成功")
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
this.commitloading = false
|
||||
this.showImport = false
|
||||
} else {
|
||||
this.commitloading = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
} else {
|
||||
this.$message.error("请先上传文件")
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
white-space: nowrap;
|
||||
.row{
|
||||
font-size: 14px;
|
||||
margin-bottom: 20px;
|
||||
margin-right: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.opaBox{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
254
resources/frontend/src/views/supplyChain/lossRecord.vue
Normal file
254
resources/frontend/src/views/supplyChain/lossRecord.vue
Normal file
@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<div class="pageBox">
|
||||
<div class="cardBox">
|
||||
<div class="searchBox">
|
||||
<div class="row">
|
||||
<span>sku标题:</span>
|
||||
<el-input v-model="filter.title" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品编号:</span>
|
||||
<el-input v-model="filter.external_sku_id" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>创建时间:</span>
|
||||
<el-date-picker
|
||||
v-model="addTime"
|
||||
type="datetimerange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 340px">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-card>
|
||||
<div class="opaBox">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
<el-button type="warning" icon="el-icon-upload2" @click="handleImport">导入</el-button>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="supplierList" style="width: 100%" border>
|
||||
<el-table-column prop="id" label="ID" width="80" align="center" />
|
||||
<el-table-column prop="goods_sku.title" label="商品标题" />
|
||||
<el-table-column prop="sku_id" label="skuID" />
|
||||
<el-table-column prop="external_sku_id" label="规格编码" />
|
||||
<el-table-column prop="num" label="数量" />
|
||||
<el-table-column prop="cost" label="成本" />
|
||||
<el-table-column prop="buyer_name" label="采购人姓名" />
|
||||
<el-table-column prop="reason" label="报损原因" />
|
||||
<el-table-column prop="created_at" label="创建时间" align="center" />
|
||||
<el-table-column label="操作" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" @click="handleEdit(scope.row)" icon="el-icon-edit" size="mini">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="page-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
layout="prev, pager, next, jumper, sizes, total"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="curInfo.id ? '编辑' : '新增供应商'" :visible.sync="dialogVisible" width="500px">
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="规格编码">
|
||||
<el-input v-model="curInfo.external_sku_id" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量">
|
||||
<el-input v-model="curInfo.num" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="成本">
|
||||
<el-input v-model="curInfo.cost" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购人">
|
||||
<el-input v-model="curInfo.buyer_name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报损原因">
|
||||
<el-input v-model="curInfo.reason" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="commitSupplier" :loading="commitloading">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="导入" :visible.sync="showImport" width="500px">
|
||||
<div style="text-align: center;">
|
||||
<el-upload class="upload-demo" drag action="" :limit="1" :multiple="false"
|
||||
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||
:file-list="fileList" :auto-upload="false" :on-change="importFileChange" :on-remove="fileRemove">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="showImport = false">取 消</el-button>
|
||||
<el-button type="primary" @click="commitUpload" :loading="commitloading">上 传</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLossLog, addLossLog, updateLossLog } from "@/api/supplyChain"
|
||||
import axios from "axios"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
supplierList: [],
|
||||
dialogVisible: false,
|
||||
curInfo: {},
|
||||
commitloading: false,
|
||||
filter: {
|
||||
title: '',
|
||||
external_sku_id: ''
|
||||
},
|
||||
addTime: [],
|
||||
showImport: false,
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
let params = {
|
||||
page: this.page,
|
||||
per_page: this.pageSize,
|
||||
...this.filter,
|
||||
start_time: this.addTime ? this.addTime[0] : '',
|
||||
end_time: this.addTime ? this.addTime[1] : ''
|
||||
}
|
||||
getLossLog(params).then((res) => {
|
||||
this.supplierList = res.data.data
|
||||
this.total = res.data.meta.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page = 1
|
||||
this.pageSize = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleSearch() {
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
},
|
||||
// 新增供应商
|
||||
handleAdd() {
|
||||
this.curInfo = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.curInfo = JSON.parse(JSON.stringify(row))
|
||||
this.dialogVisible = true
|
||||
},
|
||||
commitSupplier() {
|
||||
this.commitloading = true
|
||||
if(this.curInfo.id) {
|
||||
updateLossLog(this.curInfo.id, this.curInfo).then((res) => {
|
||||
this.fetchList()
|
||||
this.$message({ type: "success", message: "更新成功!" })
|
||||
this.dialogVisible = false
|
||||
this.commitloading = false
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
} else {
|
||||
addLossLog(this.curInfo).then((res) => {
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
this.$message({ type: "success", message: "新增成功!" })
|
||||
this.dialogVisible = false
|
||||
this.commitloading = false
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
handleImport() {
|
||||
this.fileList = []
|
||||
this.showImport = true
|
||||
},
|
||||
importFileChange(file, fileList) {
|
||||
console.log(fileList)
|
||||
this.fileList = fileList
|
||||
},
|
||||
fileRemove() {
|
||||
this.fileList = []
|
||||
},
|
||||
commitUpload() {
|
||||
if(this.fileList.length) {
|
||||
this.commitloading = true
|
||||
const params = new FormData();
|
||||
params.append("lossFile", this.fileList[0].raw)
|
||||
let token = localStorage.getItem("token")
|
||||
axios.post("/api/supplier/loss_record/loss_import", params, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.$message.success("导入成功")
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
this.commitloading = false
|
||||
this.showImport = false
|
||||
} else {
|
||||
this.commitloading = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
} else {
|
||||
this.$message.error("请先上传文件");
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
white-space: nowrap;
|
||||
.row{
|
||||
font-size: 14px;
|
||||
margin-bottom: 20px;
|
||||
margin-right: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.opaBox{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
132
resources/frontend/src/views/supplyChain/procureLog.vue
Normal file
132
resources/frontend/src/views/supplyChain/procureLog.vue
Normal file
@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<div class="pageBox">
|
||||
<div class="cardBox">
|
||||
<div class="searchBox">
|
||||
<div class="row">
|
||||
<span>sku标题:</span>
|
||||
<el-input v-model="filter.title" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品编号:</span>
|
||||
<el-input v-model="filter.external_sku_id" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>创建时间:</span>
|
||||
<el-date-picker
|
||||
v-model="addTime"
|
||||
type="datetimerange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 340px">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">筛选</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="procureList" style="width: 100%" border>
|
||||
<el-table-column prop="sku_id" label="商品id" width="80" align="center" />
|
||||
<el-table-column prop="goods_sku.title" label="商品标题" />
|
||||
<el-table-column prop="external_sku_id" label="商品编号" />
|
||||
<el-table-column prop="num" label="采购数量" />
|
||||
<el-table-column prop="cost" label="采购成本" />
|
||||
<el-table-column prop="buyer_name" label="采购人名称" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
<el-table-column prop="expire_time" label="保质期时间" />
|
||||
<el-table-column prop="supplier_name" label="供应商">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.supplier_name">{{ scope.row.supplier_name }}({{scope.row.supplier_id}})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_at" label="创建时间" align="center" />
|
||||
</el-table>
|
||||
<div class="page-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-sizes="[15, 30, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
layout="prev, pager, next, jumper, sizes, total"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPurchaseLog } from "@/api/supplyChain"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
page: 1,
|
||||
pageSize: 15,
|
||||
total: 0,
|
||||
procureList: [],
|
||||
filter: {
|
||||
title: '',
|
||||
external_sku_id: ''
|
||||
},
|
||||
addTime: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
let params = {
|
||||
page: this.page,
|
||||
per_page: this.pageSize,
|
||||
...this.filter,
|
||||
start_time: this.addTime ? this.addTime[0] : '',
|
||||
end_time: this.addTime ? this.addTime[1] : ''
|
||||
}
|
||||
getPurchaseLog(params).then((res) => {
|
||||
this.procureList = res.data.data
|
||||
this.total = res.data.meta.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page = 1
|
||||
this.pageSize = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleSearch() {
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
white-space: nowrap;
|
||||
.row{
|
||||
font-size: 14px;
|
||||
margin-bottom: 20px;
|
||||
margin-right: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
161
resources/frontend/src/views/supplyChain/supplier.vue
Normal file
161
resources/frontend/src/views/supplyChain/supplier.vue
Normal file
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div class="pageBox">
|
||||
<el-card>
|
||||
<div class="opaBox">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="supplierList" style="width: 100%" border>
|
||||
<el-table-column prop="id" label="供应商ID" width="80" align="center" />
|
||||
<el-table-column prop="supplier_name" label="供应商名称" />
|
||||
<el-table-column prop="company_name" label="供应商ID" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column prop="link_tel" label="联系方式" align="center" />
|
||||
<el-table-column prop="payment_account" label="支付账户" />
|
||||
<el-table-column prop="agent_name" label="代理名称" />
|
||||
<el-table-column prop="agent_id" label="代理人id" />
|
||||
<el-table-column prop="created_at" label="创建时间" align="center" />
|
||||
<el-table-column label="操作" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" @click="handleEdit(scope.row)" icon="el-icon-edit" size="mini">编辑</el-button>
|
||||
<el-button type="danger" @click="handleRemove(scope.row.id)" icon="el-icon-delete" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="page-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
layout="prev, pager, next, jumper, sizes, total"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="gysInfo.id ? '编辑' : '新增供应商'" :visible.sync="dialogVisible" width="500px">
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="gysInfo.supplier_name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司名称">
|
||||
<el-input v-model="gysInfo.company_name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址">
|
||||
<el-input v-model="gysInfo.address" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式">
|
||||
<el-input v-model="gysInfo.link_tel" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式">
|
||||
<el-input v-model="gysInfo.payment_account" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="代理人名称">
|
||||
<el-input v-model="gysInfo.agent_name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="commitSupplier" :loading="commitloading">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSupplier, removeSupplier, addSupplier, updateSupplier } from "@/api/supplyChain"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
supplierList: [],
|
||||
dialogVisible: false,
|
||||
gysInfo: {},
|
||||
commitloading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
let params = {
|
||||
page: this.page,
|
||||
per_page: this.pageSize
|
||||
}
|
||||
getSupplier(params).then((res) => {
|
||||
this.supplierList = res.data.data
|
||||
this.total = res.data.meta.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page = 1
|
||||
this.pageSize = val
|
||||
this.fetchList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page = val
|
||||
this.fetchList()
|
||||
},
|
||||
// 新增供应商
|
||||
handleAdd() {
|
||||
this.gysInfo = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.gysInfo = JSON.parse(JSON.stringify(row))
|
||||
this.dialogVisible = true
|
||||
},
|
||||
commitSupplier() {
|
||||
this.commitloading = true
|
||||
if(this.gysInfo.id) {
|
||||
updateSupplier(this.gysInfo.id, this.gysInfo).then((res) => {
|
||||
this.fetchList()
|
||||
this.$message({ type: "success", message: "更新成功!" })
|
||||
this.dialogVisible = false
|
||||
this.commitloading = false
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
} else {
|
||||
addSupplier(this.gysInfo).then((res) => {
|
||||
this.page = 1
|
||||
this.fetchList()
|
||||
this.$message({ type: "success", message: "新增成功!" })
|
||||
this.dialogVisible = false
|
||||
this.commitloading = false
|
||||
}).catch(() => {
|
||||
this.commitloading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
handleRemove(id) {
|
||||
this.$confirm("确定删除此条信息吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
removeSupplier(id).then(() => {
|
||||
this.fetchList()
|
||||
this.$message({ type: "success", message: "删除成功!" })
|
||||
this.dialogVisible = false
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.opaBox{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user