You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
569 lines
19 KiB
569 lines
19 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"> |
|
<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.unit">{{item.unit_dictText}}</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="4" :lg="7" :md="8" :sm="24"> |
|
<span style="float: left;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"> |
|
<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> |
|
<!-- 字符串超长截取省略号显示--> |
|
<span slot="component" slot-scope="text"> |
|
<j-ellipsis :value="text"/> |
|
</span> |
|
|
|
<!-- <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"> |
|
<ProcessMaterialsDeliveryListList :mainId="selectedRowKeys"/> |
|
</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 ProcessMaterialsDeliveryListList from '../../../views/processmaterials/ProcessMaterialsDeliveryListList' |
|
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: 'ProcessDelivery', |
|
props: ['multi', 'code', 'groupId', 'param'], |
|
components: { |
|
ProcessMaterialsDeliveryListList, |
|
JSuperQuery, |
|
JDictSelectTag |
|
}, |
|
mixins: [JeecgListMixin], |
|
data() { |
|
return { |
|
visible: false, |
|
confirmLoading: false, |
|
title: '物资出库流程管理列表', |
|
description: '物资出库流程管理页面', |
|
queryParam: {}, |
|
columns: [ |
|
{ |
|
title: '流程编号', |
|
align: 'center', |
|
dataIndex: 'warehousingBatch' |
|
}, |
|
{ |
|
title: '流程提示', |
|
align: 'center', |
|
dataIndex: 'describes', |
|
scopedSlots: { customRender: 'component' } |
|
}, |
|
{ |
|
title: '流程发起公司', |
|
align: 'center', |
|
dataIndex: 'company_dictText' |
|
}, |
|
{ |
|
title: '流程发起时间', |
|
align: 'center', |
|
dataIndex: 'createTime' |
|
}, |
|
{ |
|
title: '流程发起部门', |
|
align: 'center', |
|
dataIndex: 'sysOrgCode_dictText' |
|
}, |
|
{ |
|
title: '流程发起人', |
|
align: 'center', |
|
dataIndex: 'createBy' |
|
}, |
|
{ |
|
title: '物资类型', |
|
align: 'center', |
|
dataIndex: 'materialType_dictText' |
|
}, |
|
{ |
|
title: '出库时间', |
|
align: 'center', |
|
dataIndex: 'deliveryTime', |
|
customRender: function(text) { |
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
|
} |
|
} |
|
// { |
|
// title:'文件id', |
|
// align:"center", |
|
// dataIndex: 'fileId', |
|
// scopedSlots: {customRender: 'fileSlot'} |
|
// } |
|
], |
|
url: { |
|
listByuntil: '/unitwaste/processUnitWasteWarehouseCode/list', |
|
list: '/hy/processMaterialsDelivery/listByDel', |
|
delete: '/hy/processMaterialsDelivery/delete', |
|
deleteBatch: '/hy/processMaterialsDelivery/deleteBatch', |
|
exportXlsUrl: '/hy/processMaterialsDelivery/exportXls', |
|
importExcelUrl: 'hy/processMaterialsDelivery/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: '', |
|
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() |
|
}, |
|
/*watch: { |
|
code() { |
|
this.loadData(); |
|
}, |
|
param:{ |
|
deep:true, |
|
handler(){ |
|
alert(1) |
|
this.loadData(); |
|
|
|
}, |
|
} |
|
},*/ |
|
computed: { |
|
showSearchFlag() { |
|
return this.queryInfo && this.queryInfo.length > 0 |
|
} |
|
}, |
|
methods: { |
|
|
|
//流程发起时间 |
|
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) |
|
} |
|
}) |
|
}, |
|
handleTableChange(pagination, filters, sorter) { |
|
// console.log("执行了",pagination,filters,sorter) |
|
//分页、排序、筛选变化时触发 |
|
//TODO 筛选 |
|
if (Object.keys(sorter).length > 0) { |
|
this.isorter.column = sorter.field; |
|
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" |
|
} |
|
this.ipagination = pagination; |
|
this.loadData(); |
|
}, |
|
|
|
loadData(arg) { |
|
// console.log("执行了`````",arg); |
|
if(!this.url.list){ |
|
this.$message.error("请设置url.list属性!") |
|
return |
|
} |
|
//加载数据 若传入参数1则加载第一页的内容 |
|
if (arg === 1) { |
|
this.ipagination.current = 1; |
|
} |
|
var params = this.getQueryParams();//查询条件 |
|
this.loading = true; |
|
console.log("params>>>>>>",params) |
|
getAction(this.url.list, params).then((res) => { |
|
if (res.success) { |
|
this.dataSource = res.result.records||res.result; |
|
if(res.result.total) |
|
{ |
|
this.ipagination.total = res.result.total; |
|
} |
|
} |
|
if(res.code===510){ |
|
this.$message.warning(res.message) |
|
} |
|
this.loading = false; |
|
}) |
|
}, |
|
|
|
onClearSelected() { |
|
this.selectedRowKeys = [] |
|
this.selectionRows = [] |
|
this.selectedMainId = '' |
|
}, |
|
onSelectChange(selectedRowKeys, selectionRows) { |
|
this.selectedMainId = selectedRowKeys[0] |
|
this.selectedRowKeys = selectedRowKeys |
|
this.selectionRows = selectionRows |
|
}, |
|
loadPlan(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();//查询条件 |
|
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.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 |
|
} |
|
console.log(this.selectionRows) |
|
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() { |
|
Object.keys(this.queryParam).forEach(key => { |
|
this.queryParam[key] = '' |
|
}) |
|
this.loadData(1); |
|
}, |
|
/* onClearSelected(){ |
|
this.table.selectedRowKeys = [] |
|
this.table.selectionRows = [] |
|
},*/ |
|
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) { |
|
alert(1) |
|
let obj = {} |
|
Object.keys(dictOptions).map(k => { |
|
obj[k] = dictOptions[k].filter(item => { |
|
return item != null |
|
}) |
|
}) |
|
this.dictOptions = obj |
|
} |
|
|
|
} |
|
} |
|
</script> |
|
|
|
<style scoped> |
|
|
|
</style> |