18 changed files with 1117 additions and 273 deletions
@ -0,0 +1,186 @@ |
|||||||
|
<style lang="less"> |
||||||
|
</style> |
||||||
|
<template> |
||||||
|
<div class="search"> |
||||||
|
<a-card style="margin-bottom:10px;"> |
||||||
|
<p slot="title"> |
||||||
|
<span>流程审批进度历史</span> |
||||||
|
</p> |
||||||
|
<a-row style="position:relative"> |
||||||
|
<a-table :loading="loading" rowKey="id" |
||||||
|
:dataSource="data" |
||||||
|
:pagination="false" |
||||||
|
ref="table"> |
||||||
|
<a-table-column title="#" width="50"> |
||||||
|
<template slot-scope="t,r,i" > |
||||||
|
<span> {{i+1}} </span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="任务名称" dataIndex="name" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span> {{t}} </span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="处理人" dataIndex="assignees" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<div v-if="t"> |
||||||
|
<span v-for="item in t"> |
||||||
|
<span v-if="item.isExecutor" style="color: #00DB00;">{{item.username}} </span> |
||||||
|
<span v-else style="color: #999;">{{item.username}} </span> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="审批操作" dataIndex="deleteReason" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span v-if="t.toString().indexOf('通过')>-1" style="color: #00DB00">{{t}}</span> |
||||||
|
<span v-else-if="t.toString().indexOf('驳回')>-1" style="color: red;">{{t}}</span> |
||||||
|
<span v-else>{{t}}</span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="审批意见" dataIndex="comment" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span>{{t}}</span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="耗时" dataIndex="duration" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span>{{millsToTime(t)}}</span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="创建时间" dataIndex="createTime" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span>{{t}}</span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="完成时间" dataIndex="endTime" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span>{{t}}</span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
<a-table-column title="状态" dataIndex="endTime" key="aaa" width="150" align="center"> |
||||||
|
<template slot-scope="t"> |
||||||
|
<span v-if="t" style="color: blue;">已办理</span> |
||||||
|
<span v-else style="color: #999999">待处理</span> |
||||||
|
</template> |
||||||
|
</a-table-column> |
||||||
|
</a-table> |
||||||
|
</a-row> |
||||||
|
</a-card> |
||||||
|
|
||||||
|
<a-tabs type="card" @change="callback"> |
||||||
|
<a-tab-pane key="1" tab="实时流程图"> |
||||||
|
<a-card> |
||||||
|
<!--<p slot="title"> |
||||||
|
<span>实时流程图</span> |
||||||
|
</p>--> |
||||||
|
<a-row style="position:relative"> |
||||||
|
<img :src="imgUrl" /> |
||||||
|
<a-spin size="large" fix v-if="loadingImg"></a-spin> |
||||||
|
</a-row> |
||||||
|
</a-card> |
||||||
|
</a-tab-pane> |
||||||
|
<a-tab-pane key="2" tab="表单数据" v-if="lcModa"> |
||||||
|
<a-card> |
||||||
|
<!--流程表单--> |
||||||
|
<component :disabled="lcModa.disabled" :is="lcModa.formComponent" |
||||||
|
:processData="lcModa.processData" :isNew="lcModa.isNew" :task="lcModa.isTask" |
||||||
|
@afterSubmit="afterSub" |
||||||
|
@passTask="pass(lcModa.processData)" |
||||||
|
@backTask="back(lcModa.processData)" |
||||||
|
@close="lcModa.visible=false,lcModa.disabled = false"></component> |
||||||
|
</a-card> |
||||||
|
</a-tab-pane> |
||||||
|
</a-tabs> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||||
|
import { activitiMixin } from '@/views/activiti/mixins/activitiMixin' |
||||||
|
export default { |
||||||
|
name: "historic_detail_bak", |
||||||
|
mixins:[activitiMixin,JeecgListMixin], |
||||||
|
props: { |
||||||
|
/**/ |
||||||
|
procInstId: { |
||||||
|
type: String, |
||||||
|
default: '', |
||||||
|
required: true |
||||||
|
}, |
||||||
|
lcModa: { |
||||||
|
type: Object, |
||||||
|
required: false |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
url:{ |
||||||
|
historicFlow:'/actTask/historicFlow/', |
||||||
|
getHighlightImg:`${window._CONFIG['domianURL']}/activiti/models/getHighlightImg/` |
||||||
|
}, |
||||||
|
type: 0, |
||||||
|
loading: false, // 表单加载状态 |
||||||
|
loadingImg: false, |
||||||
|
data: [], |
||||||
|
id: "", |
||||||
|
imgUrl: "", |
||||||
|
backRoute: "" |
||||||
|
}; |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.init(); |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
procInstId:function(newval ,oldName) { |
||||||
|
this.init(); |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
loadData(){ |
||||||
|
|
||||||
|
}, |
||||||
|
init() { |
||||||
|
this.id = this.procInstId; |
||||||
|
this.imgUrl =this.url.getHighlightImg + this.id + "?time=" + new Date(); |
||||||
|
this.getDataList(); |
||||||
|
}, |
||||||
|
getDataList() { |
||||||
|
this.loading = true; |
||||||
|
this.getAction(this.url.historicFlow+this.id).then(res => { |
||||||
|
this.loading = false; |
||||||
|
if (res.success) { |
||||||
|
this.data = res.result; |
||||||
|
if (!res.result || res.result.length == 0) { |
||||||
|
this.$message.info( "未找到该记录审批历史数据,历史数据可能已被删除"); |
||||||
|
} |
||||||
|
}else { |
||||||
|
this.$message.error( res.message); |
||||||
|
} |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleTableChange(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(); |
||||||
|
}, |
||||||
|
callback(key){ |
||||||
|
}, |
||||||
|
afterSub(){ |
||||||
|
|
||||||
|
}, |
||||||
|
pass(v){ |
||||||
|
this.$emit('passTask',v) |
||||||
|
}, |
||||||
|
back(v){ |
||||||
|
this.$emit('backTask',v) |
||||||
|
} |
||||||
|
}, |
||||||
|
|
||||||
|
}; |
||||||
|
</script> |
@ -0,0 +1,313 @@ |
|||||||
|
<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 :xl="3" :lg="5" :md="5" :sm="18"> |
||||||
|
<a-form-item label="物资名称"> |
||||||
|
<a-input placeholder="请选择物资名称" v-model="queryParam.materialName" dict=",,"/> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :xl="3" :lg="5" :md="5" :sm="18"> |
||||||
|
<a-form-item label="报废日期"> |
||||||
|
<j-date placeholder="请选择报废日期" v-model="queryParam.scrapDate"></j-date> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :xl="3" :lg="5" :md="5" :sm="18"> |
||||||
|
<a-form-item label="物料码"> |
||||||
|
<a-input placeholder="请选择物料码" v-model="queryParam.descriptionId" dict=",,"/> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||||
|
<!-- <a-form-item label="品牌">--> |
||||||
|
<!-- <a-input placeholder="请输入品牌" v-model="queryParam.brand"></a-input>--> |
||||||
|
<!-- </a-form-item>--> |
||||||
|
<!-- </a-col>--> |
||||||
|
<!-- <template v-if="toggleSearchStatus">--> |
||||||
|
|
||||||
|
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||||
|
<!-- <a-form-item label="型号规格">--> |
||||||
|
<!-- <a-input placeholder="请输入型号规格" v-model="queryParam.typeSpecification"></a-input>--> |
||||||
|
<!-- </a-form-item>--> |
||||||
|
<!-- </a-col>--> |
||||||
|
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||||
|
<!-- <a-form-item label="单位">--> |
||||||
|
<!-- <j-search-select-tag placeholder="请选择单位" v-model="queryParam.unit" dict=",,"/>--> |
||||||
|
<!-- </a-form-item>--> |
||||||
|
<!-- </a-col>--> |
||||||
|
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||||
|
<!-- <a-form-item label="数量">--> |
||||||
|
<!-- <a-input placeholder="请输入数量" v-model="queryParam.number"></a-input>--> |
||||||
|
<!-- </a-form-item>--> |
||||||
|
<!-- </a-col>--> |
||||||
|
<a-col :xl="3" :lg="5" :md="5" :sm="18"> |
||||||
|
<a-form-item label="所属单位"> |
||||||
|
<a-input placeholder="请选择所属单位" v-model="queryParam.affiliation" dict=",,"/> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :xl="3" :lg="5" :md="5" :sm="18"> |
||||||
|
<a-form-item label="仓库位置"> |
||||||
|
<a-input placeholder="请选择仓库位置" v-model="queryParam.depositary" dict=",,"/> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :xl="3" :lg="5" :md="5" :sm="18"> |
||||||
|
<a-form-item label="创建人"> |
||||||
|
<a-input placeholder="请选择创建人" v-model="queryParam.createBy" dict=",,"/> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">--> |
||||||
|
<!-- <a-form-item label="报废原因">--> |
||||||
|
<!-- <a-input placeholder="请输入报废原因" v-model="queryParam.scrappedBecause"></a-input>--> |
||||||
|
<!-- </a-form-item>--> |
||||||
|
<!-- </a-col>--> |
||||||
|
|
||||||
|
|
||||||
|
<!-- </template>--> |
||||||
|
<!-- <a-col :xl="6" :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" @click="searchQuery" icon="search">查询</a-button> |
||||||
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</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>--> |
||||||
|
<a-dropdown v-if="selectedRowKeys.length > 0"> |
||||||
|
<a-menu slot="overlay"> |
||||||
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> |
||||||
|
</a-menu> |
||||||
|
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> |
||||||
|
</a-dropdown> |
||||||
|
</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">{{ selectedRowKeys.length }}</a>项 |
||||||
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||||
|
</div> |
||||||
|
|
||||||
|
<a-table |
||||||
|
ref="table" |
||||||
|
size="middle" |
||||||
|
:scroll="{x:true}" |
||||||
|
bordered |
||||||
|
rowKey="id" |
||||||
|
:columns="columns" |
||||||
|
:dataSource="dataSource" |
||||||
|
:pagination="ipagination" |
||||||
|
:loading="loading" |
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||||
|
class="j-table-force-nowrap" |
||||||
|
@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="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 @click="handleDetail(record)">详情</a> |
||||||
|
</a-menu-item> |
||||||
|
<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> |
||||||
|
|
||||||
|
<process-waste-modal ref="modalForm" @ok="modalFormOk"></process-waste-modal> |
||||||
|
</a-card> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
|
||||||
|
import '@/assets/less/TableExpand.less' |
||||||
|
import { mixinDevice } from '@/utils/mixin' |
||||||
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||||
|
import ProcessWasteModal from './modules/ProcessWasteModal' |
||||||
|
import JDate from '@/components/jeecg/JDate.vue' |
||||||
|
import JSearchSelectTag from '@/components/dict/JSearchSelectTag' |
||||||
|
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue' |
||||||
|
|
||||||
|
export default { |
||||||
|
name: 'ProcessWasteList', |
||||||
|
mixins:[JeecgListMixin, mixinDevice], |
||||||
|
components: { |
||||||
|
JDate, |
||||||
|
JSearchSelectTag, |
||||||
|
ProcessWasteModal, |
||||||
|
JSuperQuery, |
||||||
|
}, |
||||||
|
data () { |
||||||
|
return { |
||||||
|
description: '废旧物资库表管理页面', |
||||||
|
// 表头 |
||||||
|
columns: [ |
||||||
|
{ |
||||||
|
title: '#', |
||||||
|
dataIndex: '', |
||||||
|
key:'rowIndex', |
||||||
|
width:60, |
||||||
|
align:"center", |
||||||
|
customRender:function (t,r,index) { |
||||||
|
return parseInt(index)+1; |
||||||
|
} |
||||||
|
}, |
||||||
|
// { |
||||||
|
// title:'创建人', |
||||||
|
// align:"center", |
||||||
|
// dataIndex: 'createBy_dictText' |
||||||
|
// }, |
||||||
|
{ |
||||||
|
title:'物料码', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'descriptionId' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'品牌', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'brand' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'名称', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'materialName' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'型号规格', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'typeSpecification' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'单位', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'unit' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'数量', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'number' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'存放位置', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'depositary' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'报废原因', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'scrappedBecause' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'所属单位', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'affiliation' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title:'报废日期', |
||||||
|
align:"center", |
||||||
|
dataIndex: 'scrapDate', |
||||||
|
customRender:function (text) { |
||||||
|
return !text?"":(text.length>10?text.substr(0,10):text) |
||||||
|
} |
||||||
|
}, |
||||||
|
// { |
||||||
|
// title: '操作', |
||||||
|
// dataIndex: 'action', |
||||||
|
// align:"center", |
||||||
|
// fixed:"right", |
||||||
|
// width:147, |
||||||
|
// scopedSlots: { customRender: 'action' } |
||||||
|
// } |
||||||
|
], |
||||||
|
url: { |
||||||
|
list: "/waste/processWaste/list", |
||||||
|
delete: "/waste/processWaste/delete", |
||||||
|
deleteBatch: "/waste/processWaste/deleteBatch", |
||||||
|
exportXlsUrl: "/waste/processWaste/exportXls", |
||||||
|
importExcelUrl: "waste/processWaste/importExcel", |
||||||
|
|
||||||
|
}, |
||||||
|
dictOptions:{}, |
||||||
|
superFieldList:[], |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getSuperFieldList(); |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
importExcelUrl: function(){ |
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||||
|
}, |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
initDictConfig(){ |
||||||
|
}, |
||||||
|
getSuperFieldList(){ |
||||||
|
let fieldList=[]; |
||||||
|
fieldList.push({type:'sel_search',value:'createBy',text:'创建人',dictTable:'', dictText:'', dictCode:''}) |
||||||
|
fieldList.push({type:'sel_search',value:'descriptionId',text:'物料码',dictTable:'', dictText:'', dictCode:''}) |
||||||
|
fieldList.push({type:'string',value:'brand',text:'品牌',dictCode:''}) |
||||||
|
fieldList.push({type:'sel_search',value:'materialName',text:'名称',dictTable:'', dictText:'', dictCode:''}) |
||||||
|
fieldList.push({type:'string',value:'typeSpecification',text:'型号规格',dictCode:''}) |
||||||
|
fieldList.push({type:'sel_search',value:'unit',text:'单位',dictTable:'', dictText:'', dictCode:''}) |
||||||
|
fieldList.push({type:'int',value:'number',text:'数量',dictCode:''}) |
||||||
|
fieldList.push({type:'sel_search',value:'depositary',text:'存放位置',dictTable:'', dictText:'', dictCode:''}) |
||||||
|
fieldList.push({type:'string',value:'scrappedBecause',text:'报废原因',dictCode:''}) |
||||||
|
fieldList.push({type:'sel_search',value:'affiliation',text:'所属单位',dictTable:'', dictText:'', dictCode:''}) |
||||||
|
fieldList.push({type:'date',value:'scrapDate',text:'报废日期'}) |
||||||
|
this.superFieldList = fieldList |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
<style scoped> |
||||||
|
@import '~@assets/less/common.less'; |
||||||
|
</style> |
@ -0,0 +1,210 @@ |
|||||||
|
<template> |
||||||
|
<a-spin :spinning="confirmLoading"> |
||||||
|
<j-form-container :disabled="formDisabled"> |
||||||
|
<a-form :form="form" slot="detail"> |
||||||
|
<a-row> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['createBy']" dict="" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="物料码" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['descriptionId']" dict="" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['brand']" placeholder="请输入品牌" ></a-input> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="物资名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['materialName']" dict="" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="型号规格" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['typeSpecification']" placeholder="请输入型号规格" ></a-input> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['unit']" dict="" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input-number v-decorator="['number']" placeholder="请输入数量" style="width: 100%" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="存放位置" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['depositary']" dict="" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="报废原因" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['scrappedBecause']" placeholder="请输入报废原因" ></a-input> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="所属单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<a-input v-decorator="['affiliation']" dict="" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col :span="8"> |
||||||
|
<a-form-item label="报废日期" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||||
|
<j-date placeholder="请选择报废日期" v-decorator="['scrapDate']" :trigger-change="true" style="width: 100%" /> |
||||||
|
</a-form-item> |
||||||
|
</a-col> |
||||||
|
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center"> |
||||||
|
<a-button @click="submitForm">提 交</a-button> |
||||||
|
</a-col> |
||||||
|
</a-row> |
||||||
|
</a-form> |
||||||
|
</j-form-container> |
||||||
|
</a-spin> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
|
||||||
|
import { httpAction, getAction } from '@/api/manage' |
||||||
|
import pick from 'lodash.pick' |
||||||
|
import { validateDuplicateValue } from '@/utils/util' |
||||||
|
import JFormContainer from '@/components/jeecg/JFormContainer' |
||||||
|
import JDate from '@/components/jeecg/JDate' |
||||||
|
import JSearchSelectTag from '@/components/dict/JSearchSelectTag' |
||||||
|
|
||||||
|
export default { |
||||||
|
name: 'ProcessWasteForm', |
||||||
|
components: { |
||||||
|
JFormContainer, |
||||||
|
JDate, |
||||||
|
JSearchSelectTag, |
||||||
|
}, |
||||||
|
props: { |
||||||
|
//流程表单data |
||||||
|
formData: { |
||||||
|
type: Object, |
||||||
|
default: ()=>{}, |
||||||
|
required: false |
||||||
|
}, |
||||||
|
//表单模式:true流程表单 false普通表单 |
||||||
|
formBpm: { |
||||||
|
type: Boolean, |
||||||
|
default: false, |
||||||
|
required: false |
||||||
|
}, |
||||||
|
//表单禁用 |
||||||
|
disabled: { |
||||||
|
type: Boolean, |
||||||
|
default: false, |
||||||
|
required: false |
||||||
|
} |
||||||
|
}, |
||||||
|
data () { |
||||||
|
return { |
||||||
|
form: this.$form.createForm(this), |
||||||
|
model: {}, |
||||||
|
labelCol: { |
||||||
|
xs: { span: 24 }, |
||||||
|
sm: { span: 5 }, |
||||||
|
}, |
||||||
|
wrapperCol: { |
||||||
|
xs: { span: 24 }, |
||||||
|
sm: { span: 16 }, |
||||||
|
}, |
||||||
|
confirmLoading: false, |
||||||
|
validatorRules: { |
||||||
|
}, |
||||||
|
url: { |
||||||
|
add: "/waste/processWaste/add", |
||||||
|
edit: "/waste/processWaste/edit", |
||||||
|
queryById: "/waste/processWaste/queryById" |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
formDisabled(){ |
||||||
|
if(this.formBpm===true){ |
||||||
|
if(this.formData.disabled===false){ |
||||||
|
return false |
||||||
|
} |
||||||
|
return true |
||||||
|
} |
||||||
|
return this.disabled |
||||||
|
}, |
||||||
|
showFlowSubmitButton(){ |
||||||
|
if(this.formBpm===true){ |
||||||
|
if(this.formData.disabled===false){ |
||||||
|
return true |
||||||
|
} |
||||||
|
} |
||||||
|
return false |
||||||
|
} |
||||||
|
}, |
||||||
|
created () { |
||||||
|
//如果是流程中表单,则需要加载流程表单data |
||||||
|
this.showFlowData(); |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
add () { |
||||||
|
this.edit({}); |
||||||
|
}, |
||||||
|
edit (record) { |
||||||
|
this.form.resetFields(); |
||||||
|
this.model = Object.assign({}, record); |
||||||
|
this.visible = true; |
||||||
|
this.$nextTick(() => { |
||||||
|
this.form.setFieldsValue(pick(this.model,'createBy','descriptionId','brand','materialName','typeSpecification','unit','number','depositary','scrappedBecause','affiliation','scrapDate')) |
||||||
|
}) |
||||||
|
}, |
||||||
|
//渲染流程表单数据 |
||||||
|
showFlowData(){ |
||||||
|
if(this.formBpm === true){ |
||||||
|
let params = {id:this.formData.dataId}; |
||||||
|
getAction(this.url.queryById,params).then((res)=>{ |
||||||
|
if(res.success){ |
||||||
|
this.edit (res.result); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
}, |
||||||
|
submitForm () { |
||||||
|
const that = this; |
||||||
|
// 触发表单验证 |
||||||
|
this.form.validateFields((err, values) => { |
||||||
|
if (!err) { |
||||||
|
that.confirmLoading = true; |
||||||
|
let httpurl = ''; |
||||||
|
let method = ''; |
||||||
|
if(!this.model.id){ |
||||||
|
httpurl+=this.url.add; |
||||||
|
method = 'post'; |
||||||
|
}else{ |
||||||
|
httpurl+=this.url.edit; |
||||||
|
method = 'put'; |
||||||
|
} |
||||||
|
let formData = Object.assign(this.model, values); |
||||||
|
console.log("表单提交数据",formData) |
||||||
|
httpAction(httpurl,formData,method).then((res)=>{ |
||||||
|
if(res.success){ |
||||||
|
that.$message.success(res.message); |
||||||
|
that.$emit('ok'); |
||||||
|
}else{ |
||||||
|
that.$message.warning(res.message); |
||||||
|
} |
||||||
|
}).finally(() => { |
||||||
|
that.confirmLoading = false; |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
}) |
||||||
|
}, |
||||||
|
popupCallback(row){ |
||||||
|
this.form.setFieldsValue(pick(row,'createBy','descriptionId','brand','materialName','typeSpecification','unit','number','depositary','scrappedBecause','affiliation','scrapDate')) |
||||||
|
}, |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
@ -0,0 +1,60 @@ |
|||||||
|
<template> |
||||||
|
<j-modal |
||||||
|
:title="title" |
||||||
|
:width="width" |
||||||
|
:visible="visible" |
||||||
|
switchFullscreen |
||||||
|
@ok="handleOk" |
||||||
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||||
|
@cancel="handleCancel" |
||||||
|
cancelText="关闭"> |
||||||
|
<process-waste-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></process-waste-form> |
||||||
|
</j-modal> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
|
||||||
|
import ProcessWasteForm from './ProcessWasteForm' |
||||||
|
export default { |
||||||
|
name: 'ProcessWasteModal', |
||||||
|
components: { |
||||||
|
ProcessWasteForm |
||||||
|
}, |
||||||
|
data () { |
||||||
|
return { |
||||||
|
title:'', |
||||||
|
width:1024, |
||||||
|
visible: false, |
||||||
|
disableSubmit: false |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
add () { |
||||||
|
this.visible=true |
||||||
|
this.$nextTick(()=>{ |
||||||
|
this.$refs.realForm.add(); |
||||||
|
}) |
||||||
|
}, |
||||||
|
edit (record) { |
||||||
|
this.visible=true |
||||||
|
this.$nextTick(()=>{ |
||||||
|
this.$refs.realForm.edit(record); |
||||||
|
}) |
||||||
|
}, |
||||||
|
close () { |
||||||
|
this.$emit('close'); |
||||||
|
this.visible = false; |
||||||
|
}, |
||||||
|
handleOk () { |
||||||
|
this.$refs.realForm.submitForm(); |
||||||
|
}, |
||||||
|
submitCallback(){ |
||||||
|
this.$emit('ok'); |
||||||
|
this.visible = false; |
||||||
|
}, |
||||||
|
handleCancel () { |
||||||
|
this.close() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
@ -0,0 +1,83 @@ |
|||||||
|
<template> |
||||||
|
<a-drawer |
||||||
|
:title="title" |
||||||
|
:width="width" |
||||||
|
placement="right" |
||||||
|
:closable="false" |
||||||
|
@close="close" |
||||||
|
:visible="visible"> |
||||||
|
<process-waste-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></process-waste-form> |
||||||
|
<div class="drawer-footer"> |
||||||
|
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||||
|
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||||
|
</div> |
||||||
|
</a-drawer> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
|
||||||
|
import ProcessWasteForm from './ProcessWasteForm' |
||||||
|
|
||||||
|
export default { |
||||||
|
name: 'ProcessWasteModal', |
||||||
|
components: { |
||||||
|
ProcessWasteForm |
||||||
|
}, |
||||||
|
data () { |
||||||
|
return { |
||||||
|
title:"操作", |
||||||
|
width:1024, |
||||||
|
visible: false, |
||||||
|
disableSubmit: false |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
add () { |
||||||
|
this.visible=true |
||||||
|
this.$nextTick(()=>{ |
||||||
|
this.$refs.realForm.add(); |
||||||
|
}) |
||||||
|
}, |
||||||
|
edit (record) { |
||||||
|
this.visible=true |
||||||
|
this.$nextTick(()=>{ |
||||||
|
this.$refs.realForm.edit(record); |
||||||
|
}); |
||||||
|
}, |
||||||
|
close () { |
||||||
|
this.$emit('close'); |
||||||
|
this.visible = false; |
||||||
|
}, |
||||||
|
submitCallback(){ |
||||||
|
this.$emit('ok'); |
||||||
|
this.visible = false; |
||||||
|
}, |
||||||
|
handleOk () { |
||||||
|
this.$refs.realForm.submitForm(); |
||||||
|
}, |
||||||
|
handleCancel () { |
||||||
|
this.close() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang="less" scoped> |
||||||
|
/** Button按钮间距 */ |
||||||
|
.ant-btn { |
||||||
|
margin-left: 30px; |
||||||
|
margin-bottom: 30px; |
||||||
|
float: right; |
||||||
|
} |
||||||
|
.drawer-footer{ |
||||||
|
position: absolute; |
||||||
|
bottom: -8px; |
||||||
|
width: 100%; |
||||||
|
border-top: 1px solid #e8e8e8; |
||||||
|
padding: 10px 16px; |
||||||
|
text-align: right; |
||||||
|
left: 0; |
||||||
|
background: #fff; |
||||||
|
border-radius: 0 0 2px 2px; |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue