<template>
|
<a-card :bordered="false">
|
<!-- 查询区域 -->
|
<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="handleAdd" 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"
|
>
|
<!--状态栏个性展示-->
|
<span slot="action" slot-scope="text, record">
|
<a href="javascript:;" @click="handleEdit(record)" v-if="record.orderStatus == '1'">编辑</a>
|
<a-divider type="vertical" v-if="record.orderStatus == '1'" />
|
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
<a-divider type="vertical" v-if="record.orderStatus == '1'"/>
|
<a href="javascript:;" @click="handleSubmit(record)" v-if="record.orderStatus == '1'">提交</a>
|
</span>
|
</a-table>
|
<a-tabs defaultActiveKey="1">
|
<a-tab-pane tab="工具入库明细" key="1">
|
<inbound-detail-list ref="inboundDetailList"></inbound-detail-list>
|
</a-tab-pane>
|
</a-tabs>
|
<!-- table区域-end -->
|
<inbound-order-model ref="modalForm" @ok="modalFormOk"></inbound-order-model>
|
</a-card>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import InboundOrderModel from './modules/inboundOrder/InboundOrderModel'
|
import InboundDetailList from './modules/inboundOrder/InboundDetailList'
|
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: 'InboundOrderList',
|
mixins: [JeecgListMixin],
|
components: {
|
InboundOrderModel,
|
InboundDetailList,
|
JDictSelectTag,
|
JSearchSelectTag,
|
},
|
data() {
|
return {
|
description: '入库申请单',
|
url: {
|
list: '/tms/inboundOrder/list',
|
importExcelUrl: '/tms/inboundOrder/importExcel',
|
exportXlsUrl: '/tms/inboundOrder/exportXls',
|
edit:'/tms/inboundOrder/edit',
|
submit:'/tms/inboundOrder/submit'
|
},
|
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' },
|
},
|
],
|
loading:false
|
}
|
},
|
computed: {
|
/* 导入路径页面重新计算 */
|
importExcelUrl: function () {
|
// return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//开发环境指向
|
return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}`
|
},
|
},
|
methods: {
|
searchReset() {
|
this.queryParam = {}
|
this.$refs.inboundDetailList.dataSource = []
|
this.loadData(1);
|
},
|
customRow(record) {
|
return {
|
on: {
|
click: (e) => {
|
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;
|
//将当前选中的记录传到子页面
|
this.$bus.$emit('getToolingStorageData', this.selectionRows[0])
|
},
|
handleEdit: function (record) {
|
this.$refs.modalForm.edit(record)
|
this.$refs.modalForm.title = '编辑'
|
this.$refs.modalForm.disableSubmit = false
|
},
|
handleAdd() {
|
this.$refs.modalForm.add()
|
this.$refs.modalForm.title = '新增'
|
this.$refs.modalForm.disableSubmit = false
|
},
|
handleSubmit(record) {
|
let that = this;
|
that.loading = true
|
getAction(that.url.submit, { id:record.id}).then((res) => {
|
if (res.success) {
|
that.$message.success(res.message);
|
that.loadData();
|
} else {
|
that.$message.warning(res.message);
|
}
|
}).finally(() => {
|
that.loading = 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>
|