608 lines
20 KiB
608 lines
20 KiB
<template> |
|
<j-modal |
|
:title="title" |
|
:width="modalWidth" |
|
:visible="visible" |
|
:confirmLoading="confirmLoading" |
|
switchFullscreen |
|
wrapClassName="j-popup-modal" |
|
@ok="handleSubmit" |
|
@cancel="handleCancel" |
|
cancelText="关闭"> |
|
|
|
<a-card :bordered="false"> |
|
<!-- 查询区域 --> |
|
<div class="table-page-search-wrapper"> |
|
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
|
<a-row :gutter="24"> |
|
<a-col :xl="5" :lg="7" :md="8" :sm="24"> |
|
<a-form-item label="物资类型"> |
|
<j-dict-select-tag type="list" v-model="queryParam.materialType" dictCode="material_type" |
|
placeholder="请选择物资类型" /> |
|
</a-form-item> |
|
</a-col> |
|
<a-col :xl="5" :lg="7" :md="8" :sm="24"> |
|
<a-form-item label="流程发起时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
<a-range-picker |
|
format="YYYY-MM-DD" |
|
:value="processTime" |
|
:placeholder="['开始时间', '结束时间']" |
|
@change="processDateChange" |
|
/> |
|
</a-form-item> |
|
</a-col> |
|
<a-col :xl="5" :lg="7" :md="8" :sm="24" :hidden="showdw"> |
|
<a-form-item label="流程发起部门"> |
|
<a-select v-model="queryParam.departId" placeholder="请输入项目部" @mouseenter="getUnit" > |
|
<a-select-option v-for="(item,index) in queryParamsUntil" :key="index" :value="item.id">{{item.departName}}</a-select-option> |
|
</a-select> |
|
</a-form-item> |
|
</a-col> |
|
<a-col :xl="5" :lg="7" :md="8" :sm="24"> |
|
<a-form-item label="流程计划"> |
|
<j-dict-select-tag type="list" v-model="queryParam.processPlan" dictCode="process_plan" |
|
placeholder="请选择计划类型" /> |
|
</a-form-item> |
|
</a-col> |
|
<!--<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
|
<a-form-item label="需求时间"> |
|
<j-date placeholder="请选择需求时间" v-model="queryParam.needTime"></j-date> |
|
</a-form-item> |
|
</a-col>--> |
|
<a-col :xl="4" :lg="7" :md="8" :sm="24"> |
|
<span style="overflow: hidden;" class="table-page-search-submitButtons"> |
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
|
<!-- <a @click="handleToggleSearch" style="margin-left: 8px">--> |
|
<!-- {{ toggleSearchStatus ? '收起' : '展开' }}--> |
|
<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>--> |
|
<!-- </a>--> |
|
</span> |
|
</a-col> |
|
</a-row> |
|
</a-form> |
|
</div> |
|
<!-- 查询区域-END --> |
|
|
|
<!--<!– 操作按钮区域 –> |
|
<div class="table-operator"> |
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
|
<a-button type="primary" icon="download" @click="handleExportXls('预算计划采购流程')">导出</a-button> |
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
|
<a-button type="primary" icon="import">导入</a-button> |
|
</a-upload> |
|
<!– 高级查询区域 –> |
|
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
|
</div>--> |
|
|
|
<!-- table区域-begin --> |
|
<div> |
|
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> |
|
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{--> |
|
<!-- this.selectedRowKeys.length }}</a>项--> |
|
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> |
|
<!-- </div>--> |
|
|
|
<a-table |
|
ref="table" |
|
size="middle" |
|
bordered |
|
rowKey="id" |
|
class="j-table-force-nowrap" |
|
:scroll="{x:true}" |
|
:columns="columns" |
|
:dataSource="dataSource" |
|
:pagination="ipagination" |
|
:loading="loading" |
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" |
|
:customRow="clickThenSelect" |
|
@change="handleTableChange"> |
|
<span slot="describes" slot-scope="text, record"> |
|
<j-ellipsis :value="text" :length="20"/> |
|
</span> |
|
<template slot="htmlSlot" slot-scope="text"> |
|
<div v-html="text"></div> |
|
</template> |
|
<template slot="imgSlot" slot-scope="text"> |
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
|
<img v-else :src="getImgView(text)" height="25px" alt="" |
|
style="max-width:80px;font-size: 12px;font-style: italic;"/> |
|
</template> |
|
<template slot="fileSlot" slot-scope="text"> |
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
|
<a-button |
|
v-else |
|
:ghost="true" |
|
type="primary" |
|
icon="download" |
|
size="small" |
|
@click="downloadFile(text)"> |
|
下载 |
|
</a-button> |
|
</template> |
|
|
|
<!-- <template slot="fileOn" slot-scope="text">--> |
|
<!-- <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>--> |
|
<!-- <a-button--> |
|
<!-- v-else--> |
|
<!-- :ghost="true"--> |
|
<!-- type="primary"--> |
|
<!-- size="small"--> |
|
<!-- @click="onlineFile(text)">--> |
|
<!-- 预览--> |
|
<!-- </a-button>--> |
|
<!-- </template>--> |
|
|
|
<span slot="action" slot-scope="text, record"> |
|
<a @click="handleEdit(record)">编辑</a> |
|
|
|
<a-divider type="vertical"/> |
|
<a-dropdown> |
|
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a> |
|
<a-menu slot="overlay"> |
|
<a-menu-item> |
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
|
<a>删除</a> |
|
</a-popconfirm> |
|
</a-menu-item> |
|
</a-menu> |
|
</a-dropdown> |
|
</span> |
|
|
|
</a-table> |
|
</div> |
|
|
|
<a-tabs defaultActiveKey="1"> |
|
<a-tab-pane tab="预算计划采购流程物料清单表" key="1"> |
|
<ProcessUdgetPlanMaterialList :mainId="selectedRowKeys"/> |
|
</a-tab-pane> |
|
<a-tab-pane tab="预算计划采购流程物料已入清单表" key="2"> |
|
<ProcessMaterialWarehousingListList :mainId="selectedMainId" /> |
|
</a-tab-pane> |
|
<a-tab-pane tab="预算计划采购流程物料已申请清单表" key="3"> |
|
<ProcessMaterialWarehousingApplyiList :mainId="selectedMainId" /> |
|
</a-tab-pane> |
|
</a-tabs> |
|
</a-card> |
|
|
|
</j-modal> |
|
</template> |
|
|
|
<script> |
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
|
import { getAction } from '@/api/manage' |
|
import { filterObj } from '@/utils/util' |
|
import ProcessUdgetPlanMaterialList from '../../../views/processmaterials/ProcessUdgetPlanMaterialList' |
|
import ProcessMaterialWarehousingListList from '@views/processmaterials/ProcessMaterialWarehousingListList' |
|
import ProcessMaterialWarehousingApplyiList from '../../../views/processmaterials/ProcessMaterialWarehousingApplyiList' |
|
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' |
|
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue' |
|
import '@/assets/less/TableExpand.less' |
|
|
|
const MODAL_WIDTH = 1600 |
|
export default { |
|
name: 'ProcessPlan', |
|
props: ['multi', 'code', 'groupId', 'param'], |
|
components: { |
|
ProcessUdgetPlanMaterialList, |
|
ProcessMaterialWarehousingListList, |
|
ProcessMaterialWarehousingApplyiList, |
|
JSuperQuery, |
|
JDictSelectTag |
|
}, |
|
mixins: [JeecgListMixin], |
|
data() { |
|
return { |
|
showdw: true, |
|
visible: false, |
|
confirmLoading: false, |
|
title: '预算计划采购流程管理列表', |
|
description: '预算计划采购流程管理页面', |
|
queryParam: {}, |
|
// 表头 |
|
columns: [ |
|
{ |
|
title: '流程编号', |
|
align: 'center', |
|
dataIndex: 'warehousingBatch' |
|
}, |
|
{ |
|
title: '流程提示', |
|
align: 'center', |
|
scopedSlots: { customRender: 'describes' }, |
|
dataIndex: 'describes' |
|
}, |
|
{ |
|
title: '采购类型', |
|
align: 'center', |
|
dataIndex: 'planType_dictText' |
|
}, |
|
{ |
|
title: '流程发起公司', |
|
align: 'center', |
|
dataIndex: 'company_dictText' |
|
}, |
|
{ |
|
title: '流程发起时间', |
|
align: 'center', |
|
dataIndex: 'createTime' |
|
}, |
|
{ |
|
title: '流程发起部门', |
|
align: 'center', |
|
dataIndex: 'departId_dictText' |
|
}, |
|
{ |
|
title: '流程发起人', |
|
align: 'center', |
|
dataIndex: 'createBy' |
|
}, |
|
{ |
|
title: '物资类型', |
|
align: 'center', |
|
dataIndex: 'materialType_dictText' |
|
}, |
|
{ |
|
title: '流程计划', |
|
align: 'center', |
|
dataIndex: 'processPlan_dictText' |
|
}, |
|
{ |
|
title: '需求时间', |
|
align: 'center', |
|
dataIndex: 'needTime', |
|
customRender: function(text) { |
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
|
} |
|
}, |
|
// { |
|
// title: '顺序号', |
|
// align: 'center', |
|
// dataIndex: 'orderNumber' |
|
// } |
|
/* { |
|
title: '文件id', |
|
align: 'center', |
|
dataIndex: 'fileId', |
|
scopedSlots: { customRender: 'fileSlot' } |
|
}*/ |
|
], |
|
url: { |
|
listByuntil: '/unitwaste/processUnitWasteWarehouseCode/listAll', |
|
list: '/hy/processUdgetPlan/listByplan', |
|
delete: '/hy/processUdgetPlan/delete', |
|
deleteBatch: '/hy/processUdgetPlan/deleteBatch', |
|
exportXlsUrl: '/hy/processUdgetPlan/exportXls', |
|
importExcelUrl: 'hy/processUdgetPlan/importExcel' |
|
}, |
|
dictOptions: { |
|
company: [], |
|
sysOrgCode: [], |
|
materialType: [], |
|
processPlan: [] |
|
}, |
|
/* 分页参数 */ |
|
ipagination:{ |
|
current: 1, |
|
pageSize: 5, |
|
pageSizeOptions: ['5', '10', '50'], |
|
showTotal: (total, range) => { |
|
return range[0] + "-" + range[1] + " 共" + total + "条" |
|
}, |
|
showQuickJumper: true, |
|
showSizeChanger: true, |
|
total: 0 |
|
}, |
|
selectedMainId: '', |
|
materialWarehousingListID: undefined, |
|
superFieldList: [], |
|
selectedRowKeys: [], |
|
modalWidth: MODAL_WIDTH, |
|
changeData: '', |
|
getFileData: false, |
|
//部门查询 |
|
queryParamsUntil:[], |
|
//时间相关查询 |
|
processTime:[], |
|
labelCol: { |
|
xs: { span: 4 }, |
|
sm: { span: 4 }, |
|
}, |
|
wrapperCol: { |
|
xs: { span: 20 }, |
|
sm: { span: 20 }, |
|
}, |
|
} |
|
}, |
|
mounted() { |
|
//this.loadColumnsInfo() |
|
}, |
|
created() { |
|
this.showDepart() |
|
}, |
|
watch: {}, |
|
computed: { |
|
showSearchFlag() { |
|
return this.queryInfo && this.queryInfo.length > 0 |
|
} |
|
}, |
|
methods: { |
|
|
|
//是否隐藏流程发起部门查询 |
|
showDepart(){ |
|
let ue= sessionStorage.getItem('USER_INFORMATION'); |
|
let res=JSON.parse(ue); |
|
if(res.realname == "管理员"){ |
|
this.showdw = false; |
|
} |
|
}, |
|
|
|
//流程发起时间 |
|
processDateChange: function (value, dateString) { |
|
this.processTime = value |
|
this.queryParam.processTimeBegin=dateString[0]; |
|
this.queryParam.processTimeEnd=dateString[1]; |
|
console.log(this.queryParam) |
|
}, |
|
|
|
//加載項目部 |
|
getUnit(){ |
|
getAction(this.url.listByuntil).then((res) => { |
|
if (res.success) { |
|
this.queryParamsUntil = res.result.records||res.result; |
|
console.log(this.queryParamsUntil) |
|
} |
|
}) |
|
}, |
|
// initDictConfig(){ |
|
// initDictOptions('sys_depart,depart_name,id').then((res) => { |
|
// if (res.success) { |
|
// this.$set(this.dictOptions, 'company', res.result) |
|
// } |
|
// }) |
|
// initDictOptions('sys_depart,depart_name,id').then((res) => { |
|
// if (res.success) { |
|
// this.$set(this.dictOptions, 'sysOrgCode', res.result) |
|
// } |
|
// }) |
|
// initDictOptions('').then((res) => { |
|
// if (res.success) { |
|
// this.$set(this.dictOptions, 'materialType', res.result) |
|
// } |
|
// }) |
|
// initDictOptions('').then((res) => { |
|
// if (res.success) { |
|
// this.$set(this.dictOptions, 'processPlan', res.result) |
|
// } |
|
// }) |
|
// }, |
|
onClearSelected() { |
|
this.selectedRowKeys = [] |
|
this.selectionRows = [] |
|
this.selectedMainId = '' |
|
}, |
|
onSelectChange(selectedRowKeys, selectionRows) { |
|
console.log("selectedRowKeys>>>>>>>>>>>>>>>",selectedRowKeys) |
|
console.log("selectionRows>>>>>>>>>>>>>>>>>>>",selectionRows) |
|
this.selectedMainId = selectedRowKeys[0] |
|
this.selectedRowKeys = selectedRowKeys |
|
this.selectionRows = selectionRows |
|
}, |
|
loadData(arg) { |
|
if(!this.url.list){ |
|
this.$message.error("请设置url.list属性!") |
|
return |
|
} |
|
//加载数据 若传入参数1则加载第一页的内容 |
|
if (arg === 1) { |
|
this.ipagination.current = 1; |
|
} |
|
this.onClearSelected() |
|
var params = this.getQueryParams();//查询条件 |
|
let ue= sessionStorage.getItem('USER_INFORMATION'); |
|
let res=JSON.parse(ue); |
|
if(res.realname !== "管理员"){ |
|
if(!!res.departIds){ |
|
params.departId = res.departIds ; |
|
}else{ |
|
return ; |
|
} |
|
} |
|
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; |
|
}) |
|
}, |
|
clickThenSelect(record) { |
|
return { |
|
on: { |
|
click: () => { |
|
this.onSelectChange(record.id.split(','), [record]) |
|
} |
|
} |
|
} |
|
}, |
|
queryParams() { |
|
let paramTarget = {} |
|
if (this.dynamicParam) { |
|
//处理自定义参数 |
|
Object.keys(this.dynamicParam).map(key => { |
|
paramTarget['self_' + key] = this.dynamicParam[key] |
|
}) |
|
} |
|
let param = Object.assign(paramTarget, this.queryParam, this.sorter) |
|
param.pageNo = this.pagination.current |
|
param.pageSize = this.pagination.pageSize |
|
return filterObj(param) |
|
}, |
|
handleChangeInTableSelect(selectedRowKeys, selectionRows) { |
|
//update-begin-author:taoyan date:2020902 for:【issue】开源online的几个问题 LOWCOD-844 |
|
if (!selectedRowKeys || selectedRowKeys.length == 0) { |
|
this.table.selectionRows = [] |
|
} else if (selectedRowKeys.length == selectionRows.length) { |
|
this.table.selectionRows = selectionRows |
|
} else { |
|
//当两者长度不一的时候 需要判断 |
|
let keys = this.table.selectedRowKeys |
|
let rows = this.table.selectionRows |
|
//这个循环 添加新的记录 |
|
for (let i = 0; i < selectionRows.length; i++) { |
|
let combineKey = this.combineRowKey(selectionRows[i]) |
|
if (keys.indexOf(combineKey) < 0) { |
|
//如果 原来的key 不包含当前记录 push |
|
rows.push(selectionRows[i]) |
|
} |
|
} |
|
//这个循环 移除取消选中的数据 |
|
this.table.selectionRows = rows.filter(item => { |
|
let combineKey = this.combineRowKey(item) |
|
return selectedRowKeys.indexOf(combineKey) >= 0 |
|
}) |
|
} |
|
//update-end-author:taoyan date:2020902 for:【issue】开源online的几个问题 LOWCOD-844 |
|
this.table.selectedRowKeys = selectedRowKeys |
|
}, |
|
handleChangeInTable(pagination, filters, sorter) { |
|
//分页、排序、筛选变化时触发 |
|
if (Object.keys(sorter).length > 0) { |
|
this.sorter.column = sorter.field |
|
this.sorter.order = 'ascend' == sorter.order ? 'asc' : 'desc' |
|
} |
|
this.table.pagination = pagination |
|
this.loadData() |
|
}, |
|
handleCancel() { |
|
this.close() |
|
}, |
|
handleSubmit() { |
|
/*if (this.getFileData) { |
|
this.$emit('close') |
|
this.visible = false |
|
return |
|
}*/ |
|
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>',this.changeData) |
|
// if (!this.multi) { |
|
// if (this.selectionRows && this.selectionRows.length > 1) { |
|
// this.$message.warning('请选择一条记录') |
|
// return false |
|
// } |
|
// } |
|
if (!this.selectionRows || this.selectionRows.length == 0) { |
|
if (this.getFileData){ |
|
this.$emit('close') |
|
this.visible = false |
|
return |
|
} |
|
this.$message.warning('请选择一条记录') |
|
return false |
|
} |
|
this.$emit('ok', this.selectionRows) |
|
this.close() |
|
}, |
|
close() { |
|
this.$emit('close') |
|
this.visible = false |
|
//this.onClearSelected() |
|
}, |
|
show(val) { |
|
this.visible = true |
|
if (val) { |
|
this.getFileData = true |
|
let data = [] |
|
data.push(val.ids[0]) |
|
this.changeData = data |
|
// this.loadPlan(1) |
|
} |
|
}, |
|
handleToggleSearch() { |
|
this.toggleSearchStatus = !this.toggleSearchStatus |
|
}, |
|
searchByquery() { |
|
//this.loadData(1); |
|
}, |
|
onlyReload() { |
|
//this.loadData(); |
|
}, |
|
searchReset() { |
|
this.processTime=[] |
|
Object.keys(this.queryParam).forEach(key => { |
|
this.queryParam[key] = '' |
|
}) |
|
this.loadData(1); |
|
}, |
|
combineRowKey(record) { |
|
let res = '' |
|
Object.keys(record).forEach(key => { |
|
res += record[key] |
|
}) |
|
if (res.length > 50) { |
|
res = res.substring(0, 50) |
|
} |
|
return res |
|
}, |
|
clickThenCheck(record) { |
|
return { |
|
on: { |
|
click: () => { |
|
let rowKey = this.combineRowKey(record) |
|
if (!this.table.selectedRowKeys || this.table.selectedRowKeys.length == 0) { |
|
let arr1 = [], arr2 = [] |
|
arr1.push(record) |
|
arr2.push(rowKey) |
|
this.table.selectedRowKeys = arr2 |
|
this.table.selectionRows = arr1 |
|
} else { |
|
if (this.table.selectedRowKeys.indexOf(rowKey) < 0) { |
|
this.table.selectedRowKeys.push(rowKey) |
|
this.table.selectionRows.push(record) |
|
} else { |
|
let rowKey_index = this.table.selectedRowKeys.indexOf(rowKey) |
|
this.table.selectedRowKeys.splice(rowKey_index, 1) |
|
this.table.selectionRows.splice(rowKey_index, 1) |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
//防止字典中有垃圾数据 |
|
initDictOptionData(dictOptions) { |
|
let obj = {} |
|
Object.keys(dictOptions).map(k => { |
|
obj[k] = dictOptions[k].filter(item => { |
|
return item != null |
|
}) |
|
}) |
|
this.dictOptions = obj |
|
} |
|
|
|
} |
|
} |
|
</script> |
|
|
|
<style scoped> |
|
@import '~@assets/less/common.less'; |
|
|
|
/deep/.ant-modal { |
|
/*overflow-y: hidden;*/ |
|
width: 80% !important; |
|
height: 93%; |
|
top:45px |
|
} |
|
/deep/.ant-modal-content{ |
|
height: 100%; |
|
/*overflow-y: hidden;*/ |
|
overflow-y: scroll; |
|
} |
|
/deep/.ant-modal-body{ |
|
/*height: 100%;*/ |
|
/*overflow-y: scroll;*/ |
|
} |
|
</style> |