<template>
|
<j-modal
|
:width="1500"
|
:visible="visible"
|
switchFullscreen
|
:confirmLoading="confirmLoading"
|
@cancel="handleCancel"
|
cancelText="关闭"
|
:footer="null"
|
>
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-row :gutter="24">
|
<a-col :md="6" :sm="8">
|
<a-form-item label="入库申请单编号">
|
<a-input placeholder="请输入入库申请单编号" v-model="queryParam.inboundNum" />
|
</a-form-item>
|
</a-col>
|
<a-col :md="6" :sm="8">
|
<a-form-item label="入库类型">
|
<j-search-select-tag
|
placeholder="请选择入库类型"
|
v-model="queryParam.inStorehouseType"
|
dict="in_storehouse_type"
|
/>
|
</a-form-item>
|
</a-col>
|
<!-- <a-col :md="6" :sm="8">
|
<a-form-item label="经手人">
|
<j-search-select-tag
|
placeholder="请选择经手人"
|
v-model="queryParam.handler"
|
dict="sys_user,realname,id,del_flag!=1"
|
/>
|
</a-form-item>
|
</a-col> -->
|
</a-row>
|
</a-form>
|
</div>
|
|
<!-- 操作按钮区域 -->
|
<div class="table-operator">
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
|
<a-button @click="handleInbound" type="primary" icon="plus">入库</a-button>
|
</div>
|
|
<!-- table区域-begin -->
|
<a-table
|
ref="table"
|
size="middle"
|
bordered
|
rowKey="id"
|
:customRow="customRow"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"
|
@change="handleTableChange"
|
>
|
</a-table>
|
<a-tabs defaultActiveKey="1">
|
<a-tab-pane tab="工具入库明细" key="1">
|
<inbound-apply-detail-list ref="inboundDetailList" @selectRows="selectRows"></inbound-apply-detail-list>
|
</a-tab-pane>
|
</a-tabs>
|
<!-- table区域-end -->
|
</j-modal>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import InboundApplyDetailList from './InboundApplyDetailList'
|
import { requestPut } from '@/api/manage'
|
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
import { postAction,getAction } from '@/api/manage'
|
|
export default {
|
name: 'InboundApplyModelList',
|
mixins: [JeecgListMixin],
|
components: {
|
InboundApplyDetailList,
|
JDictSelectTag,
|
JSearchSelectTag,
|
},
|
data() {
|
return {
|
description: '申请单入库选择界面',
|
url: {
|
list: '/tms/inboundOrder/list',
|
importExcelUrl: '/tms/inboundOrder/importExcel',
|
exportXlsUrl: '/tms/inboundOrder/exportXls',
|
edit:'/tms/inboundOrder/edit',
|
addApplyInStorage:'/tms/inboundOrder/addApplyInStorage'
|
},
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
},
|
},
|
{
|
title: '入库申请单编号',
|
align: 'center',
|
dataIndex: 'inboundNum',
|
sorter: true,
|
},
|
{
|
title: '入库单类型',
|
align: 'center',
|
dataIndex: 'inStorehouseType_dictText',
|
},
|
{
|
title: '经手人',
|
align: 'center',
|
dataIndex: 'handler_dictText',
|
},
|
{
|
title: '申请原因',
|
align: 'center',
|
dataIndex: 'applicationReason',
|
},
|
{
|
title: '入库时间',
|
align: 'center',
|
dataIndex: 'inboundTime',
|
sorter: true,
|
},
|
{
|
title: '审核人',
|
align: 'center',
|
dataIndex: 'reviewer_dictText',
|
},
|
{
|
title: '审核时间',
|
align: 'center',
|
dataIndex: 'approvalDate',
|
sorter: true,
|
},
|
{
|
title: '审核状态',
|
align: 'center',
|
dataIndex: 'orderStatus_dictText',
|
},
|
{
|
title: '借用单号',
|
align: 'center',
|
dataIndex: 'borrowNum',
|
},
|
{
|
title: '审批意见',
|
align: 'center',
|
dataIndex: 'approvalOpinion',
|
},
|
// {
|
// width: 150,
|
// title: '操作',
|
// dataIndex: 'action',
|
// align: 'center',
|
// scopedSlots: { customRender: 'action' },
|
// },
|
],
|
visible:false,
|
selectDetailRows:{},
|
model:{},
|
form: this.$form.createForm(this),
|
confirmLoading: false,
|
loading:false,
|
disableMixinCreated: true,
|
}
|
},
|
computed: {
|
/* 导入路径页面重新计算 */
|
importExcelUrl: function () {
|
// return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//开发环境指向
|
return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}`
|
},
|
},
|
methods: {
|
show(){
|
this.visible = true
|
this.loadData()
|
},
|
loadData(arg) {
|
if(!this.url.list){
|
this.$message.error("请设置url.list属性!")
|
return
|
}
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1;
|
}
|
this.onClearSelected()
|
this.queryParam.orderStatus = '3'
|
this.queryParam.inStatus = ['1','2'].join(',')
|
var params = this.getQueryParams();//查询条件
|
this.loading = true;
|
getAction(this.url.list, params).then((res) => {
|
if (res.success) {
|
this.dataSource = res.result.records;
|
this.ipagination.total = res.result.total;
|
}
|
if(res.code===510){
|
this.$message.warning(res.message)
|
}
|
this.loading = false;
|
})
|
},
|
onClearSelected() {
|
this.selectedRowKeys = [];
|
this.selectionRows = [];
|
},
|
searchReset() {
|
this.queryParam = {}
|
this.$refs.inboundDetailList.dataSource = []
|
this.loadData(1);
|
},
|
customRow(record) {
|
return {
|
on: {
|
click: (e) => {
|
//将当前选中的记录传到子页面
|
this.$bus.$emit('getToolingStorageData', record)
|
this.onSelectChange(record.id.split(","), [record]);
|
//点击当前行变色
|
let oldList = document.querySelectorAll('.checked-td-of-add-table')
|
if (oldList) {
|
for (let j = 0; j < oldList.length; j++) {
|
oldList[j].classList.remove('checked-td-of-add-table')
|
}
|
}
|
let children = e.target.parentNode.children
|
for (let i = 0; i < children.length; i++) {
|
children[i].classList.add('checked-td-of-add-table')
|
}
|
},
|
},
|
}
|
},
|
onSelectChange(selectedRowKeys, selectionRows) {
|
this.selectedRowKeys = selectedRowKeys;
|
this.selectionRows = selectionRows;
|
},
|
selectRows(selectDetailRows) {
|
this.selectDetailRows = selectDetailRows;
|
},
|
handleInbound() {
|
let that = this
|
this.form.validateFields((err, values) => {
|
if (!err) {
|
that.confirmLoading = true
|
that.loading = true
|
let formData = Object.assign(this.model, values)
|
formData.detailData = this.selectDetailRows
|
formData.inStorehouseType = this.selectionRows[0].inStorehouseType
|
formData.orderId = this.selectionRows[0].id
|
postAction(this.url.addApplyInStorage, formData)
|
.then((res) => {
|
if (res.success) {
|
that.$message.success(res.message)
|
that.$emit('ok', new Date())
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
.finally(() => {
|
that.confirmLoading = false
|
that.loading = false
|
that.handleCancel()
|
})
|
}
|
})
|
},
|
handleCancel(){
|
this.visible = false
|
|
}
|
},
|
}
|
</script>
|
|
<style lang="less" scoped>
|
@import '~@assets/less/common.less';
|
/deep/ .notshow {
|
display: none;
|
}
|
/deep/ .checked-td-of-add-table {
|
background-color: rgba(220, 220, 220, 1);
|
}
|
</style>
|