lion 2 years ago
parent b21d14c72a
commit 8200ff1f15

@ -51,9 +51,19 @@ export const constantRoutes = [{
component: () => import('@/views/outbounds/index'),
hidden: true
},
// {
// path: '/inventorys',
// component: () => import('@/views/inventorys/index'),
// hidden: true
// },
{
path: '/inventorys',
component: () => import('@/views/inventorys/index'),
path: '/inventorys/stocks',
component: () => import('@/views/inventorys/stocks'),
hidden: true
},
{
path: '/inventorys/outbounds',
component: () => import('@/views/inventorys/outbounds'),
hidden: true
},
{

@ -21,7 +21,7 @@ if(window.location.origin.indexOf('localhost')>-1){
const service = axios.create({
baseURL: baseUrl, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 5000, // request timeout
timeout: 15000, // request timeout
isLoading:true
})

@ -61,6 +61,27 @@
</div>
</div>
</div>
</div>
<div class="box box1">
<div class="boxtitle">
<span>指定日期出入库</span>
<i class="el-icon-document statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontent">
<div class="boxcontentitem">
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{curtotal.ruku}}</span>
<span>入库</span>
</div>
<div class="boxcontentitem-small">
<span>{{curtotal.chuku}}</span>
<span>出库</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -76,7 +97,8 @@
},
totaldata: {
type: Object,
default: {
default: ()=>{
return {
"day": {
"ruku": 0,
"chuku": 0
@ -85,8 +107,22 @@
"ruku": 0,
"chuku": 0
},
"kucun":0
"kucun":0,
'current':{
"ruku": 0,
"chuku": 0
}
}
}
},
curtotal:{
type: Object,
default:()=>{
return {
'ruku':0,
'chuku':0
}
}
}
},
components: {

@ -1,20 +1,23 @@
<template>
<div>
<div>当前登录人{{user.name}}</div>
<div style='display: flex;justify-content: space-between;'>
<div>当前登录人{{user.name}}</div>
<div class="chart-title">
<!-- <span>出入库统计</span> -->
<el-date-picker @change="changeDate" v-model="dateRange" value-format="yyyy-MM-dd" type="daterange"
:picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right">
</el-date-picker>
</div>
</div>
<div class="statistics">
<panel-group :totaldata="list" />
<panel-group :totaldata="list" :curtotal='curTotal'/>
</div>
<div>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<div class="chart-title">
<span>出入库统计</span>
<el-date-picker @change="changeDate" v-model="dateRange" value-format="yyyy-MM-dd" type="daterange"
:picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
align="right">
</el-date-picker>
</div>
<line-chart :height="'500px'" :chartData="lineArr" />
</div>
</el-col>
@ -80,6 +83,10 @@
}]
},
list: {},
curTotal:{
ruku:0,
chuku:0
},
lineArr: {
xArr: [],
legendArr: ["入库", "出库"],
@ -121,6 +128,8 @@
that.lineArr.xArr = []
that.lineArr.series[0].data = []
that.lineArr.series[1].data = []
let curRukuTotal = 0
let curChukuTotal = 0
await stocksCharts({
start_time: this.start_time,
end_time: this.end_time
@ -128,7 +137,9 @@
for (var m of res) {
that.lineArr.xArr.push(m.date.split('-')[1] + "-" + m.date.split('-')[2]);
that.lineArr.series[0].data.push(m.total);
curRukuTotal+= parseInt(m.total)
}
that.curTotal.ruku = curRukuTotal
}).catch()
await outboundsCharts({
start_time: this.start_time,
@ -136,7 +147,9 @@
}).then((res) => {
for (var m of res) {
that.lineArr.series[1].data.push(m.total);
curChukuTotal+=parseInt(m.total)
}
that.curTotal.chuku = curChukuTotal
}).catch()
},
getNowDate() {

@ -122,7 +122,13 @@
list: [],
table: [{
type: 'selection'
}, {
}, {
label: '创建时间',
prop: 'created_at',
fixed: 'left',
width: 180,
},{
label: '序号',
type: 'index',
fixed: 'left',
@ -369,6 +375,10 @@
closeCode() {
this.$refs.qrCodeDiv.innerHTML = ""
this.showcode = false
},
search(){
this.select.pageIndex = 1
this.getindex()
},
async getindex() {
this.loading = true

@ -0,0 +1,294 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="出库明细" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <div class="selector-item">
<span class="selector-item__label">物资编码</span>
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="物资编码搜索" />
</div>
<div class="selector-item">
<span class="selector-item__label">资产名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="资产名称搜索" />
</div>
<Button type="primary" style="margin-left: 10px;" @click="getindex"></Button> -->
<Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" v-loading="loading" :total="total"
@pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" :table-item="table" :auths='[]'>
<template v-slot:btns >
<div></div>
<!-- <el-table-column v-if="isCkName=='仓库管理员'||roleName=='系统管理员'" fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorIn(scope.row.id,'editor')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteIn(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column> -->
</template>
</xy-table>
<imports :table-name="customForm.tableName" :form-info="form" ref="imports" @refresh="getindex"></imports>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
import imports from "@/views/component/imports.vue"
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {
getparameter
} from "@/api/system/dictionary";
import * as XLSX from "xlsx";
import {
saveAs
} from "file-saver";
import Cookies from 'js-cookie'
export default {
components: {
imports
},
data() {
return {
loading: false,
select: {
pageSize: 10,
pageIndex: 1,
keyword: "",
wzbm:'',
// is_export: 0,
},
showcode: false,
customForm: {
customFormId: 10,
tableName: "outbounds_items"
},
form: [],
total: 0,
list: [],
table: [ {
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
},
{
label: "物资编码",
width: 180,
prop: 'wuzibianma',
align: 'center',
},
{
label: "资产名称",
prop: 'zichanmingcheng',
align: 'center',
},
{
label: "规格型号",
prop: 'guigexinghao',
align: 'center',
width: 180,
},
{
label: "物资类型",
width: 120,
prop: 'wuzileixing',
align: 'center',
},
{
label: "计量单位",
width: 120,
prop: 'jiliangdanwei',
align: 'center',
},
{
label: "出库数量",
width: 120,
prop: 'jieyongshuliang',
},
{
label: "出库时间",
width: 180,
prop: 'created_at',
}
// {
// label: "",
// width: 180,
// prop: 'erweima',
// customFn: (row) => {
// return (<Button type='primary' size='small'
// on=
// {
// {
// ["click"]: (e) => (this.showCode(e, row))
// }
// }
// ></Button>)
// }
// },
]
}
},
mounted() {
this.getField()
this.getindex()
},
methods: {
async exportExcel(sheetName) {
const res = await index(Object.assign('', {
page: 1,
page_size: 9999,
table_name: this.customForm.tableName
}))
if (res.data) {
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: true,
type: 'array'
});
saveAs(new Blob([wbout], {
type: 'application/octet-stream'
}), `${sheetName}.xlsx`);
}
},
async getindex() {
this.loading = true
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: this.customForm.tableName,
// is_export:this.select.is_export,
filter: [{
"key": "wuzibianma",
"op": "like",
"value": this.select.wzbm,
},{
"key": "zichanmingcheng",
"op": "like",
"value": this.select.keyword,
},
],
})
this.list = res.data
this.total = res.total
this.loading = false
},
pageChange(e) {
this.select.pageIndex = e
this.getindex()
},
async getField() {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
try {
let custom_form = JSON.parse(decode)
this.customForm.customFormId = custom_form.custom_form_id
this.customForm.tableName = custom_form.table_name
console.log("123", this.customForm)
// this.select.table_name = custom_form.table_name
} catch (err) {
console.warn(err)
}
}
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if (res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({
id: i.parameter_id
}).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
},
}
}
</script>
<style scoped lang="scss">
.code {
position: absolute;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 9999
}
#qrCode {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>

@ -0,0 +1,335 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="入库明细" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <div class="selector-item">
<span class="selector-item__label">物资编码</span>
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="物资编码搜索" />
</div>
<div class="selector-item">
<span class="selector-item__label">资产名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="资产名称搜索" />
</div>
<Button type="primary" style="margin-left: 10px;" @click="getindex"></Button> -->
<Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" v-loading="loading" :total="total"
@pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" :table-item="table" :auths='[]'>
<template v-slot:btns >
<div></div>
<!-- <el-table-column v-if="isCkName=='仓库管理员'||roleName=='系统管理员'" fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorIn(scope.row.id,'editor')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteIn(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column> -->
</template>
</xy-table>
<imports :table-name="customForm.tableName" :form-info="form" ref="imports" @refresh="getindex"></imports>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
import imports from "@/views/component/imports.vue"
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {
getparameter
} from "@/api/system/dictionary";
import * as XLSX from "xlsx";
import {
saveAs
} from "file-saver";
import Cookies from 'js-cookie'
export default {
components: {
imports
},
data() {
return {
loading: false,
select: {
pageSize: 10,
pageIndex: 1,
keyword: "",
wzbm:'',
is_export: 0,
min: '',
max: '',
rmin: '',
rmax: ''
},
showcode: false,
customForm: {
customFormId: 11,
tableName: "stocks_item_links"
},
form: [],
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
},
{
label: "物资编码",
width: 180,
prop: 'wuzibianma',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.yuanshishuju?.wuzibianma){
return cell.yuanshishuju.wuzibianma
}else{
return value
}
}
},
{
label: "资产名称",
prop: 'zichanmingcheng',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.yuanshishuju?.zichanmingcheng){
return cell.yuanshishuju.zichanmingcheng
}else{
return value
}
}
},
{
label: "规格型号",
prop: 'guigexinghao',
align: 'center',
width: 180,
formatter: (cell, data, value, index) => {
if(cell.yuanshishuju?.guigexinghao){
return cell.yuanshishuju.guigexinghao
}else{
return value
}
}
},
{
label: "物资类型",
width: 120,
prop: 'wuzileixing',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.yuanshishuju?.wuzileixing){
return cell.yuanshishuju.wuzileixing
}else{
return value
}
}
},
{
label: "计量单位",
width: 120,
prop: 'jiliangdanwei',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.yuanshishuju?.jiliangdanwei){
return cell.yuanshishuju.jiliangdanwei
}else{
return value
}
}
},
{
label: "入库数量",
width: 120,
prop: 'rukushuliang',
formatter: (cell, data, value, index) => {
if(cell.yuanshishuju?.rukushuliang){
return cell.yuanshishuju.rukushuliang
}else{
return value
}
}
}
// {
// label: "",
// width: 180,
// prop: 'erweima',
// customFn: (row) => {
// return (<Button type='primary' size='small'
// on=
// {
// {
// ["click"]: (e) => (this.showCode(e, row))
// }
// }
// ></Button>)
// }
// },
]
}
},
mounted() {
this.getField()
this.getindex()
},
methods: {
async exportExcel(sheetName) {
const res = await index(Object.assign('', {
page: 1,
page_size: 9999,
table_name: this.customForm.tableName
}))
if (res.data) {
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: true,
type: 'array'
});
saveAs(new Blob([wbout], {
type: 'application/octet-stream'
}), `${sheetName}.xlsx`);
}
},
async getindex() {
this.loading = true
// let min = this.select.min?this.select.min:1
// let max = this.select.max?this.select.max:99999
// let rmin = this.select.rmin?this.select.rmin:1
// let rmax = this.select.rmax?this.select.rmax:99999
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: this.customForm.tableName,
is_export:this.select.is_export,
// filter: [{
// "key": "wuzibianma",
// "op": "like",
// "value": this.select.wzbm,
// },{
// "key": "zichanmingcheng",
// "op": "like",
// "value": this.select.keyword,
// }
// ],
})
this.list = res.data
this.total = res.total
this.loading = false
},
pageChange(e) {
this.select.pageIndex = e
this.getindex()
},
async getField() {
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
try {
let custom_form = JSON.parse(decode)
this.customForm.customFormId = custom_form.custom_form_id
this.customForm.tableName = custom_form.table_name
console.log("123", this.customForm)
// this.select.table_name = custom_form.table_name
} catch (err) {
console.warn(err)
}
}
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if (res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({
id: i.parameter_id
}).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
},
}
}
</script>
<style scoped lang="scss">
.code {
position: absolute;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 9999
}
#qrCode {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>

