master
lion 4 months ago
parent 7bd53b71aa
commit 1ef6e21c06

@ -7,5 +7,11 @@ VUE_APP_OA_URL= http://192.168.60.18:8001
VUE_APP_OA_URL_TYPE = '{"采购入库":51,"请示入库":54,"调拨入库":55,"领用出库":56,"处置出库":57,"调拨出库":53}'
#正式
#VUE_APP_BASE_API = http://192.168.60.99:9004/
#VUE_APP_UPLOAD_API = http://192.168.60.99:9004/api/admin/upload-file
# 正式oa
VUE_APP_OA_URL = http://192.168.60.18:2021
VUE_APP_OA_URL_TYPE = '{"采购入库":51,"请示入库":54,"调拨入库":55,"领用出库":56,"处置出库":57,"调拨出库":53}'

@ -53,21 +53,26 @@
var guige = printObj['wuzibianma_material_infos_wuzibianma_relation']['wuziguige']?printObj['wuzibianma_material_infos_wuzibianma_relation']['wuziguige']:''
var xinghao = printObj['wuzibianma_material_infos_wuzibianma_relation']['guigexinghao']?printObj['wuzibianma_material_infos_wuzibianma_relation']['guigexinghao']:""
var shunxuhao = printObj['shunxuhao']?"-"+printObj['shunxuhao']:''
var stocks_items = printObj['stocks_items']&&printObj['stocks_items'].length>0?printObj['stocks_items'][0]:''
var chanquan = stocks_items.chanquanxinxi_detail?stocks_items.chanquanxinxi_detail.value:'市河道处'
var gudingzichanbianma = printObj['gudingzichanbianma']? printObj['gudingzichanbianma']:''
$(".wrap").append("<li id='page" + index + "' style='width: 9cm; height: 5cm;font-size: 16px;font-weight:bold;background-color: #fff;'>" +
"<p style='text-align:center;margin-bottom:0;padding-top:5px;'>苏州河道处</p>"+
"<p style='text-align:center;margin-bottom:0;padding-top:5px;'><span style='text-align:left;display:inline-block;width:2cm'>"+printDate+"</span>"+
"<span style='text-align:left;display:inline-block;width:2cm'>"+chanquan+"</span></p>"+
"<div style='padding:5px 15px;'>"+
"<img src='"+printObj['path']+"' style='width:3cm; height:3cm;display: inline-block'>"+
"<div style='display:inline-block;vertical-align: top;width:170px'>"+
"<p style='margin:0'>类别:"+printObj['material_info_type']+"</p>"+
"<p style='margin:0'>规格:"+guige+"</p>"+
"<p style='margin:0'>型号:"+xinghao+"</p>"+
"<p style='margin:0'>批次:"+printObj['rukupici']+"</p>"+
"<p style='margin:0'>数量:"+printObj['zaikushuliang']+shunxuhao+"</p>"+
"<p style='margin:0'><span>批次:"+printObj['rukupici']+"</span><span>数量:</span>"+printObj['total_num']+"</p>"+
"<p style='margin:0'>批内序号:"+shunxuhao+"</p>"+
"</div>"+
"</div>"+
"<p style='padding:15px;padding-top:0;margin:0;text-align:left'>"+printDate+"</p>"+
"</li>")
"<p style='padding:15px;padding-top:0;margin:0;text-align:left'>"+gudingzichanbianma?'固定资产编码:'+gudingzichanbianma:''"</p>"+
"</li>")
// createCode("#page" + index, printObj)
$(".load").remove()
},

@ -271,7 +271,12 @@ export default {
await index({
page: 1,
page_size: 9999,
table_name: 'teams'
table_name: 'teams',
filter:[{
'key':'duiwushuxing',
'op':'eq',
'value':'自管队伍'
}]
}).then(res => {
const markers = []
if (res.data.length < 1) {

@ -8,14 +8,14 @@
<el-cascader v-model="wuzifenlei" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 60%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
<el-input
<!-- <el-input
v-model="wuzibianmakeyword"
style="margin-right:10px"
clearable
type="text"
placeholder="请输入种类编码查找库存"
@keyup.enter.native="getWuzi"
/>
/> -->
<el-input
v-model="wuzimingchengkeyword"
style="margin-right:10px"
@ -66,6 +66,7 @@ export default {
data() {
return {
//
isHuiku:false,
showLoading: false,
loadingtable:false,
isShowWuzi: false,
@ -112,15 +113,20 @@ export default {
params.row.wuzibianma_material_infos_wuzibianma_relation.fenlei_detail.name:'') : '')
])
}
}, {
title: '种类编码',
key: 'wuzibianma'
}, {
},
// {
// title: '',
// key: 'wuzibianma'
// },
{
title: '在库数量',
key: 'zaikushuliang'
}, {
title: '入库批次',
key: 'rukupici'
}, {
title: '批内序号',
key: 'shunxuhao'
}, {
title: '物资类型',
key: 'wuzileixing'
@ -145,6 +151,7 @@ export default {
this.wzList = []
this.loadingtable = false
this.wuziPageIndex = 1
this.isHuiku = false
}
}
},
@ -201,8 +208,12 @@ export default {
}]
})
console.log("res.list.data",res.list.data)
let arr = this.processInventoryData(res.list.data)
console.log("res.list.data",res.list.data)
let arr = res.list.data
if(!this.isHuiku){
let arr = this.processInventoryData(res.list.data)
}
for (var m of arr) {
m.isSelect = false
}

@ -6,8 +6,8 @@
<el-cascader v-model="select.fenlei" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 20%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
<el-input v-model="select.wuzibianma" style="margin-right:10px;flex-basis: 20%;" clearable type="text" placeholder="请输入种类编码查找库存"
@keyup.enter.native="getWuzi" />
<!-- <el-input v-model="select.wuzibianma" style="margin-right:10px;flex-basis: 20%;" clearable type="text" placeholder="请输入种类编码查找库存"
@keyup.enter.native="getWuzi" /> -->
<el-input v-model="select.zichanmingcheng" style="margin-right:10px;flex-basis: 20%;" clearable type="text" placeholder="请输入物资名称查找"
@keyup.enter.native="getWuzi" />
<el-button type="primary" @click="getWuzi"></el-button>
@ -84,10 +84,12 @@
.fenlei_material_info_types_id_relation.name : '')
])
}
}, {
title: '种类编码',
key: 'wuzibianma'
}, {
},
// {
// title: '',
// key: 'wuzibianma'
// },
{
title: '物资类型',
key: 'wuzileixing'
}, {

@ -10,7 +10,7 @@
:rules="rules"
@submit="submit"
>
<template v-slot:wuzibianma>
<!-- <template v-slot:wuzibianma>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />种类编码
@ -21,7 +21,7 @@
</div>
</div>
</div>
</template>
</template> -->
<template v-slot:zichanmingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -53,7 +53,7 @@
</div>
<div class="xy-table-item-content">
<div style="width:300px">
{{ form.wuzibianma }}
{{ form.wuzileixing }}
</div>
</div>
</div>

@ -5,18 +5,52 @@
<lx-header icon="md-apps" :text="$route.meta.title" 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">
<!-- <div class="selector-item">
<span class="selector-item__label">种类编码</span>
<el-input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" />
</div>
</div> -->
<div class="selector-item">
<span class="selector-item__label">物资名称</span>
<el-input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" />
</div>
<div>
<el-cascader v-model="select.fenlei" ref="cascaders" clearable popper-class="select_popper"
<div class="selector-item">
<el-cascader v-model="select.fenlei" placeholder="请选择所属种类" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 20%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
</div>
<div class="selector-item">
<el-select clearable v-model="select.suozaicangku" style="width:100%" placeholder="请选择所在仓库">
<el-option v-for="item in cangkuList" :key="item.id" :label="item.cangkumingcheng" :value="item.id" />
</el-select>
</div>
<div class="selector-item">
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.rukuriqi" placeholder="请选择入库日期"></el-date-picker>
</div>
<div class="selector-item">
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.rukuriqi" placeholder="请选择生产日期"></el-date-picker>
</div>
<div class="selector-item">
<el-select clearable v-model="select.wuzizhuangtai" style="width:100%" placeholder="请选择物资状态">
<el-option v-for="item in paraOptions.materials_status" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</div>
<div class="selector-item">
<el-select clearable v-model="select.chanquanxinxi" style="width:100%" placeholder="请选择产权信息">
<el-option v-for="item in paraOptions.materials_property" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</div>
<div class="selector-item">
<el-select clearable v-model="select.chubeifangshi" style="width:100%" placeholder="请选择储备方式">
<el-option v-for="item in paraOptions.material_reserve" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</div>
<div class="selector-item">
<el-select clearable v-model="select.dengjifenlei" style="width:100%" placeholder="请选择等级分类">
<el-option v-for="item in paraOptions.dengjifenlei" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</div>
<!-- <div class="selector-item">
<span class="selector-item__label">入库数量</span>
@ -51,7 +85,16 @@
</template>
</template>
</el-table-column>
</template> -->
</template> -->
<template v-slot:shifouweigudingzichan>
<el-table-column
align="center" label="操作" width="120" header-align="center">
<template slot-scope="scope">
123
</template>
</el-table-column>
</template>
<template v-slot:btns>
<!-- <div></div> -->
<el-table-column v-if="isPandian==='pandian' && (isCkName==''||roleName=='')" fixed="right"
@ -81,11 +124,15 @@
<script>
import {
index,
destroy
destroy,
save
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
} from '@/api/fenlei.js'
import {
index as baseFormIndex
} from '@/api/system/baseForm.js'
import {
getInfo
} from '@/api/user.js'
@ -105,7 +152,10 @@
import {
saveAs
} from 'file-saver'
import Cookies from 'js-cookie'
import Cookies from 'js-cookie'
import {
getparameteritemMore
} from '@/api/system/dictionary.js'
export default {
components: {
imports,
@ -119,14 +169,29 @@
roleName: '',
isCkName: '',
isPandian: '',
fenleiList:[],
fenleiList:[],
cangkuList:[],
paraOptions: {
'materials_status': [],
'material_reserve': [],
'materials_property': [],
'materials_level': []
// 'materials_fenlei':[],
},
select: {
pageSize: 40,
pageIndex: 1,
keyword: '',
wzbm: '',
fenlei:'',
is_export: 0,
is_export: 0,
wuzizhuangtai:'',
chanquanxinxi:'',
chubeifangshi:'',
suozaicangku:'',
rukuriqi:'',
shengchanriqi:'',
dengjifenlei:'',
min: '',
max: '',
rmin: '',
@ -147,28 +212,46 @@
fixed: 'left'
},
{
label: '基础信息',
label: '物资信息',
align: 'left',
prop: 'wuzibianma_material_infos_wuzibianma_relation',
multiHd: [{
multiHd: [
{
label: '一级分类',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.material_info_type',
align: 'center',
formatter: (cell, data, value) => {
return value ? value.split("-")[0] : ''
}
},
{
label: '二级分类',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.material_info_type',
align: 'center',
formatter: (cell, data, value) => {
return value ? (value.split("-").length>1?value.split("-")[1]:value.split("-")[0]) : ''
}
},
{
label: '所属种类',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.fenlei_detail.name',
align: 'center'
},{
label: '物资名称',
prop: 'zichanmingcheng',
align: 'center',
width: 180,
fixed: 'left'
},
{
label: '所属种类',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.fenlei_detail.name',
align: 'center'
},
{
label: '种类编码',
width: 120,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资类型',
width: 120,
@ -193,25 +276,6 @@
width: 120,
prop: 'jiliangdanwei',
align: 'center'
}, {
label: '储备年限',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.chubeinianxian'
}, {
label: '存放要求',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.cunfangyaoqiu'
},
{
label: '维护要求',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.weihuyaoqiu'
},
{
label: '保养频次',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.equipment_maintain_config.name'
}
]
},
@ -230,9 +294,19 @@
prop: 'zaikushuliang',
customFn: (row) => {
console.log("row",row)
return (<span>{row.row.zaikushuliang}{row.row.jiliangdanwei?row.row.jiliangdanwei:''}{row.row.shunxuhao?'-'+row.row.shunxuhao:''}</span>)
return (<span>{row.row.zaikushuliang}{row.row.jiliangdanwei?row.row.jiliangdanwei:''}</span>)
}
},
{
label: '顺序号',
width: 180,
prop: 'shunxuhao',
customFn: (row) => {
console.log("row",row)
return (<span>{row.row.shunxuhao?row.row.shunxuhao:''}</span>)
}
},
{
label: '待出库',
width: 120,
@ -283,11 +357,183 @@
label: '产权信息',
width: 120,
prop: 'stocks_items_info.chanquanxinxi_detail.value'
}
]
}, {
label: '储备年限',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.chubeinianxian'
}, {
label: '存放要求',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.cunfangyaoqiu'
},
{
label: '维护要求',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.weihuyaoqiu'
},
{
label: '保养频次',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.equipment_maintain_config.name'
},{
label: '是否为固定资产',
width: 120,
prop: 'shifouweigudingzichan',
customFn: (scope) => {
return h(
'el-popover',
{
props: {
title: '请选择',
placement: 'bottom-start',
width: 250
}
},
[
h(
'el-select',
{
style: { width: '100%' },
props: {
value: scope.row.shifouweigudingzichan,
placeholder: '请选择',
clearable:true
},
on: {
input: val => {
scope.row.shifouweigudingzichan = val;
}
}
},
[{id:'是',value:'是'},{id:'否',value:'否'}].map(item => {
return h(
'el-option',
{
props: {
value: item.id,
label: item.name
}
}
);
})
),
h(
'div',
{
style: { textAlign: 'right', marginTop: '5px' }
},
[
h(
'el-button',
{
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
//
this.updateGd(scope.row.id,scope.row.shifouweigudingzichan)
}
}
},
'确认'
)
]
),
h(
'div',
{
slot: 'reference'
},
[
h('span', scope.row.shifouweigudingzichan ? scope.row.shifouweigudingzichan : ''),
h('i', { class: 'el-icon-edit' })
]
)
]
);
}
},{
label: '固定资产编码',
width: 120,
prop: 'gudingzichanbianma',
customFn: (scope) => {
return h(
'el-popover',
{
props: {
title: '请输入',
placement: 'bottom-start',
width: 250
}
},
[
h(
'el-input',
{
style: { width: '100%' },
props: {
value: scope.row.gudingzichanbianma,
},
on: {
input: val => {
scope.row.gudingzichanbianma = val;
}
}
},
),
h(
'div',
{
style: { textAlign: 'right', marginTop: '5px' }
},
[
h(
'el-button',
{
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
//
this.updateGdbm(scope.row.id,scope.row.gudingzichanbianma)
}
}
},
'确认'
)
]
),
h(
'div',
{
slot: 'reference'
},
[
h('span', scope.row.gudingzichanbianma ? scope.row.gudingzichanbianma : ''),
h('i', { class: 'el-icon-edit' })
]
)
]
);
}
}]
}
],
],
// <el-form-item label="" prop="shifouweigudingzichan">
// <el-select v-model="formData.chanquanxinxi" :disabled="hasPici" style="width:100%" placeholder="">
// <el-option v-for="item in [{id:'',value:''},{id:'',value:''}]" :key="item.id" :label="item.value"
// :value="item.id" />
// </el-select>
// </el-form-item>
// <el-form-item label="" prop="gudingzichanbianma">
// <el-input v-model="formData.gudingzichanbianma"/>
// </el-form-item>
printObj: [],
printArr: [],
// selection
@ -305,11 +551,70 @@
}
}
this.getFenlei()
this.getField()
this.getField()
this.getCangku()
this.getindex()
this.getUserName()
this.getUserName()
this.getData()
},
methods: {
methods: {
async updateGd(id,value){
const res = await save({
id:id,
'shifouweigudingzichan':value
})
Message({
type: 'success',
message: '更新成功'
})
this.getindex()
},
async updateGdbm(id,value){
const res = await save({
id:id,
'gudingzichanbianma':value
})
Message({
type: 'success',
message: '更新成功'
})
this.getindex()
},
//
async getCangku() {
const res = await baseFormIndex({
page_size: 999,
page: 1,
table_name: 'materialstorages',
sort_name: 'sort',
sort_type: 'ASC',
filter: [{
key: 'shifouzili',
op: 'eq',
value: '是'
}]
})
this.cangkuList = res.data
},
//
async getData() {
const res = await getparameteritemMore({
'number[0]': 'materials_status', //
'number[1]': 'material_reserve', //
'number[2]': 'materials_property', //
'number[3]': 'materials_level' //
// 'number[4]':'materials_fenlei', //
})
for (var k in this.paraOptions) {
res.map(item => {
if (item.number === k) {
this.paraOptions[k] = item.detail
}
})
}
console.log(this.paraOptions)
},
// filterSpans
getSpanArr(data) {
//
@ -497,27 +802,36 @@
table_name: 'inventorys',
sort_type: 'DESC',
sort_name: 'wuzibianma',
fenlei:this.select.fenlei,
fenlei:this.select.fenlei,
wuzizhuangtai:this.select.wuzizhuangtai,
chanquanxinxi:this.select.chanquanxinxi,
chubeifangshi:this.select.chubeifangshi,
suozaicangku:this.select.suozaicangku,
rukuriqi:this.select.rukuriqi,
shengchanriqi:this.select.shengchanriqi,
dengjifenlei:this.select.dengjifenlei,
// is_export:this.select.is_export,
filter: [{
'key': 'wuzibianma',
'op': 'like',
'value': this.select.wzbm
}, {
filter: [
// {
// 'key': 'wuzibianma',
// 'op': 'like',
// 'value': this.select.wzbm
// },
{
'key': 'zichanmingcheng',
'op': 'like',
'value': this.select.keyword
},
{
'key': 'rukushuliang',
'op': 'range',
'value': rmin + ',' + rmax
},
{
'key': 'zaikushuliang',
'op': 'range',
'value': min + ',' + max
}
// {
// 'key': 'rukushuliang',
// 'op': 'range',
// 'value': rmin + ',' + rmax
// },
// {
// 'key': 'zaikushuliang',
// 'op': 'range',
// 'value': min + ',' + max
// }
]
})
//
@ -629,7 +943,10 @@
height: 100%;
z-index: 9999
}
.selector-item{
margin-right:10px;
margin-bottom:5px;
}
#qrCode {
position: absolute;
top: 50%;

@ -5,10 +5,10 @@
<lx-header icon="md-apps" :text="$route.meta.title" 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">
<!-- <div class="selector-item">
<span class="selector-item__label">种类编码</span>
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" />
</div>
</div> -->
<div class="selector-item">
<span class="selector-item__label">物资名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" />
@ -165,12 +165,12 @@ export default {
prop: 'outbounds_jilurenyuan',
width: 180
},
{
label: '种类编码',
width: 180,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 180,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资名称',
prop: 'zichanmingcheng',

@ -5,10 +5,10 @@
<lx-header icon="md-apps" :text="$route.meta.title" 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">
<!-- <div class="selector-item">
<span class="selector-item__label">种类编码</span>
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" />
</div>
</div> -->
<div class="selector-item">
<span class="selector-item__label">物资名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" />
@ -152,16 +152,16 @@
prop: 'stocks_jingbanren',
width: 120,
},
{
label: '记录人员',
prop: 'stocks_jilurenyuan',
width: 120,
},
{
label: '保管人员',
prop: 'stocks_baoguanrenyuan',
width: 120,
},
// {
// label: '',
// prop: 'stocks_jilurenyuan',
// width: 120,
// },
// {
// label: '',
// prop: 'stocks_baoguanrenyuan',
// width: 120,
// },
{
label: '物资名称',
prop: 'zichanmingcheng',
@ -174,12 +174,12 @@
align: 'center',
width: 120
},
{
label: '种类编码',
width: 120,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资类型',

@ -1,5 +1,6 @@
<template>
<div class="jsc" :style="bgStyle">
<div class="jsc" :style="bgStyle">
<div class="jsc-view" @click="toLeader"></div>
<div class="jscC">
<div class="jscC-top">
<div v-for="item in topObj">
@ -108,7 +109,7 @@
label: '仓库数量',
value: 0,
id: 'cangku_count',
unit: ''
unit: ''
}, {
label: '物资种类',
value: 0,
@ -162,7 +163,7 @@
path: '/stocks/index_purchase'
}, {
label: '出库管理',
path: '/outbounds/index_receive'
path: '/outbounds/index'
}, {
label: '统计报表',
path: '/reports/stocks'
@ -176,8 +177,8 @@
label: '运维管理',
path: '/maintenance/maintenance_records'
}, {
label: '工单管理',
path: '/flood/plan'
label: '应急调令',
path: '/workOrder/index'
}],
//
activeType: '市级',
@ -240,7 +241,10 @@
this.clearAutoSwitch();
if (this.resumeTimer) clearTimeout(this.resumeTimer);
},
methods: {
methods: {
toLeader(){
window.open("/admin/#/leader",'_blank')
},
//
startAutoSwitch() {
this.clearAutoSwitch();
@ -406,7 +410,18 @@
justify-content: center;
padding: 10px;
padding-top: 0;
&-view{
position: absolute;
top:20px;
right:20px;
border-radius: 12px;
padding: 5px 15px;
font-size: 14px;
color:#fff;
text-align: center;
background: linear-gradient(90deg, #3ad0ff 0%, #4be3c1 100%);
box-shadow: 0 2px 12px 0 rgba(58, 208, 255, 0.2);
}
.jscC {
width: 100%;
height: 100%;

@ -81,7 +81,7 @@
label: '仓库数量',
value: 0,
id: 'cangku_count',
unit: ''
unit: ''
}, {
label: '物资种类',
value: 0,

@ -13,7 +13,7 @@
</div>
</div>
</template>
<template v-slot:wuzibianma>
<!-- <template v-slot:wuzibianma>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>种类编码
@ -22,7 +22,7 @@
<el-input v-model="form.wuzibianma" disabled placeholder="请填写种类编码" clearable style="width: 300px;" />
</div>
</div>
</template>
</template> -->
<template v-slot:zichanmingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -196,10 +196,10 @@
beizhu: ''
},
rules: {
wuzibianma: [{
required: true,
message: '请输入种类编码'
}],
// wuzibianma: [{
// required: true,
// message: ''
// }],
zichanmingcheng: [{
required: true,
message: '请输入物资名称'

@ -45,7 +45,7 @@
<el-drawer title="物资记录" :visible.sync="drawer" :direction="direction">
<div class="draw">
<div>种类编码{{ detailObj.wuzibianma }}</div>
<!-- <div>种类编码{{ detailObj.wuzibianma }}</div> -->
<div>物资名称{{ detailObj.zichanmingcheng }}</div>
<div v-if="detailArr.length>0">
<el-timeline-item v-for="(item, index) in detailArr" :key="index" :timestamp="item.date">
@ -136,12 +136,12 @@
prop: 'fenlei_material_info_types_id_relation.name',
align: 'center'
},
{
label: '种类编码',
width: 120,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资类型',

@ -156,7 +156,7 @@
@on-ok="mingxiConfirm"
>
<div class="mingxiwrap">
<div class="xy-table-item">
<!-- <div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>种类编码
</div>
@ -169,7 +169,7 @@
@focus="showWuzi"
/>
</div>
</div>
</div> -->
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />物资名称
@ -299,7 +299,7 @@
<!-- 选择库存 -->
<Modal v-model="isShowWuzi" title="库存选择">
<div class="searchCompanys">
<el-input v-model="wuzibianmakeyword" style="margin-right:10px" clearable type="text" placeholder="请输入种类编码查找库存" @keyup.enter.native="getWuzi" />
<!-- <el-input v-model="wuzibianmakeyword" style="margin-right:10px" clearable type="text" placeholder="请输入种类编码查找库存" @keyup.enter.native="getWuzi" /> -->
<el-input v-model="keyword" style="margin-right:10px" clearable type="text" placeholder="请输入物资名称查找库存" @keyup.enter.native="getWuzi" />
<el-button type="primary" @click="getWuzi"></el-button>
@ -405,11 +405,12 @@ export default {
mingxiList: [],
showLoading: true,
mingxiIndex: '',
mingxiTable: [{
label: '种类编码',
prop: 'wuzibianma',
width: 180
},
mingxiTable: [
// {
// label: '',
// prop: 'wuzibianma',
// width: 180
// },
{
label: '物资名称',
prop: 'zichanmingcheng',

@ -91,7 +91,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;" />借用部门
</div>
<div class="xy-table-item-content">
<el-input v-model="form.jieyongbumen" placeholder="请填写借用部门" clearable style="width: 300px;" />
<el-input disabled v-model="form.jieyongbumen" placeholder="请填写借用部门" clearable style="width: 300px;" />
</div>
</div>
</template>
@ -217,7 +217,7 @@
@on-ok="mingxiConfirm"
>
<div class="mingxiwrap">
<div class="xy-table-item">
<!-- <div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>种类编码
</div>
@ -230,7 +230,7 @@
@focus="showWuzi"
/>
</div>
</div>
</div> -->
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;" />物资名称
@ -240,8 +240,9 @@
v-model="mingxiObj.zichanmingcheng"
type="text"
placeholder="请选择物资名称"
disabled
style="width: 300px;"
@focus="showWuzi"
/>
</div>
</div>
@ -401,7 +402,10 @@ import {
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
} from '@/utils/auth'
import {
getInfo
} from '@/api/user.js'
export default {
components: {
inventorysSelect
@ -501,11 +505,13 @@ export default {
label: '物资类型',
prop: 'wuzileixing',
width: 120
}, {
label: '种类编码',
prop: 'wuzibianma',
width: 120
},{
},
// {
// label: '',
// prop: 'wuzibianma',
// width: 120
// },
{
label: '单位',
prop: 'jiliangdanwei',
width: 80
@ -546,7 +552,8 @@ export default {
this.form.chukuleixing = this.chukuType
if (this.type === 'editor' || this.type === 'outbounds') {
this.getDetail()
} else {
} else {
this.getUserName()
this.form.jilurenyuan = this.authName
}
} else {
@ -572,6 +579,13 @@ export default {
})
},
methods: {
async getUserName() {
getInfo().then(res => {
console.log('res', res)
this.form.jilurenyuan = res.name
this.form.jieyongbumen = res.department?res.department.name:''
}).catch(error => {})
},
//
async getWorkOrder() {
const res = await indexDiaoling({

@ -101,11 +101,13 @@
label: '物资类型',
prop: 'wuzileixing',
width: 120
}, {
label: '种类编码',
prop: 'wuzibianma',
width: 120
},{
},
// {
// label: '',
// prop: 'wuzibianma',
// width: 120
// },
{
label: '单位',
prop: 'jiliangdanwei',
width: 80

@ -59,12 +59,12 @@
<el-form-item label="经办人" prop="jingbanren">
<el-input v-model="form.jingbanren" placeholder="请输入经办人" />
</el-form-item>
<el-form-item label="记录人" prop="jilurenyuan">
<!-- <el-form-item label="记录人" prop="jilurenyuan">
<el-input v-model="form.jilurenyuan" placeholder="请输入记录人" />
</el-form-item>
<el-form-item label="保管人" prop="baoguanrenyuan">
<el-input v-model="form.baoguanrenyuan" placeholder="请输入保管人" />
</el-form-item>
</el-form-item> -->
<el-form-item label="入库凭证" prop="zuozhengwenjian">
<el-upload
ref="upload"
@ -275,10 +275,10 @@ export default {
required: true,
message: '请填写经办人'
}],
jilurenyuan: [{
required: true,
message: '请填写记录人'
}],
// jilurenyuan: [{
// required: true,
// message: ''
// }],
zuozhengwenjian: [{
required: true,
message: '请上传入库凭证'
@ -481,12 +481,12 @@ export default {
prop: 'fenleiName',
align: 'center'
},
{
label: '种类编码',
width: 120,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资类型',
width: 180,

@ -45,14 +45,14 @@
style="width: 100%;" />
</el-form-item>
<el-form-item label="经办人" prop="jingbanren">
<el-input v-model="form.jingbanren" placeholder="请输入经办人" />
<el-input disabled v-model="form.jingbanren" placeholder="请输入经办人" />
</el-form-item>
<el-form-item label="记录人" prop="jilurenyuan">
<!-- <el-form-item label="记录人" prop="jilurenyuan">
<el-input v-model="form.jilurenyuan" placeholder="请输入记录人" />
</el-form-item>
<el-form-item label="保管人" prop="baoguanrenyuan">
<el-input v-model="form.baoguanrenyuan" placeholder="请输入保管人" />
</el-form-item>
</el-form-item> -->
<el-form-item label="货物验收单" prop="zuozhengwenjian">
<el-upload ref="upload" class="upload-demo" :action="action" multiple :headers="headers"
:before-upload="beforeUpload" :on-success="onSuccess" :on-error="onError" :on-remove="onRemove"
@ -141,6 +141,9 @@
show,
destroy
} from '@/api/system/baseForm.js'
import {
getInfo
} from '@/api/user.js'
import {
saveStock
} from '@/api/stocks.js'
@ -209,10 +212,10 @@
required: true,
message: '请填写经办人'
}],
jilurenyuan: [{
required: true,
message: '请填写记录人'
}],
// jilurenyuan: [{
// required: true,
// message: ''
// }],
zuozhengwenjian: [{
required: true,
message: '请上传货物验收单'
@ -253,12 +256,12 @@
prop: 'fenleiName',
align: 'center'
},
{
label: '种类编码',
width: 120,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资类型',
width: 120,
@ -327,8 +330,9 @@
if (this.type === 'editor') {
this.getDetail()
}
if (this.type == 'add') {
this.form.jingbanren = this.authName
if (this.type == 'add') {
this.getUserName()
}
} else {
this.flowList = []
@ -342,7 +346,12 @@
this.wuziguanli_oatoken = res.oatoken
})
},
methods: {
methods: {
async getUserName() {
getInfo().then(res => {
this.form.jingbanren = res.name
}).catch(error => {})
},
//
beforeUpload(file) {
// if (file.size / 1000 > 500) {

@ -2,8 +2,9 @@
<div>
<el-dialog :visible.sync="isShowMingxi" :modal="false" width="80%" title="新增明细">
<el-form ref="form" :model="formData" :rules="rules" label-width="100px">
<el-form-item label="种类编码" prop="wuzibianma">
<!-- 不是归还入库的 选择物资档案信息 -->
<!-- 不是归还入库的 选择物资档案信息 -->
<!-- <el-form-item label="种类编码" prop="wuzibianma">
<template v-if="rukuleixing!='归还入库'">
<el-input v-model="formData.wuzibianma" @focus="showMaterial">
<el-button slot="append" @click="addMaterial"></el-button>
@ -15,9 +16,21 @@
<el-button slot="append" @click="showInventorys"></el-button>
</el-input>
</template>
</el-form-item>
</el-form-item> -->
<el-form-item label="物资名称" prop="zichanmingcheng">
<el-input v-model="formData.zichanmingcheng" disabled />
<!-- <el-input v-model="formData.zichanmingcheng" disabled /> -->
<template v-if="rukuleixing!='归还入库'">
<el-input v-model="formData.zichanmingcheng" @focus="showMaterial">
<el-button slot="append" @click="addMaterial"></el-button>
</el-input>
</template>
<template v-else>
<!-- @change="getKucunShow" -->
<el-input ref="huikubianma" v-model="formData.zichanmingcheng" placeholder=""
@focus="showInventorys">
<el-button slot="append" @click="showInventorys"></el-button>
</el-input>
</template>
</el-form-item>
<el-form-item label="所属种类" prop="fenlei">
<el-input v-model="formData.fenleiName" disabled />
@ -109,6 +122,16 @@
:value="item.id" />
</el-select>
</el-form-item>
<!-- <el-form-item label="是否为固定资产" prop="shifouweigudingzichan">
<el-select v-model="formData.chanquanxinxi" :disabled="hasPici" style="width:100%" placeholder="请选择">
<el-option v-for="item in [{id:'',value:''},{id:'',value:''}]" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="固定资产编码" prop="gudingzichanbianma">
<el-input v-model="formData.gudingzichanbianma"/>
</el-form-item> -->
</el-form>
@ -197,11 +220,11 @@
},
rukupiciList: [],
rules: {
wuzibianma: [{
required: true,
message: '请选择种类编码',
trigger: 'blur'
}],
// wuzibianma: [{
// required: true,
// message: '',
// trigger: 'blur'
// }],
rukushuliang: [{
required: true,
message: '请填写入库数量',
@ -225,7 +248,17 @@
if (newVal === '归还入库') {
this.hasPici = true
}
}
},
isShowMingxi(val){
if(val){
}else{
this.hasPici = false
this.resetForm()
}
},
},
created() {
this.getData()
@ -335,7 +368,7 @@
this.formData.wuziguige = stocks_items_info.wuziguige
this.formData.jiliangdanwei = stocks_items_info.jiliangdanwei
this.formData.fenlei = stocks_items_info.fenlei
this.formData.fenleiName = stocks_items_info.fenlei_detail ? stocks_items_info.fenlei_detail.value : ''
this.formData.fenleiName = stocks_items_info.fenlei_detail ? stocks_items_info.fenlei_detail.name : ''
this.formData.wuzizhuangtai = stocks_items_info.wuzizhuangtai
this.formData.chubeifangshi = stocks_items_info.chubeifangshi
@ -410,7 +443,8 @@
},
//
showInventorys() {
showInventorys() {
this.$refs.inventorysSelect.isHuiku = true
this.$refs.inventorysSelect.isShowWuzi = true
},
mingxiCancel() {

@ -6,8 +6,8 @@
<el-descriptions-item label="入库类型">{{form.rukuleixing}}</el-descriptions-item>
<el-descriptions-item label="入库日期">{{form.rukushijian}}</el-descriptions-item>
<el-descriptions-item label="经办人">{{form.jingbanren}}</el-descriptions-item>
<el-descriptions-item label="记录人">{{form.jilurenyuan}}</el-descriptions-item>
<el-descriptions-item label="保管人" :span="2">{{form.baoguanrenyuan}}</el-descriptions-item>
<!-- <el-descriptions-item label="记录人">{{form.jilurenyuan}}</el-descriptions-item>
<el-descriptions-item label="保管人" :span="2">{{form.baoguanrenyuan}}</el-descriptions-item> -->
<el-descriptions-item label="货物验收单" :span="2">
<div v-for="item in zuozhengList">
<a style="color: blue;" :href="item.url" target="_blank">{{item.name}}</a>
@ -116,12 +116,12 @@
prop: 'fenlei_detail.name',
align: 'center'
},
{
label: '种类编码',
width: 120,
prop: 'wuzibianma',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'wuzibianma',
// align: 'center'
// },
{
label: '物资类型',
width: 120,

@ -234,18 +234,18 @@
prop: 'jingbanren',
align: 'center'
},
{
label: '记录人',
width: 120,
prop: 'jilurenyuan',
align: 'center'
},
{
label: '保管人',
width: 120,
prop: 'baoguanrenyuan',
align: 'center'
},
// {
// label: '',
// width: 120,
// prop: 'jilurenyuan',
// align: 'center'
// },
// {
// label: '',
// width: 120,
// prop: 'baoguanrenyuan',
// align: 'center'
// },
// {
// label: "",
// width: 180,

@ -19,6 +19,19 @@
<el-input v-model="form.mingcheng" style="width:300px" />
</div>
</div>
</template>
<template v-slot:duiwushuxing>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>队伍属性
</div>
<div class="xy-table-item-content">
<el-select v-model="form.duiwushuxing" style="width:300px" filterable placeholder="请选择">
<el-option v-for="item in shuxingList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:gongsi>
<div class="xy-table-item">
@ -148,7 +161,8 @@ export default {
},
mapform: [],
form: {
mingcheng: '',
mingcheng: '',
duiwushuxing:'',
gongsi: '',
fuzeren: '',
duizhang: '',
@ -159,7 +173,14 @@ export default {
jingdu: '',
weidu: '',
duiyuan: []
},
},
shuxingList:[{
label:'自管队伍',
value:'自管队伍'
},{
label:'区县队伍',
value:'区县队伍'
}],
bookList: [],
rules: {
mingcheng: [{

@ -0,0 +1,165 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
<Button type="primary" @click="getList"></Button>
<Button
type="primary"
style="margin-left: 10px;"
@click="$refs['addTeam'].type='add',
$refs['addTeam'].isShow=true"
>添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table
:list="list"
:total="total"
:table-item="table"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="120" header-align="center">
<template slot-scope="scope">
<div>
<Button
type="primary"
size="small"
@click="$refs['addTeam'].type='editor',
$refs['addTeam'].id=scope.row.id,
$refs['addTeam'].isShow=true"
>编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="error" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
<!-- <Button
type="primary"
style="margin-left: 10px;"
size="small"
@click="
$refs['showTeam'].id=scope.row.id,
$refs['showTeam'].name = scope.row.mingcheng,
$refs['showTeam'].isShow=true"
>花名册</Button> -->
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addTeam ref="addTeam" @refresh="getList" />
<showTeam ref="showTeam" />
</div>
</template>
<script>
import {
index,
destroy
} from '@/api/system/baseForm.js'
import addTeam from './components/addTeam.vue'
import showTeam from './components/showTeam.vue'
export default {
components: {
addTeam,
showTeam
},
data() {
return {
select: {
page: 1,
page_size: 10,
keyword: '',
table_name: 'haocais'
},
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80
}, {
label: '耗材名称',
prop: 'haocaimingcheng',
// width: 240,
align: 'left',
fixed: 'left'
}, {
label: '品牌',
prop: 'pinpai',
align: 'center',
width: 120
}, {
label: '型号',
prop: 'xinghao',
width: 120
}, {
label: '单位',
prop: 'danwei',
width: 120
}, {
label: '数量',
prop: 'shuliang',
width: 120
}, {
label: '使用科室',
prop: 'shiyongkeshi',
width: 120
}
]
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
...this.select,
filter: [{
key: 'mingcheng',
op: 'like',
value: this.select.keyword
}]
})
this.list = res.data
this.total = res.total
},
pageChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.getList()
},
delRow(id) {
if (id) {
destroy({
id: id,
table_name: this.select.table_name
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
}
}
}
</script>
<style>
</style>

@ -4,7 +4,8 @@
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
<Button type="primary" @click="getList"></Button>
<Button
type="primary"
@ -82,7 +83,14 @@ export default {
table_name: 'teams'
},
total: 0,
list: [],
list: [],
shuxingList:[{
label:'自管队伍',
value:'自管队伍'
},{
label:'区县队伍',
value:'区县队伍'
}],
table: [{
label: '序号',
type: 'index',
@ -94,6 +102,11 @@ export default {
width: 240,
align: 'left',
fixed: 'left'
}, {
label: '队伍属性',
prop: 'duiwushuxing',
width: 120,
align: 'center'
}, {
label: '公司',
prop: 'gongsi',

@ -18,43 +18,30 @@
<div v-if="currentRepository" class="preview-container">
<div class="preview-wrapper">
<!-- 有概览图时显示图片和货架点位 -->
<div
v-if="currentRepository.image_id_uploads_id_relation"
class="preview-image"
:style="{
<div v-if="currentRepository.image_id_uploads_id_relation" class="preview-image" :style="{
backgroundImage: `url(${currentRepository.image_id_uploads_id_relation.url})`,
}"
>
}">
<!-- 货架点位 -->
<div
v-for="shelf in shelves"
:key="shelf.id"
class="shelf-point"
:style="{
<div v-for="shelf in shelves" :key="shelf.id" class="shelf-point" :style="{
left: `${shelf.area_x}%`,
top: `${shelf.area_y}%`
}"
@click="handleShelfClick(shelf)"
/>
}" @click="handleShelfClick(shelf)" />
<!-- 物资信息浮窗 -->
<div
v-if="showMaterialInfo"
class="material-info-popup"
:style="{
<div v-if="showMaterialInfo" class="material-info-popup" :style="{
left: `${selectedShelf.area_x}%`,
top: calculatePopupPosition(selectedShelf.area_y)
}"
>
}">
<div class="popup-header" style="text-align: right;">
<span>{{ selectedShelf.huojiamingcheng }}</span>
<el-button type="text" icon="el-icon-close" @click="showMaterialInfo = false" />
</div>
<xy-table style="width: 100%" :height="300" :list="materialList" :is-page="false" :table-item="materialTable">
<template v-slot:btns>
<div />
</template>
</div>
<xy-table style="width: 100%" :height="300" :list="materialList" :is-page="false"
:table-item="materialTable">
<template v-slot:btns>
<div />
</template>
</xy-table>
<!-- <el-table :data="materialList" size="small" style="width: 100%" :max-height="300">
<el-table-column prop="name" label="物资名称"></el-table-column>
@ -93,229 +80,259 @@
</template>
<script>
import {
index
} from '@/api/system/baseForm.js'
export default {
name: 'RepositoryPreview',
data() {
return {
//
repositories: [], //
activeRepository: '', // ID
currentRepository: null, //
//
shelves: [], //
selectedShelf: null, //
showMaterialInfo: false, //
materialList: [], //
loading: false, //
materialTable: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 50
},
{
label: '种类编码',
width: 80,
prop: 'wuzibianma',
align: 'center'
},
{
label: '物资名称',
prop: 'zichanmingcheng',
align: 'left'
},
{
label: '物资类型',
width: 120,
prop: 'wuzileixing',
align: 'center'
},
{
label: '计量单位',
width: 80,
prop: 'jiliangdanwei',
align: 'center'
},
{
label: '库存',
width: 80,
prop: 'inventorys_total',
align: 'center'
}
]
}
},
//
async created() {
await this.fetchRepositories()
},
mounted() {
//
window.addEventListener('resize', this.handleResize)
this.$store.dispatch('app/closeSideBar', {
withoutAnimation: false
})
},
beforeDestroy() {
//
window.removeEventListener('resize', this.handleResize)
},
methods: {
//
async fetchRepositories() {
try {
this.loading = true
// API
const res = await index({
page: 1,
page_size: 999,
table_name: 'materialstorages',
filter: [{
key: 'shifouzili',
op: 'eq',
value: '是'
}]
})
this.repositories = res.data.reverse()
} catch (error) {
this.$message.error('获取仓库列表失败')
} finally {
this.loading = false
}
},
//
async fetchShelfData(repositoryId) {
try {
this.loading = true
// API
const res = await index({
page: 1,
page_size: 999,
table_name: 'shelfs',
filter: [{
key: 'storage_id',
op: 'eq',
value: repositoryId
}]
})
this.shelves = res.data
} catch (error) {
this.$message.error('获取货架数据失败')
this.shelves = []
} finally {
this.loading = false
}
},
//
async fetchMaterialInfo(shelfId) {
try {
this.loading = true
// API
const res = await index({
page_size: 999,
page: 1,
table_name: 'material_infos',
filter: [{
'key': 'suozaihuojia',
'op': 'eq',
'value': shelfId
import {
index
} from '@/api/system/baseForm.js'
import {
index as indexInven
} from '@/api/inventory.js'
export default {
name: 'RepositoryPreview',
data() {
return {
//
repositories: [], //
activeRepository: '', // ID
currentRepository: null, //
//
shelves: [], //
selectedShelf: null, //
showMaterialInfo: false, //
materialList: [], //
loading: false, //
materialTable: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 50
},
// {
// label: '',
// width: 80,
// prop: 'wuzibianma',
// align: 'center'
// },
{
'key': 'storages_id',
'op': 'eq',
'value': this.currentRepository.id
}
label: '所属种类',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.fenlei_detail.name',
align: 'center'
},
{
label: '物资名称',
prop: 'zichanmingcheng',
align: 'left'
},
{
label: '物资类型',
width: 120,
prop: 'wuzileixing',
align: 'center'
},
{
label: '物资型号',
prop: 'guigexinghao',
align: 'center',
width: 180
},
{
label: '物资规格',
prop: 'wuziguige',
align: 'center',
width: 180
},
{
label: '单位',
width: 120,
prop: 'jiliangdanwei',
align: 'center'
},
{
label: '在库数量',
width: 120,
prop: 'zaikushuliang',
customFn: (row) => {
console.log("row", row)
return ( <span> {
row.row.zaikushuliang
} {
row.row.jiliangdanwei ? row.row.jiliangdanwei : ''
} </span>)
}
},
]
})
this.materialList = res.data
} catch (error) {
this.$message.error('获取物资信息失败')
this.materialList = []
} finally {
this.loading = false
}
},
//
async handleSelectRepository(index) {
this.activeRepository = index
this.currentRepository = this.repositories.find(
repo => repo.id.toString() === index
)
if (this.currentRepository) {
this.showMaterialInfo = false //
await this.fetchShelfData(this.currentRepository.id)
}
},
//
async handleShelfClick(shelf) {
this.selectedShelf = shelf
// await this.fetchMaterialInfo(shelf.id);
await this.fetchMaterialInfo(shelf.huojiamingcheng)
this.showMaterialInfo = true
},
//
async handleAddImage() {
//
try {
const formData = new FormData()
// ...
await this.$http.post(
`/api/repositories/${this.currentRepository.id}/image`,
formData
)
this.$message.success('上传成功')
await this.fetchRepositories() //
} catch (error) {
this.$message.error('上传失败')
}
},
//
//
calculatePopupPosition(y) {
const position = parseFloat(y)
//
const imageHeight = this.$el.querySelector('.preview-image').offsetHeight
const popupHeight = 300 //
//
if (position > 50) {
return `calc(${position}% - ${popupHeight + 20}px)`
}
return `calc(${position}% + 20px)`
},
//
handleResize() {
//
if (this.showMaterialInfo) {
//
this.$nextTick(() => {
if (this.selectedShelf) {
const newPosition = this.calculatePopupPosition(this.selectedShelf.area_y)
//
}
},
//
async created() {
await this.fetchRepositories()
},
mounted() {
//
window.addEventListener('resize', this.handleResize)
this.$store.dispatch('app/closeSideBar', {
withoutAnimation: false
})
},
beforeDestroy() {
//
window.removeEventListener('resize', this.handleResize)
},
methods: {
//
async fetchRepositories() {
try {
this.loading = true
// API
const res = await index({
page: 1,
page_size: 999,
table_name: 'materialstorages',
sort_type: 'ASC',
sort_name: 'sort',
filter: [{
key: 'shifouzili',
op: 'eq',
value: '是'
}]
})
this.repositories = res.data.reverse()
} catch (error) {
this.$message.error('获取仓库列表失败')
} finally {
this.loading = false
}
},
//
async fetchShelfData(repositoryId) {
try {
this.loading = true
// API
const res = await index({
page: 1,
page_size: 999,
table_name: 'shelfs',
filter: [{
key: 'storage_id',
op: 'eq',
value: repositoryId
}]
})
this.shelves = res.data
} catch (error) {
this.$message.error('获取货架数据失败')
this.shelves = []
} finally {
this.loading = false
}
},
//
async fetchMaterialInfo(shelfId) {
try {
this.loading = true
// API
const res = await indexInven({
page_size: 999,
page: 1,
filter: [{
'key': 'suozaihuojia',
'op': 'eq',
'value': shelfId
},
{
'key': 'suozaicangku',
'op': 'eq',
'value': this.currentRepository.id
}
]
})
this.materialList = res.data
} catch (error) {
this.$message.error('获取物资信息失败')
this.materialList = []
} finally {
this.loading = false
}
},
//
async handleSelectRepository(index) {
this.activeRepository = index
this.currentRepository = this.repositories.find(
repo => repo.id.toString() === index
)
if (this.currentRepository) {
this.showMaterialInfo = false //
await this.fetchShelfData(this.currentRepository.id)
}
},
//
async handleShelfClick(shelf) {
this.selectedShelf = shelf
// await this.fetchMaterialInfo(shelf.id);
await this.fetchMaterialInfo(shelf.huojiamingcheng)
this.showMaterialInfo = true
},
//
async handleAddImage() {
//
try {
const formData = new FormData()
// ...
await this.$http.post(
`/api/repositories/${this.currentRepository.id}/image`,
formData
)
this.$message.success('上传成功')
await this.fetchRepositories() //
} catch (error) {
this.$message.error('上传失败')
}
},
//
//
calculatePopupPosition(y) {
const position = parseFloat(y)
//
const imageHeight = this.$el.querySelector('.preview-image').offsetHeight
const popupHeight = 300 //
//
if (position > 50) {
return `calc(${position}% - ${popupHeight + 20}px)`
}
return `calc(${position}% + 20px)`
},
//
handleResize() {
//
if (this.showMaterialInfo) {
//
this.$nextTick(() => {
if (this.selectedShelf) {
const newPosition = this.calculatePopupPosition(this.selectedShelf.area_y)
//
}
})
}
}
})
}
},
beforeRouteLeave(to, from, next) {
this.$store.dispatch('app/toggleSideBar')
next()
}
}
},
beforeRouteLeave(to, from, next) {
this.$store.dispatch('app/toggleSideBar')
next()
}
}
</script>
<style scoped>
@ -360,7 +377,7 @@ export default {
height: 100%;
overflow-y: auto;
padding: 20px;
background: linear-gradient(to right,#4261ab 20%, #8ebcd7 50%,#9e91bc 90%);
background: linear-gradient(to right, #4261ab 20%, #8ebcd7 50%, #9e91bc 90%);
}
.preview-container {

Loading…
Cancel
Save