|
|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
<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">
|
|
|
|
|
<div class="selector-item">
|
|
|
|
|
<span class="selector-item__label">物资编码:</span>
|
|
|
|
|
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="物资编码搜索" />
|
|
|
|
|
</div>
|
|
|
|
|
@ -14,7 +14,7 @@
|
|
|
|
|
<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="getindex">查询</Button>
|
|
|
|
|
<Button type="primary" style="margin-left: 10px;"
|
|
|
|
|
@click="exportExcel(new Date().getTime().toString())">导出</Button>
|
|
|
|
|
|
|
|
|
|
@ -80,15 +80,11 @@
|
|
|
|
|
keyword: "",
|
|
|
|
|
wzbm:'',
|
|
|
|
|
is_export: 0,
|
|
|
|
|
min: '',
|
|
|
|
|
max: '',
|
|
|
|
|
rmin: '',
|
|
|
|
|
rmax: ''
|
|
|
|
|
},
|
|
|
|
|
showcode: false,
|
|
|
|
|
customForm: {
|
|
|
|
|
customFormId: 11,
|
|
|
|
|
tableName: "stocks_item_links"
|
|
|
|
|
tableName: "stocks_items"
|
|
|
|
|
},
|
|
|
|
|
form: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
@ -98,6 +94,36 @@
|
|
|
|
|
type: 'index',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
width: 80,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '入库时间',
|
|
|
|
|
prop:'stocks_rukushijian',
|
|
|
|
|
width: 180
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '入库类型',
|
|
|
|
|
prop:'stocks_rukuleixing',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '关联记录',
|
|
|
|
|
prop:'stocks_guanlianjilu',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '经办人',
|
|
|
|
|
prop:'stocks_jingbanren',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '记录人员',
|
|
|
|
|
prop:'stocks_jilurenyuan',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '保管人员',
|
|
|
|
|
prop:'stocks_baoguanrenyuan',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "物资编码",
|
|
|
|
|
@ -175,7 +201,12 @@
|
|
|
|
|
return value
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '备注',
|
|
|
|
|
prop:'stocks_beizhu',
|
|
|
|
|
width: 180,
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// label: "二维码",
|
|
|
|
|
// width: 180,
|
|
|
|
|
@ -200,19 +231,45 @@
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
async exportExcel(sheetName) {
|
|
|
|
|
async exportExcel(sheetName) {
|
|
|
|
|
this.loading = true
|
|
|
|
|
const res = await index(Object.assign('', {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
table_name: this.customForm.tableName
|
|
|
|
|
page_size: 99999,
|
|
|
|
|
page: 1,
|
|
|
|
|
table_name: this.customForm.tableName,
|
|
|
|
|
filter: [{
|
|
|
|
|
"key": "wuzibianma",
|
|
|
|
|
"op": "like",
|
|
|
|
|
"value": this.select.wzbm,
|
|
|
|
|
},{
|
|
|
|
|
"key": "zichanmingcheng",
|
|
|
|
|
"op": "like",
|
|
|
|
|
"value": this.select.keyword,
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
}))
|
|
|
|
|
if (res.data) {
|
|
|
|
|
let headers = this.form.map(i => {
|
|
|
|
|
return {
|
|
|
|
|
key: i.field,
|
|
|
|
|
title: i.name
|
|
|
|
|
let headers = this.table.filter(f=>f.type!='index').map(i => {
|
|
|
|
|
if(i.type!='index'){
|
|
|
|
|
return {
|
|
|
|
|
key: i.prop,
|
|
|
|
|
title: i.label
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
for(var k of res.data){
|
|
|
|
|
if(k.stocks_id_stocks_items_id_relation){
|
|
|
|
|
k.stocks_rukushijian = k.stocks_id_stocks_items_id_relation.rukushijian?.substring(0,10)
|
|
|
|
|
k.stocks_rukuleixing = k.stocks_id_stocks_items_id_relation.rukuleixing
|
|
|
|
|
let rowname = k.stocks_rukuleixing=='采购'? 'caigouhetong':(k.stocks_rukuleixing=='请示'?'qingshiliucheng':(k.stocks_rukuleixing=='应急采购'?'yingjicaigou':''))
|
|
|
|
|
|
|
|
|
|
k.stocks_guanlianjilu = k.stocks_id_stocks_items_id_relation[rowname]
|
|
|
|
|
k.stocks_jingbanren = k.stocks_id_stocks_items_id_relation.jingbanren
|
|
|
|
|
k.stocks_jilurenyuan = k.stocks_id_stocks_items_id_relation.jilurenyuan
|
|
|
|
|
k.stocks_baoguanrenyuan = k.stocks_id_stocks_items_id_relation.baoguanrenyuan
|
|
|
|
|
k.stocks_beizhu = k.stocks_id_stocks_items_id_relation.beizhu
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
|
@ -225,7 +282,8 @@
|
|
|
|
|
});
|
|
|
|
|
saveAs(new Blob([wbout], {
|
|
|
|
|
type: 'application/octet-stream'
|
|
|
|
|
}), `${sheetName}.xlsx`);
|
|
|
|
|
}), `${sheetName}.xlsx`);
|
|
|
|
|
this.loading = false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getindex() {
|
|
|
|
|
@ -238,18 +296,30 @@
|
|
|
|
|
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,
|
|
|
|
|
// }
|
|
|
|
|
// ],
|
|
|
|
|
})
|
|
|
|
|
filter: [{
|
|
|
|
|
"key": "wuzibianma",
|
|
|
|
|
"op": "like",
|
|
|
|
|
"value": this.select.wzbm,
|
|
|
|
|
},{
|
|
|
|
|
"key": "zichanmingcheng",
|
|
|
|
|
"op": "like",
|
|
|
|
|
"value": this.select.keyword,
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
})
|
|
|
|
|
for(var k of res.data){
|
|
|
|
|
if(k.stocks_id_stocks_items_id_relation){
|
|
|
|
|
k.stocks_rukushijian = k.stocks_id_stocks_items_id_relation.rukushijian?.substring(0,10)
|
|
|
|
|
k.stocks_rukuleixing = k.stocks_id_stocks_items_id_relation.rukuleixing
|
|
|
|
|
let rowname = k.stocks_rukuleixing=='采购'? 'caigouhetong':(k.stocks_rukuleixing=='请示'?'qingshiliucheng':(k.stocks_rukuleixing=='应急采购'?'yingjicaigou':''))
|
|
|
|
|
|
|
|
|
|
k.stocks_guanlianjilu = k.stocks_id_stocks_items_id_relation[rowname]
|
|
|
|
|
k.stocks_jingbanren = k.stocks_id_stocks_items_id_relation.jingbanren
|
|
|
|
|
k.stocks_jilurenyuan = k.stocks_id_stocks_items_id_relation.jilurenyuan
|
|
|
|
|
k.stocks_baoguanrenyuan = k.stocks_id_stocks_items_id_relation.baoguanrenyuan
|
|
|
|
|
k.stocks_beizhu = k.stocks_id_stocks_items_id_relation.beizhu
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
|