@ -102,16 +102,16 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>所在货架
</div>
<div class="xy-table-item-content">
<el-input v-model="form.suozaihuojia" placeholder="请填写所在货架" clearable style="width: 300px;"></el-input>
<!-- <el-select v-model="form.suozaihuojia" style="width: 300px;" placeholder="请选择所在货架">
<!-- <el-input v-model="form.suozaihuojia" placeholder="请填写所在货架" clearable style="width: 300px;"></el-input> -->
<el-select v-model="form.suozaihuojia" style="width: 300px;" placeholder="请选择所在货架">
<el-option
v-for="item in huojiaList"
:key="item.huojiamingcheng"
:label="item.huojiamingcheng"
:value="item.huojiamingcheng">
</el-option>
</el-select> -->
</el-select>
</div>
</div>
</template>
@ -300,7 +300,7 @@
},
created() {
this.getCangku()
// this.getHuojia()
this.getHuojia()
},
methods: {
//

@ -10,7 +10,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>采购合同
</div>
<div class="xy-table-item-content">
<el-input type="text" @focus="isShowHt=true" v-model="form.caigouhetong" placeholder="请选择采购合同"
<el-input type="text" clearable @focus="isShowHt=true" v-model="form.caigouhetong" placeholder="请选择采购合同"
style="width: 300px;"></el-input>
</div>
</div>
@ -21,7 +21,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>请示流程
</div>
<div class="xy-table-item-content">
<el-input type="text" @focus="isShowQs=true" v-model="form.qingshiliucheng" placeholder="请选择请示流程"
<el-input type="text" clearable @focus="isShowQs=true" v-model="form.qingshiliucheng" placeholder="请选择请示流程"
style="width: 300px;"></el-input>
</div>
</div>
@ -32,7 +32,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>应急采购请示
</div>
<div class="xy-table-item-content">
<el-input type="text" @focus="isShowYj=true" v-model="form.yingjicaigou" placeholder="请选择应急采购请示流程"
<el-input type="text" clearable @focus="isShowYj=true" v-model="form.yingjicaigou" placeholder="请选择应急采购请示流程"
style="width: 300px;"></el-input>
</div>
</div>

Loading…
Cancel
Save