parent
eab24ede08
commit
32db54532f
@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 选择物资编号 -->
|
||||
<Modal v-model="isShowWuzi" :z-index="10000" width="70" title="物资选择" :loading='showLoading'>
|
||||
<div class="searchCompanys">
|
||||
<el-input style="margin-right:10px" clearable type="text" @keyup.enter.native="getWuzi"
|
||||
v-model="wuzibianmakeyword" placeholder="请输入物资编码查找库存"></el-input>
|
||||
<el-input style="margin-right:10px" clearable type="text" @keyup.enter.native="getWuzi"
|
||||
v-model="wuzimingchengkeyword" placeholder="请输入物资名称查找"></el-input>
|
||||
<el-button type="primary" @click="getWuzi">查询</el-button>
|
||||
</div>
|
||||
|
||||
<Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="wzList"
|
||||
@on-current-change="wuziSelect" />
|
||||
<Page :current="wuziPageIndex" :total="wuziTotal" simple
|
||||
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="wuziPageChange" />
|
||||
|
||||
<div slot="footer" align="right">
|
||||
<Button class="btn" size="default" type="default" @click="mingxiCancel">取消</Button>
|
||||
<Button class="btn" size="default" type="primary" @click="mingxiConfirm">确定</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
index,
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 物资
|
||||
showLoading:false,
|
||||
isShowWuzi: false,
|
||||
wuziPageIndex: 1,
|
||||
wuzibianmakeyword: '',
|
||||
wuzimingchengkeyword: '',
|
||||
wuziTotal: 0,
|
||||
wzList: [],
|
||||
selectItem:{},
|
||||
wuziColumns: [{
|
||||
width: 60,
|
||||
_isChecked: false,
|
||||
key: "isSelect",
|
||||
resizable: true,
|
||||
render: (h, params) => {
|
||||
return h('div', [
|
||||
h('Radio', {
|
||||
props: {
|
||||
value: params.row.isSelect
|
||||
},
|
||||
on: {
|
||||
'on-change': (e) => {
|
||||
this.wzList.forEach((items) => {
|
||||
this.$set(items, 'isSelect', false)
|
||||
});
|
||||
this.wzList[params.index].isSelect = e;
|
||||
}
|
||||
}
|
||||
})
|
||||
])
|
||||
}
|
||||
}, {
|
||||
title: '物资编码',
|
||||
key: 'wuzibianma',
|
||||
}, {
|
||||
title: '物资名称',
|
||||
key: 'zichanmingcheng',
|
||||
}, {
|
||||
title: '物资类型',
|
||||
key: 'wuzileixing',
|
||||
}, {
|
||||
title: '所属种类',
|
||||
key: 'fenlei_parameter_details_id_relation.value',
|
||||
render: (h, params) => {
|
||||
return h('div', [
|
||||
h('strong', params.row.fenlei_parameter_details_id_relation?params.row.fenlei_parameter_details_id_relation.value:'')
|
||||
]);
|
||||
}
|
||||
}, {
|
||||
title: '物资型号',
|
||||
key: 'guigexinghao',
|
||||
}, {
|
||||
title: '物资规格',
|
||||
key: 'wuziguige',
|
||||
}, {
|
||||
title: '单位',
|
||||
key: 'jiliangdanwei',
|
||||
}],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isShowWuzi(newVal) {
|
||||
if (newVal) {
|
||||
this.getWuzi()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getWuzi() {
|
||||
this.showLoading = true
|
||||
const res = await index({
|
||||
page_size: 10,
|
||||
page: this.wuziPageIndex,
|
||||
table_name: 'material_infos',
|
||||
filter: [{
|
||||
"key": "zichanmingcheng",
|
||||
"op": "like",
|
||||
"value": this.wuzimingchengkeyword
|
||||
}, {
|
||||
"key": "wuzibianma",
|
||||
"op": "like",
|
||||
"value": this.wuzibianmakeyword
|
||||
}]
|
||||
})
|
||||
|
||||
for (var m of res.data) {
|
||||
m.isSelect = false
|
||||
}
|
||||
this.wzList = res.data
|
||||
this.wuziTotal = res.total
|
||||
this.showLoading = false
|
||||
console.log("res", this.wzList)
|
||||
},
|
||||
wuziSelect(e) {
|
||||
console.log(e)
|
||||
this.wzList.forEach((items) => {
|
||||
this.$set(items, 'isSelect', false)
|
||||
if (items.id == e.id) {
|
||||
this.$set(items, 'isSelect', true)
|
||||
}
|
||||
});
|
||||
this.selectItem = e
|
||||
},
|
||||
wuziPageChange(e) {
|
||||
console.log("e", e)
|
||||
this.wuziPageIndex = e
|
||||
this.selectItem = {}
|
||||
this.getWuzi()
|
||||
},
|
||||
mingxiConfirm(){
|
||||
if(Object.keys(this.selectItem).length === 0){
|
||||
this.isShowWuzi = false
|
||||
return
|
||||
}
|
||||
this.$emit("refresh",this.selectItem)
|
||||
this.isShowWuzi = false
|
||||
},
|
||||
mingxiCancel(){
|
||||
this.selectItem = {}
|
||||
this.wuziPageIndex = 1
|
||||
this.isShowWuzi = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.searchCompanys {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div>
|
||||
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="normal" :title="titleName">
|
||||
<template v-slot:normalContent>
|
||||
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;margin-bottom:10px">
|
||||
<Input v-model="select.huojiamingcheng" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
|
||||
<Button type="primary" @click="select.page=1,getList()">查询</Button>
|
||||
<Button type="primary" style="margin-left: 10px;" @click="$refs['addShelf'].type='add',
|
||||
$refs['addShelf'].setStorage(storage_id,titleName),
|
||||
$refs['addShelf'].isShow=true">添加</Button>
|
||||
</div>
|
||||
<xy-table :list="list" :total="total" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
|
||||
:table-item="table">
|
||||
<template v-slot:btns>
|
||||
<el-table-column fixed="right" label="操作" align="center" width="120" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<Button type="primary" size="small" @click="$refs['addShelf'].type='editor',
|
||||
$refs['addShelf'].id=scope.row.id,
|
||||
$refs['addShelf'].isShow=true">编辑</Button>
|
||||
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
|
||||
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
|
||||
</Poptip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
</xy-table>
|
||||
<addShelf ref="addShelf" @refresh="getList"></addShelf>
|
||||
</template>
|
||||
</xy-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
import addShelf from '@/views/shelf/components/addShelf.vue'
|
||||
import {
|
||||
getparameteritem
|
||||
} from "@/api/system/dictionary.js"
|
||||
export default {
|
||||
components: {
|
||||
addShelf,
|
||||
},
|
||||
data() {
|
||||
|
||||
return {
|
||||
isShow:false,
|
||||
titleName:'',
|
||||
storage_id:'',
|
||||
select: {
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
huojiamingcheng: '',
|
||||
table_name: 'shelfs',
|
||||
},
|
||||
total: 0,
|
||||
list: [],
|
||||
StorageList:[],
|
||||
table: [{
|
||||
label: '序号',
|
||||
type: 'index',
|
||||
fixed: 'left',
|
||||
width: 80,
|
||||
},{
|
||||
label: '货架名称',
|
||||
prop: 'huojiamingcheng',
|
||||
// width: 120,
|
||||
}, {
|
||||
label: '创建日期',
|
||||
prop: 'created_at',
|
||||
width: 120,
|
||||
formatter: (cell, data, value) => {
|
||||
return value ? value.substring(0, 10) : ''
|
||||
}
|
||||
}],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getStorageList()
|
||||
|
||||
},
|
||||
watch:{
|
||||
isShow(newVal){
|
||||
if(newVal){
|
||||
console.log("this.storage_id",this.storage_id)
|
||||
this.getList()
|
||||
}else{
|
||||
this.storage_id = ''
|
||||
this.titleName = ''
|
||||
this.list = []
|
||||
this.total = 0
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
const res = await index({
|
||||
...this.select,
|
||||
filter: [{
|
||||
key:'huojiamingcheng',
|
||||
op:'like',
|
||||
value:this.select.huojiamingcheng
|
||||
},{
|
||||
key:'storage_id',
|
||||
op:'eq',
|
||||
value:this.storage_id
|
||||
}],
|
||||
})
|
||||
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>
|
||||
Loading…
Reference in new issue